@tailor-platform/erp-kit 0.4.0 → 0.5.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 (1402) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +12 -12
  3. package/dist/cli.mjs +476 -29
  4. package/package.json +2 -11
  5. package/skills/erp-kit-app-1-requirements/SKILL.md +31 -3
  6. package/skills/{erp-kit-app-3-plan → erp-kit-app-1-requirements}/references/story-extraction.md +3 -9
  7. package/skills/erp-kit-app-2-requirements-review/SKILL.md +31 -7
  8. package/skills/erp-kit-app-2-requirements-review/references/best-practices-check.md +1 -1
  9. package/skills/erp-kit-app-2-requirements-review/references/story-quality-check.md +67 -0
  10. package/skills/erp-kit-app-3-plan/SKILL.md +33 -32
  11. package/skills/erp-kit-app-3-plan/references/resolver-extraction.md +10 -5
  12. package/skills/erp-kit-app-3-plan/references/screen-extraction.md +5 -3
  13. package/skills/erp-kit-app-4-plan-review/SKILL.md +19 -14
  14. package/skills/erp-kit-app-4-plan-review/references/orphan-detection.md +3 -0
  15. package/skills/erp-kit-app-4-plan-review/references/story-resolver-parity.md +21 -3
  16. package/skills/erp-kit-app-5-impl-backend/SKILL.md +22 -3
  17. package/skills/erp-kit-app-6-impl-frontend/SKILL.md +19 -4
  18. package/skills/erp-kit-app-7-impl-review/SKILL.md +19 -15
  19. package/skills/erp-kit-app-shared/references/resolver-classification.md +3 -0
  20. package/skills/erp-kit-module-2-requirements-review/SKILL.md +17 -36
  21. package/skills/erp-kit-module-3-update-plan/SKILL.md +132 -0
  22. package/skills/erp-kit-module-3-update-plan/references/command-extraction.md +87 -0
  23. package/skills/erp-kit-module-3-update-plan/references/model-extraction.md +72 -0
  24. package/skills/erp-kit-module-3-update-plan/references/naming.md +73 -0
  25. package/skills/erp-kit-module-3-update-plan/references/query-extraction.md +59 -0
  26. package/skills/erp-kit-module-4-plan-review/SKILL.md +17 -76
  27. package/skills/erp-kit-module-5-impl/SKILL.md +1 -0
  28. package/skills/erp-kit-module-6-impl-review/SKILL.md +42 -120
  29. package/skills/erp-kit-module-6-impl-review/references/command-doc-test-parity.md +1 -1
  30. package/skills/erp-kit-module-6-impl-review/references/{error-implementation-parity.md → command-error-implementation-parity.md} +3 -3
  31. package/skills/erp-kit-module-6-impl-review/references/impl-parity-report-format.md +1 -1
  32. package/skills/erp-kit-module-6-impl-review/references/query-doc-code-parity.md +110 -0
  33. package/skills/erp-kit-module-6-impl-review/references/query-doc-test-parity.md +108 -0
  34. package/skills/erp-kit-module-6-impl-review/references/query-error-implementation-parity.md +100 -0
  35. package/skills/erp-kit-module-shared/references/commands.md +1 -1
  36. package/skills/erp-kit-module-shared/references/queries.md +5 -6
  37. package/src/commands/app/index.ts +18 -3
  38. package/src/commands/check.test.ts +1 -1
  39. package/src/commands/doc/module.ts +2 -3
  40. package/src/commands/doc/modules.test.ts +0 -7
  41. package/src/commands/doc/modules.ts +1 -2
  42. package/src/commands/doc/search.ts +1 -2
  43. package/src/commands/init.ts +4 -0
  44. package/src/commands/lib/distribute.test.ts +32 -1
  45. package/src/commands/lib/distribute.ts +47 -5
  46. package/src/commands/lib/sync-check-source.test.ts +1 -1
  47. package/src/commands/update.test.ts +16 -0
  48. package/src/commands/update.ts +4 -1
  49. package/src/generator/generate-code-boilerplate.test.ts +0 -1
  50. package/src/generator/generate-code.test.ts +10 -6
  51. package/src/generator/generate-errors.ts +1 -1
  52. package/src/generator/generate-permissions.ts +1 -1
  53. package/src/generator/generate-seed.ts +69 -0
  54. package/src/generator/generate-shells.ts +2 -2
  55. package/src/generator/stub-templates.ts +5 -5
  56. package/src/module.ts +59 -0
  57. package/src/modules/audit/command/activateAuditPolicy.generated.ts +1 -1
  58. package/src/modules/audit/command/activateAuditPolicy.test.ts +1 -1
  59. package/src/modules/audit/command/activateAuditPolicy.ts +1 -1
  60. package/src/modules/audit/command/createAuditPolicy.generated.ts +1 -1
  61. package/src/modules/audit/command/createAuditPolicy.test.ts +1 -1
  62. package/src/modules/audit/command/createAuditPolicy.ts +1 -1
  63. package/src/modules/audit/command/deactivateAuditPolicy.generated.ts +1 -1
  64. package/src/modules/audit/command/deactivateAuditPolicy.test.ts +2 -2
  65. package/src/modules/audit/command/deactivateAuditPolicy.ts +1 -1
  66. package/src/modules/audit/command/deleteAuditPolicy.generated.ts +1 -1
  67. package/src/modules/audit/command/deleteAuditPolicy.test.ts +1 -1
  68. package/src/modules/audit/command/deleteAuditPolicy.ts +1 -1
  69. package/src/modules/audit/command/logAuditEvent.generated.ts +1 -1
  70. package/src/modules/audit/command/logAuditEvent.test.ts +1 -1
  71. package/src/modules/audit/command/logAuditEvent.ts +1 -1
  72. package/src/modules/audit/command/reactivateAuditPolicy.generated.ts +1 -1
  73. package/src/modules/audit/command/reactivateAuditPolicy.test.ts +2 -2
  74. package/src/modules/audit/command/reactivateAuditPolicy.ts +1 -1
  75. package/src/modules/audit/command/registerAuditableEntity.generated.ts +1 -1
  76. package/src/modules/audit/command/registerAuditableEntity.test.ts +1 -1
  77. package/src/modules/audit/command/registerAuditableEntity.ts +1 -1
  78. package/src/modules/audit/command/replaceAuditPolicy.generated.ts +1 -1
  79. package/src/modules/audit/command/replaceAuditPolicy.test.ts +1 -1
  80. package/src/modules/audit/command/replaceAuditPolicy.ts +1 -1
  81. package/src/modules/audit/command/updateAuditPolicy.generated.ts +1 -1
  82. package/src/modules/audit/command/updateAuditPolicy.test.ts +1 -1
  83. package/src/modules/audit/command/updateAuditPolicy.ts +1 -1
  84. package/src/modules/audit/lib/errors.generated.ts +1 -1
  85. package/src/modules/audit/lib/permissions.generated.ts +1 -1
  86. package/src/modules/audit/lib/types.ts +6 -1
  87. package/src/modules/audit/permissions.ts +1 -1
  88. package/src/modules/audit/query/getAuditEntry.generated.ts +1 -1
  89. package/src/modules/audit/query/getAuditEntry.test.ts +2 -2
  90. package/src/modules/audit/query/getAuditEntry.ts +7 -1
  91. package/src/modules/audit/query/getAuditPolicy.generated.ts +1 -1
  92. package/src/modules/audit/query/getAuditPolicy.test.ts +2 -2
  93. package/src/modules/audit/query/getAuditPolicy.ts +7 -1
  94. package/src/modules/audit/query/getAuditSummary.generated.ts +1 -1
  95. package/src/modules/audit/query/getAuditSummary.test.ts +2 -2
  96. package/src/modules/audit/query/getAuditSummary.ts +7 -1
  97. package/src/modules/audit/query/getChangeDetails.generated.ts +1 -1
  98. package/src/modules/audit/query/getChangeDetails.test.ts +2 -2
  99. package/src/modules/audit/query/getChangeDetails.ts +7 -1
  100. package/src/modules/audit/query/listAuditPolicies.generated.ts +1 -1
  101. package/src/modules/audit/query/listAuditPolicies.test.ts +2 -2
  102. package/src/modules/audit/query/listAuditPolicies.ts +3 -3
  103. package/src/modules/audit/query/searchAuditEntries.generated.ts +1 -1
  104. package/src/modules/audit/query/searchAuditEntries.test.ts +2 -2
  105. package/src/modules/audit/query/searchAuditEntries.ts +7 -7
  106. package/src/modules/business-partner/README.md +2 -2
  107. package/src/modules/business-partner/command/activatePartner.generated.ts +1 -1
  108. package/src/modules/business-partner/command/activatePartner.ts +1 -1
  109. package/src/modules/business-partner/command/assignRoleToPartner.generated.ts +1 -1
  110. package/src/modules/business-partner/command/assignRoleToPartner.test.ts +1 -1
  111. package/src/modules/business-partner/command/assignRoleToPartner.ts +1 -1
  112. package/src/modules/business-partner/command/createContactPerson.generated.ts +1 -1
  113. package/src/modules/business-partner/command/createContactPerson.ts +1 -1
  114. package/src/modules/business-partner/command/createPartner.generated.ts +1 -1
  115. package/src/modules/business-partner/command/createPartner.test.ts +1 -1
  116. package/src/modules/business-partner/command/createPartner.ts +3 -4
  117. package/src/modules/business-partner/command/createPartnerAddress.generated.ts +1 -1
  118. package/src/modules/business-partner/command/createPartnerAddress.ts +1 -1
  119. package/src/modules/business-partner/command/createPartnerBankAccount.generated.ts +1 -1
  120. package/src/modules/business-partner/command/createPartnerBankAccount.test.ts +1 -1
  121. package/src/modules/business-partner/command/createPartnerBankAccount.ts +1 -1
  122. package/src/modules/business-partner/command/createPartnerIdentification.generated.ts +1 -1
  123. package/src/modules/business-partner/command/createPartnerIdentification.test.ts +1 -1
  124. package/src/modules/business-partner/command/createPartnerIdentification.ts +1 -1
  125. package/src/modules/business-partner/command/deactivateContactPerson.generated.ts +1 -1
  126. package/src/modules/business-partner/command/deactivateContactPerson.ts +1 -1
  127. package/src/modules/business-partner/command/deactivatePartner.generated.ts +1 -1
  128. package/src/modules/business-partner/command/deactivatePartner.ts +1 -1
  129. package/src/modules/business-partner/command/deleteContactPerson.generated.ts +1 -1
  130. package/src/modules/business-partner/command/deleteContactPerson.ts +1 -1
  131. package/src/modules/business-partner/command/deletePartner.generated.ts +1 -1
  132. package/src/modules/business-partner/command/deletePartner.ts +1 -1
  133. package/src/modules/business-partner/command/deletePartnerAddress.generated.ts +1 -1
  134. package/src/modules/business-partner/command/deletePartnerAddress.test.ts +1 -1
  135. package/src/modules/business-partner/command/deletePartnerAddress.ts +1 -1
  136. package/src/modules/business-partner/command/deletePartnerBankAccount.generated.ts +1 -1
  137. package/src/modules/business-partner/command/deletePartnerBankAccount.test.ts +1 -1
  138. package/src/modules/business-partner/command/deletePartnerBankAccount.ts +1 -1
  139. package/src/modules/business-partner/command/deletePartnerIdentification.generated.ts +1 -1
  140. package/src/modules/business-partner/command/deletePartnerIdentification.test.ts +1 -1
  141. package/src/modules/business-partner/command/deletePartnerIdentification.ts +1 -1
  142. package/src/modules/business-partner/command/reactivateContactPerson.generated.ts +1 -1
  143. package/src/modules/business-partner/command/reactivateContactPerson.ts +1 -1
  144. package/src/modules/business-partner/command/reactivatePartner.generated.ts +1 -1
  145. package/src/modules/business-partner/command/reactivatePartner.ts +1 -1
  146. package/src/modules/business-partner/command/removeRoleFromPartner.generated.ts +1 -1
  147. package/src/modules/business-partner/command/removeRoleFromPartner.test.ts +1 -1
  148. package/src/modules/business-partner/command/removeRoleFromPartner.ts +1 -1
  149. package/src/modules/business-partner/command/setDefaultPartnerAddress.generated.ts +1 -1
  150. package/src/modules/business-partner/command/setDefaultPartnerAddress.ts +1 -1
  151. package/src/modules/business-partner/command/setDefaultPartnerBankAccount.generated.ts +1 -1
  152. package/src/modules/business-partner/command/setDefaultPartnerBankAccount.test.ts +1 -1
  153. package/src/modules/business-partner/command/setDefaultPartnerBankAccount.ts +1 -1
  154. package/src/modules/business-partner/command/setPrimaryContactPerson.generated.ts +1 -1
  155. package/src/modules/business-partner/command/setPrimaryContactPerson.ts +1 -1
  156. package/src/modules/business-partner/command/updateContactPerson.generated.ts +1 -1
  157. package/src/modules/business-partner/command/updateContactPerson.ts +1 -1
  158. package/src/modules/business-partner/command/updatePartner.generated.ts +1 -1
  159. package/src/modules/business-partner/command/updatePartner.test.ts +1 -1
  160. package/src/modules/business-partner/command/updatePartner.ts +1 -1
  161. package/src/modules/business-partner/command/updatePartnerAddress.generated.ts +1 -1
  162. package/src/modules/business-partner/command/updatePartnerAddress.ts +1 -1
  163. package/src/modules/business-partner/command/updatePartnerBankAccount.generated.ts +1 -1
  164. package/src/modules/business-partner/command/updatePartnerBankAccount.test.ts +1 -1
  165. package/src/modules/business-partner/command/updatePartnerBankAccount.ts +1 -1
  166. package/src/modules/business-partner/command/updatePartnerIdentification.generated.ts +1 -1
  167. package/src/modules/business-partner/command/updatePartnerIdentification.test.ts +1 -1
  168. package/src/modules/business-partner/command/updatePartnerIdentification.ts +1 -1
  169. package/src/modules/business-partner/lib/errors.generated.ts +1 -1
  170. package/src/modules/business-partner/lib/permissions.generated.ts +1 -1
  171. package/src/modules/business-partner/lib/types.ts +6 -1
  172. package/src/modules/business-partner/module.ts +1 -1
  173. package/src/modules/business-partner/permissions.ts +1 -1
  174. package/src/modules/business-partner/query/getContactPerson.generated.ts +1 -1
  175. package/src/modules/business-partner/query/getContactPerson.ts +1 -1
  176. package/src/modules/business-partner/query/getDefaultPartnerAddress.generated.ts +1 -1
  177. package/src/modules/business-partner/query/getDefaultPartnerAddress.ts +1 -1
  178. package/src/modules/business-partner/query/getDefaultPartnerBankAccount.generated.ts +1 -1
  179. package/src/modules/business-partner/query/getDefaultPartnerBankAccount.ts +1 -1
  180. package/src/modules/business-partner/query/getPartner.generated.ts +1 -1
  181. package/src/modules/business-partner/query/getPartner.ts +1 -1
  182. package/src/modules/business-partner/query/getPartnerAddress.generated.ts +1 -1
  183. package/src/modules/business-partner/query/getPartnerAddress.ts +1 -1
  184. package/src/modules/business-partner/query/getPartnerBankAccount.generated.ts +1 -1
  185. package/src/modules/business-partner/query/getPartnerBankAccount.ts +1 -1
  186. package/src/modules/business-partner/query/getPartnerIdentification.generated.ts +1 -1
  187. package/src/modules/business-partner/query/getPartnerIdentification.ts +1 -1
  188. package/src/modules/business-partner/query/getPartnerRole.generated.ts +1 -1
  189. package/src/modules/business-partner/query/getPartnerRole.ts +1 -1
  190. package/src/modules/business-partner/query/getPrimaryContactPerson.generated.ts +1 -1
  191. package/src/modules/business-partner/query/getPrimaryContactPerson.ts +1 -1
  192. package/src/modules/business-partner/query/listContactPersonsByPartner.generated.ts +1 -1
  193. package/src/modules/business-partner/query/listContactPersonsByPartner.ts +2 -2
  194. package/src/modules/business-partner/query/listPartnerAddressesByPartner.generated.ts +1 -1
  195. package/src/modules/business-partner/query/listPartnerAddressesByPartner.ts +3 -3
  196. package/src/modules/business-partner/query/listPartnerBankAccountsByPartner.generated.ts +1 -1
  197. package/src/modules/business-partner/query/listPartnerBankAccountsByPartner.ts +2 -2
  198. package/src/modules/business-partner/query/listPartnerIdentificationsByPartner.generated.ts +1 -1
  199. package/src/modules/business-partner/query/listPartnerIdentificationsByPartner.ts +3 -3
  200. package/src/modules/business-partner/query/listPartnersByRole.generated.ts +1 -1
  201. package/src/modules/business-partner/query/listPartnersByRole.ts +4 -4
  202. package/src/modules/coa-management/command/activateAccount.generated.ts +1 -1
  203. package/src/modules/coa-management/command/activateAccount.test.ts +1 -1
  204. package/src/modules/coa-management/command/activateAccount.ts +1 -1
  205. package/src/modules/coa-management/command/activateChartOfAccounts.generated.ts +1 -1
  206. package/src/modules/coa-management/command/activateChartOfAccounts.test.ts +1 -1
  207. package/src/modules/coa-management/command/activateChartOfAccounts.ts +1 -1
  208. package/src/modules/coa-management/command/createAccount.generated.ts +1 -1
  209. package/src/modules/coa-management/command/createAccount.test.ts +1 -1
  210. package/src/modules/coa-management/command/createAccount.ts +1 -1
  211. package/src/modules/coa-management/command/createAccountGroup.generated.ts +1 -1
  212. package/src/modules/coa-management/command/createAccountGroup.test.ts +1 -1
  213. package/src/modules/coa-management/command/createAccountGroup.ts +1 -1
  214. package/src/modules/coa-management/command/createChartOfAccounts.generated.ts +1 -1
  215. package/src/modules/coa-management/command/createChartOfAccounts.test.ts +1 -1
  216. package/src/modules/coa-management/command/createChartOfAccounts.ts +1 -1
  217. package/src/modules/coa-management/command/deactivateAccount.generated.ts +1 -1
  218. package/src/modules/coa-management/command/deactivateAccount.test.ts +1 -1
  219. package/src/modules/coa-management/command/deactivateAccount.ts +1 -1
  220. package/src/modules/coa-management/command/deactivateChartOfAccounts.generated.ts +1 -1
  221. package/src/modules/coa-management/command/deactivateChartOfAccounts.test.ts +1 -1
  222. package/src/modules/coa-management/command/deactivateChartOfAccounts.ts +1 -1
  223. package/src/modules/coa-management/command/deleteAccount.generated.ts +1 -1
  224. package/src/modules/coa-management/command/deleteAccount.test.ts +1 -1
  225. package/src/modules/coa-management/command/deleteAccount.ts +1 -1
  226. package/src/modules/coa-management/command/deleteAccountGroup.generated.ts +1 -1
  227. package/src/modules/coa-management/command/deleteAccountGroup.test.ts +1 -1
  228. package/src/modules/coa-management/command/deleteAccountGroup.ts +1 -1
  229. package/src/modules/coa-management/command/deleteChartOfAccounts.generated.ts +1 -1
  230. package/src/modules/coa-management/command/deleteChartOfAccounts.test.ts +1 -1
  231. package/src/modules/coa-management/command/deleteChartOfAccounts.ts +1 -1
  232. package/src/modules/coa-management/command/moveAccountGroup.generated.ts +1 -1
  233. package/src/modules/coa-management/command/moveAccountGroup.test.ts +1 -1
  234. package/src/modules/coa-management/command/moveAccountGroup.ts +1 -1
  235. package/src/modules/coa-management/command/reactivateAccount.generated.ts +1 -1
  236. package/src/modules/coa-management/command/reactivateAccount.test.ts +1 -1
  237. package/src/modules/coa-management/command/reactivateAccount.ts +1 -1
  238. package/src/modules/coa-management/command/updateAccount.generated.ts +1 -1
  239. package/src/modules/coa-management/command/updateAccount.test.ts +1 -1
  240. package/src/modules/coa-management/command/updateAccount.ts +1 -1
  241. package/src/modules/coa-management/command/updateAccountGroup.generated.ts +1 -1
  242. package/src/modules/coa-management/command/updateAccountGroup.test.ts +1 -1
  243. package/src/modules/coa-management/command/updateAccountGroup.ts +1 -1
  244. package/src/modules/coa-management/command/updateChartOfAccounts.generated.ts +1 -1
  245. package/src/modules/coa-management/command/updateChartOfAccounts.test.ts +1 -1
  246. package/src/modules/coa-management/command/updateChartOfAccounts.ts +1 -1
  247. package/src/modules/coa-management/lib/errors.generated.ts +1 -1
  248. package/src/modules/coa-management/lib/permissions.generated.ts +1 -1
  249. package/src/modules/coa-management/lib/types.ts +6 -1
  250. package/src/modules/coa-management/module.ts +1 -1
  251. package/src/modules/coa-management/permissions.ts +1 -1
  252. package/src/modules/coa-management/query/detectCircularReference.generated.ts +1 -1
  253. package/src/modules/coa-management/query/detectCircularReference.ts +1 -1
  254. package/src/modules/coa-management/query/getAccount.generated.ts +1 -1
  255. package/src/modules/coa-management/query/getAccount.ts +1 -1
  256. package/src/modules/coa-management/query/getAccountGroup.generated.ts +1 -1
  257. package/src/modules/coa-management/query/getAccountGroup.ts +1 -1
  258. package/src/modules/coa-management/query/getChartOfAccounts.generated.ts +1 -1
  259. package/src/modules/coa-management/query/getChartOfAccounts.ts +1 -1
  260. package/src/modules/coa-management/query/listAccountGroups.generated.ts +1 -1
  261. package/src/modules/coa-management/query/listAccountGroups.ts +2 -2
  262. package/src/modules/coa-management/query/listAccounts.generated.ts +1 -1
  263. package/src/modules/coa-management/query/listAccounts.ts +3 -3
  264. package/src/modules/coa-management/query/listUnassignedAccounts.generated.ts +1 -1
  265. package/src/modules/coa-management/query/listUnassignedAccounts.ts +2 -2
  266. package/src/modules/inventory/README.md +65 -0
  267. package/src/modules/inventory/command/approveCountLine.generated.ts +6 -0
  268. package/src/modules/inventory/command/approveCountLine.test.ts +89 -0
  269. package/src/modules/inventory/command/approveCountLine.ts +68 -0
  270. package/src/modules/inventory/command/approveInventoryAdjustment.generated.ts +6 -0
  271. package/src/modules/inventory/command/approveInventoryAdjustment.test.ts +56 -0
  272. package/src/modules/inventory/command/approveInventoryAdjustment.ts +50 -0
  273. package/src/modules/inventory/command/assignSerialNumber.generated.ts +6 -0
  274. package/src/modules/inventory/command/assignSerialNumber.test.ts +133 -0
  275. package/src/modules/inventory/command/assignSerialNumber.ts +83 -0
  276. package/src/modules/inventory/command/cancelInventoryCount.generated.ts +6 -0
  277. package/src/modules/inventory/command/cancelInventoryCount.test.ts +114 -0
  278. package/src/modules/inventory/command/cancelInventoryCount.ts +62 -0
  279. package/src/modules/inventory/command/cancelStockMovement.generated.ts +6 -0
  280. package/src/modules/inventory/command/cancelStockMovement.test.ts +102 -0
  281. package/src/modules/inventory/command/cancelStockMovement.ts +56 -0
  282. package/src/modules/inventory/command/completeInventoryCount.generated.ts +6 -0
  283. package/src/modules/inventory/command/completeInventoryCount.test.ts +99 -0
  284. package/src/modules/inventory/command/completeInventoryCount.ts +70 -0
  285. package/src/modules/inventory/command/confirmInventoryAdjustment.generated.ts +6 -0
  286. package/src/modules/inventory/command/confirmInventoryAdjustment.test.ts +324 -0
  287. package/src/modules/inventory/command/confirmInventoryAdjustment.ts +194 -0
  288. package/src/modules/inventory/command/confirmStockMovement.generated.ts +6 -0
  289. package/src/modules/inventory/command/confirmStockMovement.test.ts +126 -0
  290. package/src/modules/inventory/command/confirmStockMovement.ts +131 -0
  291. package/src/modules/inventory/command/createInventoryAdjustment.generated.ts +6 -0
  292. package/src/modules/inventory/command/createInventoryAdjustment.test.ts +298 -0
  293. package/src/modules/inventory/command/createInventoryAdjustment.ts +124 -0
  294. package/src/modules/inventory/command/createInventoryCount.generated.ts +6 -0
  295. package/src/modules/inventory/command/createInventoryCount.test.ts +157 -0
  296. package/src/modules/inventory/command/createInventoryCount.ts +72 -0
  297. package/src/modules/inventory/command/createLot.generated.ts +6 -0
  298. package/src/modules/inventory/command/createLot.test.ts +106 -0
  299. package/src/modules/inventory/command/createLot.ts +72 -0
  300. package/src/modules/inventory/command/createStockMovement.generated.ts +6 -0
  301. package/src/modules/inventory/command/createStockMovement.test.ts +342 -0
  302. package/src/modules/inventory/command/createStockMovement.ts +172 -0
  303. package/src/modules/inventory/command/createStorageLocation.generated.ts +6 -0
  304. package/src/modules/inventory/command/createStorageLocation.test.ts +246 -0
  305. package/src/modules/inventory/command/createStorageLocation.ts +126 -0
  306. package/src/modules/inventory/command/createValuationPolicy.generated.ts +6 -0
  307. package/src/modules/inventory/command/createValuationPolicy.test.ts +75 -0
  308. package/src/modules/inventory/command/createValuationPolicy.ts +52 -0
  309. package/src/modules/inventory/command/createWarehouse.generated.ts +6 -0
  310. package/src/modules/inventory/command/createWarehouse.test.ts +143 -0
  311. package/src/modules/inventory/command/createWarehouse.ts +76 -0
  312. package/src/modules/inventory/command/deactivateStorageLocation.generated.ts +6 -0
  313. package/src/modules/inventory/command/deactivateStorageLocation.test.ts +69 -0
  314. package/src/modules/inventory/command/deactivateStorageLocation.ts +51 -0
  315. package/src/modules/inventory/command/deactivateWarehouse.generated.ts +6 -0
  316. package/src/modules/inventory/command/deactivateWarehouse.test.ts +75 -0
  317. package/src/modules/inventory/command/deactivateWarehouse.ts +45 -0
  318. package/src/modules/inventory/command/executeStockMovement.generated.ts +6 -0
  319. package/src/modules/inventory/command/executeStockMovement.test.ts +502 -0
  320. package/src/modules/inventory/command/executeStockMovement.ts +303 -0
  321. package/src/modules/inventory/command/reactivateStorageLocation.generated.ts +6 -0
  322. package/src/modules/inventory/command/reactivateStorageLocation.test.ts +78 -0
  323. package/src/modules/inventory/command/reactivateStorageLocation.ts +63 -0
  324. package/src/modules/inventory/command/reactivateWarehouse.generated.ts +6 -0
  325. package/src/modules/inventory/command/reactivateWarehouse.test.ts +87 -0
  326. package/src/modules/inventory/command/reactivateWarehouse.ts +65 -0
  327. package/src/modules/inventory/command/recordCountLine.generated.ts +6 -0
  328. package/src/modules/inventory/command/recordCountLine.test.ts +211 -0
  329. package/src/modules/inventory/command/recordCountLine.ts +81 -0
  330. package/src/modules/inventory/command/rejectCountLine.generated.ts +6 -0
  331. package/src/modules/inventory/command/rejectCountLine.test.ts +66 -0
  332. package/src/modules/inventory/command/rejectCountLine.ts +50 -0
  333. package/src/modules/inventory/command/rejectInventoryAdjustment.generated.ts +6 -0
  334. package/src/modules/inventory/command/rejectInventoryAdjustment.test.ts +69 -0
  335. package/src/modules/inventory/command/rejectInventoryAdjustment.ts +50 -0
  336. package/src/modules/inventory/command/releaseReservation.generated.ts +6 -0
  337. package/src/modules/inventory/command/releaseReservation.test.ts +65 -0
  338. package/src/modules/inventory/command/releaseReservation.ts +50 -0
  339. package/src/modules/inventory/command/reserveStock.generated.ts +6 -0
  340. package/src/modules/inventory/command/reserveStock.test.ts +141 -0
  341. package/src/modules/inventory/command/reserveStock.ts +88 -0
  342. package/src/modules/inventory/command/reviseInventoryAdjustment.generated.ts +6 -0
  343. package/src/modules/inventory/command/reviseInventoryAdjustment.test.ts +68 -0
  344. package/src/modules/inventory/command/reviseInventoryAdjustment.ts +48 -0
  345. package/src/modules/inventory/command/startInventoryCount.generated.ts +6 -0
  346. package/src/modules/inventory/command/startInventoryCount.test.ts +100 -0
  347. package/src/modules/inventory/command/startInventoryCount.ts +90 -0
  348. package/src/modules/inventory/command/submitInventoryAdjustment.generated.ts +6 -0
  349. package/src/modules/inventory/command/submitInventoryAdjustment.test.ts +53 -0
  350. package/src/modules/inventory/command/submitInventoryAdjustment.ts +47 -0
  351. package/src/modules/inventory/command/updateLot.generated.ts +6 -0
  352. package/src/modules/inventory/command/updateLot.test.ts +88 -0
  353. package/src/modules/inventory/command/updateLot.ts +52 -0
  354. package/src/modules/inventory/command/updateStockMovement.generated.ts +6 -0
  355. package/src/modules/inventory/command/updateStockMovement.test.ts +250 -0
  356. package/src/modules/inventory/command/updateStockMovement.ts +164 -0
  357. package/src/modules/inventory/command/updateStorageLocation.generated.ts +6 -0
  358. package/src/modules/inventory/command/updateStorageLocation.test.ts +72 -0
  359. package/src/modules/inventory/command/updateStorageLocation.ts +77 -0
  360. package/src/modules/inventory/command/updateValuationPolicy.generated.ts +6 -0
  361. package/src/modules/inventory/command/updateValuationPolicy.test.ts +68 -0
  362. package/src/modules/inventory/command/updateValuationPolicy.ts +74 -0
  363. package/src/modules/inventory/command/updateWarehouse.generated.ts +6 -0
  364. package/src/modules/inventory/command/updateWarehouse.test.ts +88 -0
  365. package/src/modules/inventory/command/updateWarehouse.ts +64 -0
  366. package/src/modules/inventory/db/costLayer.ts +54 -0
  367. package/src/modules/inventory/db/inventoryAdjustment.ts +88 -0
  368. package/src/modules/inventory/db/inventoryCount.ts +58 -0
  369. package/src/modules/inventory/db/inventoryCountLine.ts +61 -0
  370. package/src/modules/inventory/db/itemValuation.ts +50 -0
  371. package/src/modules/inventory/db/lot.ts +51 -0
  372. package/src/modules/inventory/db/lotStockLevel.ts +48 -0
  373. package/src/modules/inventory/db/serialNumber.ts +53 -0
  374. package/src/modules/inventory/db/stockLevel.ts +51 -0
  375. package/src/modules/inventory/db/stockMoveLine.ts +78 -0
  376. package/src/modules/inventory/db/stockMovement.ts +48 -0
  377. package/src/modules/inventory/db/storageLocation.ts +56 -0
  378. package/src/modules/inventory/db/valuationPolicy.ts +33 -0
  379. package/src/modules/inventory/db/warehouse.ts +45 -0
  380. package/src/modules/inventory/docs/commands/ApproveCountLine.md +44 -0
  381. package/src/modules/inventory/docs/commands/ApproveInventoryAdjustment.md +37 -0
  382. package/src/modules/inventory/docs/commands/AssignSerialNumber.md +46 -0
  383. package/src/modules/inventory/docs/commands/CancelInventoryCount.md +49 -0
  384. package/src/modules/inventory/docs/commands/CancelStockMovement.md +44 -0
  385. package/src/modules/inventory/docs/commands/CompleteInventoryCount.md +47 -0
  386. package/src/modules/inventory/docs/commands/ConfirmInventoryAdjustment.md +72 -0
  387. package/src/modules/inventory/docs/commands/ConfirmStockMovement.md +43 -0
  388. package/src/modules/inventory/docs/commands/CreateInventoryAdjustment.md +75 -0
  389. package/src/modules/inventory/docs/commands/CreateInventoryCount.md +49 -0
  390. package/src/modules/inventory/docs/commands/CreateLot.md +40 -0
  391. package/src/modules/inventory/docs/commands/CreateStockMovement.md +76 -0
  392. package/src/modules/inventory/docs/commands/CreateStorageLocation.md +66 -0
  393. package/src/modules/inventory/docs/commands/CreateValuationPolicy.md +45 -0
  394. package/src/modules/inventory/docs/commands/CreateWarehouse.md +47 -0
  395. package/src/modules/inventory/docs/commands/DeactivateStorageLocation.md +39 -0
  396. package/src/modules/inventory/docs/commands/DeactivateWarehouse.md +38 -0
  397. package/src/modules/inventory/docs/commands/ExecuteStockMovement.md +82 -0
  398. package/src/modules/inventory/docs/commands/ReactivateStorageLocation.md +42 -0
  399. package/src/modules/inventory/docs/commands/ReactivateWarehouse.md +42 -0
  400. package/src/modules/inventory/docs/commands/RecordCountLine.md +52 -0
  401. package/src/modules/inventory/docs/commands/RejectCountLine.md +42 -0
  402. package/src/modules/inventory/docs/commands/RejectInventoryAdjustment.md +38 -0
  403. package/src/modules/inventory/docs/commands/ReleaseReservation.md +37 -0
  404. package/src/modules/inventory/docs/commands/ReserveStock.md +49 -0
  405. package/src/modules/inventory/docs/commands/ReviseInventoryAdjustment.md +38 -0
  406. package/src/modules/inventory/docs/commands/StartInventoryCount.md +47 -0
  407. package/src/modules/inventory/docs/commands/SubmitInventoryAdjustment.md +37 -0
  408. package/src/modules/inventory/docs/commands/UpdateLot.md +41 -0
  409. package/src/modules/inventory/docs/commands/UpdateStockMovement.md +45 -0
  410. package/src/modules/inventory/docs/commands/UpdateStorageLocation.md +41 -0
  411. package/src/modules/inventory/docs/commands/UpdateValuationPolicy.md +44 -0
  412. package/src/modules/inventory/docs/commands/UpdateWarehouse.md +42 -0
  413. package/src/modules/inventory/docs/features/inventory-adjustment.md +64 -0
  414. package/src/modules/inventory/docs/features/inventory-count.md +78 -0
  415. package/src/modules/inventory/docs/features/inventory-valuation.md +77 -0
  416. package/src/modules/inventory/docs/features/lot-and-batch-tracking.md +81 -0
  417. package/src/modules/inventory/docs/features/scrap-management.md +63 -0
  418. package/src/modules/inventory/docs/features/serial-number-tracking.md +68 -0
  419. package/src/modules/inventory/docs/features/stock-movement.md +72 -0
  420. package/src/modules/inventory/docs/features/stock-tracking.md +78 -0
  421. package/src/modules/inventory/docs/features/warehouse-management.md +97 -0
  422. package/src/modules/inventory/docs/models/CostLayer.md +37 -0
  423. package/src/modules/inventory/docs/models/InventoryAdjustment.md +69 -0
  424. package/src/modules/inventory/docs/models/InventoryCount.md +53 -0
  425. package/src/modules/inventory/docs/models/InventoryCountLine.md +53 -0
  426. package/src/modules/inventory/docs/models/ItemValuation.md +38 -0
  427. package/src/modules/inventory/docs/models/Lot.md +45 -0
  428. package/src/modules/inventory/docs/models/LotStockLevel.md +34 -0
  429. package/src/modules/inventory/docs/models/SerialNumber.md +53 -0
  430. package/src/modules/inventory/docs/models/StockLevel.md +41 -0
  431. package/src/modules/inventory/docs/models/StockMoveLine.md +44 -0
  432. package/src/modules/inventory/docs/models/StockMovement.md +52 -0
  433. package/src/modules/inventory/docs/models/StorageLocation.md +55 -0
  434. package/src/modules/inventory/docs/models/ValuationPolicy.md +38 -0
  435. package/src/modules/inventory/docs/models/Warehouse.md +50 -0
  436. package/src/modules/inventory/docs/queries/GetInventoryAdjustment.md +40 -0
  437. package/src/modules/inventory/docs/queries/GetInventoryCount.md +43 -0
  438. package/src/modules/inventory/docs/queries/GetItemValuation.md +42 -0
  439. package/src/modules/inventory/docs/queries/GetLot.md +42 -0
  440. package/src/modules/inventory/docs/queries/GetSerialNumber.md +43 -0
  441. package/src/modules/inventory/docs/queries/GetSerialNumberHistory.md +50 -0
  442. package/src/modules/inventory/docs/queries/GetStockLevel.md +42 -0
  443. package/src/modules/inventory/docs/queries/GetStockMovement.md +41 -0
  444. package/src/modules/inventory/docs/queries/GetStorageLocation.md +40 -0
  445. package/src/modules/inventory/docs/queries/GetValuationPolicy.md +38 -0
  446. package/src/modules/inventory/docs/queries/GetWarehouse.md +40 -0
  447. package/src/modules/inventory/docs/queries/GetWarehouseStockSummary.md +50 -0
  448. package/src/modules/inventory/docs/queries/ListCostLayers.md +49 -0
  449. package/src/modules/inventory/docs/queries/ListExpiringLots.md +51 -0
  450. package/src/modules/inventory/docs/queries/ListInventoryAdjustments.md +47 -0
  451. package/src/modules/inventory/docs/queries/ListInventoryCounts.md +57 -0
  452. package/src/modules/inventory/docs/queries/ListItemValuations.md +44 -0
  453. package/src/modules/inventory/docs/queries/ListLots.md +57 -0
  454. package/src/modules/inventory/docs/queries/ListSerialNumbers.md +44 -0
  455. package/src/modules/inventory/docs/queries/ListStockLevels.md +49 -0
  456. package/src/modules/inventory/docs/queries/ListStockMovements.md +47 -0
  457. package/src/modules/inventory/docs/queries/ListStorageLocations.md +47 -0
  458. package/src/modules/inventory/docs/queries/ListValuationPolicies.md +38 -0
  459. package/src/modules/inventory/docs/queries/ListWarehouses.md +42 -0
  460. package/src/modules/inventory/docs/queries/TraceLotBackward.md +46 -0
  461. package/src/modules/inventory/docs/queries/TraceLotForward.md +46 -0
  462. package/src/modules/inventory/generated/.gitkeep +0 -0
  463. package/src/modules/inventory/generated/enums.ts +131 -0
  464. package/src/modules/inventory/generated/kysely-tailordb.ts +201 -0
  465. package/src/modules/inventory/index.ts +2 -0
  466. package/src/modules/inventory/lib/_db_deps.ts +17 -0
  467. package/src/modules/inventory/lib/errors.generated.ts +317 -0
  468. package/src/modules/inventory/lib/permissions.generated.ts +38 -0
  469. package/src/modules/inventory/lib/types.ts +92 -0
  470. package/src/modules/inventory/module.ts +202 -0
  471. package/src/modules/inventory/permissions.ts +3 -0
  472. package/src/modules/inventory/query/.gitkeep +0 -0
  473. package/src/modules/inventory/query/getInventoryAdjustment.generated.ts +5 -0
  474. package/src/modules/inventory/query/getInventoryAdjustment.test.ts +58 -0
  475. package/src/modules/inventory/query/getInventoryAdjustment.ts +16 -0
  476. package/src/modules/inventory/query/getInventoryCount.generated.ts +5 -0
  477. package/src/modules/inventory/query/getInventoryCount.test.ts +65 -0
  478. package/src/modules/inventory/query/getInventoryCount.ts +27 -0
  479. package/src/modules/inventory/query/getItemValuation.generated.ts +5 -0
  480. package/src/modules/inventory/query/getItemValuation.test.ts +72 -0
  481. package/src/modules/inventory/query/getItemValuation.ts +29 -0
  482. package/src/modules/inventory/query/getLot.generated.ts +5 -0
  483. package/src/modules/inventory/query/getLot.test.ts +62 -0
  484. package/src/modules/inventory/query/getLot.ts +28 -0
  485. package/src/modules/inventory/query/getSerialNumber.generated.ts +5 -0
  486. package/src/modules/inventory/query/getSerialNumber.test.ts +59 -0
  487. package/src/modules/inventory/query/getSerialNumber.ts +18 -0
  488. package/src/modules/inventory/query/getSerialNumberHistory.generated.ts +5 -0
  489. package/src/modules/inventory/query/getSerialNumberHistory.test.ts +80 -0
  490. package/src/modules/inventory/query/getSerialNumberHistory.ts +30 -0
  491. package/src/modules/inventory/query/getStockLevel.generated.ts +5 -0
  492. package/src/modules/inventory/query/getStockLevel.test.ts +70 -0
  493. package/src/modules/inventory/query/getStockLevel.ts +24 -0
  494. package/src/modules/inventory/query/getStockMovement.generated.ts +5 -0
  495. package/src/modules/inventory/query/getStockMovement.test.ts +62 -0
  496. package/src/modules/inventory/query/getStockMovement.ts +26 -0
  497. package/src/modules/inventory/query/getStorageLocation.generated.ts +5 -0
  498. package/src/modules/inventory/query/getStorageLocation.test.ts +54 -0
  499. package/src/modules/inventory/query/getStorageLocation.ts +26 -0
  500. package/src/modules/inventory/query/getValuationPolicy.generated.ts +5 -0
  501. package/src/modules/inventory/query/getValuationPolicy.test.ts +42 -0
  502. package/src/modules/inventory/query/getValuationPolicy.ts +16 -0
  503. package/src/modules/inventory/query/getWarehouse.generated.ts +5 -0
  504. package/src/modules/inventory/query/getWarehouse.test.ts +61 -0
  505. package/src/modules/inventory/query/getWarehouse.ts +26 -0
  506. package/src/modules/inventory/query/getWarehouseStockSummary.generated.ts +5 -0
  507. package/src/modules/inventory/query/getWarehouseStockSummary.test.ts +97 -0
  508. package/src/modules/inventory/query/getWarehouseStockSummary.ts +82 -0
  509. package/src/modules/inventory/query/listCostLayers.generated.ts +5 -0
  510. package/src/modules/inventory/query/listCostLayers.test.ts +58 -0
  511. package/src/modules/inventory/query/listCostLayers.ts +45 -0
  512. package/src/modules/inventory/query/listExpiringLots.generated.ts +5 -0
  513. package/src/modules/inventory/query/listExpiringLots.test.ts +70 -0
  514. package/src/modules/inventory/query/listExpiringLots.ts +74 -0
  515. package/src/modules/inventory/query/listInventoryAdjustments.generated.ts +5 -0
  516. package/src/modules/inventory/query/listInventoryAdjustments.test.ts +89 -0
  517. package/src/modules/inventory/query/listInventoryAdjustments.ts +59 -0
  518. package/src/modules/inventory/query/listInventoryCounts.generated.ts +5 -0
  519. package/src/modules/inventory/query/listInventoryCounts.test.ts +78 -0
  520. package/src/modules/inventory/query/listInventoryCounts.ts +55 -0
  521. package/src/modules/inventory/query/listItemValuations.generated.ts +5 -0
  522. package/src/modules/inventory/query/listItemValuations.test.ts +54 -0
  523. package/src/modules/inventory/query/listItemValuations.ts +39 -0
  524. package/src/modules/inventory/query/listLots.generated.ts +5 -0
  525. package/src/modules/inventory/query/listLots.test.ts +120 -0
  526. package/src/modules/inventory/query/listLots.ts +68 -0
  527. package/src/modules/inventory/query/listSerialNumbers.generated.ts +5 -0
  528. package/src/modules/inventory/query/listSerialNumbers.test.ts +58 -0
  529. package/src/modules/inventory/query/listSerialNumbers.ts +53 -0
  530. package/src/modules/inventory/query/listStockLevels.generated.ts +5 -0
  531. package/src/modules/inventory/query/listStockLevels.test.ts +73 -0
  532. package/src/modules/inventory/query/listStockLevels.ts +79 -0
  533. package/src/modules/inventory/query/listStockMovements.generated.ts +5 -0
  534. package/src/modules/inventory/query/listStockMovements.test.ts +98 -0
  535. package/src/modules/inventory/query/listStockMovements.ts +105 -0
  536. package/src/modules/inventory/query/listStorageLocations.generated.ts +5 -0
  537. package/src/modules/inventory/query/listStorageLocations.test.ts +70 -0
  538. package/src/modules/inventory/query/listStorageLocations.ts +53 -0
  539. package/src/modules/inventory/query/listValuationPolicies.generated.ts +5 -0
  540. package/src/modules/inventory/query/listValuationPolicies.test.ts +38 -0
  541. package/src/modules/inventory/query/listValuationPolicies.ts +39 -0
  542. package/src/modules/inventory/query/listWarehouses.generated.ts +5 -0
  543. package/src/modules/inventory/query/listWarehouses.test.ts +60 -0
  544. package/src/modules/inventory/query/listWarehouses.ts +39 -0
  545. package/src/modules/inventory/query/traceLotBackward.generated.ts +5 -0
  546. package/src/modules/inventory/query/traceLotBackward.test.ts +63 -0
  547. package/src/modules/inventory/query/traceLotBackward.ts +36 -0
  548. package/src/modules/inventory/query/traceLotForward.generated.ts +5 -0
  549. package/src/modules/inventory/query/traceLotForward.test.ts +63 -0
  550. package/src/modules/inventory/query/traceLotForward.ts +36 -0
  551. package/src/modules/inventory/tailor.config.ts +13 -0
  552. package/src/modules/inventory/tailor.d.ts +13 -0
  553. package/src/modules/inventory/testing/commandTestUtils.ts +29 -0
  554. package/src/modules/inventory/testing/fixtures.ts +412 -0
  555. package/src/modules/item-management/command/activateItem.generated.ts +1 -1
  556. package/src/modules/item-management/command/activateItem.ts +1 -1
  557. package/src/modules/item-management/command/assignItemToTaxonomy.generated.ts +1 -1
  558. package/src/modules/item-management/command/assignItemToTaxonomy.ts +1 -1
  559. package/src/modules/item-management/command/createItem.generated.ts +1 -1
  560. package/src/modules/item-management/command/createItem.test.ts +1 -1
  561. package/src/modules/item-management/command/createItem.ts +1 -1
  562. package/src/modules/item-management/command/createTaxonomyNode.generated.ts +1 -1
  563. package/src/modules/item-management/command/createTaxonomyNode.test.ts +1 -1
  564. package/src/modules/item-management/command/createTaxonomyNode.ts +1 -1
  565. package/src/modules/item-management/command/deactivateItem.generated.ts +1 -1
  566. package/src/modules/item-management/command/deactivateItem.ts +1 -1
  567. package/src/modules/item-management/command/deleteItem.generated.ts +1 -1
  568. package/src/modules/item-management/command/deleteItem.ts +1 -1
  569. package/src/modules/item-management/command/deleteTaxonomyNode.generated.ts +1 -1
  570. package/src/modules/item-management/command/deleteTaxonomyNode.ts +1 -1
  571. package/src/modules/item-management/command/moveTaxonomyNode.generated.ts +1 -1
  572. package/src/modules/item-management/command/moveTaxonomyNode.test.ts +1 -1
  573. package/src/modules/item-management/command/moveTaxonomyNode.ts +1 -1
  574. package/src/modules/item-management/command/reactivateItem.generated.ts +1 -1
  575. package/src/modules/item-management/command/reactivateItem.ts +1 -1
  576. package/src/modules/item-management/command/removeItemFromTaxonomy.generated.ts +1 -1
  577. package/src/modules/item-management/command/removeItemFromTaxonomy.ts +1 -1
  578. package/src/modules/item-management/command/updateItem.generated.ts +1 -1
  579. package/src/modules/item-management/command/updateItem.test.ts +1 -1
  580. package/src/modules/item-management/command/updateItem.ts +1 -1
  581. package/src/modules/item-management/command/updateTaxonomyNode.generated.ts +1 -1
  582. package/src/modules/item-management/command/updateTaxonomyNode.ts +1 -1
  583. package/src/modules/item-management/docs/models/{item.md → Item.md} +1 -1
  584. package/src/modules/item-management/lib/errors.generated.ts +1 -1
  585. package/src/modules/item-management/lib/permissions.generated.ts +1 -1
  586. package/src/modules/item-management/lib/types.ts +6 -1
  587. package/src/modules/item-management/module.ts +1 -1
  588. package/src/modules/item-management/query/calculateNodeDepth.generated.ts +1 -1
  589. package/src/modules/item-management/query/calculateNodeDepth.ts +1 -1
  590. package/src/modules/item-management/query/calculateSubtreeDepth.generated.ts +1 -1
  591. package/src/modules/item-management/query/calculateSubtreeDepth.ts +1 -1
  592. package/src/modules/item-management/query/detectCircularReference.generated.ts +1 -1
  593. package/src/modules/item-management/query/detectCircularReference.ts +1 -1
  594. package/src/modules/item-management/query/getItem.generated.ts +1 -1
  595. package/src/modules/item-management/query/getItem.ts +1 -1
  596. package/src/modules/item-management/query/getItemTaxonomyAssignment.generated.ts +1 -1
  597. package/src/modules/item-management/query/getItemTaxonomyAssignment.ts +1 -1
  598. package/src/modules/item-management/query/getTaxonomyNode.generated.ts +1 -1
  599. package/src/modules/item-management/query/getTaxonomyNode.ts +1 -1
  600. package/src/modules/item-management/query/getTaxonomyNodeAssignments.generated.ts +1 -1
  601. package/src/modules/item-management/query/getTaxonomyNodeAssignments.ts +1 -1
  602. package/src/modules/item-management/query/getTaxonomyNodeChildren.generated.ts +1 -1
  603. package/src/modules/item-management/query/getTaxonomyNodeChildren.ts +1 -1
  604. package/src/modules/organization/command/activateCompany.generated.ts +1 -1
  605. package/src/modules/organization/command/activateCompany.test.ts +1 -1
  606. package/src/modules/organization/command/activateCompany.ts +1 -1
  607. package/src/modules/organization/command/createCompany.generated.ts +1 -1
  608. package/src/modules/organization/command/createCompany.test.ts +1 -1
  609. package/src/modules/organization/command/createCompany.ts +1 -1
  610. package/src/modules/organization/command/createDepartment.generated.ts +1 -1
  611. package/src/modules/organization/command/createDepartment.ts +1 -1
  612. package/src/modules/organization/command/createSite.generated.ts +1 -1
  613. package/src/modules/organization/command/createSite.ts +1 -1
  614. package/src/modules/organization/command/deactivateCompany.generated.ts +1 -1
  615. package/src/modules/organization/command/deactivateCompany.ts +1 -1
  616. package/src/modules/organization/command/deactivateDepartment.generated.ts +1 -1
  617. package/src/modules/organization/command/deactivateDepartment.ts +1 -1
  618. package/src/modules/organization/command/deactivateSite.generated.ts +1 -1
  619. package/src/modules/organization/command/deactivateSite.ts +1 -1
  620. package/src/modules/organization/command/deleteCompany.generated.ts +1 -1
  621. package/src/modules/organization/command/deleteCompany.ts +1 -1
  622. package/src/modules/organization/command/reactivateCompany.generated.ts +1 -1
  623. package/src/modules/organization/command/reactivateCompany.ts +1 -1
  624. package/src/modules/organization/command/reactivateDepartment.generated.ts +1 -1
  625. package/src/modules/organization/command/reactivateDepartment.ts +1 -1
  626. package/src/modules/organization/command/reactivateSite.generated.ts +1 -1
  627. package/src/modules/organization/command/reactivateSite.ts +1 -1
  628. package/src/modules/organization/command/updateCompany.generated.ts +1 -1
  629. package/src/modules/organization/command/updateCompany.test.ts +1 -1
  630. package/src/modules/organization/command/updateCompany.ts +1 -1
  631. package/src/modules/organization/command/updateDepartment.generated.ts +1 -1
  632. package/src/modules/organization/command/updateDepartment.ts +1 -1
  633. package/src/modules/organization/command/updateSite.generated.ts +1 -1
  634. package/src/modules/organization/command/updateSite.ts +1 -1
  635. package/src/modules/organization/lib/errors.generated.ts +1 -1
  636. package/src/modules/organization/lib/permissions.generated.ts +1 -1
  637. package/src/modules/organization/lib/types.ts +6 -1
  638. package/src/modules/organization/module.ts +1 -1
  639. package/src/modules/organization/permissions.ts +1 -1
  640. package/src/modules/organization/query/detectDepartmentCircularReference.generated.ts +1 -1
  641. package/src/modules/organization/query/detectDepartmentCircularReference.ts +1 -1
  642. package/src/modules/organization/query/getCompany.generated.ts +1 -1
  643. package/src/modules/organization/query/getCompany.ts +1 -1
  644. package/src/modules/organization/query/getDepartment.generated.ts +1 -1
  645. package/src/modules/organization/query/getDepartment.ts +1 -1
  646. package/src/modules/organization/query/getDepartmentChildren.generated.ts +1 -1
  647. package/src/modules/organization/query/getDepartmentChildren.ts +1 -1
  648. package/src/modules/organization/query/getSite.generated.ts +1 -1
  649. package/src/modules/organization/query/getSite.ts +1 -1
  650. package/src/modules/organization/query/listDepartmentsByCompany.generated.ts +1 -1
  651. package/src/modules/organization/query/listDepartmentsByCompany.ts +2 -2
  652. package/src/modules/organization/query/listSitesByCompany.generated.ts +1 -1
  653. package/src/modules/organization/query/listSitesByCompany.ts +2 -2
  654. package/src/modules/primitives/command/activateCategory.generated.ts +1 -1
  655. package/src/modules/primitives/command/activateCategory.ts +1 -1
  656. package/src/modules/primitives/command/activateCurrency.generated.ts +1 -1
  657. package/src/modules/primitives/command/activateCurrency.ts +1 -1
  658. package/src/modules/primitives/command/activateUnit.generated.ts +1 -1
  659. package/src/modules/primitives/command/activateUnit.ts +1 -1
  660. package/src/modules/primitives/command/createCategory.generated.ts +1 -1
  661. package/src/modules/primitives/command/createCategory.ts +1 -1
  662. package/src/modules/primitives/command/createCurrency.generated.ts +1 -1
  663. package/src/modules/primitives/command/createCurrency.ts +1 -1
  664. package/src/modules/primitives/command/createExchangeRate.generated.ts +1 -1
  665. package/src/modules/primitives/command/createExchangeRate.ts +1 -1
  666. package/src/modules/primitives/command/createUnit.generated.ts +1 -1
  667. package/src/modules/primitives/command/createUnit.ts +1 -1
  668. package/src/modules/primitives/command/deactivateCategory.generated.ts +1 -1
  669. package/src/modules/primitives/command/deactivateCategory.ts +1 -1
  670. package/src/modules/primitives/command/deactivateCurrency.generated.ts +1 -1
  671. package/src/modules/primitives/command/deactivateCurrency.ts +1 -1
  672. package/src/modules/primitives/command/deactivateUnit.generated.ts +1 -1
  673. package/src/modules/primitives/command/deactivateUnit.ts +1 -1
  674. package/src/modules/primitives/command/setBaseCurrency.generated.ts +1 -1
  675. package/src/modules/primitives/command/setBaseCurrency.ts +1 -1
  676. package/src/modules/primitives/command/setReferenceUnit.generated.ts +1 -1
  677. package/src/modules/primitives/command/setReferenceUnit.ts +1 -1
  678. package/src/modules/primitives/lib/errors.generated.ts +1 -1
  679. package/src/modules/primitives/lib/permissions.generated.ts +1 -1
  680. package/src/modules/primitives/lib/types.ts +6 -1
  681. package/src/modules/primitives/module.ts +1 -1
  682. package/src/modules/primitives/query/convertAmount.generated.ts +1 -1
  683. package/src/modules/primitives/query/convertAmount.test.ts +1 -1
  684. package/src/modules/primitives/query/convertAmount.ts +1 -1
  685. package/src/modules/primitives/query/convertQuantity.generated.ts +1 -1
  686. package/src/modules/primitives/query/convertQuantity.test.ts +1 -1
  687. package/src/modules/primitives/query/convertQuantity.ts +1 -1
  688. package/src/modules/primitives/query/getBaseCurrency.generated.ts +1 -1
  689. package/src/modules/primitives/query/getBaseCurrency.test.ts +1 -1
  690. package/src/modules/primitives/query/getBaseCurrency.ts +1 -1
  691. package/src/modules/primitives/query/getCurrency.generated.ts +1 -1
  692. package/src/modules/primitives/query/getCurrency.ts +1 -1
  693. package/src/modules/primitives/query/getUnit.generated.ts +1 -1
  694. package/src/modules/primitives/query/getUnit.ts +1 -1
  695. package/src/modules/primitives/query/getUoMCategory.generated.ts +1 -1
  696. package/src/modules/primitives/query/getUoMCategory.ts +1 -1
  697. package/src/modules/primitives/query/listUnitsByCategory.generated.ts +1 -1
  698. package/src/modules/primitives/query/listUnitsByCategory.ts +2 -2
  699. package/src/modules/primitives/seed/currencies.ts +22 -0
  700. package/src/modules/primitives/seed/exchangeRates.ts +22 -0
  701. package/src/modules/primitives/seed/index.ts +4 -0
  702. package/src/modules/primitives/seed/seed.test.ts +80 -0
  703. package/src/modules/primitives/seed/units.ts +62 -0
  704. package/src/modules/primitives/seed/uomCategories.ts +24 -0
  705. package/src/modules/product-management/command/activateProduct.generated.ts +1 -1
  706. package/src/modules/product-management/command/activateProduct.ts +1 -1
  707. package/src/modules/product-management/command/assignProductToCategory.generated.ts +1 -1
  708. package/src/modules/product-management/command/assignProductToCategory.ts +1 -1
  709. package/src/modules/product-management/command/createProduct.generated.ts +1 -1
  710. package/src/modules/product-management/command/createProduct.test.ts +1 -1
  711. package/src/modules/product-management/command/createProduct.ts +1 -1
  712. package/src/modules/product-management/command/createProductAttribute.generated.ts +1 -1
  713. package/src/modules/product-management/command/createProductAttribute.ts +1 -1
  714. package/src/modules/product-management/command/createProductAttributeValue.generated.ts +1 -1
  715. package/src/modules/product-management/command/createProductAttributeValue.ts +1 -1
  716. package/src/modules/product-management/command/createProductCategory.generated.ts +1 -1
  717. package/src/modules/product-management/command/createProductCategory.test.ts +1 -1
  718. package/src/modules/product-management/command/createProductCategory.ts +1 -1
  719. package/src/modules/product-management/command/deactivateProduct.generated.ts +1 -1
  720. package/src/modules/product-management/command/deactivateProduct.ts +1 -1
  721. package/src/modules/product-management/command/deleteProduct.generated.ts +1 -1
  722. package/src/modules/product-management/command/deleteProduct.ts +1 -1
  723. package/src/modules/product-management/command/deleteProductAttribute.generated.ts +1 -1
  724. package/src/modules/product-management/command/deleteProductAttribute.ts +1 -1
  725. package/src/modules/product-management/command/deleteProductAttributeValue.generated.ts +1 -1
  726. package/src/modules/product-management/command/deleteProductAttributeValue.ts +1 -1
  727. package/src/modules/product-management/command/deleteProductCategory.generated.ts +1 -1
  728. package/src/modules/product-management/command/deleteProductCategory.ts +1 -1
  729. package/src/modules/product-management/command/generateVariants.generated.ts +1 -1
  730. package/src/modules/product-management/command/generateVariants.test.ts +1 -1
  731. package/src/modules/product-management/command/generateVariants.ts +1 -1
  732. package/src/modules/product-management/command/moveProductCategory.generated.ts +1 -1
  733. package/src/modules/product-management/command/moveProductCategory.test.ts +1 -1
  734. package/src/modules/product-management/command/moveProductCategory.ts +1 -1
  735. package/src/modules/product-management/command/reactivateProduct.generated.ts +1 -1
  736. package/src/modules/product-management/command/reactivateProduct.ts +1 -1
  737. package/src/modules/product-management/command/removeProductFromCategory.generated.ts +1 -1
  738. package/src/modules/product-management/command/removeProductFromCategory.ts +1 -1
  739. package/src/modules/product-management/command/setProductAttributeAssignment.generated.ts +1 -1
  740. package/src/modules/product-management/command/setProductAttributeAssignment.ts +1 -1
  741. package/src/modules/product-management/command/updateProduct.generated.ts +1 -1
  742. package/src/modules/product-management/command/updateProduct.test.ts +1 -1
  743. package/src/modules/product-management/command/updateProduct.ts +1 -1
  744. package/src/modules/product-management/command/updateProductAttribute.generated.ts +1 -1
  745. package/src/modules/product-management/command/updateProductAttribute.ts +1 -1
  746. package/src/modules/product-management/command/updateProductAttributeValue.generated.ts +1 -1
  747. package/src/modules/product-management/command/updateProductAttributeValue.ts +1 -1
  748. package/src/modules/product-management/command/updateProductCategory.generated.ts +1 -1
  749. package/src/modules/product-management/command/updateProductCategory.ts +1 -1
  750. package/src/modules/product-management/lib/errors.generated.ts +1 -1
  751. package/src/modules/product-management/lib/permissions.generated.ts +1 -1
  752. package/src/modules/product-management/lib/types.ts +6 -1
  753. package/src/modules/product-management/module.ts +1 -1
  754. package/src/modules/product-management/query/calculateCategoryDepth.generated.ts +1 -1
  755. package/src/modules/product-management/query/calculateCategoryDepth.ts +1 -1
  756. package/src/modules/product-management/query/detectCategoryCircularReference.generated.ts +1 -1
  757. package/src/modules/product-management/query/detectCategoryCircularReference.ts +1 -1
  758. package/src/modules/product-management/query/getProduct.generated.ts +1 -1
  759. package/src/modules/product-management/query/getProduct.ts +1 -1
  760. package/src/modules/product-management/query/getProductAttribute.generated.ts +1 -1
  761. package/src/modules/product-management/query/getProductAttribute.ts +1 -1
  762. package/src/modules/product-management/query/getProductAttributeAssignment.generated.ts +1 -1
  763. package/src/modules/product-management/query/getProductAttributeAssignment.ts +1 -1
  764. package/src/modules/product-management/query/getProductAttributeValue.generated.ts +1 -1
  765. package/src/modules/product-management/query/getProductAttributeValue.ts +1 -1
  766. package/src/modules/product-management/query/getProductCategory.generated.ts +1 -1
  767. package/src/modules/product-management/query/getProductCategory.ts +1 -1
  768. package/src/modules/product-management/query/getProductCategoryAssignment.generated.ts +1 -1
  769. package/src/modules/product-management/query/getProductCategoryAssignment.ts +1 -1
  770. package/src/modules/product-management/query/getProductVariant.generated.ts +1 -1
  771. package/src/modules/product-management/query/getProductVariant.ts +1 -1
  772. package/src/modules/product-management/query/listAttributeAssignmentsByAttribute.generated.ts +1 -1
  773. package/src/modules/product-management/query/listAttributeAssignmentsByAttribute.ts +1 -1
  774. package/src/modules/product-management/query/listCategoryAssignmentsByProduct.generated.ts +1 -1
  775. package/src/modules/product-management/query/listCategoryAssignmentsByProduct.ts +1 -1
  776. package/src/modules/product-management/query/listProductAttributeAssignments.generated.ts +1 -1
  777. package/src/modules/product-management/query/listProductAttributeAssignments.ts +1 -1
  778. package/src/modules/product-management/query/listProductAttributeValues.generated.ts +1 -1
  779. package/src/modules/product-management/query/listProductAttributeValues.ts +1 -1
  780. package/src/modules/product-management/query/listProductCategoryAssignments.generated.ts +1 -1
  781. package/src/modules/product-management/query/listProductCategoryAssignments.ts +1 -1
  782. package/src/modules/product-management/query/listProductCategoryChildren.generated.ts +1 -1
  783. package/src/modules/product-management/query/listProductCategoryChildren.ts +1 -1
  784. package/src/modules/product-management/query/listProductVariants.generated.ts +1 -1
  785. package/src/modules/product-management/query/listProductVariants.ts +1 -1
  786. package/src/modules/purchase/README.md +63 -0
  787. package/src/modules/purchase/command/.gitkeep +0 -0
  788. package/src/modules/purchase/command/activatePurchasePaymentTerm.generated.ts +6 -0
  789. package/src/modules/purchase/command/activatePurchasePaymentTerm.test.ts +53 -0
  790. package/src/modules/purchase/command/activatePurchasePaymentTerm.ts +39 -0
  791. package/src/modules/purchase/command/activatePurchasePriceList.generated.ts +6 -0
  792. package/src/modules/purchase/command/activatePurchasePriceList.test.ts +39 -0
  793. package/src/modules/purchase/command/activatePurchasePriceList.ts +32 -0
  794. package/src/modules/purchase/command/activatePurchasePriceRule.generated.ts +6 -0
  795. package/src/modules/purchase/command/activatePurchasePriceRule.test.ts +133 -0
  796. package/src/modules/purchase/command/activatePurchasePriceRule.ts +75 -0
  797. package/src/modules/purchase/command/approvePurchaseOrder.generated.ts +6 -0
  798. package/src/modules/purchase/command/approvePurchaseOrder.test.ts +161 -0
  799. package/src/modules/purchase/command/approvePurchaseOrder.ts +89 -0
  800. package/src/modules/purchase/command/cancelGoodsReceipt.generated.ts +6 -0
  801. package/src/modules/purchase/command/cancelGoodsReceipt.test.ts +37 -0
  802. package/src/modules/purchase/command/cancelGoodsReceipt.ts +29 -0
  803. package/src/modules/purchase/command/cancelPurchaseBill.generated.ts +6 -0
  804. package/src/modules/purchase/command/cancelPurchaseBill.test.ts +101 -0
  805. package/src/modules/purchase/command/cancelPurchaseBill.ts +84 -0
  806. package/src/modules/purchase/command/cancelPurchaseOrder.generated.ts +6 -0
  807. package/src/modules/purchase/command/cancelPurchaseOrder.test.ts +119 -0
  808. package/src/modules/purchase/command/cancelPurchaseOrder.ts +65 -0
  809. package/src/modules/purchase/command/closePurchaseOrder.generated.ts +6 -0
  810. package/src/modules/purchase/command/closePurchaseOrder.test.ts +128 -0
  811. package/src/modules/purchase/command/closePurchaseOrder.ts +58 -0
  812. package/src/modules/purchase/command/createGoodsReceipt.generated.ts +6 -0
  813. package/src/modules/purchase/command/createGoodsReceipt.test.ts +233 -0
  814. package/src/modules/purchase/command/createGoodsReceipt.ts +93 -0
  815. package/src/modules/purchase/command/createPurchaseBill.generated.ts +6 -0
  816. package/src/modules/purchase/command/createPurchaseBill.test.ts +277 -0
  817. package/src/modules/purchase/command/createPurchaseBill.ts +107 -0
  818. package/src/modules/purchase/command/createPurchaseOrder.generated.ts +6 -0
  819. package/src/modules/purchase/command/createPurchaseOrder.test.ts +291 -0
  820. package/src/modules/purchase/command/createPurchaseOrder.ts +131 -0
  821. package/src/modules/purchase/command/createPurchasePaymentTerm.generated.ts +6 -0
  822. package/src/modules/purchase/command/createPurchasePaymentTerm.test.ts +140 -0
  823. package/src/modules/purchase/command/createPurchasePaymentTerm.ts +66 -0
  824. package/src/modules/purchase/command/createPurchasePriceList.generated.ts +6 -0
  825. package/src/modules/purchase/command/createPurchasePriceList.test.ts +108 -0
  826. package/src/modules/purchase/command/createPurchasePriceList.ts +63 -0
  827. package/src/modules/purchase/command/createPurchasePriceRule.generated.ts +6 -0
  828. package/src/modules/purchase/command/createPurchasePriceRule.test.ts +139 -0
  829. package/src/modules/purchase/command/createPurchasePriceRule.ts +95 -0
  830. package/src/modules/purchase/command/deactivatePurchasePaymentTerm.generated.ts +6 -0
  831. package/src/modules/purchase/command/deactivatePurchasePaymentTerm.test.ts +49 -0
  832. package/src/modules/purchase/command/deactivatePurchasePaymentTerm.ts +41 -0
  833. package/src/modules/purchase/command/deactivatePurchasePriceList.generated.ts +6 -0
  834. package/src/modules/purchase/command/deactivatePurchasePriceList.test.ts +50 -0
  835. package/src/modules/purchase/command/deactivatePurchasePriceList.ts +32 -0
  836. package/src/modules/purchase/command/deactivatePurchasePriceRule.generated.ts +6 -0
  837. package/src/modules/purchase/command/deactivatePurchasePriceRule.test.ts +50 -0
  838. package/src/modules/purchase/command/deactivatePurchasePriceRule.ts +32 -0
  839. package/src/modules/purchase/command/matchPurchaseBill.generated.ts +6 -0
  840. package/src/modules/purchase/command/matchPurchaseBill.test.ts +188 -0
  841. package/src/modules/purchase/command/matchPurchaseBill.ts +146 -0
  842. package/src/modules/purchase/command/postGoodsReceipt.generated.ts +6 -0
  843. package/src/modules/purchase/command/postGoodsReceipt.test.ts +210 -0
  844. package/src/modules/purchase/command/postGoodsReceipt.ts +143 -0
  845. package/src/modules/purchase/command/rejectPurchaseOrder.generated.ts +6 -0
  846. package/src/modules/purchase/command/rejectPurchaseOrder.test.ts +79 -0
  847. package/src/modules/purchase/command/rejectPurchaseOrder.ts +41 -0
  848. package/src/modules/purchase/command/releasePurchaseBill.generated.ts +6 -0
  849. package/src/modules/purchase/command/releasePurchaseBill.test.ts +94 -0
  850. package/src/modules/purchase/command/releasePurchaseBill.ts +111 -0
  851. package/src/modules/purchase/command/setSupplierDefaultPurchasePaymentTerm.generated.ts +6 -0
  852. package/src/modules/purchase/command/setSupplierDefaultPurchasePaymentTerm.test.ts +171 -0
  853. package/src/modules/purchase/command/setSupplierDefaultPurchasePaymentTerm.ts +90 -0
  854. package/src/modules/purchase/command/submitPurchaseOrder.generated.ts +6 -0
  855. package/src/modules/purchase/command/submitPurchaseOrder.test.ts +98 -0
  856. package/src/modules/purchase/command/submitPurchaseOrder.ts +73 -0
  857. package/src/modules/purchase/command/updateGoodsReceipt.generated.ts +6 -0
  858. package/src/modules/purchase/command/updateGoodsReceipt.test.ts +115 -0
  859. package/src/modules/purchase/command/updateGoodsReceipt.ts +73 -0
  860. package/src/modules/purchase/command/updatePurchaseBill.generated.ts +6 -0
  861. package/src/modules/purchase/command/updatePurchaseBill.test.ts +137 -0
  862. package/src/modules/purchase/command/updatePurchaseBill.ts +89 -0
  863. package/src/modules/purchase/command/updatePurchaseOrder.generated.ts +6 -0
  864. package/src/modules/purchase/command/updatePurchaseOrder.test.ts +195 -0
  865. package/src/modules/purchase/command/updatePurchaseOrder.ts +121 -0
  866. package/src/modules/purchase/command/updatePurchasePaymentTerm.generated.ts +6 -0
  867. package/src/modules/purchase/command/updatePurchasePaymentTerm.test.ts +154 -0
  868. package/src/modules/purchase/command/updatePurchasePaymentTerm.ts +73 -0
  869. package/src/modules/purchase/command/updatePurchasePriceList.generated.ts +6 -0
  870. package/src/modules/purchase/command/updatePurchasePriceList.test.ts +73 -0
  871. package/src/modules/purchase/command/updatePurchasePriceList.ts +55 -0
  872. package/src/modules/purchase/command/updatePurchasePriceRule.generated.ts +6 -0
  873. package/src/modules/purchase/command/updatePurchasePriceRule.test.ts +191 -0
  874. package/src/modules/purchase/command/updatePurchasePriceRule.ts +104 -0
  875. package/src/modules/purchase/db/.gitkeep +0 -0
  876. package/src/modules/purchase/db/goodsReceipt.ts +62 -0
  877. package/src/modules/purchase/db/purchaseBill.ts +74 -0
  878. package/src/modules/purchase/db/purchaseOrder.ts +100 -0
  879. package/src/modules/purchase/db/purchasePaymentTerm.ts +46 -0
  880. package/src/modules/purchase/db/purchasePriceList.ts +53 -0
  881. package/src/modules/purchase/db/purchasePriceRule.ts +74 -0
  882. package/src/modules/purchase/db/supplierProfile.ts +59 -0
  883. package/src/modules/purchase/docs/commands/ActivatePurchasePaymentTerm.md +39 -0
  884. package/src/modules/purchase/docs/commands/ActivatePurchasePriceList.md +37 -0
  885. package/src/modules/purchase/docs/commands/ActivatePurchasePriceRule.md +47 -0
  886. package/src/modules/purchase/docs/commands/ApprovePurchaseOrder.md +55 -0
  887. package/src/modules/purchase/docs/commands/CancelGoodsReceipt.md +39 -0
  888. package/src/modules/purchase/docs/commands/CancelPurchaseBill.md +49 -0
  889. package/src/modules/purchase/docs/commands/CancelPurchaseOrder.md +47 -0
  890. package/src/modules/purchase/docs/commands/ClosePurchaseOrder.md +49 -0
  891. package/src/modules/purchase/docs/commands/CreateGoodsReceipt.md +54 -0
  892. package/src/modules/purchase/docs/commands/CreatePurchaseBill.md +59 -0
  893. package/src/modules/purchase/docs/commands/CreatePurchaseOrder.md +66 -0
  894. package/src/modules/purchase/docs/commands/CreatePurchasePaymentTerm.md +52 -0
  895. package/src/modules/purchase/docs/commands/CreatePurchasePriceList.md +48 -0
  896. package/src/modules/purchase/docs/commands/CreatePurchasePriceRule.md +62 -0
  897. package/src/modules/purchase/docs/commands/DeactivatePurchasePaymentTerm.md +42 -0
  898. package/src/modules/purchase/docs/commands/DeactivatePurchasePriceList.md +39 -0
  899. package/src/modules/purchase/docs/commands/DeactivatePurchasePriceRule.md +39 -0
  900. package/src/modules/purchase/docs/commands/MatchPurchaseBill.md +63 -0
  901. package/src/modules/purchase/docs/commands/PostGoodsReceipt.md +61 -0
  902. package/src/modules/purchase/docs/commands/RejectPurchaseOrder.md +44 -0
  903. package/src/modules/purchase/docs/commands/ReleasePurchaseBill.md +48 -0
  904. package/src/modules/purchase/docs/commands/SetSupplierDefaultPurchasePaymentTerm.md +50 -0
  905. package/src/modules/purchase/docs/commands/SubmitPurchaseOrder.md +51 -0
  906. package/src/modules/purchase/docs/commands/UpdateGoodsReceipt.md +48 -0
  907. package/src/modules/purchase/docs/commands/UpdatePurchaseBill.md +51 -0
  908. package/src/modules/purchase/docs/commands/UpdatePurchaseOrder.md +59 -0
  909. package/src/modules/purchase/docs/commands/UpdatePurchasePaymentTerm.md +51 -0
  910. package/src/modules/purchase/docs/commands/UpdatePurchasePriceList.md +43 -0
  911. package/src/modules/purchase/docs/commands/UpdatePurchasePriceRule.md +60 -0
  912. package/src/modules/purchase/docs/features/goods-receipt-matching.md +71 -0
  913. package/src/modules/purchase/docs/features/purchase-order-lifecycle.md +87 -0
  914. package/src/modules/purchase/docs/features/purchase-payment-terms.md +67 -0
  915. package/src/modules/purchase/docs/features/supplier-bill-matching.md +79 -0
  916. package/src/modules/purchase/docs/features/supplier-purchase-pricing.md +72 -0
  917. package/src/modules/purchase/docs/models/GoodsReceipt.md +58 -0
  918. package/src/modules/purchase/docs/models/PurchaseBill.md +68 -0
  919. package/src/modules/purchase/docs/models/PurchaseOrder.md +88 -0
  920. package/src/modules/purchase/docs/models/PurchasePaymentTerm.md +59 -0
  921. package/src/modules/purchase/docs/models/PurchasePriceList.md +53 -0
  922. package/src/modules/purchase/docs/models/PurchasePriceRule.md +58 -0
  923. package/src/modules/purchase/docs/models/SupplierProfile.md +37 -0
  924. package/src/modules/purchase/docs/queries/CalculatePurchaseBillDueSchedule.md +47 -0
  925. package/src/modules/purchase/docs/queries/CalculatePurchasePrice.md +53 -0
  926. package/src/modules/purchase/docs/queries/GetGoodsReceipt.md +36 -0
  927. package/src/modules/purchase/docs/queries/GetPurchaseBill.md +41 -0
  928. package/src/modules/purchase/docs/queries/GetPurchaseOrder.md +42 -0
  929. package/src/modules/purchase/docs/queries/GetPurchasePaymentTerm.md +36 -0
  930. package/src/modules/purchase/docs/queries/GetPurchasePriceList.md +36 -0
  931. package/src/modules/purchase/docs/queries/GetSupplierProfile.md +36 -0
  932. package/src/modules/purchase/executor/.gitkeep +0 -0
  933. package/src/modules/purchase/generated/.gitkeep +0 -0
  934. package/src/modules/purchase/generated/enums.ts +63 -0
  935. package/src/modules/purchase/generated/kysely-tailordb.ts +186 -0
  936. package/src/modules/purchase/index.ts +2 -0
  937. package/src/modules/purchase/lib/_db_deps.ts +77 -0
  938. package/src/modules/purchase/lib/domain.ts +467 -0
  939. package/src/modules/purchase/lib/errors.generated.ts +367 -0
  940. package/src/modules/purchase/lib/permissions.generated.ts +34 -0
  941. package/src/modules/purchase/lib/types.ts +65 -0
  942. package/src/modules/purchase/module.ts +218 -0
  943. package/src/modules/purchase/permissions.ts +1 -0
  944. package/src/modules/purchase/query/.gitkeep +0 -0
  945. package/src/modules/purchase/query/calculatePurchaseBillDueSchedule.generated.ts +5 -0
  946. package/src/modules/purchase/query/calculatePurchaseBillDueSchedule.test.ts +183 -0
  947. package/src/modules/purchase/query/calculatePurchaseBillDueSchedule.ts +41 -0
  948. package/src/modules/purchase/query/calculatePurchasePrice.generated.ts +5 -0
  949. package/src/modules/purchase/query/calculatePurchasePrice.test.ts +143 -0
  950. package/src/modules/purchase/query/calculatePurchasePrice.ts +113 -0
  951. package/src/modules/purchase/query/getGoodsReceipt.generated.ts +5 -0
  952. package/src/modules/purchase/query/getGoodsReceipt.test.ts +42 -0
  953. package/src/modules/purchase/query/getGoodsReceipt.ts +27 -0
  954. package/src/modules/purchase/query/getPurchaseBill.generated.ts +5 -0
  955. package/src/modules/purchase/query/getPurchaseBill.test.ts +69 -0
  956. package/src/modules/purchase/query/getPurchaseBill.ts +35 -0
  957. package/src/modules/purchase/query/getPurchaseOrder.generated.ts +5 -0
  958. package/src/modules/purchase/query/getPurchaseOrder.test.ts +65 -0
  959. package/src/modules/purchase/query/getPurchaseOrder.ts +33 -0
  960. package/src/modules/purchase/query/getPurchasePaymentTerm.generated.ts +5 -0
  961. package/src/modules/purchase/query/getPurchasePaymentTerm.test.ts +44 -0
  962. package/src/modules/purchase/query/getPurchasePaymentTerm.ts +30 -0
  963. package/src/modules/purchase/query/getPurchasePriceList.generated.ts +5 -0
  964. package/src/modules/purchase/query/getPurchasePriceList.test.ts +48 -0
  965. package/src/modules/purchase/query/getPurchasePriceList.ts +30 -0
  966. package/src/modules/purchase/query/getSupplierProfile.generated.ts +5 -0
  967. package/src/modules/purchase/query/getSupplierProfile.test.ts +50 -0
  968. package/src/modules/purchase/query/getSupplierProfile.ts +18 -0
  969. package/src/modules/purchase/tailor.config.ts +13 -0
  970. package/src/modules/purchase/tailor.d.ts +13 -0
  971. package/src/modules/purchase/testing/commandTestUtils.ts +35 -0
  972. package/src/modules/purchase/testing/fixtures.ts +317 -0
  973. package/src/modules/sales/README.md +69 -0
  974. package/src/modules/sales/command/.gitkeep +0 -0
  975. package/src/modules/sales/command/activateChannel.generated.ts +6 -0
  976. package/src/modules/sales/command/activateChannel.test.ts +70 -0
  977. package/src/modules/sales/command/activateChannel.ts +48 -0
  978. package/src/modules/sales/command/activateListing.generated.ts +6 -0
  979. package/src/modules/sales/command/activateListing.test.ts +87 -0
  980. package/src/modules/sales/command/activateListing.ts +49 -0
  981. package/src/modules/sales/command/activateSalesPaymentTerm.generated.ts +6 -0
  982. package/src/modules/sales/command/activateSalesPaymentTerm.test.ts +58 -0
  983. package/src/modules/sales/command/activateSalesPaymentTerm.ts +50 -0
  984. package/src/modules/sales/command/activateSalesPriceList.generated.ts +6 -0
  985. package/src/modules/sales/command/activateSalesPriceList.test.ts +55 -0
  986. package/src/modules/sales/command/activateSalesPriceList.ts +46 -0
  987. package/src/modules/sales/command/activateSalesPriceRule.generated.ts +6 -0
  988. package/src/modules/sales/command/activateSalesPriceRule.test.ts +83 -0
  989. package/src/modules/sales/command/activateSalesPriceRule.ts +58 -0
  990. package/src/modules/sales/command/cancelChannelOrder.generated.ts +6 -0
  991. package/src/modules/sales/command/cancelChannelOrder.test.ts +47 -0
  992. package/src/modules/sales/command/cancelChannelOrder.ts +30 -0
  993. package/src/modules/sales/command/cancelSalesInvoice.generated.ts +6 -0
  994. package/src/modules/sales/command/cancelSalesInvoice.test.ts +47 -0
  995. package/src/modules/sales/command/cancelSalesInvoice.ts +37 -0
  996. package/src/modules/sales/command/cancelSalesOrder.generated.ts +6 -0
  997. package/src/modules/sales/command/cancelSalesOrder.test.ts +70 -0
  998. package/src/modules/sales/command/cancelSalesOrder.ts +48 -0
  999. package/src/modules/sales/command/cancelSyncJob.generated.ts +6 -0
  1000. package/src/modules/sales/command/cancelSyncJob.test.ts +58 -0
  1001. package/src/modules/sales/command/cancelSyncJob.ts +30 -0
  1002. package/src/modules/sales/command/closeSalesOrder.generated.ts +6 -0
  1003. package/src/modules/sales/command/closeSalesOrder.test.ts +41 -0
  1004. package/src/modules/sales/command/closeSalesOrder.ts +51 -0
  1005. package/src/modules/sales/command/confirmSalesOrder.generated.ts +6 -0
  1006. package/src/modules/sales/command/confirmSalesOrder.test.ts +68 -0
  1007. package/src/modules/sales/command/confirmSalesOrder.ts +67 -0
  1008. package/src/modules/sales/command/convertChannelOrder.generated.ts +6 -0
  1009. package/src/modules/sales/command/convertChannelOrder.test.ts +118 -0
  1010. package/src/modules/sales/command/convertChannelOrder.ts +151 -0
  1011. package/src/modules/sales/command/createChannel.generated.ts +6 -0
  1012. package/src/modules/sales/command/createChannel.test.ts +100 -0
  1013. package/src/modules/sales/command/createChannel.ts +58 -0
  1014. package/src/modules/sales/command/createListing.generated.ts +6 -0
  1015. package/src/modules/sales/command/createListing.test.ts +88 -0
  1016. package/src/modules/sales/command/createListing.ts +76 -0
  1017. package/src/modules/sales/command/createSalesCreditNote.generated.ts +6 -0
  1018. package/src/modules/sales/command/createSalesCreditNote.test.ts +56 -0
  1019. package/src/modules/sales/command/createSalesCreditNote.ts +75 -0
  1020. package/src/modules/sales/command/createSalesInvoice.generated.ts +6 -0
  1021. package/src/modules/sales/command/createSalesInvoice.test.ts +85 -0
  1022. package/src/modules/sales/command/createSalesInvoice.ts +94 -0
  1023. package/src/modules/sales/command/createSalesOrder.generated.ts +6 -0
  1024. package/src/modules/sales/command/createSalesOrder.test.ts +134 -0
  1025. package/src/modules/sales/command/createSalesOrder.ts +140 -0
  1026. package/src/modules/sales/command/createSalesPaymentTerm.generated.ts +6 -0
  1027. package/src/modules/sales/command/createSalesPaymentTerm.test.ts +59 -0
  1028. package/src/modules/sales/command/createSalesPaymentTerm.ts +50 -0
  1029. package/src/modules/sales/command/createSalesPriceList.generated.ts +6 -0
  1030. package/src/modules/sales/command/createSalesPriceList.test.ts +67 -0
  1031. package/src/modules/sales/command/createSalesPriceList.ts +45 -0
  1032. package/src/modules/sales/command/createSalesPriceRule.generated.ts +6 -0
  1033. package/src/modules/sales/command/createSalesPriceRule.test.ts +137 -0
  1034. package/src/modules/sales/command/createSalesPriceRule.ts +66 -0
  1035. package/src/modules/sales/command/createShipment.generated.ts +6 -0
  1036. package/src/modules/sales/command/createShipment.test.ts +75 -0
  1037. package/src/modules/sales/command/createShipment.ts +86 -0
  1038. package/src/modules/sales/command/deactivateChannel.generated.ts +6 -0
  1039. package/src/modules/sales/command/deactivateChannel.test.ts +29 -0
  1040. package/src/modules/sales/command/deactivateChannel.ts +30 -0
  1041. package/src/modules/sales/command/deactivateSalesPaymentTerm.generated.ts +6 -0
  1042. package/src/modules/sales/command/deactivateSalesPaymentTerm.test.ts +29 -0
  1043. package/src/modules/sales/command/deactivateSalesPaymentTerm.ts +37 -0
  1044. package/src/modules/sales/command/deactivateSalesPriceList.generated.ts +6 -0
  1045. package/src/modules/sales/command/deactivateSalesPriceList.test.ts +33 -0
  1046. package/src/modules/sales/command/deactivateSalesPriceList.ts +37 -0
  1047. package/src/modules/sales/command/deactivateSalesPriceRule.generated.ts +6 -0
  1048. package/src/modules/sales/command/deactivateSalesPriceRule.test.ts +33 -0
  1049. package/src/modules/sales/command/deactivateSalesPriceRule.ts +37 -0
  1050. package/src/modules/sales/command/issueSalesCreditNote.generated.ts +6 -0
  1051. package/src/modules/sales/command/issueSalesCreditNote.test.ts +62 -0
  1052. package/src/modules/sales/command/issueSalesCreditNote.ts +71 -0
  1053. package/src/modules/sales/command/issueSalesInvoice.generated.ts +6 -0
  1054. package/src/modules/sales/command/issueSalesInvoice.test.ts +88 -0
  1055. package/src/modules/sales/command/issueSalesInvoice.ts +115 -0
  1056. package/src/modules/sales/command/markChannelOrderException.generated.ts +6 -0
  1057. package/src/modules/sales/command/markChannelOrderException.test.ts +59 -0
  1058. package/src/modules/sales/command/markChannelOrderException.ts +49 -0
  1059. package/src/modules/sales/command/pauseListing.generated.ts +6 -0
  1060. package/src/modules/sales/command/pauseListing.test.ts +40 -0
  1061. package/src/modules/sales/command/pauseListing.ts +30 -0
  1062. package/src/modules/sales/command/placeSalesOrderOnCreditHold.generated.ts +6 -0
  1063. package/src/modules/sales/command/placeSalesOrderOnCreditHold.test.ts +74 -0
  1064. package/src/modules/sales/command/placeSalesOrderOnCreditHold.ts +46 -0
  1065. package/src/modules/sales/command/postShipment.generated.ts +6 -0
  1066. package/src/modules/sales/command/postShipment.test.ts +97 -0
  1067. package/src/modules/sales/command/postShipment.ts +89 -0
  1068. package/src/modules/sales/command/recordChannelOrder.generated.ts +6 -0
  1069. package/src/modules/sales/command/recordChannelOrder.test.ts +124 -0
  1070. package/src/modules/sales/command/recordChannelOrder.ts +93 -0
  1071. package/src/modules/sales/command/rejectSalesOrder.generated.ts +6 -0
  1072. package/src/modules/sales/command/rejectSalesOrder.test.ts +78 -0
  1073. package/src/modules/sales/command/rejectSalesOrder.ts +42 -0
  1074. package/src/modules/sales/command/releaseSalesOrderCreditHold.generated.ts +6 -0
  1075. package/src/modules/sales/command/releaseSalesOrderCreditHold.test.ts +50 -0
  1076. package/src/modules/sales/command/releaseSalesOrderCreditHold.ts +51 -0
  1077. package/src/modules/sales/command/retireListing.generated.ts +6 -0
  1078. package/src/modules/sales/command/retireListing.test.ts +42 -0
  1079. package/src/modules/sales/command/retireListing.ts +30 -0
  1080. package/src/modules/sales/command/retrySyncJob.generated.ts +6 -0
  1081. package/src/modules/sales/command/retrySyncJob.test.ts +54 -0
  1082. package/src/modules/sales/command/retrySyncJob.ts +44 -0
  1083. package/src/modules/sales/command/sendSalesInvoice.generated.ts +6 -0
  1084. package/src/modules/sales/command/sendSalesInvoice.test.ts +50 -0
  1085. package/src/modules/sales/command/sendSalesInvoice.ts +43 -0
  1086. package/src/modules/sales/command/startSyncJob.generated.ts +6 -0
  1087. package/src/modules/sales/command/startSyncJob.test.ts +65 -0
  1088. package/src/modules/sales/command/startSyncJob.ts +54 -0
  1089. package/src/modules/sales/command/submitSalesOrder.generated.ts +6 -0
  1090. package/src/modules/sales/command/submitSalesOrder.test.ts +58 -0
  1091. package/src/modules/sales/command/submitSalesOrder.ts +49 -0
  1092. package/src/modules/sales/command/updateChannel.generated.ts +6 -0
  1093. package/src/modules/sales/command/updateChannel.test.ts +71 -0
  1094. package/src/modules/sales/command/updateChannel.ts +68 -0
  1095. package/src/modules/sales/command/updateListing.generated.ts +6 -0
  1096. package/src/modules/sales/command/updateListing.test.ts +56 -0
  1097. package/src/modules/sales/command/updateListing.ts +60 -0
  1098. package/src/modules/sales/command/updateSalesCreditNote.generated.ts +6 -0
  1099. package/src/modules/sales/command/updateSalesCreditNote.test.ts +68 -0
  1100. package/src/modules/sales/command/updateSalesCreditNote.ts +68 -0
  1101. package/src/modules/sales/command/updateSalesInvoice.generated.ts +6 -0
  1102. package/src/modules/sales/command/updateSalesInvoice.test.ts +73 -0
  1103. package/src/modules/sales/command/updateSalesInvoice.ts +80 -0
  1104. package/src/modules/sales/command/updateSalesOrder.generated.ts +6 -0
  1105. package/src/modules/sales/command/updateSalesOrder.test.ts +93 -0
  1106. package/src/modules/sales/command/updateSalesOrder.ts +121 -0
  1107. package/src/modules/sales/command/updateSalesPaymentTerm.generated.ts +6 -0
  1108. package/src/modules/sales/command/updateSalesPaymentTerm.test.ts +66 -0
  1109. package/src/modules/sales/command/updateSalesPaymentTerm.ts +59 -0
  1110. package/src/modules/sales/command/updateSalesPriceList.generated.ts +6 -0
  1111. package/src/modules/sales/command/updateSalesPriceList.test.ts +71 -0
  1112. package/src/modules/sales/command/updateSalesPriceList.ts +52 -0
  1113. package/src/modules/sales/command/updateSalesPriceRule.generated.ts +6 -0
  1114. package/src/modules/sales/command/updateSalesPriceRule.test.ts +95 -0
  1115. package/src/modules/sales/command/updateSalesPriceRule.ts +81 -0
  1116. package/src/modules/sales/command/updateShipment.generated.ts +6 -0
  1117. package/src/modules/sales/command/updateShipment.test.ts +78 -0
  1118. package/src/modules/sales/command/updateShipment.ts +84 -0
  1119. package/src/modules/sales/db/.gitkeep +0 -0
  1120. package/src/modules/sales/db/channel.ts +43 -0
  1121. package/src/modules/sales/db/channelOrder.ts +109 -0
  1122. package/src/modules/sales/db/channelOrderLine.ts +84 -0
  1123. package/src/modules/sales/db/listing.ts +81 -0
  1124. package/src/modules/sales/db/salesCreditNote.ts +63 -0
  1125. package/src/modules/sales/db/salesCreditNoteLine.ts +49 -0
  1126. package/src/modules/sales/db/salesInvoice.ts +95 -0
  1127. package/src/modules/sales/db/salesInvoiceLine.ts +64 -0
  1128. package/src/modules/sales/db/salesOrder.ts +103 -0
  1129. package/src/modules/sales/db/salesOrderLine.ts +82 -0
  1130. package/src/modules/sales/db/salesPaymentTerm.ts +46 -0
  1131. package/src/modules/sales/db/salesPriceList.ts +61 -0
  1132. package/src/modules/sales/db/salesPriceRule.ts +96 -0
  1133. package/src/modules/sales/db/shipment.ts +78 -0
  1134. package/src/modules/sales/db/shipmentLine.ts +58 -0
  1135. package/src/modules/sales/db/syncJob.ts +70 -0
  1136. package/src/modules/sales/docs/commands/ActivateChannel.md +42 -0
  1137. package/src/modules/sales/docs/commands/ActivateListing.md +46 -0
  1138. package/src/modules/sales/docs/commands/ActivateSalesPaymentTerm.md +41 -0
  1139. package/src/modules/sales/docs/commands/ActivateSalesPriceList.md +39 -0
  1140. package/src/modules/sales/docs/commands/ActivateSalesPriceRule.md +48 -0
  1141. package/src/modules/sales/docs/commands/CancelChannelOrder.md +37 -0
  1142. package/src/modules/sales/docs/commands/CancelSalesInvoice.md +39 -0
  1143. package/src/modules/sales/docs/commands/CancelSalesOrder.md +40 -0
  1144. package/src/modules/sales/docs/commands/CancelSyncJob.md +36 -0
  1145. package/src/modules/sales/docs/commands/CloseSalesOrder.md +39 -0
  1146. package/src/modules/sales/docs/commands/ConfirmSalesOrder.md +43 -0
  1147. package/src/modules/sales/docs/commands/ConvertChannelOrder.md +44 -0
  1148. package/src/modules/sales/docs/commands/CreateChannel.md +40 -0
  1149. package/src/modules/sales/docs/commands/CreateListing.md +40 -0
  1150. package/src/modules/sales/docs/commands/CreateSalesCreditNote.md +37 -0
  1151. package/src/modules/sales/docs/commands/CreateSalesInvoice.md +39 -0
  1152. package/src/modules/sales/docs/commands/CreateSalesOrder.md +51 -0
  1153. package/src/modules/sales/docs/commands/CreateSalesPaymentTerm.md +38 -0
  1154. package/src/modules/sales/docs/commands/CreateSalesPriceList.md +37 -0
  1155. package/src/modules/sales/docs/commands/CreateSalesPriceRule.md +46 -0
  1156. package/src/modules/sales/docs/commands/CreateShipment.md +38 -0
  1157. package/src/modules/sales/docs/commands/DeactivateChannel.md +35 -0
  1158. package/src/modules/sales/docs/commands/DeactivateSalesPaymentTerm.md +35 -0
  1159. package/src/modules/sales/docs/commands/DeactivateSalesPriceList.md +35 -0
  1160. package/src/modules/sales/docs/commands/DeactivateSalesPriceRule.md +35 -0
  1161. package/src/modules/sales/docs/commands/IssueSalesCreditNote.md +38 -0
  1162. package/src/modules/sales/docs/commands/IssueSalesInvoice.md +43 -0
  1163. package/src/modules/sales/docs/commands/MarkChannelOrderException.md +37 -0
  1164. package/src/modules/sales/docs/commands/PauseListing.md +36 -0
  1165. package/src/modules/sales/docs/commands/PlaceSalesOrderOnCreditHold.md +41 -0
  1166. package/src/modules/sales/docs/commands/PostShipment.md +41 -0
  1167. package/src/modules/sales/docs/commands/RecordChannelOrder.md +45 -0
  1168. package/src/modules/sales/docs/commands/RejectSalesOrder.md +41 -0
  1169. package/src/modules/sales/docs/commands/ReleaseSalesOrderCreditHold.md +36 -0
  1170. package/src/modules/sales/docs/commands/RetireListing.md +36 -0
  1171. package/src/modules/sales/docs/commands/RetrySyncJob.md +39 -0
  1172. package/src/modules/sales/docs/commands/SendSalesInvoice.md +38 -0
  1173. package/src/modules/sales/docs/commands/StartSyncJob.md +39 -0
  1174. package/src/modules/sales/docs/commands/SubmitSalesOrder.md +43 -0
  1175. package/src/modules/sales/docs/commands/UpdateChannel.md +43 -0
  1176. package/src/modules/sales/docs/commands/UpdateListing.md +38 -0
  1177. package/src/modules/sales/docs/commands/UpdateSalesCreditNote.md +38 -0
  1178. package/src/modules/sales/docs/commands/UpdateSalesInvoice.md +38 -0
  1179. package/src/modules/sales/docs/commands/UpdateSalesOrder.md +45 -0
  1180. package/src/modules/sales/docs/commands/UpdateSalesPaymentTerm.md +41 -0
  1181. package/src/modules/sales/docs/commands/UpdateSalesPriceList.md +40 -0
  1182. package/src/modules/sales/docs/commands/UpdateSalesPriceRule.md +49 -0
  1183. package/src/modules/sales/docs/commands/UpdateShipment.md +38 -0
  1184. package/src/modules/sales/docs/commands/bin/rm.md +52 -0
  1185. package/src/modules/sales/docs/commands/opt/homebrew/bin/codex.md +52 -0
  1186. package/src/modules/sales/docs/commands/opt/homebrew/bin/ps2ps2.md +52 -0
  1187. package/src/modules/sales/docs/commands/opt/homebrew/bin/rg.md +52 -0
  1188. package/src/modules/sales/docs/commands/opt/homebrew/bin/sha384sum.md +52 -0
  1189. package/src/modules/sales/docs/commands/opt/homebrew/opt/libpq/bin/pg_combinebackup.md +52 -0
  1190. package/src/modules/sales/docs/commands/sbin/mount_msdos.md +52 -0
  1191. package/src/modules/sales/docs/commands/sbin/mount_nfs.md +52 -0
  1192. package/src/modules/sales/docs/commands/usr/bin/cupstestppd.md +52 -0
  1193. package/src/modules/sales/docs/commands/usr/bin/enc2xs.md +52 -0
  1194. package/src/modules/sales/docs/commands/usr/bin/hash.md +52 -0
  1195. package/src/modules/sales/docs/commands/usr/bin/jarsigner.md +52 -0
  1196. package/src/modules/sales/docs/commands/usr/bin/mpsgraphtool.md +52 -0
  1197. package/src/modules/sales/docs/commands/usr/bin/nano.md +52 -0
  1198. package/src/modules/sales/docs/commands/usr/bin/pod2html5.34.md +52 -0
  1199. package/src/modules/sales/docs/commands/usr/bin/ri.md +52 -0
  1200. package/src/modules/sales/docs/commands/usr/bin/rs.md +52 -0
  1201. package/src/modules/sales/docs/commands/usr/bin/trustcachectl.md +52 -0
  1202. package/src/modules/sales/docs/commands/usr/sbin/htpasswd.md +52 -0
  1203. package/src/modules/sales/docs/commands/usr/sbin/lpadmin.md +52 -0
  1204. package/src/modules/sales/docs/commands/usr/sbin/setkey.md +52 -0
  1205. package/src/modules/sales/docs/features/channel-listing-management.md +68 -0
  1206. package/src/modules/sales/docs/features/channel-order-sync.md +78 -0
  1207. package/src/modules/sales/docs/features/customer-invoicing.md +89 -0
  1208. package/src/modules/sales/docs/features/customer-sales-pricing.md +72 -0
  1209. package/src/modules/sales/docs/features/sales-order-lifecycle.md +96 -0
  1210. package/src/modules/sales/docs/features/sales-payment-terms.md +67 -0
  1211. package/src/modules/sales/docs/features/shipment-fulfillment.md +71 -0
  1212. package/src/modules/sales/docs/models/Channel.md +48 -0
  1213. package/src/modules/sales/docs/models/ChannelOrder.md +56 -0
  1214. package/src/modules/sales/docs/models/ChannelOrderLine.md +39 -0
  1215. package/src/modules/sales/docs/models/Listing.md +56 -0
  1216. package/src/modules/sales/docs/models/SalesCreditNote.md +47 -0
  1217. package/src/modules/sales/docs/models/SalesCreditNoteLine.md +37 -0
  1218. package/src/modules/sales/docs/models/SalesInvoice.md +55 -0
  1219. package/src/modules/sales/docs/models/SalesInvoiceLine.md +39 -0
  1220. package/src/modules/sales/docs/models/SalesOrder.md +79 -0
  1221. package/src/modules/sales/docs/models/SalesOrderLine.md +42 -0
  1222. package/src/modules/sales/docs/models/SalesPaymentTerm.md +53 -0
  1223. package/src/modules/sales/docs/models/SalesPriceList.md +50 -0
  1224. package/src/modules/sales/docs/models/SalesPriceRule.md +51 -0
  1225. package/src/modules/sales/docs/models/Shipment.md +49 -0
  1226. package/src/modules/sales/docs/models/ShipmentLine.md +38 -0
  1227. package/src/modules/sales/docs/models/SyncJob.md +53 -0
  1228. package/src/modules/sales/docs/queries/CalculateInvoiceDueSchedule.md +37 -0
  1229. package/src/modules/sales/docs/queries/GetApplicableSalesPrice.md +38 -0
  1230. package/src/modules/sales/docs/queries/GetChannel.md +34 -0
  1231. package/src/modules/sales/docs/queries/GetChannelOrder.md +34 -0
  1232. package/src/modules/sales/docs/queries/GetListing.md +34 -0
  1233. package/src/modules/sales/docs/queries/GetListingByExternalIdentifier.md +35 -0
  1234. package/src/modules/sales/docs/queries/GetSalesCreditNote.md +34 -0
  1235. package/src/modules/sales/docs/queries/GetSalesInvoice.md +34 -0
  1236. package/src/modules/sales/docs/queries/GetSalesOrder.md +36 -0
  1237. package/src/modules/sales/docs/queries/GetSalesPaymentTerm.md +34 -0
  1238. package/src/modules/sales/docs/queries/GetSalesPriceList.md +34 -0
  1239. package/src/modules/sales/docs/queries/GetShipment.md +34 -0
  1240. package/src/modules/sales/docs/queries/GetSyncJob.md +34 -0
  1241. package/src/modules/sales/docs/queries/ListChannelOrdersByStatus.md +34 -0
  1242. package/src/modules/sales/docs/queries/ListChannels.md +33 -0
  1243. package/src/modules/sales/docs/queries/ListListingsByChannel.md +33 -0
  1244. package/src/modules/sales/docs/queries/ListSalesCreditNotesByInvoice.md +33 -0
  1245. package/src/modules/sales/docs/queries/ListSalesInvoicesBySalesOrder.md +33 -0
  1246. package/src/modules/sales/docs/queries/ListSalesOrders.md +36 -0
  1247. package/src/modules/sales/docs/queries/ListSalesPaymentTerms.md +33 -0
  1248. package/src/modules/sales/docs/queries/ListSalesPriceLists.md +33 -0
  1249. package/src/modules/sales/docs/queries/ListSalesPriceRulesByPriceList.md +33 -0
  1250. package/src/modules/sales/docs/queries/ListShipmentsBySalesOrder.md +33 -0
  1251. package/src/modules/sales/docs/queries/ListSyncJobs.md +34 -0
  1252. package/src/modules/sales/executor/.gitkeep +0 -0
  1253. package/src/modules/sales/generated/.gitkeep +0 -0
  1254. package/src/modules/sales/generated/enums.ts +119 -0
  1255. package/src/modules/sales/generated/kysely-tailordb.ts +332 -0
  1256. package/src/modules/sales/index.ts +2 -0
  1257. package/src/modules/sales/lib/_db_deps.ts +67 -0
  1258. package/src/modules/sales/lib/domain.ts +354 -0
  1259. package/src/modules/sales/lib/errors.generated.ts +417 -0
  1260. package/src/modules/sales/lib/permissions.generated.ts +53 -0
  1261. package/src/modules/sales/lib/repository.ts +137 -0
  1262. package/src/modules/sales/lib/types.ts +105 -0
  1263. package/src/modules/sales/module.ts +418 -0
  1264. package/src/modules/sales/permissions.ts +3 -0
  1265. package/src/modules/sales/query/.gitkeep +0 -0
  1266. package/src/modules/sales/query/calculateInvoiceDueSchedule.generated.ts +5 -0
  1267. package/src/modules/sales/query/calculateInvoiceDueSchedule.test.ts +107 -0
  1268. package/src/modules/sales/query/calculateInvoiceDueSchedule.ts +35 -0
  1269. package/src/modules/sales/query/getApplicableSalesPrice.generated.ts +5 -0
  1270. package/src/modules/sales/query/getApplicableSalesPrice.test.ts +110 -0
  1271. package/src/modules/sales/query/getApplicableSalesPrice.ts +81 -0
  1272. package/src/modules/sales/query/getChannel.generated.ts +5 -0
  1273. package/src/modules/sales/query/getChannel.test.ts +39 -0
  1274. package/src/modules/sales/query/getChannel.ts +15 -0
  1275. package/src/modules/sales/query/getChannelOrder.generated.ts +5 -0
  1276. package/src/modules/sales/query/getChannelOrder.test.ts +50 -0
  1277. package/src/modules/sales/query/getChannelOrder.ts +29 -0
  1278. package/src/modules/sales/query/getListing.generated.ts +5 -0
  1279. package/src/modules/sales/query/getListing.test.ts +39 -0
  1280. package/src/modules/sales/query/getListing.ts +15 -0
  1281. package/src/modules/sales/query/getListingByExternalIdentifier.generated.ts +5 -0
  1282. package/src/modules/sales/query/getListingByExternalIdentifier.test.ts +61 -0
  1283. package/src/modules/sales/query/getListingByExternalIdentifier.ts +23 -0
  1284. package/src/modules/sales/query/getSalesCreditNote.generated.ts +5 -0
  1285. package/src/modules/sales/query/getSalesCreditNote.test.ts +44 -0
  1286. package/src/modules/sales/query/getSalesCreditNote.ts +14 -0
  1287. package/src/modules/sales/query/getSalesInvoice.generated.ts +5 -0
  1288. package/src/modules/sales/query/getSalesInvoice.test.ts +44 -0
  1289. package/src/modules/sales/query/getSalesInvoice.ts +14 -0
  1290. package/src/modules/sales/query/getSalesOrder.generated.ts +5 -0
  1291. package/src/modules/sales/query/getSalesOrder.test.ts +57 -0
  1292. package/src/modules/sales/query/getSalesOrder.ts +20 -0
  1293. package/src/modules/sales/query/getSalesPaymentTerm.generated.ts +5 -0
  1294. package/src/modules/sales/query/getSalesPaymentTerm.test.ts +44 -0
  1295. package/src/modules/sales/query/getSalesPaymentTerm.ts +24 -0
  1296. package/src/modules/sales/query/getSalesPriceList.generated.ts +5 -0
  1297. package/src/modules/sales/query/getSalesPriceList.test.ts +39 -0
  1298. package/src/modules/sales/query/getSalesPriceList.ts +15 -0
  1299. package/src/modules/sales/query/getShipment.generated.ts +5 -0
  1300. package/src/modules/sales/query/getShipment.test.ts +44 -0
  1301. package/src/modules/sales/query/getShipment.ts +12 -0
  1302. package/src/modules/sales/query/getSyncJob.generated.ts +5 -0
  1303. package/src/modules/sales/query/getSyncJob.test.ts +43 -0
  1304. package/src/modules/sales/query/getSyncJob.ts +24 -0
  1305. package/src/modules/sales/query/listChannelOrdersByStatus.generated.ts +5 -0
  1306. package/src/modules/sales/query/listChannelOrdersByStatus.test.ts +58 -0
  1307. package/src/modules/sales/query/listChannelOrdersByStatus.ts +53 -0
  1308. package/src/modules/sales/query/listChannels.generated.ts +5 -0
  1309. package/src/modules/sales/query/listChannels.test.ts +36 -0
  1310. package/src/modules/sales/query/listChannels.ts +39 -0
  1311. package/src/modules/sales/query/listListingsByChannel.generated.ts +5 -0
  1312. package/src/modules/sales/query/listListingsByChannel.test.ts +36 -0
  1313. package/src/modules/sales/query/listListingsByChannel.ts +39 -0
  1314. package/src/modules/sales/query/listSalesCreditNotesByInvoice.generated.ts +5 -0
  1315. package/src/modules/sales/query/listSalesCreditNotesByInvoice.test.ts +36 -0
  1316. package/src/modules/sales/query/listSalesCreditNotesByInvoice.ts +42 -0
  1317. package/src/modules/sales/query/listSalesInvoicesBySalesOrder.generated.ts +5 -0
  1318. package/src/modules/sales/query/listSalesInvoicesBySalesOrder.test.ts +36 -0
  1319. package/src/modules/sales/query/listSalesInvoicesBySalesOrder.ts +42 -0
  1320. package/src/modules/sales/query/listSalesOrders.generated.ts +5 -0
  1321. package/src/modules/sales/query/listSalesOrders.test.ts +79 -0
  1322. package/src/modules/sales/query/listSalesOrders.ts +67 -0
  1323. package/src/modules/sales/query/listSalesPaymentTerms.generated.ts +5 -0
  1324. package/src/modules/sales/query/listSalesPaymentTerms.test.ts +36 -0
  1325. package/src/modules/sales/query/listSalesPaymentTerms.ts +42 -0
  1326. package/src/modules/sales/query/listSalesPriceLists.generated.ts +5 -0
  1327. package/src/modules/sales/query/listSalesPriceLists.test.ts +36 -0
  1328. package/src/modules/sales/query/listSalesPriceLists.ts +39 -0
  1329. package/src/modules/sales/query/listSalesPriceRulesByPriceList.generated.ts +5 -0
  1330. package/src/modules/sales/query/listSalesPriceRulesByPriceList.test.ts +39 -0
  1331. package/src/modules/sales/query/listSalesPriceRulesByPriceList.ts +47 -0
  1332. package/src/modules/sales/query/listShipmentsBySalesOrder.generated.ts +5 -0
  1333. package/src/modules/sales/query/listShipmentsBySalesOrder.test.ts +36 -0
  1334. package/src/modules/sales/query/listShipmentsBySalesOrder.ts +36 -0
  1335. package/src/modules/sales/query/listSyncJobs.generated.ts +5 -0
  1336. package/src/modules/sales/query/listSyncJobs.test.ts +50 -0
  1337. package/src/modules/sales/query/listSyncJobs.ts +47 -0
  1338. package/src/modules/sales/tailor.config.ts +13 -0
  1339. package/src/modules/sales/tailor.d.ts +13 -0
  1340. package/src/modules/sales/testing/commandTestUtils.ts +35 -0
  1341. package/src/modules/sales/testing/fixtures.ts +520 -0
  1342. package/src/modules/user-management/command/.gitkeep +0 -0
  1343. package/src/modules/user-management/command/activateUser.generated.ts +1 -1
  1344. package/src/modules/user-management/command/activateUser.ts +1 -1
  1345. package/src/modules/user-management/command/assignPermissionToRole.generated.ts +1 -1
  1346. package/src/modules/user-management/command/assignPermissionToRole.ts +1 -1
  1347. package/src/modules/user-management/command/assignRoleToUser.generated.ts +1 -1
  1348. package/src/modules/user-management/command/assignRoleToUser.ts +1 -1
  1349. package/src/modules/user-management/command/createPermission.generated.ts +1 -1
  1350. package/src/modules/user-management/command/createPermission.ts +1 -1
  1351. package/src/modules/user-management/command/createRole.generated.ts +1 -1
  1352. package/src/modules/user-management/command/createRole.ts +1 -1
  1353. package/src/modules/user-management/command/createUser.generated.ts +1 -1
  1354. package/src/modules/user-management/command/createUser.ts +1 -1
  1355. package/src/modules/user-management/command/deactivateUser.generated.ts +1 -1
  1356. package/src/modules/user-management/command/deactivateUser.ts +1 -1
  1357. package/src/modules/user-management/command/reactivateUser.generated.ts +1 -1
  1358. package/src/modules/user-management/command/reactivateUser.ts +1 -1
  1359. package/src/modules/user-management/command/revokePermissionFromRole.generated.ts +1 -1
  1360. package/src/modules/user-management/command/revokePermissionFromRole.ts +1 -1
  1361. package/src/modules/user-management/command/revokeRoleFromUser.generated.ts +1 -1
  1362. package/src/modules/user-management/command/revokeRoleFromUser.ts +1 -1
  1363. package/src/modules/user-management/db/.gitkeep +0 -0
  1364. package/src/modules/user-management/executor/.gitkeep +0 -0
  1365. package/src/modules/user-management/generated/.gitkeep +0 -0
  1366. package/src/modules/user-management/lib/errors.generated.ts +1 -6
  1367. package/src/modules/user-management/lib/permissions.generated.ts +1 -1
  1368. package/src/modules/user-management/lib/recomputeUserPermissions.ts +4 -2
  1369. package/src/modules/user-management/lib/types.ts +6 -1
  1370. package/src/modules/user-management/module.ts +1 -1
  1371. package/src/modules/user-management/permissions.ts +3 -0
  1372. package/src/modules/user-management/query/.gitkeep +0 -0
  1373. package/src/modules/user-management/query/listRolePermissionsByRole.generated.ts +5 -0
  1374. package/src/modules/user-management/query/listRolePermissionsByRole.test.ts +20 -0
  1375. package/src/modules/user-management/query/listRolePermissionsByRole.ts +28 -0
  1376. package/src/modules/user-management/query/listUserRolesByUser.generated.ts +5 -0
  1377. package/src/modules/user-management/query/listUserRolesByUser.test.ts +20 -0
  1378. package/src/modules/user-management/query/listUserRolesByUser.ts +28 -0
  1379. package/src/schemas.ts +6 -6
  1380. package/src/shared/defineCommand.ts +1 -1
  1381. package/src/shared/entityTypes.ts +1 -1
  1382. package/src/shared/uuidv5.test.ts +18 -0
  1383. package/src/shared/uuidv5.ts +23 -0
  1384. package/src/testing/index.ts +1 -1
  1385. package/templates/scaffold/app/backend/package.json +1 -3
  1386. package/templates/scaffold/app/backend/seed/exec.mjs +7 -5
  1387. package/templates/scaffold/app/backend/src/generated/kysely-tailordb.ts +0 -11
  1388. package/templates/scaffold/module/lib/types.ts +6 -1
  1389. package/templates/scaffold/module/permissions.ts +1 -1
  1390. package/templates/scaffold/module/seed/index.ts +19 -0
  1391. package/src/modules/business-partner/lib/errors.ts +0 -2
  1392. package/src/modules/organization/lib/errors.ts +0 -1
  1393. package/templates/scaffold/module/lib/errors.ts +0 -1
  1394. /package/schemas/{app-compose → app}/actors.yml +0 -0
  1395. /package/schemas/{app-compose → app}/business-flow.yml +0 -0
  1396. /package/schemas/{app-compose → app}/requirements.yml +0 -0
  1397. /package/schemas/{app-compose → app}/resolver.yml +0 -0
  1398. /package/schemas/{app-compose → app}/screen.yml +0 -0
  1399. /package/schemas/{app-compose → app}/story.yml +0 -0
  1400. /package/src/modules/{purchase → inventory/command}/.gitkeep +0 -0
  1401. /package/src/modules/{audit/lib/errors.ts → inventory/db/.gitkeep} +0 -0
  1402. /package/src/modules/{coa-management/lib/errors.ts → inventory/executor/.gitkeep} +0 -0
@@ -5,6 +5,7 @@
5
5
  App: {{APP_NAME}}
6
6
  Story docs: {{STORY_DOCS}}
7
7
  Resolver docs: {{RESOLVER_DOCS}}
8
+ Module metadata (JSON): {{MODULE_METADATA}}
8
9
 
9
10
  ## Instructions
10
11
 
@@ -20,10 +21,19 @@ From each story doc, extract:
20
21
  - Story name (from filename or heading)
21
22
  - Resolver section content:
22
23
  - `None` → read-only story, skip resolver checks
24
+ - `N/A` (with optional reason, e.g., `N/A — background job`) → story intentionally has no resolver (skip checks). Common for scheduled jobs, cron tasks, webhook handlers, and system-triggered processes that don't expose a GraphQL endpoint.
23
25
  - `- TBD` → story needs resolvers but none documented yet (fail)
24
26
  - Resolver links (format: `../../../resolver/<name>.md`) → verify they exist
25
27
  - Operations described that imply mutations (create, update, delete, submit, approve, etc.)
26
28
 
29
+ ## Extraction: Module Metadata
30
+
31
+ Parse the MODULE_METADATA JSON array. Build a lookup map:
32
+ - Key: module name (e.g., `"business-partner"`)
33
+ - Value: `{ commands: string[], queries: string[] }` from `docs.command` and `docs.query` arrays
34
+
35
+ This is the authoritative source for which modules, commands, and queries exist.
36
+
27
37
  ## Extraction: Resolver Docs
28
38
 
29
39
  From each resolver doc, extract:
@@ -44,14 +54,20 @@ For each story:
44
54
  | resolver_tbd | Are there stories still showing `- TBD` for resolvers? |
45
55
  | link_validity | Do resolver links in the story resolve to real files? |
46
56
  | operation_coverage | Do story operations (create/update/delete) have matching resolver types? |
57
+ | module_command_existence | Does the module and command/query referenced in each resolver exist in installed modules? |
47
58
 
48
59
  ### How to Check
49
60
 
50
61
  1. Read each story's `## Resolvers` section
51
62
  2. If `None` → skip (read-only story)
52
- 3. If `- TBD` → fail: resolver docs not yet created
53
- 4. If links presentverify each link resolves to a file in RESOLVER_DOCS
54
- 5. Cross-check story operations against resolver types (mutation for writes, query for reads)
63
+ 3. If `N/A` (with or without reason) skip (intentionally no resolver, e.g., background job)
64
+ 4. If `- TBD`fail: resolver docs not yet created
65
+ 5. If links present verify each link resolves to a file in RESOLVER_DOCS
66
+ 6. Cross-check story operations against resolver types (mutation for writes, query for reads)
67
+ 7. For each resolver that references a module and command/query, verify against MODULE_METADATA:
68
+ - The module name must exist as an entry in the metadata array
69
+ - The command name must appear in that module's `docs.command` array, or the query name in `docs.query`
70
+ - If either is missing, report as `module_command_existence` gap
55
71
 
56
72
  ## Link Format Reference
57
73
 
@@ -65,6 +81,8 @@ For each story:
65
81
  - **Missing resolver docs**: Story links to a resolver that has no doc
66
82
  - **Operation mismatch**: Story describes a create operation but no create resolver exists
67
83
  - **Orphaned resolvers**: Resolver doc exists but no story links to it (covered by orphan detection)
84
+ - **Non-existent module**: Resolver references a module that isn't installed (not in MODULE_METADATA)
85
+ - **Non-existent command/query**: Resolver references a command or query that doesn't exist in the referenced module
68
86
 
69
87
  ## Output Format
70
88
 
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: erp-kit-app-5-impl-backend
3
- description: Implement backend code for app-compose applications using erp-kit modules. Use after completing plan review with erp-kit-app-4-plan-review. Triggers when implementing backend resolvers, wiring modules, configuring applications, or when the user mentions implementing backend, writing resolvers, or connecting erp-kit modules.
3
+ description: Implement backend code for applications using erp-kit modules. Use after completing plan review with erp-kit-app-4-plan-review. Triggers when implementing backend resolvers, wiring modules, configuring applications, or when the user mentions implementing backend, writing resolvers, or connecting erp-kit modules.
4
4
  ---
5
5
 
6
- # App-Compose Backend Implementation
6
+ # Application Backend Implementation
7
7
 
8
- Implement backend resolvers and application configuration for an app-compose application, driven by Tier 1-4 documentation (actors, business flows, stories, screens, resolvers).
8
+ Implement backend resolvers and application configuration for an application, driven by Tier 1-4 documentation (actors, business flows, stories, screens, resolvers).
9
9
 
10
10
  ## When to Use
11
11
 
@@ -44,6 +44,17 @@ Read all resolver and screen specs to build a complete picture:
44
44
 
45
45
  Classify resolvers per [erp-kit-app-shared/references/resolver-classification.md](../erp-kit-app-shared/references/resolver-classification.md).
46
46
 
47
+ > **Parallelize if possible:** Dispatch one agent per resolver spec to extract inputs, outputs, module mapping, and error scenarios. Each agent reads a single resolver doc and returns structured analysis.
48
+
49
+ ### Phase 1b: Scaffolded Code Orientation
50
+
51
+ `erp-kit app generate code` produces two kinds of files:
52
+
53
+ - **Reference examples** — `src/resolvers/createUser.ts`, `src/modules.ts`, `src/executors/permissionCreated.ts` show the implementation pattern (command invocation, error handling, context creation). Use these as a guide.
54
+ - **Generated stubs** — Minimal resolver files created from `docs/resolver/*.md`. These are your starting points for actual implementation.
55
+
56
+ When implementing in Phase 4, follow the patterns from the reference examples. Once all actual resolvers are implemented, delete the reference files that aren't needed by your app.
57
+
47
58
  ### Phase 2: Wire Modules (`src/modules.ts`)
48
59
 
49
60
  Create the module wiring file that composes all required erp-kit modules.
@@ -67,6 +78,8 @@ Key points:
67
78
  - Auth with OAuth2, DPoP, and user profile mapping
68
79
  - Generators for Kysely types and seed data
69
80
 
81
+ > **Sync barrier:** Module wiring and configuration must complete before resolver implementation. These files are shared across all resolvers.
82
+
70
83
  ### Phase 4: Implement Backend Resolvers and Executors
71
84
 
72
85
  Write one file per resolver under `src/resolvers/`, one per executor under `executors/`.
@@ -77,6 +90,12 @@ For each resolver, check whether its spec (`docs/resolver/*.md`) documents error
77
90
 
78
91
  Do not directly mutate module-owned tables via Kysely — always use module commands.
79
92
 
93
+ > **Parallelize if possible:** Dispatch one agent per resolver. Each agent writes only to its own files:
94
+ > - `src/resolvers/<resolverName>.ts`
95
+ > - `src/executors/<resolverName>.ts`
96
+ >
97
+ > **Shared-file guard:** `src/modules.ts` and `tailor.config.ts` are written in the sync barrier phase above. Resolver agents must NOT modify these files.
98
+
80
99
  ### Phase 5: Generated Files
81
100
 
82
101
  - **Kysely types** (`src/generated/kysely-tailordb.ts`) — Auto-generated by `pnpm generate` after deployment. Before deployment, create a minimal placeholder so the codebase typechecks.
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  name: erp-kit-app-6-impl-frontend
3
- description: Implement frontend code for app-compose applications. Use after deploying the backend with erp-kit-app-5-impl-backend. Triggers when implementing frontend pages, creating React components from screen specs, or when the user mentions implementing frontend, creating pages, or building UI for an app-compose application.
3
+ description: Implement frontend code for applications. Use after deploying the backend with erp-kit-app-5-impl-backend. Triggers when implementing frontend pages, creating React components from screen specs, or when the user mentions implementing frontend, creating pages, or building UI for an application.
4
4
  ---
5
5
 
6
- # App-Compose Frontend Implementation
6
+ # Application Frontend Implementation
7
7
 
8
- Implement frontend pages for an app-compose application, driven by screen spec documentation and a deployed backend.
8
+ Implement frontend pages for an application, driven by screen spec documentation and a deployed backend.
9
9
 
10
10
  ## When to Use
11
11
 
12
12
  - Implementing frontend pages from screen spec docs
13
13
  - Creating React components for ListView, Form, or DetailView screens
14
- - Building the frontend UI for an app-compose application after backend deployment
14
+ - Building the frontend UI for an application after backend deployment
15
15
 
16
16
  ## Prerequisites
17
17
 
@@ -33,6 +33,8 @@ ANALYZE SCREENS → GENERATE GRAPHQL SCHEMA → IMPLEMENT PAGES → VERIFY
33
33
 
34
34
  Read all screen specs (`docs/screen/*.md`) to build a complete picture:
35
35
 
36
+ > **Parallelize if possible:** Dispatch one agent per screen spec to extract page structure, fields, actions, and navigation. Each agent reads a single screen doc and returns structured analysis.
37
+
36
38
  1. **Screen types** — Identify each screen as ListView, Form (create/edit), or DetailView
37
39
  2. **Fields and columns** — Map required columns (ListView), form fields (Form), and detail fields (DetailView) from each spec
38
40
  3. **Actions** — Identify navigation actions (create, edit, back-to-list) and mutation actions (save, delete, activate/deactivate)
@@ -41,12 +43,25 @@ Read all screen specs (`docs/screen/*.md`) to build a complete picture:
41
43
 
42
44
  Run `pnpm generate` in the frontend directory to fetch the GraphQL schema from the deployed backend.
43
45
 
46
+ > **Sync barrier:** Schema generation must complete before page implementation. Generated types are shared across all pages.
47
+
48
+ ### Phase 2b: Scaffolded Code Orientation
49
+
50
+ The scaffolded frontend includes example pages under `src/pages/user-management/` as a reference implementation. Use these to understand the page patterns (ListView, Form, DetailView), component structure, and GraphQL fragment conventions before implementing your actual pages.
51
+
44
52
  ### Phase 3: Implement Frontend Pages
45
53
 
54
+ > **Barrier step:** Write shared layout and router files before dispatching page agents. These files are shared across all pages and must not be modified by individual page agents.
55
+
46
56
  Run `pnpm lint`, `pnpm typecheck`, and `pnpm gql-tada:check` regularly during implementation. Fix errors before moving on.
47
57
 
48
58
  Create pages driven by screen spec docs. Each screen type has a standard implementation pattern.
49
59
 
60
+ > **Parallelize if possible:** Dispatch one agent per screen. Each agent writes only to its own directory:
61
+ > - `src/pages/<screen-name>/`
62
+ >
63
+ > **Shared-file guard:** Layout files, router configuration, and generated types are written before dispatch. Page agents must NOT modify shared files.
64
+
50
65
  **Read [pages reference](references/pages.md) for the full pattern catalog.**
51
66
 
52
67
  Page types and their file structure:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: erp-kit-app-7-impl-review
3
- description: Review implementation parity between documentation and code for app-compose applications. Use after frontend implementation (step 6) to validate code matches documentation.
3
+ description: Review implementation parity between documentation and code for applications. Use after frontend implementation (step 6) to validate code matches documentation.
4
4
  ---
5
5
 
6
6
  # Implementation Parity Review
@@ -31,26 +31,29 @@ Verify at least `RESOLVER_DOCS` or `SCREEN_DOCS` is non-empty. If no docs exist,
31
31
 
32
32
  ## Step 2: Dispatch Agents (parallelize if possible)
33
33
 
34
- Launch 4 Agent tool calls in parallel — one per parity check.
34
+ Dispatch agents in parallel — one per item in each group. All groups are dispatched simultaneously.
35
35
  Each agent receives: APP_NAME, relevant doc/code file paths.
36
36
  Each agent returns: structured JSON per [references/impl-parity-report-format.md](references/impl-parity-report-format.md).
37
37
  If a doc or code directory is empty, the agent reports "no files found" and skips.
38
+ All review agents are read-only — no shared-file conflict risk.
38
39
 
39
- | Agent | Prompt Template | Inputs |
40
- | ----- | -------------------------------------------------------------------------------- | --------------------------------------------------- |
41
- | 1 | [references/resolver-doc-code-parity.md](references/resolver-doc-code-parity.md) | RESOLVER_DOCS, BACKEND_RESOLVERS, BACKEND_EXECUTORS |
42
- | 2 | [references/screen-doc-code-parity.md](references/screen-doc-code-parity.md) | SCREEN_DOCS, FRONTEND_PAGES |
43
- | 3 | [references/module-wiring-parity.md](references/module-wiring-parity.md) | RESOLVER_DOCS, BACKEND_MODULES, BACKEND_CONFIG |
44
- | 4 | (build verification inline, no template) | APP_ROOT |
40
+ | Group | Prompt Template | Per-item scope | Inputs per agent |
41
+ | ----- | -------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------ |
42
+ | A | [references/resolver-doc-code-parity.md](references/resolver-doc-code-parity.md) | One per resolver | Single RESOLVER_DOC + matching BACKEND_RESOLVER + BACKEND_EXECUTOR |
43
+ | B | [references/screen-doc-code-parity.md](references/screen-doc-code-parity.md) | One per screen | Single SCREEN_DOC + matching FRONTEND_PAGE directory |
44
+ | C | [references/module-wiring-parity.md](references/module-wiring-parity.md) | One per resolver | Single RESOLVER_DOC + BACKEND_MODULES + BACKEND_CONFIG |
45
+ | D | Build verification (inline) | One global agent | All source paths |
45
46
 
46
- For agents 1-3:
47
+ With R resolvers and S screens, this produces R + S + R + 1 parallel agents.
48
+
49
+ For groups A-C:
47
50
 
48
51
  1. Read the prompt template file
49
52
  2. Replace `{{APP_NAME}}` with the resolved app name
50
- 3. Replace doc/code path placeholders with the actual file paths
51
- 4. Dispatch the agent with the filled prompt
53
+ 3. Replace doc/code path placeholders with the actual file paths for that single item
54
+ 4. Dispatch one agent per item with the filled prompt
52
55
 
53
- For agent 4 (build & sync verification):
56
+ For group D (build & sync verification):
54
57
 
55
58
  Run build checks and source-doc sync check inline:
56
59
 
@@ -60,7 +63,7 @@ cd <APP_ROOT>/frontend && pnpm lint && pnpm typecheck && pnpm build
60
63
  erp-kit app sync-check -p <APP_ROOT>/..
61
64
  ```
62
65
 
63
- Report pass/fail for each check. `sync-check` detects missing resolver implementations and orphaned docs, so agents 1-3 can skip file-existence checks and focus on content parity.
66
+ Report pass/fail for each check. `sync-check` detects missing resolver implementations and orphaned docs, so groups A-C agents can skip file-existence checks and focus on content parity.
64
67
 
65
68
  ## Step 3: Aggregate Results
66
69
 
@@ -70,8 +73,9 @@ After ALL agents return:
70
73
  2. Merge all `gaps[]` arrays into a single list
71
74
  3. Merge all `inconsistencies[]` arrays into a single list
72
75
  4. Deduplicate: if two gaps share the same `source + target + check`, keep only one
73
- 5. Calculate totals across all summaries
74
- 6. Render the final report below
76
+ 5. Deduplicate findings: if agents from groups A and C report the same resolver issue, keep only one
77
+ 6. Calculate totals across all summaries
78
+ 7. Render the final report below
75
79
 
76
80
  ## Report Format
77
81
 
@@ -21,3 +21,6 @@ Prefer built-in queries over custom resolvers for list/get operations where poss
21
21
  | Assign X to Y | Mutation | `assign<X>To<Y>` |
22
22
  | Submit/Approve | Mutation | `submit<Entity>` etc. |
23
23
  | View/List/Get | Query | Built-in (no resolver) |
24
+ | Scheduled/Cron job | N/A | No resolver — background worker/job |
25
+ | Webhook handler | N/A | No resolver — external trigger |
26
+ | System event | N/A | No resolver — internal event processing |
@@ -52,60 +52,41 @@ After ALL agents return:
52
52
  2. Merge all `issues[]` arrays into a single list
53
53
  3. Merge all `recommendations[]` arrays into a single list
54
54
  4. Calculate totals across all summaries
55
- 5. **Classify severity** — for each non-pass finding, the router assigns a severity based on the finding's `status`, `check`, and `detail`:
56
- - `critical`: fundamental design flaw, missing required capability, boundary violation — blocks progress
57
- - `major`: significant gap that will likely cause downstream issues — should fix
58
- - `nit`: cosmetic, stylistic, or minor improvement — does NOT block the review
59
- 6. **Determine verdict**:
60
- - **APPROVED**: zero `critical` and zero `major` findings (nits only, or all pass)
61
- - **NEEDS CHANGES**: one or more `critical` or `major` findings
62
- 7. Render the final report below
63
55
 
64
- ## Report Format
56
+ ## Step 4: Severity Validation
65
57
 
66
- Render the aggregated results as markdown:
58
+ Subagents tend to over-classify. Before rendering the report, re-evaluate every non-pass finding:
67
59
 
68
- ### Requirements Review Report
60
+ - **"Is this even this module's responsibility?"** — If the concern belongs to another module or is out of scope, drop it from the report
61
+ - **"Does this block planning?"** → `critical`
62
+ - **"Will this force model/command/query rework?"** → `major`
63
+ - All no → `nit`, regardless of subagent label
69
64
 
70
- **Module:** <MODULE_NAME>
65
+ ## Step 5: Determine Verdict
71
66
 
72
- ---
67
+ - **APPROVED**: zero `critical` and zero `major`
68
+ - **NEEDS CHANGES**: one or more `critical` or `major`
73
69
 
74
- ### 1. Best Practices
75
-
76
- | Feature | Check | Status | Detail |
77
- | ------- | ----- | ------ | ------ |
78
-
79
- (Populated from agent 1 issues)
80
-
81
- ---
70
+ ## Step 6: Render Report
82
71
 
83
- ### 2. Module Boundary Consistency
84
-
85
- | Feature | Overlapping Module | Overlap Area | Recommendation |
86
- | ------- | ------------------ | ------------ | -------------- |
87
-
88
- (Populated from agent 2 issues where check is `boundary_overlap`)
89
-
90
- ---
72
+ ## Report Format
91
73
 
92
- ### 3. Dependency Analysis
74
+ Render the aggregated results as markdown:
93
75
 
94
- | Feature | Depends On Module | Dependency Type | Status |
95
- | ------- | ----------------- | --------------- | ------ |
76
+ ### Requirements Review Report
96
77
 
97
- (Populated from agent 2 issues where check is `dependency_analysis`)
78
+ **Module:** <MODULE_NAME>
98
79
 
99
80
  ---
100
81
 
101
- ### 4. Summary
82
+ ### 1. Summary
102
83
 
103
84
  | Aspect | Status | Details |
104
85
  | -------------------- | ------ | ----------------- |
105
86
  | Best Practices | | X/Y checks passed |
106
87
  | Boundary Consistency | | X/Y checks passed |
107
88
 
108
- ### 5. Recommendations
89
+ ### 2. Recommendations
109
90
 
110
91
  Numbered list of actionable fixes, grouped by severity:
111
92
 
@@ -113,7 +94,7 @@ Numbered list of actionable fixes, grouped by severity:
113
94
  2. `major` — best practice violations, missing capabilities (should fix)
114
95
  3. `nit` — cosmetic, stylistic, minor improvements (informational only)
115
96
 
116
- ### 6. Verdict
97
+ ### 3. Verdict
117
98
 
118
99
  **Verdict: APPROVED / NEEDS CHANGES**
119
100
 
@@ -0,0 +1,132 @@
1
+ ---
2
+ name: erp-kit-module-3-update-plan
3
+ description: Update model/command/query documentation based on plan review (step 4) feedback. Use after erp-kit-module-4-plan-review returns NEEDS CHANGES to apply targeted fixes without re-creating existing docs.
4
+ ---
5
+
6
+ # Fix Plan Documentation from Review Feedback
7
+
8
+ Apply targeted fixes to model, command, and query documentation based on plan review feedback. Unlike erp-kit-module-3-plan which creates docs from scratch, this skill reads the review report and applies only the necessary changes.
9
+
10
+ ## When to Use
11
+
12
+ - After erp-kit-module-4-plan-review returns **NEEDS CHANGES**
13
+ - User wants to fix specific gaps or inconsistencies flagged by the review
14
+ - User says "fix the review findings" or "apply the review feedback"
15
+
16
+ ## Step 1: Setup
17
+
18
+ Define shared context:
19
+
20
+ - `MODULES_ROOT`: glob `**/modules/*/README.md` and derive the parent directory
21
+ - `MODULE_NAME`: from argument or detect from current working directory
22
+ - `FEATURE_DOCS`: glob `<MODULES_ROOT>/<MODULE_NAME>/docs/features/*.md`
23
+ - `MODEL_DOCS`: glob `<MODULES_ROOT>/<MODULE_NAME>/docs/models/*.md`
24
+ - `COMMAND_DOCS`: glob `<MODULES_ROOT>/<MODULE_NAME>/docs/commands/*.md`
25
+ - `QUERY_DOCS`: glob `<MODULES_ROOT>/<MODULE_NAME>/docs/queries/*.md`
26
+
27
+ Verify that at least some model/command/query docs exist. If none exist, stop with: "No existing docs found. Use erp-kit-module-3-plan to create docs first."
28
+
29
+ ## Step 2: Extract & Triage Review Findings
30
+
31
+ Look at the conversation history for the most recent plan review report (from erp-kit-module-4-plan-review). Extract all `critical` and `major` findings.
32
+
33
+ If no review report is found in conversation history, ask the user: "No review report found in this conversation. Please either run /erp-kit-module-4-plan-review first, or paste the review findings."
34
+
35
+ ### Severity Re-evaluation
36
+
37
+ The review may over-classify findings. Before accepting each finding, re-evaluate it by reading the relevant feature docs:
38
+
39
+ - **"Is this a real gap or a design choice?"** — If the feature intentionally omits a command/query/model (e.g., handled by another module, deferred to a later phase, or covered by a generic mechanism), **reject** the finding
40
+ - **"Does the feature doc explicitly require this?"** — Only accept findings for capabilities the feature doc actually specifies. Reject findings that invent requirements the feature does not mention
41
+ - **"Does this block implementation?"** → accept as `critical`
42
+ - **"Will this cause rework during implementation?"** → accept as `major`
43
+ - Neither → downgrade to `nit` (informational only, do not fix)
44
+
45
+ ### Categorize accepted findings into:
46
+
47
+ 1. **Missing docs** — new model/command/query docs that need to be created
48
+ 2. **Incomplete docs** — existing docs with missing fields, business rules, or error scenarios
49
+ 3. **Inconsistencies** — mismatches between feature docs and model/command/query docs
50
+
51
+ ## Step 3: Plan the Delta
52
+
53
+ Produce a targeted fix plan listing **only** the changes needed. Format:
54
+
55
+ ### Fix Plan
56
+
57
+ **Findings rejected** (design choices or not required by feature docs):
58
+ - (list rejected findings with reason — these will NOT be fixed)
59
+
60
+ **Findings downgraded to nit** (informational, no action):
61
+ - (list downgraded findings with reason)
62
+
63
+ **Docs to create:**
64
+ - (list new docs with purpose — scaffold these)
65
+
66
+ **Docs to update:**
67
+ - (list existing docs with specific changes needed — edit in place)
68
+
69
+ **Docs unchanged:**
70
+ - (explicitly note docs that are fine — do NOT touch these)
71
+
72
+ ## Step 4: Apply Fixes
73
+
74
+ For each item in the fix plan:
75
+
76
+ ### Missing docs → Scaffold & Populate
77
+
78
+ Scaffold using `erp-kit` CLI. **Names must be PascalCase** (see [naming convention](references/naming.md)):
79
+
80
+ ```bash
81
+ erp-kit module generate doc model ModelName -p <MODULES_ROOT>/<module-name>
82
+ erp-kit module generate doc command CommandName -p <MODULES_ROOT>/<module-name>
83
+ erp-kit module generate doc query QueryName -p <MODULES_ROOT>/<module-name>
84
+ ```
85
+
86
+ Populate the new docs using the extraction rules from:
87
+
88
+ - [Model extraction](references/model-extraction.md)
89
+ - [Command extraction](references/command-extraction.md)
90
+ - [Query extraction](references/query-extraction.md)
91
+
92
+ ### Incomplete docs → Edit in place
93
+
94
+ Read the existing doc, then edit it directly to add the missing content. Do NOT re-scaffold or overwrite.
95
+
96
+ ### Inconsistencies → Align with feature spec
97
+
98
+ Read both the feature doc and the model/command/query doc, then edit the model/command/query doc to align with the feature spec.
99
+
100
+ **Important**: Do NOT touch docs listed as "unchanged."
101
+
102
+ ## Step 5: Dispatch Refinement Agents (parallelize)
103
+
104
+ Launch up to 3 Agent tool calls in parallel — one per doc type that had changes — to review and refine the modified docs. Skip agents for doc types with no changes.
105
+
106
+ Each agent receives: MODULE_NAME, the list of **changed** doc file paths only, and FEATURE_DOCS for cross-reference.
107
+
108
+ | Agent | Prompt Template | Inputs |
109
+ | ----- | ---------------------------------------------------------------------------------------- | -------------------------------------------------- |
110
+ | 1 | [model-extraction.md](references/model-extraction.md) | MODULE_NAME, changed model doc paths, FEATURE_DOCS |
111
+ | 2 | [command-extraction.md](references/command-extraction.md) | MODULE_NAME, changed command doc paths, FEATURE_DOCS |
112
+ | 3 | [query-extraction.md](references/query-extraction.md) | MODULE_NAME, changed query doc paths, FEATURE_DOCS |
113
+
114
+ For each agent:
115
+
116
+ 1. Read the prompt template file
117
+ 2. Replace `{{MODULE_NAME}}` with the resolved module name
118
+ 3. Replace `{{FEATURE_DOCS}}` with the actual file paths
119
+ 4. Add to the prompt: "Read the docs at [doc paths]. These were just modified to fix review findings. Cross-reference against the feature docs and the extraction rules. Fix any remaining issues. Edit files directly."
120
+ 5. Dispatch the agent with the filled prompt
121
+
122
+ ## Step 6: Validate
123
+
124
+ Run `pnpm run module:doc:check` and fix any violations.
125
+
126
+ ## References
127
+
128
+ - [Naming convention](references/naming.md)
129
+ - [Module structure](../erp-kit-module-shared/references/structure.md)
130
+ - [Model extraction rules](references/model-extraction.md)
131
+ - [Command extraction rules](references/command-extraction.md)
132
+ - [Query extraction rules](references/query-extraction.md)
@@ -0,0 +1,87 @@
1
+ # Command Extraction
2
+
3
+ ## Context
4
+
5
+ Module: {{MODULE_NAME}}
6
+ Feature docs: {{FEATURE_DOCS}}
7
+
8
+ ## Instructions
9
+
10
+ Read ALL feature docs and extract command (write operation) definitions.
11
+
12
+ 1. Read ALL feature docs at the paths above
13
+ 2. For each feature, identify operations that change state
14
+ 3. For each operation, extract:
15
+ - Command name (following naming convention)
16
+ - Input parameters
17
+ - Business rules and validations
18
+ - Error scenarios
19
+ - Process flow (step-by-step)
20
+
21
+ ## Naming Convention
22
+
23
+ See [naming.md](naming.md) for the full canonical verb vocabulary.
24
+
25
+ Key mappings:
26
+
27
+ | Feature Operation | Command Name |
28
+ | -------------------- | -------------- |
29
+ | "Create X" / "Add X" | `createX` |
30
+ | "Update X" | `updateX` |
31
+ | "Delete X" | `deleteX` |
32
+ | "Deactivate X" | `deactivateX` |
33
+ | "Activate X" | `activateX` |
34
+ | "Reactivate X" | `reactivateX` |
35
+ | "Set default X" | `setDefaultX` |
36
+ | "Assign X to Y" | `assignXToY` |
37
+ | "Remove X from Y" | `removeXFromY` |
38
+ | "Revoke X from Y" | `revokeXFromY` |
39
+ | "Move X" | `moveX` |
40
+ | "Log X" | `logX` |
41
+
42
+ **Banned verbs**: `archive`, `unarchive`, `disable`, `enable`, `add...To...`, `unlink`
43
+
44
+ ## Extraction Rules
45
+
46
+ ### Business Rules
47
+
48
+ - Extract explicit validation rules from feature scenarios
49
+ - Extract implicit rules from test cases ("should not allow X when Y")
50
+ - Map each rule to an error scenario
51
+
52
+ ### Error Scenarios
53
+
54
+ - For each business rule violation, define an error code
55
+ - Follow SCREAMING_SNAKE_CASE convention
56
+ - Categories: NOT_FOUND, DUPLICATE, LOCKED/INACTIVE, INVALID_STATE, NO_OP
57
+
58
+ ### Process Flow
59
+
60
+ - Extract step-by-step flow from feature scenarios
61
+ - Identify branching points (conditional logic)
62
+ - Map to validate → query → mutate pattern
63
+
64
+ ## Output Format
65
+
66
+ Return your extraction as a structured markdown report:
67
+
68
+ ### Commands
69
+
70
+ For each command:
71
+
72
+ #### <commandName>
73
+
74
+ - **Source features:** list of feature files
75
+ - **Target model:** ModelName
76
+ - **Inputs:**
77
+
78
+ | Param | Type | Required | Description |
79
+ | ----- | ---- | -------- | ----------- |
80
+
81
+ - **Business Rules:**
82
+
83
+ | Rule | Error Code | Error Message |
84
+ | ---- | ---------- | ------------- |
85
+
86
+ - **Process Flow:** numbered steps
87
+ - **Permissions:** list
@@ -0,0 +1,72 @@
1
+ # Model Extraction
2
+
3
+ ## Context
4
+
5
+ Module: {{MODULE_NAME}}
6
+ Feature docs: {{FEATURE_DOCS}}
7
+
8
+ ## Instructions
9
+
10
+ Read ALL feature docs and extract entity/model definitions.
11
+
12
+ 1. Read ALL feature docs at the paths above
13
+ 2. For each feature, identify entities that need database models
14
+ 3. For each entity, extract:
15
+ - Fields and their types
16
+ - Relationships to other entities
17
+ - State machines (if stateful)
18
+ - Required constraints (unique, required, etc.)
19
+ 4. Resolve cross-feature entity references (same entity mentioned in multiple features)
20
+
21
+ ## Extraction Rules
22
+
23
+ ### Entity Identification
24
+
25
+ - Look for nouns that represent persistent data
26
+ - Check for explicit "Entity" or "Model" mentions
27
+ - Identify implicit entities from relationship descriptions
28
+
29
+ ### Field Extraction
30
+
31
+ - Map feature attributes to database field types
32
+ - Identify required vs optional fields
33
+ - Note any validation constraints
34
+
35
+ ### State Machine Extraction
36
+
37
+ - Look for state diagrams or transition descriptions
38
+ - Extract all possible states
39
+ - Map transitions to operations (verbs → commands)
40
+
41
+ ### Relationship Extraction
42
+
43
+ - Identify foreign key relationships (N-1, 1-1)
44
+ - Identify junction table needs (N-N)
45
+ - Note cross-module entity references
46
+
47
+ ## Output Format
48
+
49
+ Return your extraction as a structured markdown report:
50
+
51
+ ### Models
52
+
53
+ For each model:
54
+
55
+ #### <ModelName>
56
+
57
+ - **Source features:** list of feature files
58
+ - **Fields:**
59
+
60
+ | Field | Type | Required | Description |
61
+ | ----- | ---- | -------- | ----------- |
62
+
63
+ - **Relationships:**
64
+
65
+ | Type | Target | Field | Cross-module |
66
+ | ---- | ------ | ----- | ------------ |
67
+
68
+ - **States:** list of states (if stateful)
69
+ - **State Transitions:**
70
+
71
+ | From | To | Trigger (command) |
72
+ | ---- | --- | ----------------- |