Skip to content

Commit

Permalink
feat: loyalty program schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
AbleKSaju committed Aug 22, 2024
1 parent a619a16 commit aa81ab5
Show file tree
Hide file tree
Showing 6 changed files with 211 additions and 0 deletions.
7 changes: 7 additions & 0 deletions schemas/app/AccountingSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@
"default": false,
"section": "Features"
},
{
"fieldname": "enableLoyaltyProgram",
"label": "Enable Loyalty Program",
"fieldtype": "Check",
"default": false,
"section": "Features"
},
{
"fieldname": "fiscalYearStart",
"label": "Fiscal Year Start Date",
Expand Down
23 changes: 23 additions & 0 deletions schemas/app/CollectionRulesItems.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "CollectionRulesItems",
"label": "Collection Rules",
"isChild": true,
"fields": [
{
"fieldname": "tierName",
"label": "Tier Name",
"fieldtype": "Data"
},
{
"fieldname": "collectionFactor",
"label": "Collection Factor (=1 LP)",
"fieldtype": "Float"
},
{
"fieldname": "minimumTotalSpent",
"label": "Minimum Total Spent",
"fieldtype": "Currency"
}
],
"tableFields": ["tierName", "collectionFactor", "minimumTotalSpent"]
}
70 changes: 70 additions & 0 deletions schemas/app/LoyaltyPointEntry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "LoyaltyPointEntry",
"label": "Loyalty Point Entry",
"create": false,
"naming": "random",
"fields": [
{
"label": "Entry No.",
"fieldname": "name",
"fieldtype": "Data",
"required": true,
"readOnly": true,
"section": "Default"
},
{
"fieldname": "loyaltyProgram",
"readOnly": true,
"label": "Loyalty Program",
"fieldtype": "Data",
"required": true
},
{
"fieldname": "loyaltyProgramTier",
"readOnly": true,
"label": "Loyalty Program Tier",
"fieldtype": "Data"
},
{
"fieldname": "customer",
"readOnly": true,
"label": "Customer",
"fieldtype": "Link",
"target": "Party",
"required": true
},
{
"fieldname": "invoice",
"readOnly": true,
"label": "Invoice",
"fieldtype": "Link",
"target": "SalesInvoice",
"required": true
},
{
"fieldname": "loyaltyPoints",
"readOnly": true,
"label": "Loyalty Points",
"fieldtype": "Int"
},
{
"fieldname": "purchaseAmount",
"readOnly": true,
"label": "Purchase Amount",
"fieldtype": "Currency",
"required": true
},
{
"fieldname": "expiryDate",
"readOnly": true,
"label": "Expiry Date",
"fieldtype": "Date"
},
{
"fieldname": "postingDate",
"readOnly": true,
"label": "Posting Date",
"fieldtype": "Date"
}
]
}
72 changes: 72 additions & 0 deletions schemas/app/LoyaltyProgram.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"name": "LoyaltyProgram",
"label": "Loyalty Program",
"naming": "manual",

"fields": [
{
"fieldname": "name",
"label": "Name",
"fieldtype": "Data",
"required": true,
"placeholder": "Full Name",
"section": "Default"
},
{
"fieldname": "fromDate",
"label": "From Date",
"fieldtype": "Date",
"required": true
},
{
"fieldname": "toDate",
"label": "To Date",
"fieldtype": "Date",
"required": true
},
{
"fieldname": "isEnabled",
"label": "Is Enabled",
"fieldtype": "Check",
"default": true,
"required": true
},
{
"fieldname": "collectionRules",
"label": "Collection Rules",
"fieldtype": "Table",
"target": "CollectionRulesItems",
"required": false
},
{
"fieldname": "conversionFactor",
"label": "Conversion Factor",
"fieldtype": "Float",
"default": 1,
"required": true
},
{
"fieldname": "expiryDuration",
"label": "Expiry Duration",
"fieldtype": "Int",
"default": 1,
"required": true
},
{
"fieldname": "expenseAccount",
"label": "Expense Account",
"fieldtype": "Link",
"target": "Account",
"required": true
}
],
"quickEditFields": [
"name",
"fromDate",
"toDate",
"conversionFactor",
"expenseAccount",
"expiryDuration"
],
"keywordFields": ["name"]
}
18 changes: 18 additions & 0 deletions schemas/app/Party.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@
"readOnly": true,
"section": "References"
},

{
"fieldname": "loyaltyProgram",
"label": "Loyalty Program",
"fieldtype": "Link",
"target": "LoyaltyProgram",
"create": true,
"section": "Loyalty Program"
},
{
"fieldname": "loyaltyPoints",
"label": "Loyalty Points",
"fieldtype": "Int",
"readOnly": true,
"default": 0,
"section": "Loyalty Program"
},
{
"fieldname": "taxId",
"label": "Tax ID",
Expand All @@ -104,6 +121,7 @@
"phone",
"address",
"defaultAccount",
"loyaltyProgram",
"currency",
"role",
"taxId"
Expand Down
21 changes: 21 additions & 0 deletions schemas/app/SalesInvoice.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@
"label": "Return Against",
"section": "References"
},
{
"fieldname": "loyaltyProgram",
"fieldtype": "Link",
"target": "LoyaltyProgram",
"label": "Loyalty Program",
"section": "References",
"readOnly": true
},
{
"fieldname": "redeemLoyaltyPoints",
"fieldtype": "Check",
"default": false,
"label": "Redeem Loyalty Points",
"section": "Loyalty Points Redemption"
},
{
"fieldname": "loyaltyPoints",
"fieldtype": "Int",
"label": "Loyalty Points",
"section": "Loyalty Points Redemption"
},
{
"fieldname": "isPOS",
"fieldtype": "Check",
Expand Down

0 comments on commit aa81ab5

Please sign in to comment.