@etsoo/appscript 1.2.24 → 1.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/__tests__/app/CoreApp.ts +15 -0
  2. package/lib/cjs/address/AddressRegion.js +2 -2
  3. package/lib/cjs/app/CoreApp.d.ts +15 -2
  4. package/lib/cjs/app/CoreApp.js +10 -0
  5. package/lib/cjs/business/BusinessUtils.d.ts +28 -2
  6. package/lib/cjs/business/BusinessUtils.js +48 -6
  7. package/lib/cjs/business/EntityStatus.d.ts +12 -0
  8. package/lib/cjs/business/EntityStatus.js +12 -0
  9. package/lib/cjs/business/ProductUnit.d.ts +47 -45
  10. package/lib/cjs/business/ProductUnit.js +36 -48
  11. package/lib/cjs/business/RepeatOption.d.ts +56 -0
  12. package/lib/cjs/business/RepeatOption.js +60 -0
  13. package/lib/cjs/i18n/en-US.json +43 -0
  14. package/lib/cjs/i18n/zh-CN.json +44 -0
  15. package/lib/cjs/i18n/zh-HK.json +43 -0
  16. package/lib/cjs/index.d.ts +1 -0
  17. package/lib/cjs/index.js +1 -0
  18. package/lib/mjs/address/AddressRegion.js +2 -2
  19. package/lib/mjs/app/CoreApp.d.ts +15 -2
  20. package/lib/mjs/app/CoreApp.js +10 -0
  21. package/lib/mjs/business/BusinessUtils.d.ts +28 -2
  22. package/lib/mjs/business/BusinessUtils.js +48 -6
  23. package/lib/mjs/business/EntityStatus.d.ts +12 -0
  24. package/lib/mjs/business/EntityStatus.js +12 -0
  25. package/lib/mjs/business/ProductUnit.d.ts +47 -45
  26. package/lib/mjs/business/ProductUnit.js +35 -47
  27. package/lib/mjs/business/RepeatOption.d.ts +56 -0
  28. package/lib/mjs/business/RepeatOption.js +57 -0
  29. package/lib/mjs/i18n/en-US.json +43 -0
  30. package/lib/mjs/i18n/zh-CN.json +44 -0
  31. package/lib/mjs/i18n/zh-HK.json +43 -0
  32. package/lib/mjs/index.d.ts +1 -0
  33. package/lib/mjs/index.js +1 -0
  34. package/package.json +10 -10
  35. package/src/address/AddressRegion.ts +2 -2
  36. package/src/app/CoreApp.ts +20 -2
  37. package/src/business/BusinessUtils.ts +82 -7
  38. package/src/business/EntityStatus.ts +15 -0
  39. package/src/business/ProductUnit.ts +35 -51
  40. package/src/business/RepeatOption.ts +65 -0
  41. package/src/i18n/en-US.json +43 -0
  42. package/src/i18n/zh-CN.json +44 -0
  43. package/src/i18n/zh-HK.json +43 -0
  44. package/src/index.ts +1 -0
@@ -1,67 +1,55 @@
1
+ import { RepeatOption } from './RepeatOption';
1
2
  /**
2
- * Product units enum
3
- * See com.etsoo.CoreFramework.Business.ProductUnit
3
+ * Product base units
4
+ * 1 - 9
4
5
  */
5
- export var ProductUnit;
6
- (function (ProductUnit) {
6
+ export var ProductBaseUnit;
7
+ (function (ProductBaseUnit) {
7
8
  /**
8
9
  * Picese
9
10
  * 件
10
11
  */
11
- ProductUnit[ProductUnit["PC"] = 0] = "PC";
12
+ ProductBaseUnit[ProductBaseUnit["PC"] = 1] = "PC";
12
13
  /**
13
14
  * Set
14
15
  * 套
15
16
  */
16
- ProductUnit[ProductUnit["SET"] = 1] = "SET";
17
- /**
18
- * Year
19
- *
20
- */
21
- ProductUnit[ProductUnit["YEAR"] = 10] = "YEAR";
22
- /**
23
- * Quater
24
- * 季
25
- */
26
- ProductUnit[ProductUnit["QUATER"] = 11] = "QUATER";
27
- /**
28
- * Month
29
- * 月
30
- */
31
- ProductUnit[ProductUnit["MONTH"] = 12] = "MONTH";
32
- /**
33
- * Fortnight
34
- * 两周
35
- */
36
- ProductUnit[ProductUnit["FORNIGHT"] = 13] = "FORNIGHT";
37
- /**
38
- * Week
39
- * 周
40
- */
41
- ProductUnit[ProductUnit["WEEK"] = 14] = "WEEK";
42
- /**
43
- * Day
44
- * 天
45
- */
46
- ProductUnit[ProductUnit["DAY"] = 15] = "DAY";
17
+ ProductBaseUnit[ProductBaseUnit["SET"] = 2] = "SET";
18
+ })(ProductBaseUnit || (ProductBaseUnit = {}));
19
+ /**
20
+ * Product weight units
21
+ * Range 40 - 49
22
+ */
23
+ export var ProductWeightUnit;
24
+ (function (ProductWeightUnit) {
47
25
  /**
48
- * Hour
49
- * 小时
26
+ * Gram
27
+ *
50
28
  */
51
- ProductUnit[ProductUnit["HOUR"] = 16] = "HOUR";
29
+ ProductWeightUnit[ProductWeightUnit["GRAM"] = 40] = "GRAM";
52
30
  /**
53
- * Ton
54
- *
31
+ * Half Kg
32
+ *
55
33
  */
56
- ProductUnit[ProductUnit["TON"] = 31] = "TON";
34
+ ProductWeightUnit[ProductWeightUnit["JIN"] = 41] = "JIN";
57
35
  /**
58
36
  * Kilogram
59
37
  * 千克
60
38
  */
61
- ProductUnit[ProductUnit["KILOGRAM"] = 32] = "KILOGRAM";
39
+ ProductWeightUnit[ProductWeightUnit["KILOGRAM"] = 42] = "KILOGRAM";
62
40
  /**
63
- * Gram
64
- *
41
+ * Ton
42
+ *
65
43
  */
66
- ProductUnit[ProductUnit["GRAM"] = 33] = "GRAM";
67
- })(ProductUnit || (ProductUnit = {}));
44
+ ProductWeightUnit[ProductWeightUnit["TON"] = 49] = "TON";
45
+ })(ProductWeightUnit || (ProductWeightUnit = {}));
46
+ /**
47
+ * Product units enum
48
+ * Repeat options take range 10 - 39
49
+ * See com.etsoo.CoreFramework.Business.ProductUnit
50
+ */
51
+ export const ProductUnit = {
52
+ ...ProductBaseUnit,
53
+ ...RepeatOption,
54
+ ...ProductWeightUnit
55
+ };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Repeat options
3
+ * Part of ProductUnit, range 10 - 39
4
+ */
5
+ export declare enum RepeatOption {
6
+ /**
7
+ * Hour
8
+ * 小时
9
+ */
10
+ HOUR = 10,
11
+ /**
12
+ * Day
13
+ * 天
14
+ */
15
+ DAY = 11,
16
+ /**
17
+ * Year
18
+ * 年
19
+ */
20
+ YEAR = 12,
21
+ /**
22
+ * Week
23
+ * 周
24
+ */
25
+ WEEK = 21,
26
+ /**
27
+ * Two weeks
28
+ * 两周
29
+ */
30
+ FORTNIGHT = 22,
31
+ /**
32
+ * Four weeks
33
+ * 四周
34
+ */
35
+ FOURWEEK = 24,
36
+ /**
37
+ * Month
38
+ * 月
39
+ */
40
+ MONTH = 31,
41
+ /**
42
+ * Two months
43
+ * 两月
44
+ */
45
+ BIMONTH = 32,
46
+ /**
47
+ * Quater(3 months)
48
+ * 季(三个月)
49
+ */
50
+ QUATER = 33,
51
+ /**
52
+ * Half a year
53
+ * 半年
54
+ */
55
+ HALFYEAR = 36
56
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Repeat options
3
+ * Part of ProductUnit, range 10 - 39
4
+ */
5
+ export var RepeatOption;
6
+ (function (RepeatOption) {
7
+ /**
8
+ * Hour
9
+ * 小时
10
+ */
11
+ RepeatOption[RepeatOption["HOUR"] = 10] = "HOUR";
12
+ /**
13
+ * Day
14
+ * 天
15
+ */
16
+ RepeatOption[RepeatOption["DAY"] = 11] = "DAY";
17
+ /**
18
+ * Year
19
+ * 年
20
+ */
21
+ RepeatOption[RepeatOption["YEAR"] = 12] = "YEAR";
22
+ /**
23
+ * Week
24
+ * 周
25
+ */
26
+ RepeatOption[RepeatOption["WEEK"] = 21] = "WEEK";
27
+ /**
28
+ * Two weeks
29
+ * 两周
30
+ */
31
+ RepeatOption[RepeatOption["FORTNIGHT"] = 22] = "FORTNIGHT";
32
+ /**
33
+ * Four weeks
34
+ * 四周
35
+ */
36
+ RepeatOption[RepeatOption["FOURWEEK"] = 24] = "FOURWEEK";
37
+ /**
38
+ * Month
39
+ * 月
40
+ */
41
+ RepeatOption[RepeatOption["MONTH"] = 31] = "MONTH";
42
+ /**
43
+ * Two months
44
+ * 两月
45
+ */
46
+ RepeatOption[RepeatOption["BIMONTH"] = 32] = "BIMONTH";
47
+ /**
48
+ * Quater(3 months)
49
+ * 季(三个月)
50
+ */
51
+ RepeatOption[RepeatOption["QUATER"] = 33] = "QUATER";
52
+ /**
53
+ * Half a year
54
+ * 半年
55
+ */
56
+ RepeatOption[RepeatOption["HALFYEAR"] = 36] = "HALFYEAR";
57
+ })(RepeatOption || (RepeatOption = {}));
@@ -1,6 +1,10 @@
1
1
  {
2
+ "accountant": "Accountant",
2
3
  "actions": "Actions",
3
4
  "add": "Add",
5
+ "authorizer": "Authorizer",
6
+ "applicant": "Applicant",
7
+ "approve": "Approve it",
4
8
  "back": "Back",
5
9
  "cancel": "Cancel",
6
10
  "clear": "Clear",
@@ -11,6 +15,16 @@
11
15
  "copy": "Copy",
12
16
  "creation": "Creation",
13
17
  "currency": "Currency",
18
+ "currencyAUD": "Australia Dollar $",
19
+ "currencyCAD": "Canada Dollar $",
20
+ "currencyCNY": "Renminbi(RMB) ¥",
21
+ "currencyEUR": "Euro €",
22
+ "currencyGBP": "British Pound £",
23
+ "currencyHKD": "Hong Kong Dollar $",
24
+ "currencyJPY": "Japan Yen ¥",
25
+ "currencyNZD": "New Zealand Dollar $",
26
+ "currencySGD": "Singapore Dollar $",
27
+ "currencyUSD": "U.S. Dollar $",
14
28
  "delete": "Delete",
15
29
  "deleteConfirm": "Are you sure you want to permanently delete this {0}?",
16
30
  "description": "Description",
@@ -44,6 +58,7 @@
44
58
  "pageNotFound": "Page Not Found",
45
59
  "prompt": "Input",
46
60
  "pullToRefresh": "Pull down to refresh",
61
+ "record": "Record",
47
62
  "refresh": "Refresh",
48
63
  "refreshing": "Refreshing",
49
64
  "releaseToRefresh": "Release to refresh",
@@ -66,17 +81,45 @@
66
81
  "smartERP": "SmartERP",
67
82
  "sortTip": "Drag and drop items to sort",
68
83
  "status": "Status",
84
+ "statusApproved": "Approved",
69
85
  "statusArchived": "Archived",
86
+ "statusAudited": "Audited",
87
+ "statusCompleted": "Completed",
70
88
  "statusDeleted": "Deleted",
71
89
  "statusFlaged": "Flaged",
72
90
  "statusNormal": "Normla",
73
91
  "statusInactivated": "Inactivated",
74
92
  "submit": "Submit",
75
93
  "success": "Success",
94
+ "taxId": "Tax ID number",
95
+ "taxIdHelp": "Used for real-name authentication and invoicing",
96
+ "taxCABN": "Business number",
97
+ "taxCNUSCC": "Unified social credit code",
98
+ "taxHKBRN": "Business registration number",
99
+ "taxNZIRD": "IRD",
100
+ "taxUSEIN": "Employer identification number",
76
101
  "timeDifferenceInvalid": "The time difference between the device and the server is {0}, which exceeds the limit of {1} seconds. Please adjust the device time. If it is abnormal, please inform the administrator",
77
102
  "tokenExpiry": "Your session is about to expire. Click the Cancel button to continue",
78
103
  "yes": "Yes",
79
104
  "unknownError": "Unknown Error",
105
+ "unitJoin": "per {0}",
106
+ "unitPC": "PC",
107
+ "unitSET": "SET",
108
+ "unitHOUR": "Hour",
109
+ "unitDAY": "Day",
110
+ "unitYEAR": "Year",
111
+ "unitWEEK": "Week",
112
+ "unitFORTNIGHT": "Fortnight",
113
+ "unitFOURWEEK": "4-week",
114
+ "unitMONTH": "Month",
115
+ "unitBIMONTH": "2-month",
116
+ "unitQUATER": "Quater",
117
+ "unitHALFYEAR": "6-month",
118
+ "unitGRAM": "g",
119
+ "unitJIN": "½Kg",
120
+ "unitKILOGRAM": "Kg",
121
+ "user": "User",
122
+ "view": "View",
80
123
  "warning": "Warning",
81
124
  "welcome": "{0}, welcome!"
82
125
  }
@@ -1,6 +1,10 @@
1
1
  {
2
+ "accountant": "会计",
2
3
  "actions": "操作",
3
4
  "add": "添加",
5
+ "authorizer": "授权人",
6
+ "applicant": "申请人",
7
+ "approve": "批准",
4
8
  "back": "后退",
5
9
  "cancel": "取消",
6
10
  "clear": "清除",
@@ -11,6 +15,16 @@
11
15
  "copy": "复制",
12
16
  "creation": "登记时间",
13
17
  "currency": "币种",
18
+ "currencyAUD": "澳元$",
19
+ "currencyCAD": "加元$",
20
+ "currencyCNY": "人民币¥",
21
+ "currencyEUR": "欧元€",
22
+ "currencyGBP": "英镑£",
23
+ "currencyHKD": "港币$",
24
+ "currencyJPY": "日元¥",
25
+ "currencyNZD": "纽币$",
26
+ "currencySGD": "新币$",
27
+ "currencyUSD": "美元$",
14
28
  "delete": "删除",
15
29
  "deleteConfirm": "确定要永久删除此{0}吗?",
16
30
  "description": "描述",
@@ -44,6 +58,7 @@
44
58
  "pageNotFound": "找不到页面",
45
59
  "prompt": "输入",
46
60
  "pullToRefresh": "下拉刷新",
61
+ "record": "记录",
47
62
  "refresh": "刷新",
48
63
  "refreshing": "正在刷新",
49
64
  "releaseToRefresh": "释放刷新",
@@ -66,17 +81,46 @@
66
81
  "smartERP": "司友云ERP",
67
82
  "sortTip": "拖拽项目进行排序",
68
83
  "status": "状态",
84
+ "statusApproved": "已批准",
69
85
  "statusArchived": "已归档",
86
+ "statusAudited": "已审核",
87
+ "statusCompleted": "已完成",
70
88
  "statusDeleted": "已删除",
71
89
  "statusFlaged": "已标记",
72
90
  "statusNormal": "正常",
73
91
  "statusInactivated": "已停用",
74
92
  "submit": "提交",
75
93
  "success": "成功",
94
+ "taxId": "税号",
95
+ "taxIdHelp": "用于实名认证和开具发票",
96
+ "taxCABN": "营业编号(BN)",
97
+ "taxCNUSCC": "统一信用代码",
98
+ "taxHKBRN": "商业登记号码(BRN)",
99
+ "taxNZIRD": "IRD",
100
+ "taxUSEIN": "雇主识别号码(EIN)",
76
101
  "timeDifferenceInvalid": "设备时间和服务器时间差为{0},超过{1}秒的限制,请调整设备时间,如果异常请告知管理员",
77
102
  "tokenExpiry": "您的会话即将过期。点击 取消 按钮继续使用",
78
103
  "yes": "是",
79
104
  "unknownError": "未知错误",
105
+ "unitJoin": "每{0}",
106
+ "unitPC": "件",
107
+ "unitSET": "套",
108
+ "unitHOUR": "小时",
109
+ "unitDAY": "天",
110
+ "unitYEAR": "年",
111
+ "unitWEEK": "周",
112
+ "unitFORTNIGHT": "两周",
113
+ "unitFOURWEEK": "四周",
114
+ "unitMONTH": "月",
115
+ "unitBIMONTH": "两月",
116
+ "unitQUATER": "季度",
117
+ "unitHALFYEAR": "半年",
118
+ "unitGRAM": "克",
119
+ "unitJIN": "斤",
120
+ "unitKILOGRAM": "公斤",
121
+ "unitTON": "吨",
122
+ "user": "用户",
123
+ "view": "查看",
80
124
  "warning": "警告",
81
125
  "welcome": "{0}, 欢迎光临!"
82
126
  }
@@ -1,6 +1,10 @@
1
1
  {
2
+ "accountant": "會計",
2
3
  "actions": "操作",
3
4
  "add": "添加",
5
+ "authorizer": "授權人",
6
+ "applicant": "申請人",
7
+ "approve": "批准",
4
8
  "back": "後退",
5
9
  "cancel": "取消",
6
10
  "clear": "清除",
@@ -11,6 +15,16 @@
11
15
  "copy": "複製",
12
16
  "creation": "登記時間",
13
17
  "currency": "幣種",
18
+ "currencyAUD": "澳元$",
19
+ "currencyCAD": "加元$",
20
+ "currencyCNY": "人民幣¥",
21
+ "currencyEUR": "歐元€",
22
+ "currencyGBP": "英鎊£",
23
+ "currencyHKD": "港幣$",
24
+ "currencyJPY": "日元¥",
25
+ "currencyNZD": "紐幣$",
26
+ "currencySGD": "新幣$",
27
+ "currencyUSD": "美元$",
14
28
  "delete": "刪除",
15
29
  "deleteConfirm": "確定要永久刪除此{0}嗎?",
16
30
  "description": "描述",
@@ -44,6 +58,7 @@
44
58
  "pageNotFound": "找不到頁面",
45
59
  "prompt": "輸入",
46
60
  "pullToRefresh": "下拉刷新",
61
+ "record": "記錄",
47
62
  "refresh": "刷新",
48
63
  "refreshing": "正在刷新",
49
64
  "releaseToRefresh": "釋放刷新",
@@ -66,17 +81,45 @@
66
81
  "smartERP": "司友雲ERP",
67
82
  "sortTip": "拖拽項目進行排序",
68
83
  "status": "狀態",
84
+ "statusApproved": "已批准",
69
85
  "statusArchived": "已歸檔",
86
+ "statusAudited": "已審核",
87
+ "statusCompleted": "已完成",
70
88
  "statusDeleted": "已刪除",
71
89
  "statusFlaged": "已標記",
72
90
  "statusNormal": "正常",
73
91
  "statusInactivated": "已停用",
74
92
  "submit": "提交",
75
93
  "success": "成功",
94
+ "taxId": "稅號",
95
+ "taxIdHelp": "用於實名認證和開具發票",
96
+ "taxCABN": "營業編號(BN)",
97
+ "taxCNUSCC": "統一信用代碼",
98
+ "taxHKBRN": "商業登記號碼(BRN)",
99
+ "taxNZIRD": "IRD",
100
+ "taxUSEIN": "雇主識別號碼(EIN)",
76
101
  "timeDifferenceInvalid": "設備時間和服務器時間差為{0},超過{1}秒的限制,請調整設備時間,如果異常請告知管理員",
77
102
  "tokenExpiry": "您的會話即將過期。點擊 取消 按鈕繼續使用",
78
103
  "yes": "是",
79
104
  "unknownError": "未知錯誤",
105
+ "unitJoin": "每{0}",
106
+ "unitPC": "件",
107
+ "unitSET": "套",
108
+ "unitHOUR": "小時",
109
+ "unitDAY": "天",
110
+ "unitYEAR": "年",
111
+ "unitWEEK": "週",
112
+ "unitFORTNIGHT": "兩週",
113
+ "unitFOURWEEK": "四周",
114
+ "unitMONTH": "月",
115
+ "unitBIMONTH": "兩月",
116
+ "unitQUATER": "季度",
117
+ "unitHALFYEAR": "半年",
118
+ "unitGRAM": "克",
119
+ "unitJIN": "斤",
120
+ "unitKILOGRAM": "公斤",
121
+ "user": "用戶",
122
+ "view": "查看",
80
123
  "warning": "警告",
81
124
  "welcome": "{0}, 歡迎光臨!"
82
125
  }
@@ -12,6 +12,7 @@ export * from './business/BusinessTax';
12
12
  export * from './business/BusinessUtils';
13
13
  export * from './business/EntityStatus';
14
14
  export * from './business/ProductUnit';
15
+ export * from './business/RepeatOption';
15
16
  export * from './def/ListItem';
16
17
  export * from './dto/IdDto';
17
18
  export * from './dto/IdLabelDto';
package/lib/mjs/index.js CHANGED
@@ -16,6 +16,7 @@ export * from './business/BusinessTax';
16
16
  export * from './business/BusinessUtils';
17
17
  export * from './business/EntityStatus';
18
18
  export * from './business/ProductUnit';
19
+ export * from './business/RepeatOption';
19
20
  // def
20
21
  export * from './def/ListItem';
21
22
  // dto
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.2.24",
3
+ "version": "1.2.28",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -54,24 +54,24 @@
54
54
  "dependencies": {
55
55
  "@etsoo/notificationbase": "^1.1.0",
56
56
  "@etsoo/restclient": "^1.0.64",
57
- "@etsoo/shared": "^1.1.3",
57
+ "@etsoo/shared": "^1.1.6",
58
58
  "@types/crypto-js": "^4.1.0",
59
59
  "crypto-js": "^4.1.1"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@babel/cli": "^7.16.8",
63
- "@babel/core": "^7.16.7",
64
- "@babel/plugin-transform-runtime": "^7.16.8",
65
- "@babel/preset-env": "^7.16.8",
63
+ "@babel/core": "^7.16.12",
64
+ "@babel/plugin-transform-runtime": "^7.16.10",
65
+ "@babel/preset-env": "^7.16.11",
66
66
  "@babel/runtime-corejs3": "^7.16.8",
67
67
  "@types/jest": "^27.4.0",
68
- "@typescript-eslint/eslint-plugin": "^5.9.1",
69
- "@typescript-eslint/parser": "^5.9.1",
70
- "eslint": "^8.6.0",
68
+ "@typescript-eslint/eslint-plugin": "^5.10.1",
69
+ "@typescript-eslint/parser": "^5.10.1",
70
+ "eslint": "^8.7.0",
71
71
  "eslint-config-airbnb-base": "^15.0.0",
72
72
  "eslint-plugin-import": "^2.25.4",
73
73
  "jest": "^27.4.7",
74
- "ts-jest": "^27.1.2",
75
- "typescript": "^4.5.4"
74
+ "ts-jest": "^27.1.3",
75
+ "typescript": "^4.5.5"
76
76
  }
77
77
  }
@@ -149,7 +149,7 @@ export class AddressRegion implements IAddressRegion {
149
149
  AddressContinent.NA,
150
150
  '011',
151
151
  '1',
152
- 'USD',
152
+ 'CAD',
153
153
  ['en-CA', 'fr-CA']
154
154
  );
155
155
 
@@ -209,7 +209,7 @@ export class AddressRegion implements IAddressRegion {
209
209
  AddressContinent.EU,
210
210
  '00',
211
211
  '353',
212
- 'IEP',
212
+ 'EUR',
213
213
  ['en-IE']
214
214
  );
215
215
 
@@ -30,6 +30,7 @@ import {
30
30
  import { AddressRegion } from '../address/AddressRegion';
31
31
  import { AddressUtils } from '../address/AddressUtils';
32
32
  import { BusinessUtils } from '../business/BusinessUtils';
33
+ import { ProductUnit } from '../business/ProductUnit';
33
34
  import { IdLabelDto } from '../dto/IdLabelDto';
34
35
  import { InitCallDto } from '../dto/InitCallDto';
35
36
  import { ActionResultError } from '../result/ActionResultError';
@@ -335,7 +336,7 @@ export interface ICoreApp<
335
336
  * Get entity status label
336
337
  * @param data Input data
337
338
  */
338
- getEntityStatusLabel<D extends { entityStatus?: number }>(data: D): string;
339
+ getEntityStatusLabel<D extends { entityStatus?: number }>(data?: D): string;
339
340
 
340
341
  /**
341
342
  * Get all regions
@@ -356,6 +357,13 @@ export interface ICoreApp<
356
357
  */
357
358
  getTimeZone(): string | undefined;
358
359
 
360
+ /**
361
+ * Get product unit and repeat option label
362
+ * @param unit Product unit or repeat option
363
+ * @param isJoined Add the join label like 'per Kg' for Kg
364
+ */
365
+ getUnitLabel(unit?: ProductUnit, isJoined?: boolean): string;
366
+
359
367
  /**
360
368
  * Hash message, SHA3 or HmacSHA512, 512 as Base64
361
369
  * https://cryptojs.gitbook.io/docs/
@@ -1397,7 +1405,7 @@ export abstract class CoreApp<
1397
1405
  * Get entity status label
1398
1406
  * @param data Input data
1399
1407
  */
1400
- getEntityStatusLabel<D extends { entityStatus?: number }>(data: D) {
1408
+ getEntityStatusLabel<D extends { entityStatus?: number }>(data?: D) {
1401
1409
  if (data == null || data.entityStatus == null) return '';
1402
1410
  return BusinessUtils.getEntityStatusLabel(
1403
1411
  data.entityStatus,
@@ -1427,6 +1435,16 @@ export abstract class CoreApp<
1427
1435
  return this.settings.timeZone ?? this.ipData?.timezone;
1428
1436
  }
1429
1437
 
1438
+ /**
1439
+ * Get product unit and repeat option label
1440
+ * @param unit Product unit or repeat option
1441
+ * @param isJoined Add the join label like 'per Kg' for Kg
1442
+ */
1443
+ getUnitLabel(unit?: ProductUnit, isJoined?: boolean): string {
1444
+ if (unit == null) return '';
1445
+ return BusinessUtils.getUnitLabel(unit, this.labelDelegate, isJoined);
1446
+ }
1447
+
1430
1448
  /**
1431
1449
  * Hash message, SHA3 or HmacSHA512, 512 as Base64
1432
1450
  * https://cryptojs.gitbook.io/docs/