@tailor-platform/erp-kit 0.8.0 → 0.9.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.
- package/CHANGELOG.md +15 -0
- package/package.json +1 -1
- package/skills/erp-kit-app-1-requirements/SKILL.md +6 -0
- package/skills/erp-kit-app-2-requirements-review/SKILL.md +6 -0
- package/skills/erp-kit-app-3-plan/SKILL.md +6 -0
- package/skills/erp-kit-app-4-plan-review/SKILL.md +6 -0
- package/skills/erp-kit-app-5-impl-backend/SKILL.md +7 -0
- package/skills/erp-kit-app-6-impl-frontend/SKILL.md +6 -0
- package/skills/erp-kit-app-7-impl-review/SKILL.md +6 -0
- package/skills/erp-kit-app-shared/SKILL.md +2 -0
- package/skills/erp-kit-mock-scenario/SKILL.md +6 -0
- package/skills/erp-kit-module-1-requirements/SKILL.md +6 -0
- package/skills/erp-kit-module-2-requirements-review/SKILL.md +6 -0
- package/skills/erp-kit-module-3-plan/SKILL.md +6 -0
- package/skills/erp-kit-module-3-update-plan/SKILL.md +6 -0
- package/skills/erp-kit-module-4-plan-review/SKILL.md +6 -0
- package/skills/erp-kit-module-5-impl/SKILL.md +6 -0
- package/skills/erp-kit-module-6-impl-review/SKILL.md +6 -0
- package/skills/erp-kit-module-shared/SKILL.md +2 -0
- package/skills/erp-kit-module-shared/references/commands.md +3 -0
- package/skills/erp-kit-update/SKILL.md +6 -0
- package/src/modules/accounting/command/assignProfitCenterToHierarchyNode.test.ts +3 -3
- package/src/modules/accounting/command/assignProfitCenterToHierarchyNode.ts +1 -1
- package/src/modules/accounting/command/createCostCenterHierarchyNode.test.ts +3 -3
- package/src/modules/accounting/command/createCostCenterHierarchyNode.ts +1 -1
- package/src/modules/accounting/command/moveCostCenterHierarchyNode.test.ts +2 -2
- package/src/modules/accounting/command/moveCostCenterHierarchyNode.ts +1 -1
- package/src/modules/accounting/module.ts +1 -0
- package/src/modules/business-partner/command/createPartnerBankAccount.test.ts +3 -3
- package/src/modules/business-partner/command/createPartnerBankAccount.ts +1 -1
- package/src/modules/business-partner/module.ts +1 -0
- package/src/modules/coa-management/command/activateAccount.test.ts +0 -15
- package/src/modules/coa-management/command/activateAccount.ts +1 -42
- package/src/modules/coa-management/command/activateChartOfAccounts.test.ts +2 -31
- package/src/modules/coa-management/command/activateChartOfAccounts.ts +1 -37
- package/src/modules/coa-management/command/createAccount.test.ts +0 -28
- package/src/modules/coa-management/command/createAccount.ts +0 -43
- package/src/modules/coa-management/command/createAccountGroup.test.ts +2 -51
- package/src/modules/coa-management/command/createAccountGroup.ts +1 -56
- package/src/modules/coa-management/command/createChartOfAccounts.test.ts +1 -49
- package/src/modules/coa-management/command/createChartOfAccounts.ts +0 -51
- package/src/modules/coa-management/command/deactivateAccount.test.ts +0 -15
- package/src/modules/coa-management/command/deactivateAccount.ts +1 -53
- package/src/modules/coa-management/command/deactivateChartOfAccounts.test.ts +2 -29
- package/src/modules/coa-management/command/deactivateChartOfAccounts.ts +1 -37
- package/src/modules/coa-management/command/deleteAccount.test.ts +0 -13
- package/src/modules/coa-management/command/deleteAccount.ts +1 -42
- package/src/modules/coa-management/command/deleteAccountGroup.test.ts +0 -19
- package/src/modules/coa-management/command/deleteAccountGroup.ts +1 -42
- package/src/modules/coa-management/command/deleteChartOfAccounts.test.ts +2 -58
- package/src/modules/coa-management/command/deleteChartOfAccounts.ts +4 -88
- package/src/modules/coa-management/command/moveAccountGroup.test.ts +0 -27
- package/src/modules/coa-management/command/moveAccountGroup.ts +1 -48
- package/src/modules/coa-management/command/reactivateAccount.test.ts +0 -15
- package/src/modules/coa-management/command/reactivateAccount.ts +1 -53
- package/src/modules/coa-management/command/updateAccount.test.ts +0 -15
- package/src/modules/coa-management/command/updateAccount.ts +0 -92
- package/src/modules/coa-management/command/updateAccountGroup.test.ts +0 -20
- package/src/modules/coa-management/command/updateAccountGroup.ts +1 -61
- package/src/modules/coa-management/command/updateChartOfAccounts.test.ts +2 -31
- package/src/modules/coa-management/command/updateChartOfAccounts.ts +1 -50
- package/src/modules/coa-management/docs/commands/ActivateAccount.md +1 -4
- package/src/modules/coa-management/docs/commands/ActivateChartOfAccounts.md +1 -4
- package/src/modules/coa-management/docs/commands/CreateAccount.md +1 -4
- package/src/modules/coa-management/docs/commands/CreateAccountGroup.md +2 -5
- package/src/modules/coa-management/docs/commands/CreateChartOfAccounts.md +2 -6
- package/src/modules/coa-management/docs/commands/DeactivateAccount.md +1 -4
- package/src/modules/coa-management/docs/commands/DeactivateChartOfAccounts.md +1 -4
- package/src/modules/coa-management/docs/commands/DeleteAccount.md +1 -4
- package/src/modules/coa-management/docs/commands/DeleteAccountGroup.md +1 -4
- package/src/modules/coa-management/docs/commands/DeleteChartOfAccounts.md +1 -6
- package/src/modules/coa-management/docs/commands/MoveAccountGroup.md +1 -4
- package/src/modules/coa-management/docs/commands/ReactivateAccount.md +1 -4
- package/src/modules/coa-management/docs/commands/UpdateAccount.md +1 -4
- package/src/modules/coa-management/docs/commands/UpdateAccountGroup.md +2 -5
- package/src/modules/coa-management/docs/commands/UpdateChartOfAccounts.md +1 -4
- package/src/modules/coa-management/module.ts +16 -27
- package/src/modules/finance-ledger/module.ts +1 -0
- package/src/modules/inventory/command/approveInventoryAdjustment.test.ts +1 -1
- package/src/modules/inventory/command/approveInventoryAdjustment.ts +1 -1
- package/src/modules/inventory/command/cancelStockMovement.test.ts +2 -2
- package/src/modules/inventory/command/cancelStockMovement.ts +1 -1
- package/src/modules/inventory/command/confirmInventoryAdjustment.test.ts +4 -4
- package/src/modules/inventory/command/confirmInventoryAdjustment.ts +1 -1
- package/src/modules/inventory/command/confirmStockMovement.test.ts +1 -1
- package/src/modules/inventory/command/confirmStockMovement.ts +1 -1
- package/src/modules/inventory/command/createInventoryAdjustment.test.ts +6 -6
- package/src/modules/inventory/command/createInventoryAdjustment.ts +1 -1
- package/src/modules/inventory/command/createStockMovement.test.ts +3 -3
- package/src/modules/inventory/command/createStockMovement.ts +1 -1
- package/src/modules/inventory/command/executeStockMovement.test.ts +5 -5
- package/src/modules/inventory/command/executeStockMovement.ts +1 -1
- package/src/modules/inventory/command/rejectInventoryAdjustment.test.ts +1 -1
- package/src/modules/inventory/command/rejectInventoryAdjustment.ts +1 -1
- package/src/modules/inventory/command/reviseInventoryAdjustment.test.ts +2 -2
- package/src/modules/inventory/command/reviseInventoryAdjustment.ts +1 -1
- package/src/modules/inventory/command/submitInventoryAdjustment.test.ts +1 -1
- package/src/modules/inventory/command/submitInventoryAdjustment.ts +1 -1
- package/src/modules/inventory/command/updateStockMovement.test.ts +4 -4
- package/src/modules/inventory/command/updateStockMovement.ts +2 -2
- package/src/modules/inventory/module.ts +1 -0
- package/src/modules/item-management/command/createTaxonomyNode.test.ts +4 -4
- package/src/modules/item-management/command/createTaxonomyNode.ts +1 -1
- package/src/modules/item-management/command/moveTaxonomyNode.test.ts +2 -2
- package/src/modules/item-management/command/moveTaxonomyNode.ts +2 -2
- package/src/modules/item-management/command/updateTaxonomyNode.test.ts +2 -2
- package/src/modules/item-management/command/updateTaxonomyNode.ts +1 -1
- package/src/modules/item-management/module.ts +1 -0
- package/src/modules/manufacturing/command/createRouting.ts +1 -1
- package/src/modules/manufacturing/command/recordInventoryIssueOutcome.test.ts +1 -1
- package/src/modules/manufacturing/command/recordInventoryIssueOutcome.ts +1 -1
- package/src/modules/manufacturing/command/recordManufacturingCostSettlementAcknowledgment.test.ts +1 -1
- package/src/modules/manufacturing/command/recordManufacturingCostSettlementAcknowledgment.ts +1 -1
- package/src/modules/manufacturing/command/reviewManufacturingCostSummary.test.ts +1 -1
- package/src/modules/manufacturing/command/reviewManufacturingCostSummary.ts +1 -1
- package/src/modules/manufacturing/command/updateRouting.ts +1 -1
- package/src/modules/manufacturing/module.ts +1 -0
- package/src/modules/organization/module.ts +1 -0
- package/src/modules/primitives/module.ts +1 -0
- package/src/modules/product-management/command/assignProductToCategory.test.ts +2 -2
- package/src/modules/product-management/command/assignProductToCategory.ts +2 -2
- package/src/modules/product-management/command/createProductAttribute.test.ts +1 -1
- package/src/modules/product-management/command/createProductAttribute.ts +1 -1
- package/src/modules/product-management/command/createProductAttributeValue.test.ts +1 -1
- package/src/modules/product-management/command/createProductAttributeValue.ts +1 -1
- package/src/modules/product-management/command/createProductCategory.test.ts +2 -2
- package/src/modules/product-management/command/createProductCategory.ts +1 -1
- package/src/modules/product-management/command/setProductAttributeAssignment.test.ts +3 -3
- package/src/modules/product-management/command/setProductAttributeAssignment.ts +2 -2
- package/src/modules/product-management/module.ts +1 -0
- package/src/modules/purchase/command/activatePurchasePaymentTerm.test.ts +4 -4
- package/src/modules/purchase/command/activatePurchasePaymentTerm.ts +2 -2
- package/src/modules/purchase/command/deactivatePurchasePaymentTerm.test.ts +4 -4
- package/src/modules/purchase/command/deactivatePurchasePaymentTerm.ts +2 -2
- package/src/modules/purchase/command/updatePurchasePaymentTerm.test.ts +2 -2
- package/src/modules/purchase/command/updatePurchasePaymentTerm.ts +1 -1
- package/src/modules/purchase/module.ts +1 -0
- package/src/modules/sales/command/createSalesOrder.ts +1 -1
- package/src/modules/sales/module.ts +1 -0
- package/templates/scaffold/app/backend/eslint.config.js +17 -0
- package/templates/scaffold/app/backend/package.json +1 -0
- package/templates/scaffold/app/backend/src/tests/stories/audit-log/user--view-audit-log-detail.test.ts +3 -3
- package/templates/scaffold/app/backend/src/tests/stories/role-management/user--assign-role-to-user.test.ts +4 -4
- package/templates/scaffold/app/backend/src/tests/stories/role-management/user--remove-role-from-user.test.ts +4 -4
- package/templates/scaffold/app/backend/src/tests/stories/user-lifecycle/user--toggle-user-status.test.ts +6 -6
- package/templates/scaffold/app/backend/src/tests/stories/user-lifecycle/user--update-own-profile.test.ts +13 -13
- package/templates/scaffold/app/backend/src/tests/stories/user-lifecycle/user--update-user-profile.test.ts +16 -17
- package/templates/scaffold/app/backend/src/tests/stories/user-lifecycle/user--view-user-detail.test.ts +3 -3
- package/templates/scaffold/app/backend/tailor.config.ts +15 -1
- package/templates/scaffold/app/backend/tsconfig.json +1 -1
- package/templates/scaffold/app/frontend/src/App.tsx +57 -16
- package/templates/scaffold/module/eslint.config.js +24 -0
- package/templates/scaffold/module/module.ts +1 -0
- package/templates/scaffold/module/package.json +3 -1
- package/templates/scaffold/module/vitest.config.ts +11 -0
- /package/templates/scaffold/app/frontend/src/pages/{user-management/audit → audit}/[id]/components/audit-entry-detail.tsx +0 -0
- /package/templates/scaffold/app/frontend/src/pages/{user-management/audit → audit}/[id]/page.tsx +0 -0
- /package/templates/scaffold/app/frontend/src/pages/{user-management/audit → audit}/components/audit-entries-table.tsx +0 -0
- /package/templates/scaffold/app/frontend/src/pages/{user-management/audit → audit}/page.tsx +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @tailor-platform/erp-kit
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- afa2455: - Add seed:validate script and skill step to scaffold template
|
|
8
|
+
- Add vitest to module scaffold template
|
|
9
|
+
- Add version self-checking to all erp-kit skills
|
|
10
|
+
- Fix command return properties to use full model names across all modules
|
|
11
|
+
- Fix tree-shaking by adding sideEffects annotations to all module defineModule exports
|
|
12
|
+
- Fix scaffold app integration tests
|
|
13
|
+
- Fix inactive users being able to access the scaffold app
|
|
14
|
+
- Fix skills CLI version check, remove erp-kit-shared dependency
|
|
15
|
+
- Refactor audit pages out of user-management directory into standalone location
|
|
16
|
+
- Remove audit dependency from coa-management module
|
|
17
|
+
|
|
3
18
|
## 0.8.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-app-1-requirements
|
|
3
3
|
description: Create Tier 1-2 documentation (requirements, actors, business-flow) for an application. Use when starting a new application or documenting high-level requirements and workflows.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Application Requirement Analysis Workflow
|
|
7
9
|
|
|
8
10
|
Create Tier 1-2 documentation: Requirements, Actors, and Business Flows.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## Progress Logging
|
|
11
17
|
|
|
12
18
|
Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-app-2-requirements-review
|
|
3
3
|
description: Review requirements quality and documentation consistency for applications. Use after creating Tier 1-2 documentation (requirements, actors, business-flow) with erp-kit-app-1-requirements.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Requirements Review
|
|
7
9
|
|
|
8
10
|
Review **requirements quality** and **documentation consistency** for an application's Tier 1-2 documentation.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## Progress Logging
|
|
11
17
|
|
|
12
18
|
Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-app-3-plan
|
|
3
3
|
description: Create Tier 3-4 documentation (screens, resolvers) by breaking down business flows and existing stories. Use after completing requirements review with erp-kit-app-2-requirements-review.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Business Flow Breakdown to Stories, Screens, and Resolvers
|
|
7
9
|
|
|
8
10
|
Convert Tier 2 business flows and stories into Tier 3 (screens) and Tier 4 (resolvers) documentation using parallel extraction agents.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## Progress Logging
|
|
11
17
|
|
|
12
18
|
Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-app-4-plan-review
|
|
3
3
|
description: Review parity between Tier 2 (business flows, actors, stories) and Tier 3-4 (screens, resolvers). Use after creating plan documentation with erp-kit-app-3-plan to validate completeness.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Documentation Parity Review
|
|
7
9
|
|
|
8
10
|
Review **documentation consistency** across Tier 2 (business flows, actors, stories), Tier 3 (screens), and Tier 4 (resolvers) documentation.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## Progress Logging
|
|
11
17
|
|
|
12
18
|
Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-app-5-impl-backend
|
|
3
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
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Application Backend Implementation
|
|
7
9
|
|
|
8
10
|
Implement backend resolvers and application configuration for an application, driven by Tier 1-4 documentation (actors, business flows, stories, screens, resolvers).
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## Progress Logging
|
|
11
17
|
|
|
12
18
|
Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
|
|
@@ -117,6 +123,7 @@ After resolvers are done, implement the story integration test stubs generated i
|
|
|
117
123
|
- **Seed data** (`seed/`) — `exec.mjs` runner + `data/*.jsonl` (records) and `data/*.schema.ts` (validation).
|
|
118
124
|
1. **Module seed** — Run `pnpm erp-kit app generate seed -p <app-path>` to generate module-provided defaults (currencies, units, UoM categories, exchange rates). This writes JSONL files to `seed/data/`, skipping files that already exist.
|
|
119
125
|
2. **App-specific seed** — Manually create seed records for permissions, roles, test users, and domain-specific data. Seeded users must have concrete permission keys required by the wired modules.
|
|
126
|
+
3. **Validate seed** — Run `pnpm run seed:validate` and fix any errors before proceeding.
|
|
120
127
|
|
|
121
128
|
### Phase 6: Deploy Backend & Next Steps
|
|
122
129
|
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-app-6-impl-frontend
|
|
3
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
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Application Frontend Implementation
|
|
7
9
|
|
|
8
10
|
Implement frontend pages for an application, driven by screen spec documentation and a deployed backend.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## Progress Logging
|
|
11
17
|
|
|
12
18
|
Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-app-7-impl-review
|
|
3
3
|
description: Review implementation parity between documentation and code for applications. Use after frontend implementation (step 6) to validate code matches documentation.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Implementation Parity Review
|
|
7
9
|
|
|
8
10
|
Review **implementation consistency** between Tier 3-4 documentation and actual backend/frontend code.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## Progress Logging
|
|
11
17
|
|
|
12
18
|
Log to the audit trail at every checkpoint. See [erp-kit-app-shared/references/progress-protocol.md](../erp-kit-app-shared/references/progress-protocol.md) for the full protocol.
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-mock-scenario
|
|
3
3
|
description: Scaffold a new Mockoon mock scenario with CRUD routes, error scenarios, and registry updates
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Mock Scenario Scaffolder
|
|
7
9
|
|
|
8
10
|
Generate a complete Mockoon mock API config for a new provider scenario and wire it into the registry.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## Workflow
|
|
11
17
|
|
|
12
18
|
### Step 1: Identify target API
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-module-1-requirements
|
|
3
3
|
description: Create ERP module requirements and feature documentation. Use when starting a new module, defining requirements, scoping features, or designing module architecture. Guides collaborative research, scoping, and iterative feature breakdown.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Module Requirements Workflow
|
|
7
9
|
|
|
8
10
|
Autonomous workflow for creating ERP module requirements. Uses parallel agents for research, then automatically decides scope based on recommendations.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## Workflow
|
|
11
17
|
|
|
12
18
|
```
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-module-2-requirements-review
|
|
3
3
|
description: Review requirements quality and module boundary consistency. Use after creating requirements (step 1) to validate best practices and cross-module boundaries.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Requirements Review
|
|
7
9
|
|
|
8
10
|
Review **requirements quality** and **module boundary consistency** for a module.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## When to Use
|
|
11
17
|
|
|
12
18
|
- After writing module requirements and feature documentation (step 1)
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-module-3-plan
|
|
3
3
|
description: Create implementation plan by breaking down feature specs into model, command, and query documentation. Use after requirements review (step 2) to plan the implementation structure.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Feature Breakdown to Model/Command/Query Docs
|
|
7
9
|
|
|
8
10
|
Convert feature specifications into structured model, command, and query documentation. The main agent creates the plan and populates scaffolded docs, then parallel subagents refine each doc type.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## When to Use
|
|
11
17
|
|
|
12
18
|
- User has feature specs (e.g., `docs/features/*.md`) and wants implementation docs
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-module-3-update-plan
|
|
3
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
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Fix Plan Documentation from Review Feedback
|
|
7
9
|
|
|
8
10
|
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
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## When to Use
|
|
11
17
|
|
|
12
18
|
- After erp-kit-module-4-plan-review returns **NEEDS CHANGES**
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-module-4-plan-review
|
|
3
3
|
description: Review parity between feature documentation and command/model/query documentation. Use after creating implementation plan (step 3) to validate completeness.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Feature Parity Review
|
|
7
9
|
|
|
8
10
|
Review **documentation consistency** between feature specs and command/model/query docs.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## When to Use
|
|
11
17
|
|
|
12
18
|
- After writing feature documentation, check for gaps in command/model/query documentation
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-module-5-impl
|
|
3
3
|
description: Implement features in modules using TDD. Use after plan review (step 4) to implement database models, commands, and queries with test-driven development.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# TDD Implementation for Module Development
|
|
7
9
|
|
|
8
10
|
Implement features in modules using Test-Driven Development with per-item agent delegation.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## When to Use
|
|
11
17
|
|
|
12
18
|
- Implementing new domain commands in any module
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-module-6-impl-review
|
|
3
3
|
description: Review implementation parity between documentation and code. Use after TDD implementation (step 5) to validate code matches documentation.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Implementation Parity Review
|
|
7
9
|
|
|
8
10
|
Review **implementation consistency** between documentation and actual code.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## When to Use
|
|
11
17
|
|
|
12
18
|
- After TDD implementation (step 4), verify it matches documentation
|
|
@@ -179,6 +179,9 @@ const units = await db
|
|
|
179
179
|
|
|
180
180
|
- **Error handling**: Use `ok()` / `err()` from `@tailor-platform/erp-kit/module` — do not throw
|
|
181
181
|
- **Validation**: Check referenced entities exist before operating, return `err()` if not found
|
|
182
|
+
- **Return property naming**: Use the full model name in camelCase as the return property key — never abbreviate. This keeps property names unambiguous across modules.
|
|
183
|
+
- `return ok({ stockMovement: ... })` — not `movement`
|
|
184
|
+
- `return ok({ inventoryAdjustment: ... })` — not `adjustment`
|
|
182
185
|
|
|
183
186
|
## Update Command Input Type
|
|
184
187
|
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: erp-kit-update
|
|
3
3
|
description: Route requirements changes to the correct erp-kit skill. Use when requirements change midway — adding features, modifying business flows, updating screens, changing module specs, or when unsure which erp-kit skill to re-run after a change.
|
|
4
|
+
metadata:
|
|
5
|
+
erp-kit-version: "0.9.0"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Requirements Update Router
|
|
7
9
|
|
|
8
10
|
Route mid-workflow changes to the correct erp-kit skill. Dynamically discovers available skills — no hardcoded routing tables.
|
|
9
11
|
|
|
12
|
+
## Version Check
|
|
13
|
+
|
|
14
|
+
Run `npx erp-kit --version` and compare against this skill's `metadata.erp-kit-version`. If they differ, the local skills are outdated — tell the user to run `pnpm erp-kit update skills` and stop.
|
|
15
|
+
|
|
10
16
|
## Workflow
|
|
11
17
|
|
|
12
18
|
```
|
|
@@ -29,7 +29,7 @@ describe("assignProfitCenterToHierarchyNode", () => {
|
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
const value = expectOk(result);
|
|
32
|
-
expect(value.
|
|
32
|
+
expect(value.profitCenterHierarchyAssignment).toEqual(baseProfitCenterHierarchyAssignment);
|
|
33
33
|
expect(spies.insert).toHaveBeenCalled();
|
|
34
34
|
expect(spies.update).not.toHaveBeenCalled();
|
|
35
35
|
});
|
|
@@ -56,7 +56,7 @@ describe("assignProfitCenterToHierarchyNode", () => {
|
|
|
56
56
|
);
|
|
57
57
|
|
|
58
58
|
const value = expectOk(result);
|
|
59
|
-
expect(value.
|
|
59
|
+
expect(value.profitCenterHierarchyAssignment.hierarchyNodeId).toBe(childProfitCenterNode.id);
|
|
60
60
|
expect(spies.update).toHaveBeenCalled();
|
|
61
61
|
expect(spies.insert).not.toHaveBeenCalled();
|
|
62
62
|
});
|
|
@@ -90,7 +90,7 @@ describe("assignProfitCenterToHierarchyNode", () => {
|
|
|
90
90
|
);
|
|
91
91
|
|
|
92
92
|
const value = expectOk(result);
|
|
93
|
-
expect(value.
|
|
93
|
+
expect(value.profitCenterHierarchyAssignment.hierarchyNodeId).toBe(secondHierarchyNode.id);
|
|
94
94
|
expect(spies.insert).toHaveBeenCalled();
|
|
95
95
|
expect(spies.update).not.toHaveBeenCalled();
|
|
96
96
|
});
|
|
@@ -83,7 +83,7 @@ describe("createCostCenterHierarchyNode", () => {
|
|
|
83
83
|
);
|
|
84
84
|
|
|
85
85
|
const value = expectOk(result);
|
|
86
|
-
expect(value.
|
|
86
|
+
expect(value.costCenterHierarchyNode).toEqual(rootCostCenterNode);
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
it("creates child node with correct computed level", async () => {
|
|
@@ -105,8 +105,8 @@ describe("createCostCenterHierarchyNode", () => {
|
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
const value = expectOk(result);
|
|
108
|
-
expect(value.
|
|
109
|
-
expect(value.
|
|
108
|
+
expect(value.costCenterHierarchyNode).toEqual(childCostCenterNode);
|
|
109
|
+
expect(value.costCenterHierarchyNode.level).toBe(1);
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
it("returns error when node references itself as parent", async () => {
|
|
@@ -104,7 +104,7 @@ describe("moveCostCenterHierarchyNode", () => {
|
|
|
104
104
|
);
|
|
105
105
|
|
|
106
106
|
const value = expectOk(result);
|
|
107
|
-
expect(value.
|
|
107
|
+
expect(value.costCenterHierarchyNode).toEqual(movedNode);
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
it("updates level based on new parent level", async () => {
|
|
@@ -130,6 +130,6 @@ describe("moveCostCenterHierarchyNode", () => {
|
|
|
130
130
|
);
|
|
131
131
|
|
|
132
132
|
const value = expectOk(result);
|
|
133
|
-
expect(value.
|
|
133
|
+
expect(value.costCenterHierarchyNode.level).toBe(1);
|
|
134
134
|
});
|
|
135
135
|
});
|
|
@@ -190,6 +190,7 @@ export interface DefineModuleParams<
|
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
193
194
|
export const defineModule = <
|
|
194
195
|
const CeF extends Record<string, TailorAnyDBField> = EmptyFields,
|
|
195
196
|
const CcF extends Record<string, TailorAnyDBField> = EmptyFields,
|
|
@@ -67,7 +67,7 @@ describe("createPartnerBankAccount", () => {
|
|
|
67
67
|
|
|
68
68
|
expect(result.ok).toBe(true);
|
|
69
69
|
if (result.ok) {
|
|
70
|
-
expect(result.value.
|
|
70
|
+
expect(result.value.partnerBankAccount).toEqual(baseDefaultBankAccount);
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
|
|
@@ -204,7 +204,7 @@ describe("createPartnerBankAccount", () => {
|
|
|
204
204
|
|
|
205
205
|
expect(result.ok).toBe(true);
|
|
206
206
|
if (result.ok) {
|
|
207
|
-
expect(result.value.
|
|
207
|
+
expect(result.value.partnerBankAccount.partnerId).toBe("partner-1");
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
210
|
|
|
@@ -221,7 +221,7 @@ describe("createPartnerBankAccount", () => {
|
|
|
221
221
|
|
|
222
222
|
expect(result.ok).toBe(true);
|
|
223
223
|
if (result.ok) {
|
|
224
|
-
expect(result.value.
|
|
224
|
+
expect(result.value.partnerBankAccount.partnerId).toBe("partner-3");
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
227
|
|
|
@@ -107,19 +107,4 @@ describe("activateAccount", () => {
|
|
|
107
107
|
expect(result.value.account.status).toBe("ACTIVE");
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
-
|
|
111
|
-
it("emits audit event recording status transition from DRAFT to ACTIVE", async () => {
|
|
112
|
-
const { db, spies } = createMockDb<Transaction>();
|
|
113
|
-
const activated = { ...baseDraftAccount, status: "ACTIVE" };
|
|
114
|
-
spies.select.mockReturnValueOnce(baseDraftAccount).mockReturnValueOnce(baseActiveCoa);
|
|
115
|
-
spies.update.mockReturnValue(activated);
|
|
116
|
-
|
|
117
|
-
const result = await run(db, { id: baseDraftAccount.id }, ctx);
|
|
118
|
-
|
|
119
|
-
// Audit event is emitted as part of successful activation
|
|
120
|
-
expect(result.ok).toBe(true);
|
|
121
|
-
if (result.ok) {
|
|
122
|
-
expect(result.value.account.status).toBe("ACTIVE");
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
110
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
2
1
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
3
2
|
import {
|
|
4
3
|
AccountNotFoundError,
|
|
@@ -12,35 +11,13 @@ export interface ActivateAccountInput {
|
|
|
12
11
|
from?: string[];
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
export interface AuditCommands {
|
|
16
|
-
logAuditEvent: (
|
|
17
|
-
db: Transaction,
|
|
18
|
-
input: {
|
|
19
|
-
eventId: string;
|
|
20
|
-
actorType: string;
|
|
21
|
-
actorId: string;
|
|
22
|
-
entityType: string;
|
|
23
|
-
entityId: string;
|
|
24
|
-
operationType: string;
|
|
25
|
-
companyId?: string;
|
|
26
|
-
changes: { fieldName: string; oldValue?: unknown; newValue?: unknown }[];
|
|
27
|
-
},
|
|
28
|
-
ctx: CommandContext,
|
|
29
|
-
) => Promise<{ ok: true; value: unknown }>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
14
|
/**
|
|
33
15
|
* Function: activateAccount
|
|
34
16
|
*
|
|
35
17
|
* Transitions a GL account from DRAFT to ACTIVE status, making it eligible
|
|
36
18
|
* to receive journal postings from downstream modules.
|
|
37
19
|
*/
|
|
38
|
-
export async function run(
|
|
39
|
-
db: Transaction,
|
|
40
|
-
input: ActivateAccountInput,
|
|
41
|
-
ctx: CommandContext,
|
|
42
|
-
auditCommands?: AuditCommands,
|
|
43
|
-
) {
|
|
20
|
+
export async function run(db: Transaction, input: ActivateAccountInput, _ctx: CommandContext) {
|
|
44
21
|
const { id, from = ["DRAFT"] } = input;
|
|
45
22
|
|
|
46
23
|
// 1. Find account with forUpdate
|
|
@@ -83,23 +60,5 @@ export async function run(
|
|
|
83
60
|
.returningAll()
|
|
84
61
|
.executeTakeFirst();
|
|
85
62
|
|
|
86
|
-
// 6. Emit audit event
|
|
87
|
-
if (auditCommands) {
|
|
88
|
-
await auditCommands.logAuditEvent(
|
|
89
|
-
db,
|
|
90
|
-
{
|
|
91
|
-
eventId: randomUUID(),
|
|
92
|
-
actorType: "USER",
|
|
93
|
-
actorId: ctx.actorId,
|
|
94
|
-
entityType: "Account",
|
|
95
|
-
entityId: id,
|
|
96
|
-
operationType: "UPDATE",
|
|
97
|
-
companyId: coa.companyId,
|
|
98
|
-
changes: [{ fieldName: "status", oldValue: account.status, newValue: "ACTIVE" }],
|
|
99
|
-
},
|
|
100
|
-
ctx,
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
63
|
return ok({ account: updated! });
|
|
105
64
|
}
|