{
  "formId": "loyaltyprogram",
  "entity": "LoyaltyProgram",
  "title": "Loyalty Program",

  "pages": [
    {
      "pageId": "overview",
      "pageName": "Overview",
      "isDynamic": true
    },
    {
      "pageId": "General",
      "pageName": "General",
      "sections": [
        {
          "sectionId": "header",
          "sectionName": "Program Identity",
          "layout": { "columns": 12 },
          "fields": [
            { "Name": "LoyaltyProgramId", "Type": "number", "PostData": true, "DefaultValue": 0, "IsVisible": false },
            {
              "Name": "ProgramCode", "Type": "string",
              "Label": "pay.loyalty.programCode", "PlaceHolder": "Enter program code",
              "Required": true, "MaxLength": 20, "isKeyField": true,
              "layout": { "colSpan": 4 }
            },
            {
              "Name": "ProgramName", "Type": "string",
              "Label": "pay.loyalty.programName", "PlaceHolder": "Enter program name",
              "Required": true, "MaxLength": 100,
              "layout": { "colSpan": 4 }
            },
            {
              "Name": "ProgramType", "Type": "combobox",
              "Label": "pay.loyalty.programType", "Required": true,
              "DefaultValue": 1,
              "PickLists": [
                { "key": 1, "value": "Standard" },
                { "key": 2, "value": "Tiered" }
              ],
              "layout": { "colSpan": 4 }
            },
            {
              "Name": "Status", "Type": "combobox",
              "Label": "pay.common.status", "DefaultValue": 1,
              "PickLists": [
                { "key": 1, "value": "Active" },
                { "key": 0, "value": "Inactive" }
              ],
              "layout": { "colSpan": 4 }
            },
            {
              "Name": "SortOrder", "Type": "number",
              "Label": "pay.common.sortOrder", "PlaceHolder": "0", "DefaultValue": 0,
              "layout": { "colSpan": 4 }
            },
            {
              "Name": "Remarks", "Type": "textarea",
              "Label": "pay.common.remarks", "PlaceHolder": "Enter remarks", "MaxLength": 500,
              "layout": { "colSpan": 8 }
            }
          ]
        },
        {
          "sectionId": "pointsConfig",
          "sectionName": "Points Configuration",
          "layout": { "columns": 12 },
          "fields": [
            {
              "Name": "PointsName", "Type": "string",
              "Label": "pay.loyalty.pointsName", "PlaceHolder": "e.g. Points, Stars, Coins",
              "Required": true, "MaxLength": 50, "DefaultValue": "Points",
              "layout": { "colSpan": 4 }
            },
            {
              "Name": "PointsExpireDays", "Type": "number",
              "Label": "pay.loyalty.pointsExpireDays", "PlaceHolder": "0 = never expire",
              "Required": true, "DefaultValue": 0,
              "layout": { "colSpan": 4 }
            },
            {
              "Name": "MinRedeemPoints", "Type": "number",
              "Label": "pay.loyalty.minRedeemPoints", "PlaceHolder": "0",
              "Required": true, "DefaultValue": 0,
              "layout": { "colSpan": 4 }
            },
            {
              "Name": "PointsToCurrency", "Type": "number",
              "Label": "pay.loyalty.pointsToCurrency", "PlaceHolder": "1",
              "Required": true, "DefaultValue": 1,
              "layout": { "colSpan": 4 }
            },
            {
              "Name": "CurrencyToPoints", "Type": "number",
              "Label": "pay.loyalty.currencyToPoints", "PlaceHolder": "1",
              "Required": true, "DefaultValue": 1,
              "layout": { "colSpan": 4 }
            },
            {
              "Name": "AllowTiering", "Type": "number",
              "Label": "pay.loyalty.allowTiering",
              "PickLists": [{ "key": 0, "value": "No" }, { "key": 1, "value": "Yes" }],
              "DefaultValue": 0,
              "layout": { "colSpan": 4 }
            }
          ]
        }
      ]
    }
  ],

  "serverValidations": [],

  "api": {
    "save":   "Pay.LoyaltyProgram.Save",
    "update": "Pay.LoyaltyProgram.Save",
    "delete": "Pay.LoyaltyProgram.Delete",
    "get":    "Pay.LoyaltyProgram.Get"
  }
}