📁 Showcase
Backend

Backend

1. Variables

// priority list
ensure var VarSetOfTextPriority kind: setOfText 
  modules: ["TaskList"] 
  deploy: fixedOnDeploy 
  value: "<root>
      <node color='error' key='keyHigh'>High</node>
      <node color='primary' key='keyMedium'>Medium</node>
      <node color='success' key='keyLow'>Low</node>
    </root>"

// status list
ensure var VarSetOfTextStatus kind: setOfText 
  modules: ["TaskList"] 
  deploy: fixedOnDeploy 
  value: "<root>
      <node key='keyPending'>Pending</node>
      <node key='keyStarted'>Started</node>
      <node key='keyDone'>Done</node>
    </root>"

// date variable for current date
ensure var VarDateNow kind: date modules: ["TaskList"] deploy: fixedOnDeploy value: "now"

// WhatsApp message variable
ensure var VarTextPatternInCompleteTaskWhatsAppMessage kind: text 
  modules: ["TaskList"] 
  deploy: fixedOnDeploy 
  value: "This is a quick update to inform you that this task list : ${P} is still on the pending status."
  
// email subject variable
ensure var VarTextPatternInCompleteTaskSubject kind: text 
  modules: ["TaskList"] 
  deploy: fixedOnDeploy 
  value: "Your incomplete task list"

// email body variable
ensure var VarParagraphInCompleteTaskEmailBody kind: paragraph 
  modules: ["TaskList"] 
  deploy: fixedOnDeploy 
  value: "Dear User, 

This is a quick update to inform you that this task list : ${P2} is still on the pending status."

2. TaskSheet

// fields ending with "*" suffix are required
ensure spreadsheet: TaskSheet
withFields: [
    "Date",
    "Task*",
    "Priority",
    "Status",
    "DueDate",
    "CreatedBy",
    "Divider",
    "Notes"
  ]
ofTypes: [date, text, pickText, pickText, date, text, divider, paragraph]
modules: ["TaskList"] 
readRoleSet: [Member] 
insertRoleSet: [Member] 
updateRoleSet: [Member] 
removeRoleSet: [Member]

ensure spreadsheet TaskSheet
  searchables: [Task, Priority, Status] 
  queryables: [Task, Priority, Status, Date, DueDate] 

ensure form EntityTask 
  modules: ["TaskList"] 
  commentRoleSet: [Member] 
  allowToPrintForm: true
ensure section: Details
ensure field Date defaultValue: "now"
ensure field Priority sourceVar: VarSetOfTextPriority defaultOptionId: "keyLow"
ensure field Status sourceVar: VarSetOfTextStatus defaultOptionId: "keyPending"
ensure field CreatedBy
  permissionMatrix: {
      'defaultPermission': 'invisible'
    }
ensure field Divider dividerKind: thick
ensure field Notes flexHeight: true

ensure section: Attachments
ensure field Attachments kind: document fileTypeSet: ["any"]

3. ReportGetInCompleteTasks

a. Input form

ensure form FilterTask 
ensure section: Details
ensure field Priority kind: pickText sourceVar: VarSetOfTextPriority
ensure field Status kind: pickText sourceVar: VarSetOfTextStatus

b. Output form

ensure form OutputPendingTask modules: ["TaskList"]
ensure grid: TaskDetails
ensure field Date kind: date 
ensure field Task kind: text 

ensure layoutGrid TableLayout kind: table 
  showComps: [TaskDetails.Date, TaskDetails.Task]
ensure layout ContentLayout kind: content 
  direction: vertical 
  contentPadding: thick
  flexCenter.gridLayouts: [TaskDetails.TableLayout]

b. Report

ensure var VarMappingTaskToPendingTask
 kind: mapping modules: ["TaskList"] deploy: fixedOnDeploy
  fromForm: EntityTask 
  toForm: OutputPendingTask 
  toGrid: TaskDetails 
  fieldMappingMap: {
      'map': {
        '${f:Details.Date}': 'TaskDetails.Date',
        '${f:Details.Task}': 'TaskDetails.Task'
      }
    }

ensure var VarConditionIsInCompletedTask kind: condition 
  modules: ["TaskList"] 
  deploy: fixedOnDeploy
  value: "<root>
      <and>
        <or>
          <stmt>${f:Details.Status} == ${d:Status.keyPending}</stmt>
          <stmt>${f:Details.Status} == ${d:Status.keyStarted}</stmt>
          <stmt>${f:Details.Status} has no value</stmt>
        </or>
        <or>
          <stmt>${f:Details.DueDate} has no value</stmt>
          <stmt>${f:Details.DueDate} &lt;= ${var:VarDateNow}</stmt>
        </or>
      </and>
    </root>" 
  sourceForm: EntityTask

ensure report ReportGetInCompleteTasks kind: spreadsheet 
  modules: ["TaskList"] 
  outputForm: OutputPendingTask 
  fromSpreadsheet: TaskSheet 
  filterConditionVar: VarConditionIsInCompletedTask 
  outputFormMappingVar: VarMappingTaskToPendingTask