@newpeak/barista-cli 0.1.11 → 0.1.13

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 (329) hide show
  1. package/dist/commands/liberica/dict-types/get.d.ts.map +1 -1
  2. package/dist/commands/liberica/dict-types/get.js +9 -1
  3. package/dist/commands/liberica/dict-types/get.js.map +1 -1
  4. package/dist/commands/liberica/dict-types/index.d.ts.map +1 -1
  5. package/dist/commands/liberica/dict-types/index.js +2 -0
  6. package/dist/commands/liberica/dict-types/index.js.map +1 -1
  7. package/dist/commands/liberica/dict-types/list.d.ts.map +1 -1
  8. package/dist/commands/liberica/dict-types/list.js +19 -1
  9. package/dist/commands/liberica/dict-types/list.js.map +1 -1
  10. package/dist/commands/liberica/dict-types/tenant-items.d.ts +3 -0
  11. package/dist/commands/liberica/dict-types/tenant-items.d.ts.map +1 -0
  12. package/dist/commands/liberica/dict-types/tenant-items.js +275 -0
  13. package/dist/commands/liberica/dict-types/tenant-items.js.map +1 -0
  14. package/dist/commands/liberica/dicts/get.d.ts.map +1 -1
  15. package/dist/commands/liberica/dicts/get.js +9 -1
  16. package/dist/commands/liberica/dicts/get.js.map +1 -1
  17. package/dist/commands/liberica/dicts/list.d.ts.map +1 -1
  18. package/dist/commands/liberica/dicts/list.js +9 -1
  19. package/dist/commands/liberica/dicts/list.js.map +1 -1
  20. package/dist/core/api/client.d.ts +7 -7
  21. package/dist/core/api/client.d.ts.map +1 -1
  22. package/dist/core/api/client.js +15 -12
  23. package/dist/core/api/client.js.map +1 -1
  24. package/dist/core/config/manager.d.ts.map +1 -1
  25. package/dist/core/config/manager.js +1 -0
  26. package/dist/core/config/manager.js.map +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/types/dict.d.ts +2 -0
  29. package/dist/types/dict.d.ts.map +1 -1
  30. package/dist/types/index.d.ts +2 -0
  31. package/dist/types/index.d.ts.map +1 -1
  32. package/dist/types/index.js.map +1 -1
  33. package/package.json +7 -3
  34. package/docs/ARCHITECTURE.md +0 -184
  35. package/docs/COMMANDS.md +0 -352
  36. package/docs/COMMAND_DESIGN_SPEC.md +0 -840
  37. package/docs/INTEGRATION_NOTES.md +0 -270
  38. package/docs/commands/REFERENCE.md +0 -323
  39. package/docs/commands/arabica/auth/index.md +0 -296
  40. package/docs/commands/liberica/auth/index.md +0 -133
  41. package/docs/commands/liberica/calendar/DESIGN.md +0 -333
  42. package/docs/commands/liberica/client-contacts/create.md +0 -152
  43. package/docs/commands/liberica/client-contacts/delete.md +0 -123
  44. package/docs/commands/liberica/client-contacts/get.md +0 -133
  45. package/docs/commands/liberica/client-contacts/list.md +0 -143
  46. package/docs/commands/liberica/client-contacts/update.md +0 -158
  47. package/docs/commands/liberica/context/index.md +0 -60
  48. package/docs/commands/liberica/currency/create.md +0 -145
  49. package/docs/commands/liberica/currency/delete.md +0 -121
  50. package/docs/commands/liberica/currency/disable.md +0 -119
  51. package/docs/commands/liberica/currency/enable.md +0 -115
  52. package/docs/commands/liberica/currency/get.md +0 -118
  53. package/docs/commands/liberica/currency/list.md +0 -149
  54. package/docs/commands/liberica/currency/update.md +0 -141
  55. package/docs/commands/liberica/employees/create.md +0 -185
  56. package/docs/commands/liberica/employees/disable.md +0 -138
  57. package/docs/commands/liberica/employees/enable.md +0 -137
  58. package/docs/commands/liberica/employees/get.md +0 -153
  59. package/docs/commands/liberica/employees/list.md +0 -168
  60. package/docs/commands/liberica/employees/update.md +0 -180
  61. package/docs/commands/liberica/locations/create.md +0 -195
  62. package/docs/commands/liberica/locations/list.md +0 -171
  63. package/docs/commands/liberica/materials/create.md +0 -293
  64. package/docs/commands/liberica/materials/delete.md +0 -240
  65. package/docs/commands/liberica/materials/disable.md +0 -150
  66. package/docs/commands/liberica/materials/enable.md +0 -146
  67. package/docs/commands/liberica/materials/get.md +0 -188
  68. package/docs/commands/liberica/materials/list.md +0 -198
  69. package/docs/commands/liberica/materials/update.md +0 -250
  70. package/docs/commands/liberica/orgs/list.md +0 -62
  71. package/docs/commands/liberica/positions/list.md +0 -61
  72. package/docs/commands/liberica/roles/list.md +0 -67
  73. package/docs/commands/liberica/stock/ledger.md +0 -209
  74. package/docs/commands/liberica/stock/list.md +0 -165
  75. package/docs/commands/liberica/supplier-contacts/create.md +0 -152
  76. package/docs/commands/liberica/supplier-contacts/delete.md +0 -123
  77. package/docs/commands/liberica/supplier-contacts/get.md +0 -133
  78. package/docs/commands/liberica/supplier-contacts/list.md +0 -143
  79. package/docs/commands/liberica/supplier-contacts/update.md +0 -158
  80. package/docs/commands/liberica/teams/issues/close.md +0 -161
  81. package/docs/commands/liberica/teams/issues/create.md +0 -212
  82. package/docs/commands/liberica/teams/issues/delete.md +0 -179
  83. package/docs/commands/liberica/teams/issues/get.md +0 -167
  84. package/docs/commands/liberica/teams/issues/list.md +0 -182
  85. package/docs/commands/liberica/teams/issues/tests-design.md +0 -341
  86. package/docs/commands/liberica/teams/issues/update.md +0 -202
  87. package/docs/commands/liberica/teams/projects/create.md +0 -174
  88. package/docs/commands/liberica/teams/projects/delete.md +0 -180
  89. package/docs/commands/liberica/teams/projects/get.md +0 -150
  90. package/docs/commands/liberica/teams/projects/list.md +0 -179
  91. package/docs/commands/liberica/teams/projects/update.md +0 -175
  92. package/docs/commands/liberica/teams/tasks/create.md +0 -163
  93. package/docs/commands/liberica/teams/tasks/delete.md +0 -109
  94. package/docs/commands/liberica/teams/tasks/get.md +0 -121
  95. package/docs/commands/liberica/teams/tasks/list.md +0 -148
  96. package/docs/commands/liberica/teams/tasks/update.md +0 -158
  97. package/docs/commands/liberica/teams/work-logs/create.md +0 -151
  98. package/docs/commands/liberica/teams/work-logs/delete.md +0 -130
  99. package/docs/commands/liberica/teams/work-logs/get.md +0 -131
  100. package/docs/commands/liberica/teams/work-logs/list.md +0 -153
  101. package/docs/commands/liberica/teams/work-logs/update.md +0 -150
  102. package/docs/commands/liberica/transfer-in-forms/batch-delete.md +0 -157
  103. package/docs/commands/liberica/transfer-in-forms/batch-review.md +0 -157
  104. package/docs/commands/liberica/transfer-in-forms/batch-unreview.md +0 -157
  105. package/docs/commands/liberica/transfer-in-forms/create.md +0 -220
  106. package/docs/commands/liberica/transfer-in-forms/get.md +0 -221
  107. package/docs/commands/liberica/transfer-in-forms/list.md +0 -242
  108. package/docs/commands/liberica/transfer-in-forms/update.md +0 -185
  109. package/docs/commands/liberica/transfer-out-forms/batch-delete.md +0 -187
  110. package/docs/commands/liberica/transfer-out-forms/batch-review.md +0 -157
  111. package/docs/commands/liberica/transfer-out-forms/batch-unreview.md +0 -157
  112. package/docs/commands/liberica/transfer-out-forms/create.md +0 -280
  113. package/docs/commands/liberica/transfer-out-forms/get.md +0 -211
  114. package/docs/commands/liberica/transfer-out-forms/list.md +0 -233
  115. package/docs/commands/liberica/transfer-out-forms/update.md +0 -286
  116. package/docs/commands/liberica/uoms/create.md +0 -136
  117. package/docs/commands/liberica/uoms/delete.md +0 -119
  118. package/docs/commands/liberica/uoms/disable.md +0 -117
  119. package/docs/commands/liberica/uoms/enable.md +0 -115
  120. package/docs/commands/liberica/uoms/get.md +0 -119
  121. package/docs/commands/liberica/uoms/list.md +0 -155
  122. package/docs/commands/liberica/uoms/update.md +0 -148
  123. package/docs/commands/liberica/users/create.md +0 -170
  124. package/docs/commands/liberica/users/get.md +0 -151
  125. package/docs/commands/liberica/users/list.md +0 -175
  126. package/docs/commands/liberica/warehouses/create.md +0 -222
  127. package/docs/commands/liberica/warehouses/list.md +0 -184
  128. package/src/commands/arabica/auth/index.ts +0 -277
  129. package/src/commands/arabica/auth/login.ts +0 -5
  130. package/src/commands/arabica/auth/logout.ts +0 -5
  131. package/src/commands/arabica/auth/register.ts +0 -5
  132. package/src/commands/arabica/auth/status.ts +0 -5
  133. package/src/commands/arabica/index.ts +0 -23
  134. package/src/commands/auth.ts +0 -107
  135. package/src/commands/context.ts +0 -60
  136. package/src/commands/liberica/auth/index.ts +0 -176
  137. package/src/commands/liberica/calendar/index.ts +0 -13
  138. package/src/commands/liberica/calendar/list.ts +0 -214
  139. package/src/commands/liberica/calendar/set.ts +0 -130
  140. package/src/commands/liberica/client-contacts/create.ts +0 -115
  141. package/src/commands/liberica/client-contacts/delete.ts +0 -140
  142. package/src/commands/liberica/client-contacts/get.ts +0 -103
  143. package/src/commands/liberica/client-contacts/index.ts +0 -19
  144. package/src/commands/liberica/client-contacts/list.ts +0 -118
  145. package/src/commands/liberica/client-contacts/update.ts +0 -137
  146. package/src/commands/liberica/clients/create.ts +0 -122
  147. package/src/commands/liberica/clients/delete.ts +0 -125
  148. package/src/commands/liberica/clients/get.ts +0 -88
  149. package/src/commands/liberica/clients/index.ts +0 -19
  150. package/src/commands/liberica/clients/list.ts +0 -123
  151. package/src/commands/liberica/clients/update.ts +0 -103
  152. package/src/commands/liberica/context/index.ts +0 -43
  153. package/src/commands/liberica/currency/create.ts +0 -183
  154. package/src/commands/liberica/currency/delete.ts +0 -124
  155. package/src/commands/liberica/currency/disable.ts +0 -147
  156. package/src/commands/liberica/currency/enable.ts +0 -128
  157. package/src/commands/liberica/currency/get.ts +0 -91
  158. package/src/commands/liberica/currency/index.ts +0 -23
  159. package/src/commands/liberica/currency/list.ts +0 -140
  160. package/src/commands/liberica/currency/update.ts +0 -129
  161. package/src/commands/liberica/dict-types/get.ts +0 -74
  162. package/src/commands/liberica/dict-types/index.ts +0 -15
  163. package/src/commands/liberica/dict-types/list.ts +0 -118
  164. package/src/commands/liberica/dict-types/update.ts +0 -134
  165. package/src/commands/liberica/dicts/create.ts +0 -175
  166. package/src/commands/liberica/dicts/delete.ts +0 -107
  167. package/src/commands/liberica/dicts/get.ts +0 -80
  168. package/src/commands/liberica/dicts/index.ts +0 -19
  169. package/src/commands/liberica/dicts/list.ts +0 -114
  170. package/src/commands/liberica/dicts/update.ts +0 -116
  171. package/src/commands/liberica/employees/create.ts +0 -275
  172. package/src/commands/liberica/employees/delete.ts +0 -122
  173. package/src/commands/liberica/employees/disable.ts +0 -97
  174. package/src/commands/liberica/employees/enable.ts +0 -97
  175. package/src/commands/liberica/employees/get.ts +0 -115
  176. package/src/commands/liberica/employees/index.ts +0 -23
  177. package/src/commands/liberica/employees/list.ts +0 -131
  178. package/src/commands/liberica/employees/update.ts +0 -157
  179. package/src/commands/liberica/index.ts +0 -81
  180. package/src/commands/liberica/materials/create.ts +0 -199
  181. package/src/commands/liberica/materials/delete.ts +0 -105
  182. package/src/commands/liberica/materials/disable.ts +0 -148
  183. package/src/commands/liberica/materials/enable.ts +0 -129
  184. package/src/commands/liberica/materials/get.ts +0 -83
  185. package/src/commands/liberica/materials/index.ts +0 -23
  186. package/src/commands/liberica/materials/list.ts +0 -142
  187. package/src/commands/liberica/materials/update.ts +0 -125
  188. package/src/commands/liberica/mould/get.ts +0 -111
  189. package/src/commands/liberica/mould/index.ts +0 -17
  190. package/src/commands/liberica/mould/list.ts +0 -157
  191. package/src/commands/liberica/mould/set-status.ts +0 -99
  192. package/src/commands/liberica/mould/stock-in.ts +0 -165
  193. package/src/commands/liberica/operations/active.ts +0 -153
  194. package/src/commands/liberica/operations/batch-delete.ts +0 -131
  195. package/src/commands/liberica/operations/copy.ts +0 -138
  196. package/src/commands/liberica/operations/create.ts +0 -223
  197. package/src/commands/liberica/operations/deactive.ts +0 -152
  198. package/src/commands/liberica/operations/delete.ts +0 -128
  199. package/src/commands/liberica/operations/design.md +0 -587
  200. package/src/commands/liberica/operations/get.ts +0 -112
  201. package/src/commands/liberica/operations/index.ts +0 -27
  202. package/src/commands/liberica/operations/list.ts +0 -180
  203. package/src/commands/liberica/operations/update.ts +0 -218
  204. package/src/commands/liberica/orgs/index.ts +0 -34
  205. package/src/commands/liberica/positions/index.ts +0 -30
  206. package/src/commands/liberica/roles/index.ts +0 -59
  207. package/src/commands/liberica/stock/index.ts +0 -13
  208. package/src/commands/liberica/stock/ledger.ts +0 -159
  209. package/src/commands/liberica/stock/list.ts +0 -128
  210. package/src/commands/liberica/supplier-contacts/create.ts +0 -120
  211. package/src/commands/liberica/supplier-contacts/delete.ts +0 -88
  212. package/src/commands/liberica/supplier-contacts/get.ts +0 -94
  213. package/src/commands/liberica/supplier-contacts/index.ts +0 -19
  214. package/src/commands/liberica/supplier-contacts/list.ts +0 -130
  215. package/src/commands/liberica/supplier-contacts/update.ts +0 -127
  216. package/src/commands/liberica/suppliers/create.ts +0 -149
  217. package/src/commands/liberica/suppliers/delete.ts +0 -102
  218. package/src/commands/liberica/suppliers/disable.ts +0 -145
  219. package/src/commands/liberica/suppliers/enable.ts +0 -126
  220. package/src/commands/liberica/suppliers/get.ts +0 -86
  221. package/src/commands/liberica/suppliers/index.ts +0 -23
  222. package/src/commands/liberica/suppliers/list.ts +0 -134
  223. package/src/commands/liberica/suppliers/update.ts +0 -128
  224. package/src/commands/liberica/teams/index.ts +0 -17
  225. package/src/commands/liberica/teams/issues/close.ts +0 -104
  226. package/src/commands/liberica/teams/issues/create.ts +0 -254
  227. package/src/commands/liberica/teams/issues/delete.ts +0 -58
  228. package/src/commands/liberica/teams/issues/get.ts +0 -78
  229. package/src/commands/liberica/teams/issues/index.ts +0 -21
  230. package/src/commands/liberica/teams/issues/list.ts +0 -144
  231. package/src/commands/liberica/teams/issues/update.ts +0 -141
  232. package/src/commands/liberica/teams/projects/create.ts +0 -159
  233. package/src/commands/liberica/teams/projects/delete.ts +0 -58
  234. package/src/commands/liberica/teams/projects/get.ts +0 -87
  235. package/src/commands/liberica/teams/projects/index.ts +0 -19
  236. package/src/commands/liberica/teams/projects/list.ts +0 -147
  237. package/src/commands/liberica/teams/projects/update.ts +0 -117
  238. package/src/commands/liberica/teams/tasks/create.ts +0 -102
  239. package/src/commands/liberica/teams/tasks/delete.ts +0 -92
  240. package/src/commands/liberica/teams/tasks/get.ts +0 -64
  241. package/src/commands/liberica/teams/tasks/index.ts +0 -19
  242. package/src/commands/liberica/teams/tasks/list.ts +0 -102
  243. package/src/commands/liberica/teams/tasks/update.ts +0 -122
  244. package/src/commands/liberica/teams/work-logs/create.ts +0 -204
  245. package/src/commands/liberica/teams/work-logs/delete.ts +0 -58
  246. package/src/commands/liberica/teams/work-logs/get.ts +0 -87
  247. package/src/commands/liberica/teams/work-logs/index.ts +0 -19
  248. package/src/commands/liberica/teams/work-logs/list.ts +0 -141
  249. package/src/commands/liberica/teams/work-logs/update.ts +0 -120
  250. package/src/commands/liberica/transfer-in-forms/batch-delete.ts +0 -152
  251. package/src/commands/liberica/transfer-in-forms/batch-review.ts +0 -151
  252. package/src/commands/liberica/transfer-in-forms/batch-unreview.ts +0 -152
  253. package/src/commands/liberica/transfer-in-forms/create.ts +0 -179
  254. package/src/commands/liberica/transfer-in-forms/get.ts +0 -107
  255. package/src/commands/liberica/transfer-in-forms/index.ts +0 -23
  256. package/src/commands/liberica/transfer-in-forms/list.ts +0 -97
  257. package/src/commands/liberica/transfer-in-forms/update.ts +0 -213
  258. package/src/commands/liberica/transfer-out-forms/batch-delete.ts +0 -83
  259. package/src/commands/liberica/transfer-out-forms/batch-review.ts +0 -148
  260. package/src/commands/liberica/transfer-out-forms/batch-unreview.ts +0 -56
  261. package/src/commands/liberica/transfer-out-forms/create.ts +0 -194
  262. package/src/commands/liberica/transfer-out-forms/get.ts +0 -114
  263. package/src/commands/liberica/transfer-out-forms/index.ts +0 -23
  264. package/src/commands/liberica/transfer-out-forms/list.ts +0 -125
  265. package/src/commands/liberica/transfer-out-forms/update.ts +0 -197
  266. package/src/commands/liberica/uoms/create.ts +0 -134
  267. package/src/commands/liberica/uoms/delete.ts +0 -105
  268. package/src/commands/liberica/uoms/disable.ts +0 -148
  269. package/src/commands/liberica/uoms/enable.ts +0 -129
  270. package/src/commands/liberica/uoms/get.ts +0 -83
  271. package/src/commands/liberica/uoms/index.ts +0 -23
  272. package/src/commands/liberica/uoms/list.ts +0 -129
  273. package/src/commands/liberica/uoms/update.ts +0 -124
  274. package/src/commands/liberica/users/create.ts +0 -133
  275. package/src/commands/liberica/users/delete.ts +0 -49
  276. package/src/commands/liberica/users/disable.ts +0 -41
  277. package/src/commands/liberica/users/enable.ts +0 -30
  278. package/src/commands/liberica/users/get.ts +0 -46
  279. package/src/commands/liberica/users/index.ts +0 -27
  280. package/src/commands/liberica/users/list.ts +0 -68
  281. package/src/commands/liberica/users/me.ts +0 -42
  282. package/src/commands/liberica/users/reset-password.ts +0 -42
  283. package/src/commands/liberica/users/update.ts +0 -48
  284. package/src/commands/liberica/warehouses/create.ts +0 -204
  285. package/src/commands/liberica/warehouses/delete.ts +0 -112
  286. package/src/commands/liberica/warehouses/disable.ts +0 -174
  287. package/src/commands/liberica/warehouses/enable.ts +0 -174
  288. package/src/commands/liberica/warehouses/get.ts +0 -101
  289. package/src/commands/liberica/warehouses/index.ts +0 -25
  290. package/src/commands/liberica/warehouses/list.ts +0 -136
  291. package/src/commands/liberica/warehouses/locations/create.ts +0 -209
  292. package/src/commands/liberica/warehouses/locations/delete.ts +0 -116
  293. package/src/commands/liberica/warehouses/locations/disable.ts +0 -174
  294. package/src/commands/liberica/warehouses/locations/enable.ts +0 -174
  295. package/src/commands/liberica/warehouses/locations/get.ts +0 -84
  296. package/src/commands/liberica/warehouses/locations/index.ts +0 -23
  297. package/src/commands/liberica/warehouses/locations/list.ts +0 -140
  298. package/src/commands/liberica/warehouses/locations/update.ts +0 -135
  299. package/src/commands/liberica/warehouses/update.ts +0 -142
  300. package/src/core/api/client.ts +0 -4443
  301. package/src/core/auth/token-manager.ts +0 -183
  302. package/src/core/config/manager.ts +0 -164
  303. package/src/index.ts +0 -35
  304. package/src/types/calendar.ts +0 -36
  305. package/src/types/client-contact.ts +0 -78
  306. package/src/types/client.ts +0 -115
  307. package/src/types/currency.ts +0 -90
  308. package/src/types/dict.ts +0 -121
  309. package/src/types/employee.ts +0 -102
  310. package/src/types/index.ts +0 -93
  311. package/src/types/location.ts +0 -66
  312. package/src/types/material.ts +0 -61
  313. package/src/types/mould-stock-in.ts +0 -82
  314. package/src/types/mould.ts +0 -74
  315. package/src/types/operation.ts +0 -72
  316. package/src/types/org.ts +0 -25
  317. package/src/types/position.ts +0 -24
  318. package/src/types/stock.ts +0 -161
  319. package/src/types/supplier-contact.ts +0 -78
  320. package/src/types/supplier.ts +0 -66
  321. package/src/types/team-issue.ts +0 -94
  322. package/src/types/team-project.ts +0 -74
  323. package/src/types/team-task.ts +0 -98
  324. package/src/types/team-work-log.ts +0 -87
  325. package/src/types/transfer-in-form.ts +0 -265
  326. package/src/types/transfer-out-form.ts +0 -290
  327. package/src/types/uom.ts +0 -60
  328. package/src/types/user.ts +0 -64
  329. package/src/types/warehouse.ts +0 -82
@@ -1,270 +0,0 @@
1
- # Liberica API Integration Notes
2
-
3
- This document captures the lessons learned from integrating with the Liberica backend API.
4
-
5
- ## Authentication
6
-
7
- ### Authorization Header
8
-
9
- The API expects the token directly without `Bearer` prefix:
10
-
11
- ```typescript
12
- // WRONG
13
- this.client.defaults.headers.common['Authorization'] = `Bearer ${token}`;
14
-
15
- // CORRECT
16
- this.client.defaults.headers.common['Authorization'] = token;
17
- ```
18
-
19
- ### Tenant Header (X-TENANT-ID)
20
-
21
- **IMPORTANT**: The `X-TENANT-ID` header is NOT required. The tenant is embedded in the JWT token.
22
-
23
- ```typescript
24
- // WRONG - Backend expects Long but we pass String
25
- { headers: { 'X-TENANT-ID': tenant } }
26
-
27
- // CORRECT - Don't pass X-TENANT-ID at all
28
- // Tenant is extracted from JWT token by the backend
29
- ```
30
-
31
- Adding `X-TENANT-ID` with string tenant name causes `NumberFormatException: For input string: "shanghai"` because the backend expects a numeric tenant ID.
32
-
33
- ## BigInteger IDs
34
-
35
- **CRITICAL**: Backend returns BigInteger for ID fields, which exceeds JavaScript's `number` range (max safe integer: 9007199254740991).
36
-
37
- **Always use `string` type for ID fields in TypeScript**:
38
-
39
- ```typescript
40
- // WRONG - Precision loss for IDs > 9007199254740991
41
- interface Employee {
42
- employeeId: number; // Will lose precision!
43
- }
44
-
45
- // CORRECT - Use string for IDs
46
- interface Employee {
47
- employeeId: string;
48
- }
49
- ```
50
-
51
- ### Affected Fields
52
- - `Employee.employeeId` - always use string
53
- - `Employee.organizationId` - always use string
54
- - `UpdateEmployeeRequest.employeeId` - always use string
55
- - Any ID field from backend that is BigInteger
56
-
57
- ## API Endpoints
58
-
59
- ### Base URL Pattern
60
- ```
61
- https://{tenant}-{env}.newpeaksh.com/api/...
62
- ```
63
-
64
- ### Required Prefix
65
- All endpoints require the `/api` prefix:
66
- ```
67
- /api/enterprise/employee/page
68
- /api/enterprise/employee/add
69
- /api/enterprise/employee/edit
70
- /api/enterprise/employee/delete
71
- /api/enterprise/employee/deActive
72
- /api/enterprise/employee/active
73
- ```
74
-
75
- ### HTTP Methods
76
- Different endpoints use different HTTP methods:
77
-
78
- | Endpoint | Method | Notes |
79
- |----------|--------|-------|
80
- | `/employee/page` | GET | List with pagination |
81
- | `/employee/detail` | GET | Single item lookup |
82
- | `/employee/add` | POST | Create |
83
- | `/employee/edit` | POST | Update |
84
- | `/employee/delete` | POST | Delete |
85
- | `/employee/active` | POST | Enable |
86
- | `/employee/deActive` | POST | Disable |
87
- | `/master/org/tree` | POST | Get org list (POST required, not GET) |
88
- | `/master/position/list` | GET | Get position list |
89
-
90
- ## Pagination
91
-
92
- ### 0-Based Pagination
93
- The backend uses 0-based pagination (page starts at 0, not 1):
94
-
95
- ```typescript
96
- // CLI page 1 -> API page 0
97
- const page = parseInt(options.page as string, 10) - 1;
98
- ```
99
-
100
- ### Query Parameters
101
- Use `pageNo` and `pageSize` (not `page` and `size`):
102
-
103
- ```
104
- /api/enterprise/employee/page?pageNo=0&pageSize=20
105
- ```
106
-
107
- ## Response Field Names
108
-
109
- The backend uses different field names than typical conventions:
110
-
111
- | Backend Field | Standard Field | Description |
112
- |-------------|---------------|-------------|
113
- | `rows` | `records` | Array of items |
114
- | `pageNo` | `current` | Current page number |
115
- | `pageSize` | `size` | Items per page |
116
- | `totalRows` | `total` | Total item count |
117
-
118
- ### Example Response
119
- ```json
120
- {
121
- "success": true,
122
- "data": {
123
- "pageNo": 1,
124
- "pageSize": 20,
125
- "totalRows": 19,
126
- "totalPage": 1,
127
- "rows": [...]
128
- }
129
- }
130
- ```
131
-
132
- ## Error Response Format
133
-
134
- **IMPORTANT**: Backend error format varies - may be at top level OR nested under `error`:
135
-
136
- ```typescript
137
- // Backend returns ONE of these formats:
138
-
139
- // Format 1: Error at top level (common for delete, enable, disable)
140
- {
141
- "success": false,
142
- "code": "A150001",
143
- "message": "A150001: 查询结果不存在"
144
- }
145
-
146
- // Format 2: Error nested under 'error' object
147
- {
148
- "success": false,
149
- "error": {
150
- "code": "01001150001",
151
- "message": "职员不存在"
152
- }
153
- }
154
- ```
155
-
156
- ### Handle in handleApiError():
157
- ```typescript
158
- function handleApiError(error: unknown): EmployeeApiResponse {
159
- if (axios.isAxiosError(error)) {
160
- const responseData = axiosError.response?.data;
161
- if (responseData) {
162
- const success = responseData.success as boolean | undefined;
163
- if (success === false) {
164
- const code = responseData.code as string | undefined;
165
- const message = responseData.message as string | undefined;
166
- const errorObj = responseData.error as { code?: string; message?: string } | undefined;
167
- if (!errorObj && (code || message)) {
168
- return {
169
- success: false,
170
- error: {
171
- code: code || 'API_ERROR',
172
- message: message || 'API error occurred',
173
- },
174
- };
175
- }
176
- }
177
- return responseData as EmployeeApiResponse;
178
- }
179
- }
180
- // ...
181
- }
182
- ```
183
-
184
- ## Null Data Handling
185
-
186
- When the API returns no data, the `data` field may be:
187
- - `null`
188
- - Not present in the response
189
-
190
- Always check for null before accessing data fields:
191
-
192
- ```typescript
193
- const data = response.data as EmployeeListResponse | null;
194
-
195
- if (!data) {
196
- console.log('No data found');
197
- return;
198
- }
199
- ```
200
-
201
- ## Error Codes
202
-
203
- | Code | Message | Cause |
204
- |------|---------|-------|
205
- | B0301 | TOKEN解析失败 | Invalid or expired token |
206
- | B0001 | 系统执行出错 | Internal server error (check exceptionTip) |
207
- | A150001 | 查询结果不存在 | Resource not found |
208
- | A1504 | 当前接口不支持GET方式请求 | Wrong HTTP method (should be POST) |
209
-
210
- ## Common Issues
211
-
212
- ### 1. Token Parsing Failed
213
- **Error**: `B0301: TOKEN解析失败,请重新登录`
214
-
215
- **Cause**: Token format issue or secret mismatch.
216
-
217
- **Solution**: Re-authenticate and ensure the token is passed without `Bearer` prefix.
218
-
219
- ### 2. X-TENANT-ID Causing NumberFormatException
220
- **Error**: `NumberFormatException: For input string: "shanghai"`
221
-
222
- **Cause**: Passing `X-TENANT-ID` header with string tenant name. Backend expects numeric tenant ID or no header at all.
223
-
224
- **Solution**: Do NOT pass `X-TENANT-ID` header. Tenant is embedded in JWT token.
225
-
226
- ### 3. Wrong HTTP Method
227
- **Error**: `A1504: 当前接口不支持GET方式请求`
228
-
229
- **Cause**: Using GET when endpoint requires POST (or vice versa).
230
-
231
- **Solution**: Check endpoint documentation for correct HTTP method.
232
-
233
- ### 4. BigInteger Precision Loss
234
- **Symptom**: Employee IDs display as truncated in CLI, API calls fail with "not found" for valid IDs.
235
-
236
- **Cause**: ID is BigInteger > 9007199254740991, losing precision in JavaScript number.
237
-
238
- **Solution**: Use string type for all ID fields.
239
-
240
- ### 5. Empty Results Despite Data
241
- **Cause**: Field name mismatch between client and API.
242
-
243
- **Solution**: Verify you are using the correct field names from the response, not assumed names.
244
-
245
- ## Testing
246
-
247
- ### Verify API Connection
248
- ```bash
249
- # Login first
250
- node ./bin/barista.js liberica auth login dev <tenant> <email> <password>
251
-
252
- # Test list
253
- node ./bin/barista.js liberica employees list
254
-
255
- # Test with JSON output
256
- node ./bin/barista.js liberica employees list --json
257
- ```
258
-
259
- ### Debug API Calls
260
- Add temporary logging to see raw responses:
261
- ```typescript
262
- console.error('DEBUG response:', JSON.stringify(response, null, 2));
263
- ```
264
-
265
- ## File Locations
266
-
267
- - API Client: `src/core/api/client.ts`
268
- - Types: `src/types/employee.ts`
269
- - Commands: `src/commands/liberica/employees/*.ts`
270
- - Config: `~/.barista/config.yaml`
@@ -1,323 +0,0 @@
1
- # Barista CLI 命令参考
2
-
3
- > 基于实际业务需求整理的所有功能清单,按 Arabica(销售前端)和 Liberica(生产管理)分类。
4
-
5
- ## 📊 命令统计总览
6
-
7
- | 服务 | 模块 | 命令数量 | 状态 | 优先级 |
8
- |------|------|---------|------|--------|
9
- | **Arabica** | auth | 4 | ✅ 已实现 | P0 |
10
- | **Arabica** | members | 3 | 📋 待开发 | P0 |
11
- | **Arabica** | enterprises | 3 | 📋 待开发 | P0 |
12
- | **Arabica** | products | 2 | 📋 待开发 | P1 |
13
- | **Arabica** | subscriptions | 4 | 📋 待开发 | P0 |
14
- | **Arabica** | access | 1 | 📋 待开发 | P0 |
15
- | **Liberica** | auth | 2 | ✅ 已实现 | P0 |
16
- | **Liberica** | context | 3 | ✅ 已实现 | P0 |
17
- | **Liberica** | users | 3 | ✅ 已实现 | P1 |
18
- | **Liberica** | employees | 3 | ✅ 已实现 | P1 |
19
- | **Liberica** | clients | 4 | 📋 待开发 | P0 |
20
- | **Liberica** | suppliers | 4 | 📋 待开发 | P0 |
21
- | **Liberica** | materials | 5 | 📋 待开发 | P0 |
22
- | **Liberica** | sales-prices | 4 | 📋 待开发 | P1 |
23
- | **Liberica** | purchase-prices | 4 | 📋 待开发 | P1 |
24
- | **Liberica** | sales-orders | 5 | 📋 待开发 | P0 |
25
- | **总计** | 16模块 | **47命令** | | |
26
-
27
- **状态说明**:
28
- - ✅ 已实现 - 功能已完成,可在 `src/commands/` 目录查看实现
29
- - 📋 待开发 - 功能已设计但尚未实现,需按设计规范开发
30
-
31
- ---
32
-
33
- ## 🌐 Arabica 命令(销售前端)
34
-
35
- > **用户**: 最终客户(潜在租户企业的代表)
36
- > **访问**: www.newpeaksh.com / members.newpeakjp.com
37
-
38
- ### 1. auth(认证)- ✅ 已实现
39
-
40
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
41
- |------|------|------|------|----------|
42
- | 会员登录 | `barista arabica auth login [env] [account] [password]` | POST | 获取访问Token | [docs](./arabica/auth/index.md) |
43
- | 注册会员 | `barista arabica auth register [env] [email] [password] [phone] [username]` | POST | 新用户注册 | [docs](./arabica/auth/index.md) |
44
- | 获取登录状态 | `barista arabica auth status` | GET | 查看当前登录状态 | [docs](./arabica/auth/index.md) |
45
- | 登出 | `barista arabica auth logout` | - | 清除登录Token | [docs](./arabica/auth/index.md) |
46
-
47
- ### 2. members(会员管理)- 📋 待开发
48
-
49
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
50
- |------|------|------|------|----------|
51
- | 注册会员 | `barista arabica members register` | POST | 新用户注册 | 待创建 |
52
- | 会员登录 | `barista arabica members login` | POST | 获取访问Token | 待创建 |
53
- | 获取会员信息 | `barista arabica members get` | GET | 查看当前会员详情 | 待创建 |
54
-
55
- ### 3. enterprises(企业管理)- 📋 待开发
56
-
57
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
58
- |------|------|------|------|----------|
59
- | 注册企业 | `barista arabica enterprises register` | POST | 会员创建新企业 | 待创建 |
60
- | 获取企业列表 | `barista arabica enterprises list` | GET | 查看会员关联的所有企业 | 待创建 |
61
- | 获取企业详情 | `barista arabica enterprises get <id>` | GET | 查看企业详细信息 | 待创建 |
62
-
63
- ### 4. products(产品浏览)- 📋 待开发
64
-
65
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
66
- |------|------|------|------|----------|
67
- | 查询产品列表 | `barista arabica products list` | GET | 浏览可购买的SaaS产品 | 待创建 |
68
- | 获取产品详情 | `barista arabica products get <id>` | GET | 查看产品详细信息 | 待创建 |
69
-
70
- ### 5. subscriptions(服务订阅)- 📋 待开发
71
-
72
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
73
- |------|------|------|------|----------|
74
- | 申请产品试用 | `barista arabica subscriptions trial` | POST | 申请免费试用 | 待创建 |
75
- | 购买服务 | `barista arabica subscriptions purchase` | POST | 购买正式服务 | 待创建 |
76
- | 获取已购买服务 | `barista arabica subscriptions list` | GET | 查看所有订阅(含试用) | 待创建 |
77
- | 获取服务详情 | `barista arabica subscriptions get <id>` | GET | 查看订阅详情 | 待创建 |
78
-
79
- ### 6. access(系统访问)- 📋 待开发
80
-
81
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
82
- |------|------|------|------|----------|
83
- | 获取Liberica访问URL | `barista arabica access url` | GET | 获取租户系统访问地址 | 待创建 |
84
-
85
- ---
86
-
87
- ## 🏭 Liberica 命令(生产管理)
88
-
89
- > **用户**: 租户企业内部员工
90
- > **访问**: {tenant}.newpeaksh.com / {tenant}.newpeakjp.com
91
-
92
- ### 1. auth(认证)- ✅ 已实现
93
-
94
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
95
- |------|------|------|------|----------|
96
- | 租户企业账号登录 | `barista liberica auth login` | POST | 使用租户账号登录 | [docs](./liberica/auth/index.md) |
97
- | 获取登录状态 | `barista liberica auth status` | GET | 查看当前登录状态 | [docs](./liberica/auth/index.md) |
98
-
99
- ### 2. context(上下文管理)- ✅ 已实现
100
-
101
- | 功能 | 命令 | 说明 | 设计文档 |
102
- |------|------|------|----------|
103
- | 显示当前上下文 | `barista context show` | 查看当前环境、租户、Token状态 | [docs](./liberica/context/index.md) |
104
- | 切换环境 | `barista context use-env [env]` | 切换操作的环境 | [docs](./liberica/context/index.md) |
105
- | 切换租户 | `barista context use-tenant <tenant>` | 切换操作的企业 | [docs](./liberica/context/index.md) |
106
-
107
- ### 3. users(用户管理)- ✅ 已实现
108
-
109
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
110
- |------|------|------|------|----------|
111
- | 创建新用户 | `barista liberica users create` | POST | 创建系统用户账号 | [docs](./liberica/users/create.md) |
112
- | 获取用户列表 | `barista liberica users list` | GET | 查看所有用户 | [docs](./liberica/users/list.md) |
113
- | 获取用户详情 | `barista liberica users get <id>` | GET | 查看用户信息 | [docs](./liberica/users/get.md) |
114
-
115
- ### 4. employees(职员管理)- ✅ 已实现
116
-
117
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
118
- |------|------|------|------|----------|
119
- | 创建新职员 | `barista liberica employees create` | POST | 添加企业员工 | [docs](./liberica/employees/create.md) |
120
- | 获取职员列表 | `barista liberica employees list` | GET | 查看所有职员 | [docs](./liberica/employees/list.md) |
121
- | 获取职员详情 | `barista liberica employees get <id>` | GET | 查看职员信息 | [docs](./liberica/employees/get.md) |
122
-
123
- ### 5. clients(客户管理)- 📋 待开发
124
-
125
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
126
- |------|------|------|------|----------|
127
- | 创建客户 | `barista liberica clients create` | POST | 添加下游客户 | 待创建 |
128
- | 获取客户列表 | `barista liberica clients list` | GET | 查看所有客户 | 待创建 |
129
- | 获取客户详情 | `barista liberica clients get <id>` | GET | 查看客户信息 | 待创建 |
130
- | 更新客户 | `barista liberica clients update <id>` | POST | 修改客户信息 | 待创建 |
131
-
132
- ### 6. suppliers(供应商管理)- 📋 待开发
133
-
134
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
135
- |------|------|------|------|----------|
136
- | 创建供应商 | `barista liberica suppliers create` | POST | 添加上游供应商 | 待创建 |
137
- | 获取供应商列表 | `barista liberica suppliers list` | GET | 查看所有供应商 | 待创建 |
138
- | 获取供应商详情 | `barista liberica suppliers get <id>` | GET | 查看供应商信息 | 待创建 |
139
- | 更新供应商 | `barista liberica suppliers update <id>` | POST | 修改供应商信息 | 待创建 |
140
-
141
- ### 7. client-contacts(客户联系人管理)- 📋 开发中
142
-
143
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
144
- |------|------|------|------|----------|
145
- | 获取联系人列表 | `barista liberica client-contacts list` | GET | 查看客户的所有联系人 | [docs](./liberica/client-contacts/list.md) |
146
- | 获取联系人详情 | `barista liberica client-contacts get <id>` | GET | 查看联系人信息 | [docs](./liberica/client-contacts/get.md) |
147
- | 创建联系人 | `barista liberica client-contacts create` | POST | 添加客户联系人 | [docs](./liberica/client-contacts/create.md) |
148
- | 更新联系人 | `barista liberica client-contacts update <id>` | POST | 修改联系人信息 | [docs](./liberica/client-contacts/update.md) |
149
- | 删除联系人 | `barista liberica client-contacts delete <id>` | POST | 删除联系人 | [docs](./liberica/client-contacts/delete.md) |
150
-
151
- ### 8. supplier-contacts(供应商联系人管理)- 📋 开发中
152
-
153
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
154
- |------|------|------|------|----------|
155
- | 获取联系人列表 | `barista liberica supplier-contacts list` | GET | 查看供应商的所有联系人 | [docs](./liberica/supplier-contacts/list.md) |
156
- | 获取联系人详情 | `barista liberica supplier-contacts get <id>` | GET | 查看联系人信息 | [docs](./liberica/supplier-contacts/get.md) |
157
- | 创建联系人 | `barista liberica supplier-contacts create` | POST | 添加供应商联系人 | [docs](./liberica/supplier-contacts/create.md) |
158
- | 更新联系人 | `barista liberica supplier-contacts update <id>` | POST | 修改联系人信息 | [docs](./liberica/supplier-contacts/update.md) |
159
- | 删除联系人 | `barista liberica supplier-contacts delete <id>` | POST | 删除联系人 | [docs](./liberica/supplier-contacts/delete.md) |
160
-
161
- ### 9. materials(物料管理)- 📋 待开发
162
-
163
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
164
- |------|------|------|------|----------|
165
- | 创建物料 | `barista liberica materials create` | POST | 创建产品/原材料/半成品 | 待创建 |
166
- | 获取物料列表 | `barista liberica materials list` | GET | 查看所有物料 | 待创建 |
167
- | 获取物料详情 | `barista liberica materials get <id>` | GET | 查看物料信息 | 待创建 |
168
- | 搜索物料 | `barista liberica materials search` | GET | 按条件搜索物料 | 待创建 |
169
- | 更新物料 | `barista liberica materials update <id>` | POST | 修改物料信息 | 待创建 |
170
-
171
- ### 10. sales-prices(销售价格)- 📋 待开发
172
-
173
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
174
- |------|------|------|------|----------|
175
- | 添加销售价格 | `barista liberica sales-prices create` | POST | 设置物料的销售价格 | 待创建 |
176
- | 查询销售价格 | `barista liberica sales-prices list` | GET | 查看销售价格列表 | 待创建 |
177
- | 获取价格详情 | `barista liberica sales-prices get <id>` | GET | 查看价格详情 | 待创建 |
178
- | 更新销售价格 | `barista liberica sales-prices update <id>` | POST | 修改销售价格 | 待创建 |
179
-
180
- ### 11. purchase-prices(采购价格)- 📋 待开发
181
-
182
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
183
- |------|------|------|------|----------|
184
- | 添加采购价格 | `barista liberica purchase-prices create` | POST | 设置物料的采购价格 | 待创建 |
185
- | 查询采购价格 | `barista liberica purchase-prices list` | GET | 查看采购价格列表 | 待创建 |
186
- | 获取价格详情 | `barista liberica purchase-prices get <id>` | GET | 查看价格详情 | 待创建 |
187
- | 更新采购价格 | `barista liberica purchase-prices update <id>` | POST | 修改采购价格 | 待创建 |
188
-
189
- ### 12. sales-orders(销售订单)- 📋 待开发
190
-
191
- | 功能 | 命令 | HTTP | 说明 | 设计文档 |
192
- |------|------|------|------|----------|
193
- | 创建销售订单 | `barista liberica sales-orders create` | POST | 创建新的销售订单 | 待创建 |
194
- | 获取销售订单列表 | `barista liberica sales-orders list` | GET | 查看所有销售订单 | 待创建 |
195
- | 获取销售订单详情 | `barista liberica sales-orders get <id>` | GET | 查看订单详情 | 待创建 |
196
- | 更新销售订单 | `barista liberica sales-orders update <id>` | POST | 修改订单信息 | 待创建 |
197
- | 取消销售订单 | `barista liberica sales-orders cancel <id>` | POST | 取消订单 | 待创建 |
198
-
199
- ---
200
-
201
- ## 🎯 开发优先级
202
-
203
- ### P0 - 核心功能(MVP必须)
204
-
205
- **Arabica(销售前端)**:
206
- 1. `arabica members register/login` - 会员注册登录
207
- 2. `arabica enterprises register/list` - 企业注册管理
208
- 3. `arabica subscriptions trial/list` - 试用申请和服务查看
209
- 4. `arabica access url` - 获取Liberica访问地址
210
-
211
- **Liberica(生产管理)**:
212
- 5. `liberica auth login` - 租户登录 ✅ 已实现
213
- 6. `liberica clients create/list` - 客户管理
214
- 7. `liberica suppliers create/list` - 供应商管理
215
- 8. `liberica materials create/list` - 物料管理
216
- 9. `liberica sales-orders create/list` - 销售订单
217
-
218
- ### P1 - 重要功能(第二阶段)
219
-
220
- - `arabica products list/get` - 产品浏览
221
- - `liberica users/employees` - 用户和职员管理
222
- - `liberica sales-prices/purchase-prices` - 价格管理
223
- - `liberica materials search/update` - 物料高级功能
224
-
225
- ### P2 - 扩展功能(后续迭代)
226
-
227
- - 更新操作(所有 update/cancel 命令)
228
- - 高级搜索和筛选
229
- - 批量操作
230
- - 报表和统计
231
-
232
- ---
233
-
234
- ## 📝 设计文档目录结构
235
-
236
- ```
237
- docs/commands/
238
- ├── REFERENCE.md # 本文件 - 命令总览
239
-
240
- ├── arabica/
241
- │ ├── auth/ # ✅ 已实现
242
- │ │ └── index.md
243
- │ ├── members/ # 📋 待开发
244
- │ │ └── index.md # 待创建
245
- │ ├── enterprises/ # 📋 待开发
246
- │ │ └── index.md # 待创建
247
- │ ├── products/ # 📋 待开发
248
- │ │ └── index.md # 待创建
249
- │ ├── subscriptions/ # 📋 待开发
250
- │ │ └── index.md # 待创建
251
- │ └── access/ # 📋 待开发
252
- │ └── index.md # 待创建
253
-
254
- └── liberica/
255
- ├── auth/ # ✅ 已实现
256
- │ └── index.md
257
- ├── context/ # ✅ 已实现
258
- │ └── index.md
259
- ├── users/ # ✅ 已实现
260
- │ ├── create.md
261
- │ ├── list.md
262
- │ └── get.md
263
- ├── employees/ # ✅ 已实现
264
- │ ├── create.md
265
- │ ├── list.md
266
- │ ├── get.md
267
- │ ├── enable.md
268
- │ └── disable.md
269
- ├── clients/ # 📋 待开发
270
- │ └── index.md # 待创建
271
- ├── suppliers/ # 📋 待开发
272
- │ └── index.md # 待创建
273
- ├── materials/ # 📋 待开发
274
- │ └── index.md # 待创建
275
- ├── sales-prices/ # 📋 待开发
276
- │ └── index.md # 待创建
277
- ├── purchase-prices/ # 📋 待开发
278
- │ └── index.md # 待创建
279
- └── sales-orders/ # 📋 待开发
280
- └── index.md # 待创建
281
- ```
282
-
283
- ---
284
-
285
- ## ⚠️ 关键说明
286
-
287
- ### 1. 用户角色区分
288
-
289
- **Arabica 用户**(会员):
290
- - 可以是个人,也可以代表企业
291
- - 可以注册多个企业
292
- - 主要操作:浏览、购买、管理订阅
293
-
294
- **Liberica 用户**(租户内部):
295
- - 必须是某个租户企业的员工
296
- - 拥有系统账号和权限
297
- - 主要操作:生产管理、订单处理
298
-
299
- ### 2. 数据流
300
-
301
- ```
302
- Arabica(会员) Liberica(租户员工)
303
- │ │
304
- ├─ 注册企业 ───────────────>├─ 企业成为租户
305
- ├─ 购买服务 ───────────────>├─ 开通租户账号
306
- └─ 获取访问URL ────────────>└─ 登录生产系统
307
- ```
308
-
309
- ### 3. 认证差异
310
-
311
- **Arabica 认证**:
312
- - 会员注册/登录
313
- - Token 关联会员ID
314
- - 权限:管理自己的企业和订阅
315
-
316
- **Liberica 认证**:
317
- - 租户员工登录
318
- - Token 关联租户ID + 用户ID
319
- - 权限:操作租户企业的生产数据
320
-
321
- ---
322
-
323
- **最后更新**: 2026-04-14