📁 Showcase
Master Data

Master data

Backend

1. ItemSizeMaster

Create an ItemSizeMaster spreadsheet to store data related to tile sizes.

ensure spreadsheet: ItemSizeMaster
  withFields: ["Size", "Stock"]
  ofTypes: [text, logNumber]
  removeRoleSet: [Owner]
  insertRoleSet: [Owner]
  updateRoleSet: [Owner]
  readRoleSet: [Owner]

ensure layoutSpreadsheet ListLayout kind: list
  filter.showSearchBar: true
  firstLine.first.lineFields: [Size]

ensure spreadsheet ItemSizeMaster searchables: [Size]

ensure form EntityItemSize label: "Tile Size"

2. ItemTypeMaster

Create an ItemTypeMaster spreadsheet to store data related to tile types.

ensure spreadsheet: ItemTypeMaster
  withFields: ["Type", "Stock"]
  ofTypes: [text, logNumber]
  removeRoleSet: [Owner]
  insertRoleSet: [Owner]
  updateRoleSet: [Owner]
  readRoleSet: [Owner]

ensure layoutSpreadsheet ListLayout kind: list
  filter.showSearchBar: true
  firstLine.first.lineFields: [Type]

ensure spreadsheet ItemTypeMaster searchables: [Type]

ensure form EntityItemType label: "Tile Type"

3. ItemMaster

Create an ItemMaster spreadsheet to store data related to tiles.

ensure spreadsheet: ItemMaster
  withFields: ["Name", "Description", "Price"]
  ofTypes: [text, paragraph, number]
  removeRoleSet: [Owner]
  insertRoleSet: [Owner]
  updateRoleSet: [Owner]
  readRoleSet: [Owner]

Configure the properties of the EntityItem form and its associated fields.

ensure form EntityItem label: "Tile"
ensure section: Details
ensure field Description lineCount: 5
ensure field Price prefix: "₹"
ensure field ItemTypeRef kind: ref
  spreadsheet: ItemTypeMaster
  layoutSpreadsheet: ListLayout
  copyFieldMap: {
    'ItemTypeMasterRowId': '$RowId',
    'ItemType': 'Type'
  }
ensure field ItemSizeRef kind: ref
  spreadsheet: ItemSizeMaster
  layoutSpreadsheet: ListLayout
  copyFieldMap: {
    'ItemSizeMasterRowId': '$RowId',
    'ItemSize': 'Size'
  }

Set the fields as searchable and/or queryable to enable search functionality on them.

ensure spreadsheet ItemMaster
  searchables: [Name, Price, ItemType, ItemSize]
  queryables: [ItemTypeMasterRowId, ItemSizeMasterRowId, Price, ItemType, ItemSize]

Apply a ListLayout to the spreadsheet to display the data in a list format.

ensure layoutSpreadsheet ListLayout kind: list
  filter.kind: tree
  filter.showSearchBar: true
  filter.categoryFields: [Details.ItemTypeRef, Details.ItemSizeRef]
  filter.advanceFilterFields: [Details.Price]
  firstLine.first.lineFields: [Details.Name]
  secondLine.first.lineFields: [Details.Price]
  secondLine.first.showLabels: true
  thirdLine.first.lineFields: [Details.ItemType, Details.ItemSize]
  thirdLine.first.showLabels: true

ensure layoutSpreadsheet TableLayout kind: table
  showComps: [Name, Description, Price, ItemType, ItemSize]
  columnSizeSet: ["AutoSize"]

Frontend

1. Actions

a. EditItemSizeMaster

Implement an EditItemSizeMaster action to facilitate the modification and updating of existing size information within the VisitBook spreadsheet.

// this action will allow you to edit or add new size

ensure action EditItemSizeMaster kind: spreadsheetEditor
  icon: "CategoryRounded"
  spreadsheet: ItemSizeMaster
  layoutSpreadsheet: ListLayout
  bulkInsertRoleSet: [Owner]

b. EditItemTypeMaster

Implement an EditItemTypeMaster action to facilitate the modification and updating of existing type information within the VisitBook spreadsheet.

ensure action EditItemTypeMaster kind: spreadsheetEditor
  icon: "CategoryRounded"
  spreadsheet: ItemTypeMaster
  layoutSpreadsheet: ListLayout
  bulkInsertRoleSet: [Owner]

c. EditItemMaster

Implement an EditItemMaster action to facilitate the modification and updating of existing tile information within the VisitBook spreadsheet.

ensure action EditItemMaster kind: spreadsheetEditor
  icon: "FeaturedPlayListRounded"
  spreadsheet: ItemMaster
  layoutSpreadsheet: TableLayout
  bulkInsertRoleSet: [Owner]

2. Group actions

Group all these actions into a MasterData section for more convenient access.

ensure group MasterData
  pinnedActions: [EditItemMaster]
  actionPermission: {
      'EditItemTypeMaster': {
        'roles': [
          'Owner'
        ]
      },
      'EditItemSizeMaster': {
        'roles': [
          'Owner'
        ]
      },
      'EditItemMaster': {
        'roles': [
          'Owner'
        ]
      }
    }