File size: 933 Bytes
ba7fcc6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
export const SUBSCRIPTION_PACKAGES = {
   basic: {
      key: "basic",
      label: "Basic",
      cashierLimit: 1,
      branchLimit: 1,   
   },
   standard: {
      key: "standard",
      label: "Standard",
      cashierLimit: 2,
      branchLimit: 2,     
   },
   premium: {
      key: "premium",
      label: "Premium",
      cashierLimit: null,
      branchLimit: null, 
   },
};

export const DEFAULT_SUBSCRIPTION_PACKAGE = "basic";

export const normalizePackageKey = (value) => {
   const key = String(value || "").trim().toLowerCase();
   return SUBSCRIPTION_PACKAGES[key] ? key : null;
};

export const getPackageDetails = (value) => {
   const key = normalizePackageKey(value) || DEFAULT_SUBSCRIPTION_PACKAGE;
   return SUBSCRIPTION_PACKAGES[key];
};

export const isUnlimitedCashierLimit = (limit) => limit === null;

export const isUnlimitedBranchLimit = (limit) => limit === null;