@newpeak/barista-cli 0.1.7 → 0.1.9

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 (306) hide show
  1. package/README.md +10 -10
  2. package/dist/commands/liberica/calendar/index.d.ts +3 -0
  3. package/dist/commands/liberica/calendar/index.d.ts.map +1 -0
  4. package/dist/commands/liberica/calendar/index.js +11 -0
  5. package/dist/commands/liberica/calendar/index.js.map +1 -0
  6. package/dist/commands/liberica/calendar/list.d.ts +3 -0
  7. package/dist/commands/liberica/calendar/list.d.ts.map +1 -0
  8. package/dist/commands/liberica/calendar/list.js +181 -0
  9. package/dist/commands/liberica/calendar/list.js.map +1 -0
  10. package/dist/commands/liberica/calendar/set.d.ts +3 -0
  11. package/dist/commands/liberica/calendar/set.d.ts.map +1 -0
  12. package/dist/commands/liberica/calendar/set.js +120 -0
  13. package/dist/commands/liberica/calendar/set.js.map +1 -0
  14. package/dist/commands/liberica/client-contacts/create.d.ts +3 -0
  15. package/dist/commands/liberica/client-contacts/create.d.ts.map +1 -0
  16. package/dist/commands/liberica/client-contacts/create.js +132 -0
  17. package/dist/commands/liberica/client-contacts/create.js.map +1 -0
  18. package/dist/commands/liberica/client-contacts/delete.d.ts +3 -0
  19. package/dist/commands/liberica/client-contacts/delete.d.ts.map +1 -0
  20. package/dist/commands/liberica/client-contacts/delete.js +139 -0
  21. package/dist/commands/liberica/client-contacts/delete.js.map +1 -0
  22. package/dist/commands/liberica/client-contacts/get.d.ts +3 -0
  23. package/dist/commands/liberica/client-contacts/get.d.ts.map +1 -0
  24. package/dist/commands/liberica/client-contacts/get.js +92 -0
  25. package/dist/commands/liberica/client-contacts/get.js.map +1 -0
  26. package/dist/commands/liberica/client-contacts/index.d.ts +3 -0
  27. package/dist/commands/liberica/client-contacts/index.d.ts.map +1 -0
  28. package/dist/commands/liberica/client-contacts/index.js +17 -0
  29. package/dist/commands/liberica/client-contacts/index.js.map +1 -0
  30. package/dist/commands/liberica/client-contacts/list.d.ts +3 -0
  31. package/dist/commands/liberica/client-contacts/list.d.ts.map +1 -0
  32. package/dist/commands/liberica/client-contacts/list.js +92 -0
  33. package/dist/commands/liberica/client-contacts/list.js.map +1 -0
  34. package/dist/commands/liberica/client-contacts/update.d.ts +3 -0
  35. package/dist/commands/liberica/client-contacts/update.d.ts.map +1 -0
  36. package/dist/commands/liberica/client-contacts/update.js +156 -0
  37. package/dist/commands/liberica/client-contacts/update.js.map +1 -0
  38. package/dist/commands/liberica/dict-types/get.d.ts +3 -0
  39. package/dist/commands/liberica/dict-types/get.d.ts.map +1 -0
  40. package/dist/commands/liberica/dict-types/get.js +62 -0
  41. package/dist/commands/liberica/dict-types/get.js.map +1 -0
  42. package/dist/commands/liberica/dict-types/index.d.ts +3 -0
  43. package/dist/commands/liberica/dict-types/index.d.ts.map +1 -0
  44. package/dist/commands/liberica/dict-types/index.js +13 -0
  45. package/dist/commands/liberica/dict-types/index.js.map +1 -0
  46. package/dist/commands/liberica/dict-types/list.d.ts +3 -0
  47. package/dist/commands/liberica/dict-types/list.d.ts.map +1 -0
  48. package/dist/commands/liberica/dict-types/list.js +91 -0
  49. package/dist/commands/liberica/dict-types/list.js.map +1 -0
  50. package/dist/commands/liberica/dict-types/update.d.ts +3 -0
  51. package/dist/commands/liberica/dict-types/update.d.ts.map +1 -0
  52. package/dist/commands/liberica/dict-types/update.js +127 -0
  53. package/dist/commands/liberica/dict-types/update.js.map +1 -0
  54. package/dist/commands/liberica/dicts/create.d.ts +3 -0
  55. package/dist/commands/liberica/dicts/create.d.ts.map +1 -0
  56. package/dist/commands/liberica/dicts/create.js +157 -0
  57. package/dist/commands/liberica/dicts/create.js.map +1 -0
  58. package/dist/commands/liberica/dicts/delete.d.ts +3 -0
  59. package/dist/commands/liberica/dicts/delete.d.ts.map +1 -0
  60. package/dist/commands/liberica/dicts/delete.js +106 -0
  61. package/dist/commands/liberica/dicts/delete.js.map +1 -0
  62. package/dist/commands/liberica/dicts/get.d.ts +3 -0
  63. package/dist/commands/liberica/dicts/get.d.ts.map +1 -0
  64. package/dist/commands/liberica/dicts/get.js +69 -0
  65. package/dist/commands/liberica/dicts/get.js.map +1 -0
  66. package/dist/commands/liberica/dicts/index.d.ts +3 -0
  67. package/dist/commands/liberica/dicts/index.d.ts.map +1 -0
  68. package/dist/commands/liberica/dicts/index.js +17 -0
  69. package/dist/commands/liberica/dicts/index.js.map +1 -0
  70. package/dist/commands/liberica/dicts/list.d.ts +3 -0
  71. package/dist/commands/liberica/dicts/list.d.ts.map +1 -0
  72. package/dist/commands/liberica/dicts/list.js +88 -0
  73. package/dist/commands/liberica/dicts/list.js.map +1 -0
  74. package/dist/commands/liberica/dicts/update.d.ts +3 -0
  75. package/dist/commands/liberica/dicts/update.d.ts.map +1 -0
  76. package/dist/commands/liberica/dicts/update.js +112 -0
  77. package/dist/commands/liberica/dicts/update.js.map +1 -0
  78. package/dist/commands/liberica/index.d.ts.map +1 -1
  79. package/dist/commands/liberica/index.js +20 -0
  80. package/dist/commands/liberica/index.js.map +1 -1
  81. package/dist/commands/liberica/materials/create.d.ts.map +1 -1
  82. package/dist/commands/liberica/materials/create.js +13 -6
  83. package/dist/commands/liberica/materials/create.js.map +1 -1
  84. package/dist/commands/liberica/materials/update.js +1 -1
  85. package/dist/commands/liberica/materials/update.js.map +1 -1
  86. package/dist/commands/liberica/mould/get.d.ts +3 -0
  87. package/dist/commands/liberica/mould/get.d.ts.map +1 -0
  88. package/dist/commands/liberica/mould/get.js +90 -0
  89. package/dist/commands/liberica/mould/get.js.map +1 -0
  90. package/dist/commands/liberica/mould/index.d.ts +3 -0
  91. package/dist/commands/liberica/mould/index.d.ts.map +1 -0
  92. package/dist/commands/liberica/mould/index.js +15 -0
  93. package/dist/commands/liberica/mould/index.js.map +1 -0
  94. package/dist/commands/liberica/mould/list.d.ts +3 -0
  95. package/dist/commands/liberica/mould/list.d.ts.map +1 -0
  96. package/dist/commands/liberica/mould/list.js +114 -0
  97. package/dist/commands/liberica/mould/list.js.map +1 -0
  98. package/dist/commands/liberica/mould/set-status.d.ts +3 -0
  99. package/dist/commands/liberica/mould/set-status.d.ts.map +1 -0
  100. package/dist/commands/liberica/mould/set-status.js +84 -0
  101. package/dist/commands/liberica/mould/set-status.js.map +1 -0
  102. package/dist/commands/liberica/mould/stock-in.d.ts +3 -0
  103. package/dist/commands/liberica/mould/stock-in.d.ts.map +1 -0
  104. package/dist/commands/liberica/mould/stock-in.js +160 -0
  105. package/dist/commands/liberica/mould/stock-in.js.map +1 -0
  106. package/dist/commands/liberica/operations/active.d.ts +3 -0
  107. package/dist/commands/liberica/operations/active.d.ts.map +1 -0
  108. package/dist/commands/liberica/operations/active.js +152 -0
  109. package/dist/commands/liberica/operations/active.js.map +1 -0
  110. package/dist/commands/liberica/operations/batch-delete.d.ts +3 -0
  111. package/dist/commands/liberica/operations/batch-delete.d.ts.map +1 -0
  112. package/dist/commands/liberica/operations/batch-delete.js +130 -0
  113. package/dist/commands/liberica/operations/batch-delete.js.map +1 -0
  114. package/dist/commands/liberica/operations/copy.d.ts +3 -0
  115. package/dist/commands/liberica/operations/copy.d.ts.map +1 -0
  116. package/dist/commands/liberica/operations/copy.js +137 -0
  117. package/dist/commands/liberica/operations/copy.js.map +1 -0
  118. package/dist/commands/liberica/operations/create.d.ts +3 -0
  119. package/dist/commands/liberica/operations/create.d.ts.map +1 -0
  120. package/dist/commands/liberica/operations/create.js +212 -0
  121. package/dist/commands/liberica/operations/create.js.map +1 -0
  122. package/dist/commands/liberica/operations/deactive.d.ts +3 -0
  123. package/dist/commands/liberica/operations/deactive.d.ts.map +1 -0
  124. package/dist/commands/liberica/operations/deactive.js +152 -0
  125. package/dist/commands/liberica/operations/deactive.js.map +1 -0
  126. package/dist/commands/liberica/operations/delete.d.ts +3 -0
  127. package/dist/commands/liberica/operations/delete.d.ts.map +1 -0
  128. package/dist/commands/liberica/operations/delete.js +128 -0
  129. package/dist/commands/liberica/operations/delete.js.map +1 -0
  130. package/dist/commands/liberica/operations/get.d.ts +3 -0
  131. package/dist/commands/liberica/operations/get.d.ts.map +1 -0
  132. package/dist/commands/liberica/operations/get.js +93 -0
  133. package/dist/commands/liberica/operations/get.js.map +1 -0
  134. package/dist/commands/liberica/operations/index.d.ts +3 -0
  135. package/dist/commands/liberica/operations/index.d.ts.map +1 -0
  136. package/dist/commands/liberica/operations/index.js +25 -0
  137. package/dist/commands/liberica/operations/index.js.map +1 -0
  138. package/dist/commands/liberica/operations/list.d.ts +3 -0
  139. package/dist/commands/liberica/operations/list.d.ts.map +1 -0
  140. package/dist/commands/liberica/operations/list.js +141 -0
  141. package/dist/commands/liberica/operations/list.js.map +1 -0
  142. package/dist/commands/liberica/operations/update.d.ts +3 -0
  143. package/dist/commands/liberica/operations/update.d.ts.map +1 -0
  144. package/dist/commands/liberica/operations/update.js +208 -0
  145. package/dist/commands/liberica/operations/update.js.map +1 -0
  146. package/dist/commands/liberica/stock/__tests__/ledger.test.d.ts +2 -0
  147. package/dist/commands/liberica/stock/__tests__/ledger.test.d.ts.map +1 -0
  148. package/dist/commands/liberica/stock/__tests__/ledger.test.js +41 -0
  149. package/dist/commands/liberica/stock/__tests__/ledger.test.js.map +1 -0
  150. package/dist/commands/liberica/stock/__tests__/list.test.d.ts +2 -0
  151. package/dist/commands/liberica/stock/__tests__/list.test.d.ts.map +1 -0
  152. package/dist/commands/liberica/stock/__tests__/list.test.js +39 -0
  153. package/dist/commands/liberica/stock/__tests__/list.test.js.map +1 -0
  154. package/dist/commands/liberica/stock/index.d.ts +3 -0
  155. package/dist/commands/liberica/stock/index.d.ts.map +1 -0
  156. package/dist/commands/liberica/stock/index.js +11 -0
  157. package/dist/commands/liberica/stock/index.js.map +1 -0
  158. package/dist/commands/liberica/stock/ledger.d.ts +3 -0
  159. package/dist/commands/liberica/stock/ledger.d.ts.map +1 -0
  160. package/dist/commands/liberica/stock/ledger.js +154 -0
  161. package/dist/commands/liberica/stock/ledger.js.map +1 -0
  162. package/dist/commands/liberica/stock/list.d.ts +3 -0
  163. package/dist/commands/liberica/stock/list.d.ts.map +1 -0
  164. package/dist/commands/liberica/stock/list.js +127 -0
  165. package/dist/commands/liberica/stock/list.js.map +1 -0
  166. package/dist/commands/liberica/supplier-contacts/create.d.ts +3 -0
  167. package/dist/commands/liberica/supplier-contacts/create.d.ts.map +1 -0
  168. package/dist/commands/liberica/supplier-contacts/create.js +129 -0
  169. package/dist/commands/liberica/supplier-contacts/create.js.map +1 -0
  170. package/dist/commands/liberica/supplier-contacts/delete.d.ts +3 -0
  171. package/dist/commands/liberica/supplier-contacts/delete.d.ts.map +1 -0
  172. package/dist/commands/liberica/supplier-contacts/delete.js +88 -0
  173. package/dist/commands/liberica/supplier-contacts/delete.js.map +1 -0
  174. package/dist/commands/liberica/supplier-contacts/get.d.ts +3 -0
  175. package/dist/commands/liberica/supplier-contacts/get.d.ts.map +1 -0
  176. package/dist/commands/liberica/supplier-contacts/get.js +84 -0
  177. package/dist/commands/liberica/supplier-contacts/get.js.map +1 -0
  178. package/dist/commands/liberica/supplier-contacts/index.d.ts +3 -0
  179. package/dist/commands/liberica/supplier-contacts/index.d.ts.map +1 -0
  180. package/dist/commands/liberica/supplier-contacts/index.js +17 -0
  181. package/dist/commands/liberica/supplier-contacts/index.js.map +1 -0
  182. package/dist/commands/liberica/supplier-contacts/list.d.ts +3 -0
  183. package/dist/commands/liberica/supplier-contacts/list.d.ts.map +1 -0
  184. package/dist/commands/liberica/supplier-contacts/list.js +98 -0
  185. package/dist/commands/liberica/supplier-contacts/list.js.map +1 -0
  186. package/dist/commands/liberica/supplier-contacts/update.d.ts +3 -0
  187. package/dist/commands/liberica/supplier-contacts/update.d.ts.map +1 -0
  188. package/dist/commands/liberica/supplier-contacts/update.js +136 -0
  189. package/dist/commands/liberica/supplier-contacts/update.js.map +1 -0
  190. package/dist/core/api/client.d.ts +63 -0
  191. package/dist/core/api/client.d.ts.map +1 -1
  192. package/dist/core/api/client.js +1050 -65
  193. package/dist/core/api/client.js.map +1 -1
  194. package/dist/index.js +1 -1
  195. package/dist/types/calendar.d.ts +28 -0
  196. package/dist/types/calendar.d.ts.map +1 -0
  197. package/dist/types/calendar.js +2 -0
  198. package/dist/types/calendar.js.map +1 -0
  199. package/dist/types/client-contact.d.ts +65 -0
  200. package/dist/types/client-contact.d.ts.map +1 -0
  201. package/dist/types/client-contact.js +4 -0
  202. package/dist/types/client-contact.js.map +1 -0
  203. package/dist/types/dict.d.ts +97 -0
  204. package/dist/types/dict.d.ts.map +1 -0
  205. package/dist/types/dict.js +2 -0
  206. package/dist/types/dict.js.map +1 -0
  207. package/dist/types/index.d.ts +7 -0
  208. package/dist/types/index.d.ts.map +1 -1
  209. package/dist/types/index.js +1 -0
  210. package/dist/types/index.js.map +1 -1
  211. package/dist/types/material.d.ts +1 -1
  212. package/dist/types/material.d.ts.map +1 -1
  213. package/dist/types/mould-stock-in.d.ts +70 -0
  214. package/dist/types/mould-stock-in.d.ts.map +1 -0
  215. package/dist/types/mould-stock-in.js +3 -0
  216. package/dist/types/mould-stock-in.js.map +1 -0
  217. package/dist/types/mould.d.ts +61 -0
  218. package/dist/types/mould.d.ts.map +1 -0
  219. package/dist/types/mould.js +2 -0
  220. package/dist/types/mould.js.map +1 -0
  221. package/dist/types/operation.d.ts +66 -0
  222. package/dist/types/operation.d.ts.map +1 -0
  223. package/dist/types/operation.js +2 -0
  224. package/dist/types/operation.js.map +1 -0
  225. package/dist/types/stock.d.ts +133 -0
  226. package/dist/types/stock.d.ts.map +1 -0
  227. package/dist/types/stock.js +3 -0
  228. package/dist/types/stock.js.map +1 -0
  229. package/dist/types/supplier-contact.d.ts +65 -0
  230. package/dist/types/supplier-contact.d.ts.map +1 -0
  231. package/dist/types/supplier-contact.js +4 -0
  232. package/dist/types/supplier-contact.js.map +1 -0
  233. package/docs/commands/REFERENCE.md +24 -4
  234. package/docs/commands/liberica/calendar/DESIGN.md +333 -0
  235. package/docs/commands/liberica/client-contacts/create.md +152 -0
  236. package/docs/commands/liberica/client-contacts/delete.md +123 -0
  237. package/docs/commands/liberica/client-contacts/get.md +133 -0
  238. package/docs/commands/liberica/client-contacts/list.md +143 -0
  239. package/docs/commands/liberica/client-contacts/update.md +158 -0
  240. package/docs/commands/liberica/stock/ledger.md +209 -0
  241. package/docs/commands/liberica/stock/list.md +165 -0
  242. package/docs/commands/liberica/supplier-contacts/create.md +152 -0
  243. package/docs/commands/liberica/supplier-contacts/delete.md +123 -0
  244. package/docs/commands/liberica/supplier-contacts/get.md +133 -0
  245. package/docs/commands/liberica/supplier-contacts/list.md +143 -0
  246. package/docs/commands/liberica/supplier-contacts/update.md +158 -0
  247. package/package.json +1 -1
  248. package/src/commands/liberica/calendar/index.ts +13 -0
  249. package/src/commands/liberica/calendar/list.ts +214 -0
  250. package/src/commands/liberica/calendar/set.ts +130 -0
  251. package/src/commands/liberica/client-contacts/create.ts +115 -0
  252. package/src/commands/liberica/client-contacts/delete.ts +140 -0
  253. package/src/commands/liberica/client-contacts/get.ts +103 -0
  254. package/src/commands/liberica/client-contacts/index.ts +19 -0
  255. package/src/commands/liberica/client-contacts/list.ts +118 -0
  256. package/src/commands/liberica/client-contacts/update.ts +137 -0
  257. package/src/commands/liberica/dict-types/get.ts +74 -0
  258. package/src/commands/liberica/dict-types/index.ts +15 -0
  259. package/src/commands/liberica/dict-types/list.ts +118 -0
  260. package/src/commands/liberica/dict-types/update.ts +134 -0
  261. package/src/commands/liberica/dicts/create.ts +175 -0
  262. package/src/commands/liberica/dicts/delete.ts +107 -0
  263. package/src/commands/liberica/dicts/get.ts +80 -0
  264. package/src/commands/liberica/dicts/index.ts +19 -0
  265. package/src/commands/liberica/dicts/list.ts +114 -0
  266. package/src/commands/liberica/dicts/update.ts +116 -0
  267. package/src/commands/liberica/index.ts +20 -0
  268. package/src/commands/liberica/materials/create.ts +13 -5
  269. package/src/commands/liberica/materials/update.ts +1 -1
  270. package/src/commands/liberica/mould/get.ts +111 -0
  271. package/src/commands/liberica/mould/index.ts +17 -0
  272. package/src/commands/liberica/mould/list.ts +157 -0
  273. package/src/commands/liberica/mould/set-status.ts +99 -0
  274. package/src/commands/liberica/mould/stock-in.ts +165 -0
  275. package/src/commands/liberica/operations/active.ts +153 -0
  276. package/src/commands/liberica/operations/batch-delete.ts +131 -0
  277. package/src/commands/liberica/operations/copy.ts +138 -0
  278. package/src/commands/liberica/operations/create.ts +223 -0
  279. package/src/commands/liberica/operations/deactive.ts +152 -0
  280. package/src/commands/liberica/operations/delete.ts +128 -0
  281. package/src/commands/liberica/operations/design.md +587 -0
  282. package/src/commands/liberica/operations/get.ts +112 -0
  283. package/src/commands/liberica/operations/index.ts +27 -0
  284. package/src/commands/liberica/operations/list.ts +180 -0
  285. package/src/commands/liberica/operations/update.ts +218 -0
  286. package/src/commands/liberica/stock/index.ts +13 -0
  287. package/src/commands/liberica/stock/ledger.ts +159 -0
  288. package/src/commands/liberica/stock/list.ts +128 -0
  289. package/src/commands/liberica/supplier-contacts/create.ts +120 -0
  290. package/src/commands/liberica/supplier-contacts/delete.ts +88 -0
  291. package/src/commands/liberica/supplier-contacts/get.ts +94 -0
  292. package/src/commands/liberica/supplier-contacts/index.ts +19 -0
  293. package/src/commands/liberica/supplier-contacts/list.ts +130 -0
  294. package/src/commands/liberica/supplier-contacts/update.ts +127 -0
  295. package/src/core/api/client.ts +1238 -17
  296. package/src/index.ts +1 -1
  297. package/src/types/calendar.ts +36 -0
  298. package/src/types/client-contact.ts +78 -0
  299. package/src/types/dict.ts +121 -0
  300. package/src/types/index.ts +7 -0
  301. package/src/types/material.ts +1 -1
  302. package/src/types/mould-stock-in.ts +82 -0
  303. package/src/types/mould.ts +74 -0
  304. package/src/types/operation.ts +72 -0
  305. package/src/types/stock.ts +161 -0
  306. package/src/types/supplier-contact.ts +78 -0
@@ -138,7 +138,27 @@
138
138
  | 获取供应商详情 | `barista liberica suppliers get <id>` | GET | 查看供应商信息 | 待创建 |
139
139
  | 更新供应商 | `barista liberica suppliers update <id>` | POST | 修改供应商信息 | 待创建 |
140
140
 
141
- ### 7. materials(物料管理)- 📋 待开发
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(物料管理)- 📋 待开发
142
162
 
143
163
  | 功能 | 命令 | HTTP | 说明 | 设计文档 |
144
164
  |------|------|------|------|----------|
@@ -148,7 +168,7 @@
148
168
  | 搜索物料 | `barista liberica materials search` | GET | 按条件搜索物料 | 待创建 |
149
169
  | 更新物料 | `barista liberica materials update <id>` | POST | 修改物料信息 | 待创建 |
150
170
 
151
- ### 8. sales-prices(销售价格)- 📋 待开发
171
+ ### 10. sales-prices(销售价格)- 📋 待开发
152
172
 
153
173
  | 功能 | 命令 | HTTP | 说明 | 设计文档 |
154
174
  |------|------|------|------|----------|
@@ -157,7 +177,7 @@
157
177
  | 获取价格详情 | `barista liberica sales-prices get <id>` | GET | 查看价格详情 | 待创建 |
158
178
  | 更新销售价格 | `barista liberica sales-prices update <id>` | POST | 修改销售价格 | 待创建 |
159
179
 
160
- ### 9. purchase-prices(采购价格)- 📋 待开发
180
+ ### 11. purchase-prices(采购价格)- 📋 待开发
161
181
 
162
182
  | 功能 | 命令 | HTTP | 说明 | 设计文档 |
163
183
  |------|------|------|------|----------|
@@ -166,7 +186,7 @@
166
186
  | 获取价格详情 | `barista liberica purchase-prices get <id>` | GET | 查看价格详情 | 待创建 |
167
187
  | 更新采购价格 | `barista liberica purchase-prices update <id>` | POST | 修改采购价格 | 待创建 |
168
188
 
169
- ### 10. sales-orders(销售订单)- 📋 待开发
189
+ ### 12. sales-orders(销售订单)- 📋 待开发
170
190
 
171
191
  | 功能 | 命令 | HTTP | 说明 | 设计文档 |
172
192
  |------|------|------|------|----------|
@@ -0,0 +1,333 @@
1
+ # barista liberica calendar
2
+
3
+ 工作日历管理命令组。支持查询租户工作日历列表和设置指定日期的日历类型。
4
+
5
+ ---
6
+
7
+ ## 2.1 命令元数据
8
+
9
+ ### calendar list
10
+
11
+ | 字段 | 值 |
12
+ |------|-----|
13
+ | 完整命令 | `barista liberica calendar list` |
14
+ | 功能描述 | 查询租户工作日历列表 |
15
+ | HTTP方法 | GET |
16
+ | 是否需要认证 | ✅ 是 |
17
+ | 是否支持dry-run | ⬜ 否 |
18
+
19
+ ### calendar set
20
+
21
+ | 字段 | 值 |
22
+ |------|-----|
23
+ | 完整命令 | `barista liberica calendar set` |
24
+ | 功能描述 | 设置指定日期的日历类型 |
25
+ | HTTP方法 | POST |
26
+ | 是否需要认证 | ✅ 是 |
27
+ | 是否支持dry-run | ✅ 是 |
28
+
29
+ ---
30
+
31
+ ## 2.2 后端接口引用
32
+
33
+ ### Controller位置
34
+
35
+ ```
36
+ coffee-liberica-end/
37
+ └── facade/liberica-facade-enterprise/
38
+ └── src/main/java/com/newpeak/liberica/facade/enterprise/controller/
39
+ └── EnterpriseCalendarController.java
40
+ └── page(@GetResource(path = "/page"))
41
+ └── public ResponseData<Map<String, List<WorkDayCalendar>>> page(
42
+ @RequestHeader("X-TENANT-ID") Long tenantId,
43
+ @ParameterObject WorkCalendarRequest request
44
+ )
45
+ └── edit(@PostResource(path = "/edit", requiredPermission = true, requirePermissionCode = "EDIT_CALENDAR"))
46
+ └── public ResponseData<?> edit(
47
+ @RequestHeader("X-TENANT-ID") Long tenantId,
48
+ @RequestBody TenantCalendarRequest request
49
+ )
50
+ ```
51
+
52
+ ### Request DTO位置
53
+
54
+ **WorkCalendarRequest(列表查询)**
55
+ ```
56
+ coffee-liberica-end/
57
+ └── support/support-t-calendar/data-calendar-business/
58
+ └── src/main/java/com/newpeak/liberica/business/support/calendar/pojo/request/
59
+ └── WorkCalendarRequest.java
60
+ ├── year: Integer
61
+ ├── month: Integer
62
+ ├── months: Integer
63
+ └── entityCode: String
64
+ ```
65
+
66
+ **TenantCalendarRequest(编辑日历类型)**
67
+ ```
68
+ coffee-liberica-end/
69
+ └── support/support-t-calendar/data-calendar-business/
70
+ └── src/main/java/com/newpeak/liberica/business/support/calendar/pojo/request/
71
+ └── TenantCalendarRequest.java
72
+ ├── tenantId: Long
73
+ ├── countryCode: String
74
+ ├── calendarDate: String (@NotBlank)
75
+ ├── dateType: DateType (@NotBlank)
76
+ ├── remark: String
77
+ └── versionFlag: Long
78
+ ```
79
+
80
+ ### Response DTO位置
81
+
82
+ **WorkDayCalendar(列表响应元素)**
83
+ ```
84
+ coffee-liberica-end/
85
+ └── support/support-t-calendar/data-calendar-api/
86
+ └── src/main/java/com/newpeak/liberica/support/calendar/api/
87
+ └── WorkDayCalendar.java (interface)
88
+ ├── getCalendarDate(): String
89
+ ├── getRemark(): String
90
+ ├── getDateType(): DateType
91
+ ├── isWorkDay(): boolean
92
+ ├── isNonWorkDay(): boolean
93
+ └── isWeekend(): boolean
94
+ ```
95
+
96
+ **DateType枚举**
97
+ ```
98
+ coffee-liberica-end/
99
+ └── support/support-t-calendar/data-calendar-api/
100
+ └── src/main/java/com/newpeak/liberica/support/calendar/api/
101
+ └── DateType.java
102
+ ├── WORKDAY
103
+ ├── WEEKEND
104
+ └── HOLIDAY
105
+ ```
106
+
107
+ ---
108
+
109
+ ## 2.3 CLI参数设计
110
+
111
+ ### 命令结构
112
+
113
+ ```bash
114
+ barista liberica calendar <subcommand> [options]
115
+
116
+ # Subcommands
117
+ barista liberica calendar list [options]
118
+ barista liberica calendar set [options]
119
+ ```
120
+
121
+ ### 全局选项
122
+
123
+ | 选项 | 类型 | 说明 |
124
+ |------|------|------|
125
+ | `--env` | string | 目标环境(dev\|test\|prod-cn\|prod-jp) |
126
+ | `--tenant` | string | 租户代码(仅Liberica) |
127
+ | `--dry-run` | boolean | 预览模式 |
128
+ | `--json` | boolean | JSON输出 |
129
+
130
+ ### calendar list 命令选项
131
+
132
+ | 选项 | 短选项 | 类型 | 必填 | 默认值 | 说明 | 对应DTO字段 |
133
+ |------|--------|------|------|--------|------|-------------|
134
+ | --year | -y | number | ✅ | - | 年份 | year |
135
+ | --month | -m | number | ✅ | - | 月份 (1-12) | month |
136
+ | --months | — | number | ⬜ | 12 | 查询月数 | months |
137
+ | --grid | -g | boolean | ⬜ | false | 日历网格视图 | - |
138
+ | --json | — | boolean | ⬜ | false | JSON输出 | - |
139
+
140
+ ### calendar set 命令选项
141
+
142
+ | 选项 | 短选项 | 类型 | 必填 | 默认值 | 说明 | 对应DTO字段 |
143
+ |------|--------|------|------|--------|------|-------------|
144
+ | --date | -d | string | ✅ | - | 日期 (yyyy-MM-dd) | calendarDate |
145
+ | --type | -t | string | ✅ | - | 日期类型 (WORKDAY\|WEEKEND\|HOLIDAY) | dateType |
146
+ | --remark | -r | string | ⬜ | - | 备注说明 | remark |
147
+ | --dry-run | — | boolean | ⬜ | false | 预览模式 | - |
148
+ | --json | — | boolean | ⬜ | false | JSON输出 | - |
149
+
150
+ ---
151
+
152
+ ## 2.4 字段映射表
153
+
154
+ ### calendar list
155
+
156
+ | CLI参数 | DTO字段 | 类型转换 | 验证规则 |
157
+ |---------|---------|----------|----------|
158
+ | --year / -y | year | number→Integer | 4位数字,>= 2000 |
159
+ | --month / -m | month | number→Integer | 1-12 |
160
+ | --months | months | number→Integer | >= 1,默认12 |
161
+
162
+ ### calendar set
163
+
164
+ | CLI参数 | DTO字段 | 类型转换 | 验证规则 |
165
+ |---------|---------|----------|----------|
166
+ | --date / -d | calendarDate | 直接传递 | yyyy-MM-dd,@NotBlank |
167
+ | --type / -t | dateType | 直接传递 | 枚举值 WORKDAY/WEEKEND/HOLIDAY,@NotBlank |
168
+ | --remark / -r | remark | 直接传递 | 可选,max=255 |
169
+
170
+ **自动填充字段(不通过CLI参数):**
171
+
172
+ | 字段 | 值 |
173
+ |------|-----|
174
+ | tenantId | 由后端从JWT Token中解析,CLI不传递 X-TENANT-ID header |
175
+ | countryCode | 后端根据tenantId查询Tenant表自动填充 |
176
+ | versionFlag | 编辑时由后端查询现有记录自动填充(upsert逻辑) |
177
+
178
+ ---
179
+
180
+ ## 2.5 错误码引用
181
+
182
+ ### ExceptionEnum位置
183
+
184
+ ```
185
+ coffee-liberica-end/
186
+ └── support/support-t-calendar/data-calendar-business/
187
+ └── src/main/java/com/newpeak/liberica/business/support/calendar/enums/
188
+ ├── CalendarExceptionEnum.java
189
+ │ └── CALENDAR_NOT_EXISTED("01001100001", "查询结果不存在")
190
+ └── TenantCalendarExceptionEnum.java
191
+ └── TENANT_CALENDAR_NOT_EXISTED("01001100001", "查询结果不存在")
192
+ ```
193
+
194
+ ### 已知错误码
195
+
196
+ | 错误码 | 错误消息 | 触发条件 |
197
+ |--------|----------|----------|
198
+ | 01001100001 | 查询结果不存在 | 查询无匹配结果(通常返回空列表或空Map) |
199
+
200
+ ### Service层业务校验
201
+
202
+ `EnterpriseCalendarController.edit()` 内部采用 upsert 逻辑:
203
+ 1. 根据 `tenantId + calendarDate` 查询现有记录
204
+ 2. 若记录不存在,调用 `tenantCalendarBusiness.add(request)` 新增
205
+ 3. 若记录存在,设置 `tenantCalendarId` 后调用 `tenantCalendarBusiness.edit(request)` 更新
206
+
207
+ ---
208
+
209
+ ## 2.6 权限检查
210
+
211
+ | 检查项 | 位置 | 说明 |
212
+ |--------|------|------|
213
+ | `calendar list` | `@GetResource(path = "/page")` | 无 requiredPermission(无需权限码) |
214
+ | `calendar set` | `@PostResource(path = "/edit", requiredPermission = true, requirePermissionCode = "EDIT_CALENDAR")` | 需要 EDIT_CALENDAR 权限 |
215
+
216
+ ---
217
+
218
+ ## 2.7 实现要点
219
+
220
+ ### 通用约定
221
+
222
+ 1. **无 X-TENANT-ID Header**:CLI 规范禁止传递此 Header,租户信息通过 JWT Token 由后端解析。
223
+ 2. **ID 类型**:所有 ID 字段使用 `string` 类型(避免后端 BigInteger 精度丢失)。
224
+ 3. **错误响应归一化**:后端存在两种错误格式,需在 `handleApiError()` 中统一处理:
225
+ - 格式1: `{ success: false, code: "A150001", message: "..." }`
226
+ - 格式2: `{ success: false, error: { code: "...", message: "..." } }`
227
+
228
+ ### calendar list 实现要点
229
+
230
+ 1. **参数验证**:`--year` 和 `--month` 为必填项;`--months` 默认值为 12。
231
+ 2. **API 路径**:`GET /api/enterprise/portal/calendar/page`
232
+ 3. **响应结构**:返回 `Map<String, List<WorkDayCalendar>>`,Key 为日期字符串(如 `"2025-04"`),Value 为该月份每日的日历对象列表。
233
+ 4. **输出模式**:
234
+ - 默认输出:按月份分组表格,显示日期、类型、备注
235
+ - `--grid` 模式:日历网格视图,每行一周,标注工作日/周末/假日
236
+ - `--json` 模式:结构化 JSON 输出
237
+
238
+ ### calendar set 实现要点
239
+
240
+ 1. **参数验证**:`--date` 格式必须为 `yyyy-MM-dd`;`--type` 必须为 `WORKDAY|WEEKEND|HOLIDAY` 之一。
241
+ 2. **API 路径**:`POST /api/enterprise/portal/calendar/edit`
242
+ 3. **Dry-run 支持**:使用 `--dry-run` 时构造 `TenantCalendarRequest` 但不发送请求,输出预览信息(日期、目标类型、备注)。
243
+ 4. **Upsert 行为**:后端自动判断是新增还是更新同一日期的记录。
244
+ 5. **成功响应**:`SuccessResponseData<>` 无具体 data 内容,输出成功提示即可。
245
+
246
+ ---
247
+
248
+ ## 2.8 测试策略(TDD)
249
+
250
+ ### 单元测试文件位置
251
+
252
+ ```
253
+ coffee-barista-cli/
254
+ └── tests/unit/commands/liberica/calendar/
255
+ ├── list.test.ts
256
+ └── set.test.ts
257
+ ```
258
+
259
+ ### calendar list 测试场景
260
+
261
+ - [ ] 正常查询:提供 `--year` 和 `--month`,返回多月份日历数据
262
+ - [ ] 默认 `--months=12`:未传该参数时验证 API 请求参数
263
+ - [ ] 自定义 `--months`:验证请求参数正确传递
264
+ - [ ] `--grid` 视图:验证表格按周排列输出
265
+ - [ ] `--json` 输出:验证 JSON 结构包含 `success` 和 `data`
266
+ - [ ] 缺少必填参数:`--year` 或 `--month` 缺失时返回验证错误
267
+ - [ ] 无效参数:`--month 13` 返回验证错误
268
+ - [ ] 空结果:API 返回空 Map 时友好提示
269
+ - [ ] 错误响应:模拟后端两种错误格式,验证统一处理
270
+
271
+ ### calendar set 测试场景
272
+
273
+ - [ ] 正常设置:`--date` 和 `--type` 均有效,API 调用成功
274
+ - [ ] 带备注设置:`--remark` 参数正确传递
275
+ - [ ] `--dry-run` 模式:不调用 API,输出预览信息
276
+ - [ ] `--json` 输出:dry-run 和正常模式均验证 JSON 结构
277
+ - [ ] 缺少必填参数:`--date` 或 `--type` 缺失时返回验证错误
278
+ - [ ] 无效日期格式:`--date 2025/04/15` 返回验证错误
279
+ - [ ] 无效类型值:`--type INVALID` 返回验证错误
280
+ - [ ] 错误响应:模拟无权限/后端异常,验证友好提示和退出码
281
+
282
+ ### 集成测试流程
283
+
284
+ ```bash
285
+ # 1. 登录
286
+ barista liberica auth login dev shanghai admin@shanghai.newpeaksh.com 123456
287
+
288
+ # 2. 查询 2025 年 4 月日历
289
+ barista liberica calendar list --year 2025 --month 4
290
+
291
+ # 3. 查询 2025 年 4 月起连续 3 个月
292
+ barista liberica calendar list --year 2025 --month 4 --months 3
293
+
294
+ # 4. 网格视图
295
+ barista liberica calendar list --year 2025 --month 4 --grid
296
+
297
+ # 5. JSON 输出
298
+ barista liberica calendar list --year 2025 --month 4 --json
299
+
300
+ # 6. 设置日期类型(dry-run)
301
+ barista liberica calendar set --date 2025-04-15 --type HOLIDAY --remark "测试假日" --dry-run
302
+
303
+ # 7. 实际设置日期类型
304
+ barista liberica calendar set --date 2025-04-15 --type HOLIDAY --remark "测试假日"
305
+
306
+ # 8. 验证设置结果
307
+ barista liberica calendar list --year 2025 --month 4 --json
308
+ ```
309
+
310
+ ---
311
+
312
+ ## 2.9 示例用法
313
+
314
+ ```bash
315
+ # 查询 2025 年全年工作日历
316
+ barista liberica calendar list --year 2025 --month 1
317
+
318
+ # 查询 2025 年第二季度(4-6月)
319
+ barista liberica calendar list --year 2025 --month 4 --months 3
320
+
321
+ # 网格视图展示
322
+ barista liberica calendar list -y 2025 -m 4 --grid
323
+
324
+ # 设置 2025-04-15 为假日
325
+ barista liberica calendar set --date 2025-04-15 --type HOLIDAY --remark "清明节调休"
326
+
327
+ # 预览设置(不实际提交)
328
+ barista liberica calendar set -d 2025-04-15 -t HOLIDAY -r "测试" --dry-run
329
+
330
+ # JSON 输出(便于脚本处理)
331
+ barista liberica calendar list --year 2025 --month 4 --json
332
+ barista liberica calendar set --date 2025-04-15 --type WORKDAY --json
333
+ ```
@@ -0,0 +1,152 @@
1
+ # barista liberica client-contacts create
2
+
3
+ 创建客户联系人。
4
+
5
+ ## 2.1 命令元数据
6
+
7
+ | 字段 | 值 |
8
+ |------|-----|
9
+ | 完整命令 | `barista liberica client-contacts create` |
10
+ | 功能描述 | 添加新客户联系人 |
11
+ | HTTP方法 | POST |
12
+ | 是否需要认证 | ✅ 是 |
13
+ | 是否支持dry-run | ✅ 是 |
14
+
15
+ ## 2.2 后端接口引用
16
+
17
+ ### Controller位置
18
+ ```
19
+ coffee-liberica-end/
20
+ └── facade/liberica-facade-enterprise/
21
+ └── src/main/java/com/newpeak/liberica/facade/enterprise/controller/sales/
22
+ └── EnterpriseClientContactController.java
23
+ └── add(@PostResource(path = "/add", requiredPermission = true, requirePermissionCode = "ADD_MASTER_CLIENT_CONTACT"))
24
+ └── public ResponseData<MasterClientContactResponse> add(
25
+ @RequestHeader("X-TENANT-ID") Long tenantId,
26
+ @RequestBody @Validated(BaseRequest.add.class) MasterClientContactRequest masterClientContactRequest
27
+ )
28
+ ```
29
+
30
+ ### Request DTO位置
31
+ ```
32
+ coffee-liberica-end/
33
+ └── business/liberica-business-sales/sales-api/
34
+ └── src/main/java/com/newpeak/liberica/sales/api/pojo/request/
35
+ └── MasterClientContactRequest.java
36
+ ├── clientId: Long (@NotNull)
37
+ ├── clientContactName: String (@NotBlank, max=255)
38
+ ├── clientContactPhone: String (max=256)
39
+ ├── clientContactTelephone: String (max=256)
40
+ ├── clientContactEmail: String (max=512)
41
+ ├── clientContactSex: String (max=255)
42
+ ├── clientContactBirthday: Date
43
+ ├── clientContactQq: String (max=512)
44
+ ├── clientContactWechat: String (max=512)
45
+ ├── clientContactAddress: String (max=512)
46
+ ├── defaultFlag: String (@NotBlank, max=1)
47
+ └── remark: String (max=255)
48
+ ```
49
+
50
+ ### Response DTO位置
51
+ ```
52
+ coffee-liberica-end/
53
+ └── business/liberica-business-sales/sales-api/
54
+ └── src/main/java/com/newpeak/liberica/sales/api/pojo/response/
55
+ └── MasterClientContactResponse.java
56
+ └── (同 get 接口)
57
+ ```
58
+
59
+ ## 2.3 CLI参数设计
60
+
61
+ ### 命令结构
62
+ ```
63
+ barista liberica client-contacts create [options]
64
+ ```
65
+
66
+ ### 全局选项
67
+ | 选项 | 类型 | 说明 |
68
+ |------|------|------|
69
+ | `--env` | string | 目标环境(dev\|test\|prod-cn\|prod-jp) |
70
+ | `--tenant` | string | 租户代码 |
71
+ | `--dry-run` | boolean | 预览模式 |
72
+ | `--json` | boolean | JSON输出 |
73
+
74
+ ### 命令选项
75
+ | 选项 | 短选项 | 类型 | 必填 | 默认值 | 说明 | 对应DTO字段 |
76
+ |------|--------|------|------|--------|------|-------------|
77
+ | --client-id | -c | string | ✅ | - | 客户ID | clientId |
78
+ | --name | -n | string | ✅ | - | 姓名 | clientContactName |
79
+ | --phone | -p | string | ⬜ | - | 手机号 | clientContactPhone |
80
+ | --telephone | -t | string | ⬜ | - | 座机号 | clientContactTelephone |
81
+ | --email | -e | string | ⬜ | - | 电子邮箱 | clientContactEmail |
82
+ | --sex | -s | string | ⬜ | - | 性别 | clientContactSex |
83
+ | --birthday | -b | string | ⬜ | - | 生日(YYYY-MM-DD) | clientContactBirthday |
84
+ | --qq | -q | string | ⬜ | - | QQ号 | clientContactQq |
85
+ | --wechat | -w | string | ⬜ | - | 微信号 | clientContactWechat |
86
+ | --address | -a | string | ⬜ | - | 详细地址 | clientContactAddress |
87
+ | --default | -d | boolean | ⬜ | N | 是否默认联系人 | defaultFlag |
88
+ | --remark | -r | string | ⬜ | - | 备注 | remark |
89
+
90
+ ## 2.4 字段映射表
91
+
92
+ | CLI参数 | DTO字段 | 类型转换 | 验证规则 |
93
+ |---------|---------|----------|----------|
94
+ | --client-id / -c | clientId | string→Long | @NotNull |
95
+ | --name / -n | clientContactName | 直接传递 | @NotBlank, max=255 |
96
+ | --phone / -p | clientContactPhone | 直接传递 | max=256 |
97
+ | --telephone / -t | clientContactTelephone | 直接传递 | max=256 |
98
+ | --email / -e | clientContactEmail | 直接传递 | max=512 |
99
+ | --sex / -s | clientContactSex | 直接传递 | max=255 |
100
+ | --birthday / -b | clientContactBirthday | string→Date | yyyy-MM-dd |
101
+ | --qq / -q | clientContactQq | 直接传递 | max=512 |
102
+ | --wechat / -w | clientContactWechat | 直接传递 | max=512 |
103
+ | --address / -a | clientContactAddress | 直接传递 | max=512 |
104
+ | --default / -d | defaultFlag | boolean→Y/N | @NotBlank, max=1 |
105
+ | --remark / -r | remark | 直接传递 | max=255 |
106
+
107
+ ## 2.5 错误码引用
108
+
109
+ ### ExceptionEnum位置
110
+ ```
111
+ coffee-liberica-end/
112
+ └── business/liberica-business-sales/sales-api/
113
+ └── src/main/java/com/newpeak/liberica/sales/api/exception/enums/
114
+ └── MasterClientContactExceptionEnum.java
115
+ ```
116
+
117
+ ### 已知错误码
118
+ | 错误码 | 错误消息 | 触发条件 |
119
+ |--------|----------|----------|
120
+ | 01001207001 | 租户客户联系人不存在 | 客户ID不存在 |
121
+ | 01001XXX... | 相关验证错误 | 字段验证失败 |
122
+
123
+ ## 2.6 权限检查
124
+
125
+ | 检查项 | 位置 | 说明 |
126
+ |--------|------|------|
127
+ | PermissionConstants | `ADD_MASTER_CLIENT_CONTACT` | 添加客户联系人需要此权限 |
128
+ | 注解 | `@PostResource(requirePermissionCode = "ADD_MASTER_CLIENT_CONTACT")` | Controller方法上 |
129
+
130
+ ## 2.7 实现要点
131
+
132
+ 1. **必填参数**:--client-id 和 --name 必须指定
133
+ 2. **defaultFlag**:--default 不指定时默认为 "N",指定时为 "Y"
134
+ 3. **dry-run 模式**:预览模式下只显示将要发送的数据,不实际调用 API
135
+ 4. **输出格式**:成功后显示创建的联系人信息
136
+ 5. **错误处理**:字段验证错误显示友好提示
137
+
138
+ ## 2.8 示例用法
139
+
140
+ ```bash
141
+ # 创建客户联系人(dry-run 预览)
142
+ barista liberica client-contacts create --client-id 123 --name "张三" --phone "13800138000" --dry-run
143
+
144
+ # 实际创建
145
+ barista liberica client-contacts create --client-id 123 --name "张三" --phone "13800138000" --email "zhang@example.com"
146
+
147
+ # 创建默认联系人
148
+ barista liberica client-contacts create --client-id 123 --name "李四" --default --address "北京市朝阳区xxx"
149
+
150
+ # JSON 输出
151
+ barista liberica client-contacts create --client-id 123 --name "张三" --json
152
+ ```
@@ -0,0 +1,123 @@
1
+ # barista liberica client-contacts delete
2
+
3
+ 删除客户联系人。
4
+
5
+ ## 2.1 命令元数据
6
+
7
+ | 字段 | 值 |
8
+ |------|-----|
9
+ | 完整命令 | `barista liberica client-contacts delete <contact-id>` |
10
+ | 功能描述 | 删除客户联系人 |
11
+ | HTTP方法 | POST |
12
+ | 是否需要认证 | ✅ 是 |
13
+ | 是否支持dry-run | ✅ 是(默认) |
14
+
15
+ ## 2.2 后端接口引用
16
+
17
+ ### Controller位置
18
+ ```
19
+ coffee-liberica-end/
20
+ └── facade/liberica-facade-enterprise/
21
+ └── src/main/java/com/newpeak/liberica/facade/enterprise/controller/sales/
22
+ └── EnterpriseClientContactController.java
23
+ └── delete(@PostResource(path = "/delete", requiredPermission = true, requirePermissionCode = "DEL_MASTER_CLIENT_CONTACT"))
24
+ └── public ResponseData<?> delete(
25
+ @RequestHeader("X-TENANT-ID") Long tenantId,
26
+ @RequestBody @Validated(BaseRequest.delete.class) MasterClientContactRequest masterClientContactRequest
27
+ )
28
+ ```
29
+
30
+ ### Request DTO位置
31
+ ```
32
+ coffee-liberica-end/
33
+ └── business/liberica-business-sales/sales-api/
34
+ └── src/main/java/com/newpeak/liberica/sales/api/pojo/request/
35
+ └── MasterClientContactRequest.java
36
+ └── clientContactId: Long (@NotNull on delete)
37
+ ```
38
+
39
+ ### Response DTO位置
40
+ ```
41
+ coffee-liberica-end/
42
+ └── business/liberica-business-sales/sales-api/
43
+ └── src/main/java/com/newpeak/liberica/sales/api/pojo/response/
44
+ └── SuccessResponseData<?>
45
+ └── 无具体数据
46
+ ```
47
+
48
+ ## 2.3 CLI参数设计
49
+
50
+ ### 命令结构
51
+ ```
52
+ barista liberica client-contacts delete <contact-id> [options]
53
+ ```
54
+
55
+ ### 位置参数
56
+ | 参数 | 类型 | 必填 | 说明 |
57
+ |------|------|------|------|
58
+ | contact-id | string | ✅ | 客户联系人ID |
59
+
60
+ ### 全局选项
61
+ | 选项 | 类型 | 说明 |
62
+ |------|------|------|
63
+ | `--env` | string | 目标环境(dev\|test\|prod-cn\|prod-jp) |
64
+ | `--tenant` | string | 租户代码 |
65
+ | `--dry-run` | boolean | 预览模式(默认开启) |
66
+ | `--force` | boolean | 跳过确认,直接执行删除 |
67
+ | `--json` | boolean | JSON输出 |
68
+
69
+ ## 2.4 字段映射表
70
+
71
+ | CLI参数 | DTO字段 | 类型转换 | 验证规则 |
72
+ |---------|---------|----------|----------|
73
+ | <contact-id> | clientContactId | string→Long | @NotNull |
74
+
75
+ ## 2.5 错误码引用
76
+
77
+ ### ExceptionEnum位置
78
+ ```
79
+ coffee-liberica-end/
80
+ └── business/liberica-business-sales/sales-api/
81
+ └── src/main/java/com/newpeak/liberica/sales/api/exception/enums/
82
+ └── MasterClientContactExceptionEnum.java
83
+ └── MASTER_CLIENT_CONTACT_NOT_EXIST("01001207001", "租户客户联系人不存在")
84
+ ```
85
+
86
+ ### 已知错误码
87
+ | 错误码 | 错误消息 | 触发条件 |
88
+ |--------|----------|----------|
89
+ | 01001207001 | 租户客户联系人不存在 | contact-id 不存在或不属于当前租户 |
90
+
91
+ ## 2.6 权限检查
92
+
93
+ | 检查项 | 位置 | 说明 |
94
+ |--------|------|------|
95
+ | PermissionConstants | `DEL_MASTER_CLIENT_CONTACT` | 删除客户联系人需要此权限 |
96
+ | 注解 | `@PostResource(requirePermissionCode = "DEL_MASTER_CLIENT_CONTACT")` | Controller方法上 |
97
+
98
+ ## 2.7 实现要点
99
+
100
+ 1. **位置参数**:contact-id 必须指定
101
+ 2. **默认 dry-run**:不带 --force 时默认是 dry-run 模式,只预览不执行
102
+ 3. **--force 确认**:实际删除前必须显式指定 --force
103
+ 4. **输出格式**:预览模式显示将要删除的联系人信息,确认后显示删除结果
104
+ 5. **错误处理**:联系人不存在时显示友好错误信息
105
+
106
+ ## 2.8 示例用法
107
+
108
+ ```bash
109
+ # 预览删除(默认 dry-run)
110
+ barista liberica client-contacts delete 12345
111
+ # 输出: 🔍 Dry-Run 模式:不会实际删除
112
+ # 将删除联系人: 张三 (ID: 12345)
113
+ # 添加 --force 选项以确认删除
114
+
115
+ # 确认删除
116
+ barista liberica client-contacts delete 12345 --force
117
+
118
+ # JSON 预览
119
+ barista liberica client-contacts delete 12345 --json
120
+
121
+ # JSON 确认删除
122
+ barista liberica client-contacts delete 12345 --force --json
123
+ ```