📁 Showcase
TransactionSheet

TransactionSheet

Backend

1. Variables

ensure var VarSetOfTextTransaction kind: setOfText 
  modules: ["QuickBooks"]
  deploy: fixedOnDeploy
  value: "<root>
      <node key='keyCredit'>Credit</node>
      <node key='keyDebit'>Debit</node>
    </root>"

ensure var VarSetOfTextTarget kind: setOfText 
  modules: ["QuickBooks"] 
  deploy: fixedOnDeploy 
  value: "<root>
      <node key='keyFixed'>Fixed</node>
      <node key='keyEmergency'>Emergency</node>
      <node key='keyEssential'>Essential</node>
      <node key='keyEntertainment'>Entertainment</node>
      <node key='keyGrocery'>Grocery</node>
      <node key='keySubscription'>Subscription</node>
      <node key='keyTransportation'>Transportation</node>
      <node key='keyInvestment'>Investment</node>
    </root>"

ensure var VarSetOfTextSource kind: setOfText 
  modules: ["QuickBooks"] 
  deploy: fixedOnDeploy 
  value: "<root>
      <node key='keyPayCheck'>Pay check</node>
      <node key='keyInterest'>Interest</node>
      <node key='keyRental'>Rental</node>
      <node key='keyDividend'>Dividend</node>
      <node key='keySale'>Sale</node>
      <node key='keyOther'>Other</node>
    </root>"

1. TransactionSheet

// fields ending with "*" suffix are required
ensure spreadsheet: TransactionSheet 
withFields: [
    "TransactionRowId",
    "AssetRowId",
    "Type*",
    "Date*"
  ]
ofTypes: [rowId, rowId, pickText, dateTime]
modules: ["QuickBooks"]
readRoleSet: [Member]
insertRoleSet: [Member]
updateRoleSet: [Member]
removeRoleSet: [Member]

ensure form EntityTransaction 
  modules: ["QuickBooks"]
ensure section: Details
ensure field TransactionRowId
  permissionMatrix: {
      'defaultPermission': 'invisible'
    }
ensure field AssetRowId
  permissionMatrix: {
      'defaultPermission': 'invisible'
    }
ensure field Type
  permissionMatrix: {
      'defaultPermission': 'writeOnce'
    }
  sourceVar: VarSetOfTextTransaction
  defaultOptionId: "keyDebit"
ensure field Date defaultValue: "now"
ensure field RefDebit kind: ref
  spreadsheet: DebitCategoryMaster
  copyFieldMap: {
      'DebitName': 'Name',
      'DebitParentCategoryRowId': 'ParentCategoryRowId',
      'DebitParentCategory': 'ParentCategory',
      'DebitMasterRowId': '$RowId'
    }
  layoutSpreadsheet: ListLayout
ensure field DebitMasterRowId
  permissionMatrix: {
      'defaultPermission': 'invisible'
    }
ensure field DebitParentCategoryRowId
  permissionMatrix: {
      'defaultPermission': 'invisible'
    }
ensure field RefCredit kind: ref
  spreadsheet: CreditCategoryMaster
  copyFieldMap: {
      'CreditName': 'Name',
      'CreditParentCategoryRowId': 'ParentCategoryRowId',
      'CreditParentCategory': 'ParentCategory',
      'CreditMasterRowId': '$RowId'
    }
  layoutSpreadsheet: ListLayout
ensure field CreditMasterRowId
  permissionMatrix: {
      'defaultPermission': 'invisible'
    }
ensure field CreditParentCategoryRowId
  permissionMatrix: {
      'defaultPermission': 'invisible'
    }
ensure field Target kind: pickText sourceVar: VarSetOfTextTarget
ensure field Source kind: pickText sourceVar: VarSetOfTextSource
ensure field TotalAmount kind: decimal required: true numberOfDigitsAfterPeriod: 2

// composite, section, Attachment
ensure section: Attachment
ensure field Attachments kind: setOfDocument
  fileTypeSet: ["any"]

// composite, section, Summary
ensure section: Summary
ensure field Verified kind: bool
  showAsCheckbox: true
  position: start
  labelPlacement: end
ensure field Notes kind: paragraph flexHeight: true

ensure spreadsheet TransactionSheet
  queryables: [TransactionRowId]
ensure layoutSpreadsheet TableLayout kind: table
  showComps: [
    Details.Date, 
    Details.DebitName, 
    Details.CreditName, 
    Details.TotalAmount, 
    Summary.Verified
  ]
  columnSizeSet: ["Flex"]

2. Visibility rules

ensure form EntityTransaction 
// visibilityRule, CreditVisibilityRule
ensure visibilityRule CreditVisibilityRule
  condition: "<root>
      <stmt>Details.Type == ${d:Type.keyCredit}</stmt>
    </root>"
ensure actionMapIfTrue MakeSourceVisible
  comp: Details.Source
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfTrue MakeRefCreditVisible
  comp: Details.RefCredit
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfTrue MakeCreditSubCategoryVisible
  comp: Details.CreditParentCategory
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfTrue MakeCreditSubCategoryRowIdVisible
  comp: Details.CreditParentCategoryRowId
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfTrue MakeCreditNameVisible
  comp: Details.CreditName
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfTrue MakeCreditMasterRowIdVisible
  comp: Details.CreditMasterRowId
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfFalse MakeSourceHidden
  comp: Details.Source
  visibilityAction: hidden
  visibilityActionOn: field
ensure actionMapIfFalse MakeRefCreditHidden
  comp: Details.RefCredit
  visibilityAction: hidden
  visibilityActionOn: field
ensure actionMapIfFalse MakeCreditNameHidden
  comp: Details.CreditName
  visibilityAction: hidden
  visibilityActionOn: field
ensure actionMapIfFalse MakeCreditMasterRowIdHidden
  comp: Details.CreditMasterRowId
  visibilityAction: hidden
  visibilityActionOn: field
ensure actionMapIfFalse MakeCreditSubCategoryHidden
  comp: Details.CreditParentCategory
  visibilityAction: hidden
  visibilityActionOn: field
ensure actionMapIfFalse MakeCreditSubCategoryRowIdHidden
  comp: Details.CreditParentCategoryRowId
  visibilityAction: hidden
  visibilityActionOn: field

// visibilityRule, DebitVisibilityRule
ensure visibilityRule DebitVisibilityRule
  condition: "<root>
      <stmt>Details.Type == ${d:Type.keyDebit}</stmt>
    </root>"
ensure actionMapIfTrue MakeTargetVisible
  comp: Details.Target
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfTrue MakeRefDebitVisible
  comp: Details.RefDebit
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfTrue MakeDebitNameVisible
  comp: Details.DebitName
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfTrue MakeDebitSubCategoryVisible
  comp: Details.DebitParentCategory
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfTrue MakeDebitMasterRowIdVisible
  comp: Details.DebitMasterRowId
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfTrue MakeDebitSubCategoryRowIdVisible
  comp: Details.DebitParentCategoryRowId
  visibilityAction: visible
  visibilityActionOn: field
ensure actionMapIfFalse MakeTargetHidden
  comp: Details.Target
  visibilityAction: hidden
  visibilityActionOn: field
ensure actionMapIfFalse MakeRefDebitHidden
  comp: Details.RefDebit
  visibilityAction: hidden
  visibilityActionOn: field
ensure actionMapIfFalse MakeDebitNameHidden
  comp: Details.DebitName
  visibilityAction: hidden
  visibilityActionOn: field
ensure actionMapIfFalse MakeDebitMasterRowIdHidden
  comp: Details.DebitMasterRowId
  visibilityAction: hidden
  visibilityActionOn: field
ensure actionMapIfFalse MakeDebitSubCategoryHidden
  comp: Details.DebitParentCategory
  visibilityAction: hidden
  visibilityActionOn: field
ensure actionMapIfFalse MakeDebitSubCategoryRowIdHidden
  comp: Details.DebitParentCategoryRowId
  visibilityAction: hidden
  visibilityActionOn: field

Frontend

1. Actions

a. AddTransaction

ensure action AddTransaction kind: rowInsert 
  modules: ["QuickBooks"] 
  icon: "AddCircleOutlineRounded" 
  spreadsheet: TransactionSheet 
  sendMessageToInbox: true

b. TransactionSheet

ensure action TransactionSheet kind: spreadsheetEditor 
  modules: ["QuickBooks"] 
  icon: "AutoStoriesRounded" 
  spreadsheet: TransactionSheet 
  layoutSpreadsheet: TableLayout

c. AddCreditTransaction

ensure action AddCreditTransaction kind: rowInsert 
  modules: ["QuickBooks"] 
  icon: "AddCircleOutlineRounded" 
  defaultValueMap: {
      'Details.Type': {
        'value': 'Credit',
        'optionId': 'keyCredit'
      },
      'Details.TotalAmount': {
        'value': 0
      }
    } 
  spreadsheet: TransactionSheet

d. AddDebitTransaction

ensure action AddDebitTransaction kind: rowInsert 
  modules: ["QuickBooks"] 
  icon: "AddCircleOutlineRounded" 
  defaultValueMap: {
      'Details.Type': {
        'optionId': 'keyDebit'
      },
      'Details.TotalAmount': {
        'value': 0
      }
    } 
  spreadsheet: TransactionSheet

2. Prompts

ensure root
  promptMap.acceptPromptViaEmail: true
  promptMap.acceptPromptViaWhatsapp: true

ensure prompt PromptAddCreditTransaction 
  action: AddCreditTransaction 
  promptText: "credit ${f:RefCredit}${sep}${f:Source}${sep}${f:TotalAmount}" 
  permissionRoles: [Member]

//** prompt, PromptAddDebitTransaction
ensure prompt PromptAddDebitTransaction 
  action: AddDebitTransaction 
  promptText: "debit ${f:RefDebit}${sep}${f:Target}${sep}${f:TotalAmount}" 
  permissionRoles: [Member]

3. Group actions

ensure group QuickBooks
  actionPermission: {
      'AddTransaction': {
        'menuGroup': '4',
        'roles': [
          'Member'
        ]
      },
      'TransactionSheet': {
        'menuGroup': '4',
        'roles': [
          'Member'
        ]
      }
    }