@etsoo/smarterp-crm 1.0.0

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 (156) hide show
  1. package/.gitattributes +2 -0
  2. package/.github/workflows/main.yml +60 -0
  3. package/LICENSE +21 -0
  4. package/README.md +17 -0
  5. package/__tests__/PersonApi.ts +15 -0
  6. package/__tests__/app/TestApp.ts +139 -0
  7. package/__tests__/tsconfig.json +20 -0
  8. package/babel.config.json +11 -0
  9. package/lib/cjs/CrmApp.d.ts +186 -0
  10. package/lib/cjs/CrmApp.js +170 -0
  11. package/lib/cjs/PersonApi.d.ts +38 -0
  12. package/lib/cjs/PersonApi.js +45 -0
  13. package/lib/cjs/PersonProfileApi.d.ts +54 -0
  14. package/lib/cjs/PersonProfileApi.js +63 -0
  15. package/lib/cjs/components/index.d.ts +1 -0
  16. package/lib/cjs/components/index.js +18 -0
  17. package/lib/cjs/components/person/PersonTiplist.d.ts +28 -0
  18. package/lib/cjs/components/person/PersonTiplist.js +27 -0
  19. package/lib/cjs/dto/person/AddressItem.d.ts +36 -0
  20. package/lib/cjs/dto/person/AddressItem.js +12 -0
  21. package/lib/cjs/dto/person/CategoryItem.d.ts +16 -0
  22. package/lib/cjs/dto/person/CategoryItem.js +2 -0
  23. package/lib/cjs/dto/person/ContactItem.d.ts +30 -0
  24. package/lib/cjs/dto/person/ContactItem.js +2 -0
  25. package/lib/cjs/dto/person/MaritalStatus.d.ts +36 -0
  26. package/lib/cjs/dto/person/MaritalStatus.js +40 -0
  27. package/lib/cjs/dto/person/PersonDegree.d.ts +26 -0
  28. package/lib/cjs/dto/person/PersonDegree.js +30 -0
  29. package/lib/cjs/dto/person/PersonEducation.d.ts +111 -0
  30. package/lib/cjs/dto/person/PersonEducation.js +115 -0
  31. package/lib/cjs/dto/person/PersonListDto.d.ts +6 -0
  32. package/lib/cjs/dto/person/PersonListDto.js +2 -0
  33. package/lib/cjs/dto/person/PersonQueryData.d.ts +24 -0
  34. package/lib/cjs/dto/person/PersonQueryData.js +2 -0
  35. package/lib/cjs/dto/person/PersonReadDto.d.ts +206 -0
  36. package/lib/cjs/dto/person/PersonReadDto.js +2 -0
  37. package/lib/cjs/dto/person/PersonTitle.d.ts +36 -0
  38. package/lib/cjs/dto/person/PersonTitle.js +40 -0
  39. package/lib/cjs/dto/personProfile/PersonProfileKind.d.ts +26 -0
  40. package/lib/cjs/dto/personProfile/PersonProfileKind.js +30 -0
  41. package/lib/cjs/dto/personProfile/PersonProfileListData.d.ts +16 -0
  42. package/lib/cjs/dto/personProfile/PersonProfileListData.js +2 -0
  43. package/lib/cjs/dto/personProfile/PersonProfileQueryData.d.ts +43 -0
  44. package/lib/cjs/dto/personProfile/PersonProfileQueryData.js +2 -0
  45. package/lib/cjs/dto/personProfile/PersonProfileUpdateReadData.d.ts +73 -0
  46. package/lib/cjs/dto/personProfile/PersonProfileUpdateReadData.js +2 -0
  47. package/lib/cjs/dto/personProfile/PersonProfileViewData.d.ts +5 -0
  48. package/lib/cjs/dto/personProfile/PersonProfileViewData.js +2 -0
  49. package/lib/cjs/i18n/CrmCulture.d.ts +244 -0
  50. package/lib/cjs/i18n/CrmCulture.js +23 -0
  51. package/lib/cjs/i18n/en.json +74 -0
  52. package/lib/cjs/i18n/zh-Hans.json +74 -0
  53. package/lib/cjs/i18n/zh-Hant.json +74 -0
  54. package/lib/cjs/index.d.ts +20 -0
  55. package/lib/cjs/index.js +40 -0
  56. package/lib/cjs/rq/person/PersonListRQ.d.ts +6 -0
  57. package/lib/cjs/rq/person/PersonListRQ.js +2 -0
  58. package/lib/cjs/rq/person/PersonQueryRQ.d.ts +6 -0
  59. package/lib/cjs/rq/person/PersonQueryRQ.js +2 -0
  60. package/lib/cjs/rq/personProfile/PersonProfileCreateRQ.d.ts +73 -0
  61. package/lib/cjs/rq/personProfile/PersonProfileCreateRQ.js +2 -0
  62. package/lib/cjs/rq/personProfile/PersonProfileListRQ.d.ts +48 -0
  63. package/lib/cjs/rq/personProfile/PersonProfileListRQ.js +2 -0
  64. package/lib/cjs/rq/personProfile/PersonProfileQueryRQ.d.ts +12 -0
  65. package/lib/cjs/rq/personProfile/PersonProfileQueryRQ.js +2 -0
  66. package/lib/mjs/CrmApp.d.ts +186 -0
  67. package/lib/mjs/CrmApp.js +165 -0
  68. package/lib/mjs/PersonApi.d.ts +38 -0
  69. package/lib/mjs/PersonApi.js +41 -0
  70. package/lib/mjs/PersonProfileApi.d.ts +54 -0
  71. package/lib/mjs/PersonProfileApi.js +59 -0
  72. package/lib/mjs/components/index.d.ts +1 -0
  73. package/lib/mjs/components/index.js +2 -0
  74. package/lib/mjs/components/person/PersonTiplist.d.ts +28 -0
  75. package/lib/mjs/components/person/PersonTiplist.js +24 -0
  76. package/lib/mjs/dto/person/AddressItem.d.ts +36 -0
  77. package/lib/mjs/dto/person/AddressItem.js +11 -0
  78. package/lib/mjs/dto/person/CategoryItem.d.ts +16 -0
  79. package/lib/mjs/dto/person/CategoryItem.js +1 -0
  80. package/lib/mjs/dto/person/ContactItem.d.ts +30 -0
  81. package/lib/mjs/dto/person/ContactItem.js +1 -0
  82. package/lib/mjs/dto/person/MaritalStatus.d.ts +36 -0
  83. package/lib/mjs/dto/person/MaritalStatus.js +37 -0
  84. package/lib/mjs/dto/person/PersonDegree.d.ts +26 -0
  85. package/lib/mjs/dto/person/PersonDegree.js +27 -0
  86. package/lib/mjs/dto/person/PersonEducation.d.ts +111 -0
  87. package/lib/mjs/dto/person/PersonEducation.js +112 -0
  88. package/lib/mjs/dto/person/PersonListDto.d.ts +6 -0
  89. package/lib/mjs/dto/person/PersonListDto.js +1 -0
  90. package/lib/mjs/dto/person/PersonQueryData.d.ts +24 -0
  91. package/lib/mjs/dto/person/PersonQueryData.js +1 -0
  92. package/lib/mjs/dto/person/PersonReadDto.d.ts +206 -0
  93. package/lib/mjs/dto/person/PersonReadDto.js +1 -0
  94. package/lib/mjs/dto/person/PersonTitle.d.ts +36 -0
  95. package/lib/mjs/dto/person/PersonTitle.js +37 -0
  96. package/lib/mjs/dto/personProfile/PersonProfileKind.d.ts +26 -0
  97. package/lib/mjs/dto/personProfile/PersonProfileKind.js +27 -0
  98. package/lib/mjs/dto/personProfile/PersonProfileListData.d.ts +16 -0
  99. package/lib/mjs/dto/personProfile/PersonProfileListData.js +1 -0
  100. package/lib/mjs/dto/personProfile/PersonProfileQueryData.d.ts +43 -0
  101. package/lib/mjs/dto/personProfile/PersonProfileQueryData.js +1 -0
  102. package/lib/mjs/dto/personProfile/PersonProfileUpdateReadData.d.ts +73 -0
  103. package/lib/mjs/dto/personProfile/PersonProfileUpdateReadData.js +1 -0
  104. package/lib/mjs/dto/personProfile/PersonProfileViewData.d.ts +5 -0
  105. package/lib/mjs/dto/personProfile/PersonProfileViewData.js +1 -0
  106. package/lib/mjs/i18n/CrmCulture.d.ts +460 -0
  107. package/lib/mjs/i18n/CrmCulture.js +20 -0
  108. package/lib/mjs/i18n/en.json +74 -0
  109. package/lib/mjs/i18n/zh-Hans.json +74 -0
  110. package/lib/mjs/i18n/zh-Hant.json +74 -0
  111. package/lib/mjs/index.d.ts +20 -0
  112. package/lib/mjs/index.js +24 -0
  113. package/lib/mjs/rq/person/PersonListRQ.d.ts +6 -0
  114. package/lib/mjs/rq/person/PersonListRQ.js +1 -0
  115. package/lib/mjs/rq/person/PersonQueryRQ.d.ts +6 -0
  116. package/lib/mjs/rq/person/PersonQueryRQ.js +1 -0
  117. package/lib/mjs/rq/personProfile/PersonProfileCreateRQ.d.ts +73 -0
  118. package/lib/mjs/rq/personProfile/PersonProfileCreateRQ.js +1 -0
  119. package/lib/mjs/rq/personProfile/PersonProfileListRQ.d.ts +48 -0
  120. package/lib/mjs/rq/personProfile/PersonProfileListRQ.js +1 -0
  121. package/lib/mjs/rq/personProfile/PersonProfileQueryRQ.d.ts +12 -0
  122. package/lib/mjs/rq/personProfile/PersonProfileQueryRQ.js +1 -0
  123. package/package.json +64 -0
  124. package/src/CrmApp.ts +270 -0
  125. package/src/PersonApi.ts +50 -0
  126. package/src/PersonProfileApi.ts +81 -0
  127. package/src/components/index.ts +2 -0
  128. package/src/components/person/PersonTiplist.tsx +75 -0
  129. package/src/dto/person/AddressItem.ts +39 -0
  130. package/src/dto/person/CategoryItem.ts +17 -0
  131. package/src/dto/person/ContactItem.ts +38 -0
  132. package/src/dto/person/MaritalStatus.ts +41 -0
  133. package/src/dto/person/PersonDegree.ts +29 -0
  134. package/src/dto/person/PersonEducation.ts +131 -0
  135. package/src/dto/person/PersonListDto.ts +7 -0
  136. package/src/dto/person/PersonQueryData.ts +28 -0
  137. package/src/dto/person/PersonReadDto.ts +242 -0
  138. package/src/dto/person/PersonTitle.ts +41 -0
  139. package/src/dto/personProfile/PersonProfileKind.ts +29 -0
  140. package/src/dto/personProfile/PersonProfileListData.ts +17 -0
  141. package/src/dto/personProfile/PersonProfileQueryData.ts +50 -0
  142. package/src/dto/personProfile/PersonProfileUpdateReadData.ts +86 -0
  143. package/src/dto/personProfile/PersonProfileViewData.ts +5 -0
  144. package/src/i18n/CrmCulture.ts +21 -0
  145. package/src/i18n/en.json +74 -0
  146. package/src/i18n/zh-Hans.json +74 -0
  147. package/src/i18n/zh-Hant.json +74 -0
  148. package/src/index.ts +30 -0
  149. package/src/rq/person/PersonListRQ.ts +7 -0
  150. package/src/rq/person/PersonQueryRQ.ts +7 -0
  151. package/src/rq/personProfile/PersonProfileCreateRQ.ts +86 -0
  152. package/src/rq/personProfile/PersonProfileListRQ.ts +56 -0
  153. package/src/rq/personProfile/PersonProfileQueryRQ.ts +13 -0
  154. package/tsconfig.cjs.json +20 -0
  155. package/tsconfig.json +20 -0
  156. package/vite.config.mts +12 -0
@@ -0,0 +1,74 @@
1
+ {
2
+ "assets": "資產",
3
+ "contacts": "聯絡人",
4
+ "cultures": "語言/文化",
5
+ "currencies": "貨幣",
6
+ "customers": "客戶",
7
+ "degreeBachelor": "學士",
8
+ "degreeDoctor": "博士",
9
+ "degreeMaster": "碩士",
10
+ "degreePreBachelor": "副學士",
11
+ "educationHighSchool": "高中",
12
+ "educationHighSchool1": "高中1年級",
13
+ "educationHighSchool2": "高中2年級",
14
+ "educationHighSchool3": "高中3年級",
15
+ "educationMiddleSchool": "初中",
16
+ "educationMiddleSchool1": "初中1年級",
17
+ "educationMiddleSchool2": "初中2年級",
18
+ "educationMiddleSchool3": "初中3年級",
19
+ "educationPrimarySchool": "小學",
20
+ "educationPrimarySchool2": "小學2年級",
21
+ "educationPrimarySchool3": "小學3年級",
22
+ "educationPrimarySchool4": "小學4年級",
23
+ "educationPrimarySchool5": "小學5年級",
24
+ "educationPrimarySchool6": "小學6年級",
25
+ "educationUniversity10": "大學本科畢業且獲得學士學位",
26
+ "educationUniversity12": "研究生畢業(無學位證書)",
27
+ "educationUniversity14": "碩士學位畢業",
28
+ "educationUniversity2": "大專畢業",
29
+ "educationUniversity4": "五大學歷畢業(自考、電大、夜大、黨校、函授)",
30
+ "educationUniversity6": "大學在讀",
31
+ "educationUniversity8": "大學本科畢業(無學士學位)",
32
+ "employees": "員工",
33
+ "idUser": "用戶",
34
+ "isLegalPerson": "是否企業",
35
+ "isOrg": "是否本機構",
36
+ "jobTitle": "職位",
37
+ "latinName": "拼音名",
38
+ "maritalDivorced": "離異",
39
+ "maritalMarried": "已婚",
40
+ "maritalPartnership": "同居伴侶",
41
+ "maritalSeparated": "分居",
42
+ "maritalSingle": "未婚",
43
+ "maritalWidowed": "喪偶",
44
+ "offerings": "產品和服務",
45
+ "orders": "訂單",
46
+ "personBirthday": "生日",
47
+ "personDegree": "學位",
48
+ "personEducation": "學歷",
49
+ "personEthnicity": "民族",
50
+ "personFemale": "女",
51
+ "personGender": "性別",
52
+ "personMale": "男",
53
+ "personMaritalStatus": "婚姻狀況",
54
+ "personName": "名稱 / 姓名",
55
+ "personTitle": "稱謂",
56
+ "personTitleDR": "博士",
57
+ "personTitleMR": "先生",
58
+ "personTitleMRS": "夫人",
59
+ "personTitleMS": "女士",
60
+ "personTitleMiss": "小姐",
61
+ "personTitleProf": "教授",
62
+ "personHeight": "身高 (厘米)",
63
+ "personWeight": "體重 (公斤)",
64
+ "politicalStatus": "政治面貌",
65
+ "profiles": "檔案",
66
+ "products": "產品",
67
+ "purchases": "採購",
68
+ "regions": "國家或地區",
69
+ "reports": "報表",
70
+ "stockIn": "入庫",
71
+ "stockOut": "出庫",
72
+ "system": "系統",
73
+ "suppliers": "供應商"
74
+ }
package/src/index.ts ADDED
@@ -0,0 +1,30 @@
1
+ // Person
2
+ export * from "./dto/person/AddressItem";
3
+ export * from "./dto/person/CategoryItem";
4
+ export * from "./dto/person/ContactItem";
5
+ export * from "./dto/person/PersonListDto";
6
+ export * from "./dto/person/PersonQueryData";
7
+ export * from "./dto/person/PersonReadDto";
8
+
9
+ export * from "./rq/person/PersonListRQ";
10
+ export * from "./rq/person/PersonQueryRQ";
11
+
12
+ // PersonProfile
13
+ export * from "./dto/personProfile/PersonProfileKind";
14
+ export * from "./dto/personProfile/PersonProfileListData";
15
+ export * from "./dto/personProfile/PersonProfileQueryData";
16
+ export * from "./dto/personProfile/PersonProfileUpdateReadData";
17
+ export * from "./dto/personProfile/PersonProfileViewData";
18
+
19
+ export * from "./rq/personProfile/PersonProfileCreateRQ";
20
+ export * from "./rq/personProfile/PersonProfileListRQ";
21
+ export * from "./rq/personProfile/PersonProfileQueryRQ";
22
+
23
+ // i18n
24
+ export * from "./i18n/CrmCulture";
25
+
26
+ // APIs
27
+ export * from "./PersonApi";
28
+ export * from "./PersonProfileApi";
29
+
30
+ export * from "./CrmApp";
@@ -0,0 +1,7 @@
1
+ import { QueryRQ } from "@etsoo/appscript";
2
+
3
+ /**
4
+ * Person list request data
5
+ * 成员列表请求数据
6
+ */
7
+ export type PersonListRQ = QueryRQ & {};
@@ -0,0 +1,7 @@
1
+ import { PersonListRQ } from "./PersonListRQ";
2
+
3
+ /**
4
+ * Person query request data
5
+ * 成员查询请求数据
6
+ */
7
+ export type PersonQueryRQ = PersonListRQ & {};
@@ -0,0 +1,86 @@
1
+ import { EntityStatus, UserRole } from "@etsoo/appscript";
2
+ import { PersonProfileKind } from "../../dto/personProfile/PersonProfileKind";
3
+
4
+ /**
5
+ * Person profile create request data
6
+ * 人员档案创建请求数据
7
+ */
8
+ export type PersonProfileCreateRQ = {
9
+ /**
10
+ * Person id
11
+ * 人员编号
12
+ */
13
+ personId: number;
14
+
15
+ /**
16
+ * Other participants
17
+ * 其他参与者
18
+ */
19
+ persons?: number[];
20
+
21
+ /**
22
+ * Order / purchase id
23
+ * 订单 / 采购编号
24
+ */
25
+ orderId?: number;
26
+
27
+ /**
28
+ * Kind
29
+ * 类型
30
+ */
31
+ kind: PersonProfileKind;
32
+
33
+ /**
34
+ * Title
35
+ * 标题
36
+ */
37
+ title: string;
38
+
39
+ /**
40
+ * Comment
41
+ * 评论
42
+ */
43
+ comment: string;
44
+
45
+ /**
46
+ * Location
47
+ * 位置
48
+ */
49
+ location?: string;
50
+
51
+ /**
52
+ * Location id
53
+ * 位置编号
54
+ */
55
+ locationId?: number;
56
+
57
+ /**
58
+ * Happen date
59
+ * 发生日期
60
+ */
61
+ happenDate?: string;
62
+
63
+ /**
64
+ * Happen date end
65
+ * 发生日期结束
66
+ */
67
+ happenDateEnd?: string;
68
+
69
+ /**
70
+ * User role for privacy
71
+ * 控制隐私的用户角色
72
+ */
73
+ userRole?: UserRole;
74
+
75
+ /**
76
+ * JSON data
77
+ * JSON 数据
78
+ */
79
+ data?: string;
80
+
81
+ /**
82
+ * Status
83
+ * 状况
84
+ */
85
+ status: EntityStatus;
86
+ };
@@ -0,0 +1,56 @@
1
+ import { QueryRQ } from "@etsoo/appscript";
2
+ import { PersonProfileKind } from "../../dto/personProfile/PersonProfileKind";
3
+
4
+ /**
5
+ * Person profile list request data
6
+ * 人员档案列表请求数据
7
+ */
8
+ export type PersonProfileListRQ = QueryRQ & {
9
+ /**
10
+ * Core user id who created the profile
11
+ * 创建档案的核心用户id
12
+ */
13
+ coreUserId?: number;
14
+
15
+ /**
16
+ * Person id
17
+ * 人员编号
18
+ */
19
+ personId?: number;
20
+
21
+ /**
22
+ * Kind
23
+ * 类型
24
+ */
25
+ kind?: PersonProfileKind;
26
+
27
+ /**
28
+ * Order / PO id
29
+ * 订单 / 采购编号
30
+ */
31
+ orderId?: number;
32
+
33
+ /**
34
+ * Happen date start
35
+ * 发生日期开始
36
+ */
37
+ happenDateStart?: string | Date;
38
+
39
+ /**
40
+ * Happen date end
41
+ * 发生日期结束
42
+ */
43
+ happenDateEnd?: string | Date;
44
+
45
+ /**
46
+ * Creation start
47
+ * 登记日期开始
48
+ */
49
+ creationStart?: string | Date;
50
+
51
+ /**
52
+ * Creation end
53
+ * 登记日期结束
54
+ */
55
+ creationEnd?: string | Date;
56
+ };
@@ -0,0 +1,13 @@
1
+ import { PersonProfileListRQ } from "./PersonProfileListRQ";
2
+
3
+ /**
4
+ * Person profile query request data
5
+ * 人员档案查询请求数据
6
+ */
7
+ export type PersonProfileQueryRQ = PersonProfileListRQ & {
8
+ /**
9
+ * Location
10
+ * 地点
11
+ */
12
+ location?: string;
13
+ };
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
+ "target": "ES2022",
5
+ "module": "NodeNext",
6
+ "moduleResolution": "NodeNext",
7
+ "resolveJsonModule": true,
8
+ "isolatedModules": true,
9
+ "outDir": "./lib/cjs",
10
+ "noEmit": false,
11
+ "declaration": true,
12
+ "strict": true,
13
+ "esModuleInterop": true,
14
+ "skipLibCheck": true,
15
+ "forceConsistentCasingInFileNames": true,
16
+ "jsx": "react-jsx",
17
+ "lib": ["dom", "dom.iterable", "ESNext"]
18
+ },
19
+ "include": ["src"]
20
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
+ "target": "ES2022",
5
+ "module": "ES2022",
6
+ "moduleResolution": "bundler",
7
+ "allowJs": false,
8
+ "isolatedModules": true,
9
+ "outDir": "./lib/mjs",
10
+ "noEmit": false,
11
+ "declaration": true,
12
+ "resolveJsonModule": true,
13
+ "strict": true,
14
+ "esModuleInterop": true,
15
+ "skipLibCheck": true,
16
+ "jsx": "react-jsx",
17
+ "forceConsistentCasingInFileNames": true
18
+ },
19
+ "include": ["src"]
20
+ }
@@ -0,0 +1,12 @@
1
+ import { defineConfig } from "vitest/config";
2
+ import react from "@vitejs/plugin-react";
3
+
4
+ export default defineConfig({
5
+ plugins: [react()],
6
+ test: {
7
+ globals: true,
8
+ environment: "jsdom",
9
+ include: ["__tests__/**/*.ts(x)?"],
10
+ exclude: ["__tests__/app/**"]
11
+ }
12
+ });