@tailor-platform/erp-kit 0.4.0 → 0.4.1
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 +9 -0
- package/dist/cli.mjs +9 -9
- package/package.json +1 -1
- package/skills/erp-kit-app-1-requirements/SKILL.md +31 -3
- package/skills/{erp-kit-app-3-plan → erp-kit-app-1-requirements}/references/story-extraction.md +3 -9
- package/skills/erp-kit-app-2-requirements-review/SKILL.md +29 -5
- package/skills/erp-kit-app-2-requirements-review/references/story-quality-check.md +67 -0
- package/skills/erp-kit-app-3-plan/SKILL.md +33 -32
- package/skills/erp-kit-app-3-plan/references/resolver-extraction.md +4 -2
- package/skills/erp-kit-app-3-plan/references/screen-extraction.md +5 -3
- package/skills/erp-kit-app-4-plan-review/SKILL.md +16 -13
- package/skills/erp-kit-app-5-impl-backend/SKILL.md +10 -0
- package/skills/erp-kit-app-6-impl-frontend/SKILL.md +11 -0
- package/skills/erp-kit-app-7-impl-review/SKILL.md +18 -14
- package/skills/erp-kit-module-2-requirements-review/SKILL.md +16 -8
- package/skills/erp-kit-module-4-plan-review/SKILL.md +19 -12
- package/skills/erp-kit-module-shared/references/commands.md +1 -1
- package/skills/erp-kit-module-shared/references/queries.md +5 -6
- package/src/generator/generate-code-boilerplate.test.ts +0 -1
- package/src/generator/generate-code.test.ts +10 -6
- package/src/generator/generate-errors.ts +1 -1
- package/src/generator/generate-permissions.ts +1 -1
- package/src/generator/generate-shells.ts +2 -2
- package/src/generator/stub-templates.ts +5 -5
- package/src/module.ts +3 -0
- package/src/modules/audit/command/activateAuditPolicy.generated.ts +1 -1
- package/src/modules/audit/command/activateAuditPolicy.test.ts +1 -1
- package/src/modules/audit/command/activateAuditPolicy.ts +1 -1
- package/src/modules/audit/command/createAuditPolicy.generated.ts +1 -1
- package/src/modules/audit/command/createAuditPolicy.test.ts +1 -1
- package/src/modules/audit/command/createAuditPolicy.ts +1 -1
- package/src/modules/audit/command/deactivateAuditPolicy.generated.ts +1 -1
- package/src/modules/audit/command/deactivateAuditPolicy.test.ts +2 -2
- package/src/modules/audit/command/deactivateAuditPolicy.ts +1 -1
- package/src/modules/audit/command/deleteAuditPolicy.generated.ts +1 -1
- package/src/modules/audit/command/deleteAuditPolicy.test.ts +1 -1
- package/src/modules/audit/command/deleteAuditPolicy.ts +1 -1
- package/src/modules/audit/command/logAuditEvent.generated.ts +1 -1
- package/src/modules/audit/command/logAuditEvent.test.ts +1 -1
- package/src/modules/audit/command/logAuditEvent.ts +1 -1
- package/src/modules/audit/command/reactivateAuditPolicy.generated.ts +1 -1
- package/src/modules/audit/command/reactivateAuditPolicy.test.ts +2 -2
- package/src/modules/audit/command/reactivateAuditPolicy.ts +1 -1
- package/src/modules/audit/command/registerAuditableEntity.generated.ts +1 -1
- package/src/modules/audit/command/registerAuditableEntity.test.ts +1 -1
- package/src/modules/audit/command/registerAuditableEntity.ts +1 -1
- package/src/modules/audit/command/replaceAuditPolicy.generated.ts +1 -1
- package/src/modules/audit/command/replaceAuditPolicy.test.ts +1 -1
- package/src/modules/audit/command/replaceAuditPolicy.ts +1 -1
- package/src/modules/audit/command/updateAuditPolicy.generated.ts +1 -1
- package/src/modules/audit/command/updateAuditPolicy.test.ts +1 -1
- package/src/modules/audit/command/updateAuditPolicy.ts +1 -1
- package/src/modules/audit/lib/errors.generated.ts +1 -1
- package/src/modules/audit/lib/permissions.generated.ts +1 -1
- package/src/modules/audit/lib/types.ts +6 -1
- package/src/modules/audit/permissions.ts +1 -1
- package/src/modules/audit/query/getAuditEntry.generated.ts +1 -1
- package/src/modules/audit/query/getAuditEntry.test.ts +2 -2
- package/src/modules/audit/query/getAuditEntry.ts +7 -1
- package/src/modules/audit/query/getAuditPolicy.generated.ts +1 -1
- package/src/modules/audit/query/getAuditPolicy.test.ts +2 -2
- package/src/modules/audit/query/getAuditPolicy.ts +7 -1
- package/src/modules/audit/query/getAuditSummary.generated.ts +1 -1
- package/src/modules/audit/query/getAuditSummary.test.ts +2 -2
- package/src/modules/audit/query/getAuditSummary.ts +7 -1
- package/src/modules/audit/query/getChangeDetails.generated.ts +1 -1
- package/src/modules/audit/query/getChangeDetails.test.ts +2 -2
- package/src/modules/audit/query/getChangeDetails.ts +7 -1
- package/src/modules/audit/query/listAuditPolicies.generated.ts +1 -1
- package/src/modules/audit/query/listAuditPolicies.test.ts +2 -2
- package/src/modules/audit/query/listAuditPolicies.ts +3 -3
- package/src/modules/audit/query/searchAuditEntries.generated.ts +1 -1
- package/src/modules/audit/query/searchAuditEntries.test.ts +2 -2
- package/src/modules/audit/query/searchAuditEntries.ts +7 -7
- package/src/modules/business-partner/command/activatePartner.generated.ts +1 -1
- package/src/modules/business-partner/command/activatePartner.ts +1 -1
- package/src/modules/business-partner/command/assignRoleToPartner.generated.ts +1 -1
- package/src/modules/business-partner/command/assignRoleToPartner.test.ts +1 -1
- package/src/modules/business-partner/command/assignRoleToPartner.ts +1 -1
- package/src/modules/business-partner/command/createContactPerson.generated.ts +1 -1
- package/src/modules/business-partner/command/createContactPerson.ts +1 -1
- package/src/modules/business-partner/command/createPartner.generated.ts +1 -1
- package/src/modules/business-partner/command/createPartner.test.ts +1 -1
- package/src/modules/business-partner/command/createPartner.ts +3 -4
- package/src/modules/business-partner/command/createPartnerAddress.generated.ts +1 -1
- package/src/modules/business-partner/command/createPartnerAddress.ts +1 -1
- package/src/modules/business-partner/command/createPartnerBankAccount.generated.ts +1 -1
- package/src/modules/business-partner/command/createPartnerBankAccount.test.ts +1 -1
- package/src/modules/business-partner/command/createPartnerBankAccount.ts +1 -1
- package/src/modules/business-partner/command/createPartnerIdentification.generated.ts +1 -1
- package/src/modules/business-partner/command/createPartnerIdentification.test.ts +1 -1
- package/src/modules/business-partner/command/createPartnerIdentification.ts +1 -1
- package/src/modules/business-partner/command/deactivateContactPerson.generated.ts +1 -1
- package/src/modules/business-partner/command/deactivateContactPerson.ts +1 -1
- package/src/modules/business-partner/command/deactivatePartner.generated.ts +1 -1
- package/src/modules/business-partner/command/deactivatePartner.ts +1 -1
- package/src/modules/business-partner/command/deleteContactPerson.generated.ts +1 -1
- package/src/modules/business-partner/command/deleteContactPerson.ts +1 -1
- package/src/modules/business-partner/command/deletePartner.generated.ts +1 -1
- package/src/modules/business-partner/command/deletePartner.ts +1 -1
- package/src/modules/business-partner/command/deletePartnerAddress.generated.ts +1 -1
- package/src/modules/business-partner/command/deletePartnerAddress.test.ts +1 -1
- package/src/modules/business-partner/command/deletePartnerAddress.ts +1 -1
- package/src/modules/business-partner/command/deletePartnerBankAccount.generated.ts +1 -1
- package/src/modules/business-partner/command/deletePartnerBankAccount.test.ts +1 -1
- package/src/modules/business-partner/command/deletePartnerBankAccount.ts +1 -1
- package/src/modules/business-partner/command/deletePartnerIdentification.generated.ts +1 -1
- package/src/modules/business-partner/command/deletePartnerIdentification.test.ts +1 -1
- package/src/modules/business-partner/command/deletePartnerIdentification.ts +1 -1
- package/src/modules/business-partner/command/reactivateContactPerson.generated.ts +1 -1
- package/src/modules/business-partner/command/reactivateContactPerson.ts +1 -1
- package/src/modules/business-partner/command/reactivatePartner.generated.ts +1 -1
- package/src/modules/business-partner/command/reactivatePartner.ts +1 -1
- package/src/modules/business-partner/command/removeRoleFromPartner.generated.ts +1 -1
- package/src/modules/business-partner/command/removeRoleFromPartner.test.ts +1 -1
- package/src/modules/business-partner/command/removeRoleFromPartner.ts +1 -1
- package/src/modules/business-partner/command/setDefaultPartnerAddress.generated.ts +1 -1
- package/src/modules/business-partner/command/setDefaultPartnerAddress.ts +1 -1
- package/src/modules/business-partner/command/setDefaultPartnerBankAccount.generated.ts +1 -1
- package/src/modules/business-partner/command/setDefaultPartnerBankAccount.test.ts +1 -1
- package/src/modules/business-partner/command/setDefaultPartnerBankAccount.ts +1 -1
- package/src/modules/business-partner/command/setPrimaryContactPerson.generated.ts +1 -1
- package/src/modules/business-partner/command/setPrimaryContactPerson.ts +1 -1
- package/src/modules/business-partner/command/updateContactPerson.generated.ts +1 -1
- package/src/modules/business-partner/command/updateContactPerson.ts +1 -1
- package/src/modules/business-partner/command/updatePartner.generated.ts +1 -1
- package/src/modules/business-partner/command/updatePartner.test.ts +1 -1
- package/src/modules/business-partner/command/updatePartner.ts +1 -1
- package/src/modules/business-partner/command/updatePartnerAddress.generated.ts +1 -1
- package/src/modules/business-partner/command/updatePartnerAddress.ts +1 -1
- package/src/modules/business-partner/command/updatePartnerBankAccount.generated.ts +1 -1
- package/src/modules/business-partner/command/updatePartnerBankAccount.test.ts +1 -1
- package/src/modules/business-partner/command/updatePartnerBankAccount.ts +1 -1
- package/src/modules/business-partner/command/updatePartnerIdentification.generated.ts +1 -1
- package/src/modules/business-partner/command/updatePartnerIdentification.test.ts +1 -1
- package/src/modules/business-partner/command/updatePartnerIdentification.ts +1 -1
- package/src/modules/business-partner/lib/errors.generated.ts +1 -1
- package/src/modules/business-partner/lib/permissions.generated.ts +1 -1
- package/src/modules/business-partner/lib/types.ts +6 -1
- package/src/modules/business-partner/module.ts +1 -1
- package/src/modules/business-partner/permissions.ts +1 -1
- package/src/modules/business-partner/query/getContactPerson.generated.ts +1 -1
- package/src/modules/business-partner/query/getContactPerson.ts +1 -1
- package/src/modules/business-partner/query/getDefaultPartnerAddress.generated.ts +1 -1
- package/src/modules/business-partner/query/getDefaultPartnerAddress.ts +1 -1
- package/src/modules/business-partner/query/getDefaultPartnerBankAccount.generated.ts +1 -1
- package/src/modules/business-partner/query/getDefaultPartnerBankAccount.ts +1 -1
- package/src/modules/business-partner/query/getPartner.generated.ts +1 -1
- package/src/modules/business-partner/query/getPartner.ts +1 -1
- package/src/modules/business-partner/query/getPartnerAddress.generated.ts +1 -1
- package/src/modules/business-partner/query/getPartnerAddress.ts +1 -1
- package/src/modules/business-partner/query/getPartnerBankAccount.generated.ts +1 -1
- package/src/modules/business-partner/query/getPartnerBankAccount.ts +1 -1
- package/src/modules/business-partner/query/getPartnerIdentification.generated.ts +1 -1
- package/src/modules/business-partner/query/getPartnerIdentification.ts +1 -1
- package/src/modules/business-partner/query/getPartnerRole.generated.ts +1 -1
- package/src/modules/business-partner/query/getPartnerRole.ts +1 -1
- package/src/modules/business-partner/query/getPrimaryContactPerson.generated.ts +1 -1
- package/src/modules/business-partner/query/getPrimaryContactPerson.ts +1 -1
- package/src/modules/business-partner/query/listContactPersonsByPartner.generated.ts +1 -1
- package/src/modules/business-partner/query/listContactPersonsByPartner.ts +2 -2
- package/src/modules/business-partner/query/listPartnerAddressesByPartner.generated.ts +1 -1
- package/src/modules/business-partner/query/listPartnerAddressesByPartner.ts +3 -3
- package/src/modules/business-partner/query/listPartnerBankAccountsByPartner.generated.ts +1 -1
- package/src/modules/business-partner/query/listPartnerBankAccountsByPartner.ts +2 -2
- package/src/modules/business-partner/query/listPartnerIdentificationsByPartner.generated.ts +1 -1
- package/src/modules/business-partner/query/listPartnerIdentificationsByPartner.ts +3 -3
- package/src/modules/business-partner/query/listPartnersByRole.generated.ts +1 -1
- package/src/modules/business-partner/query/listPartnersByRole.ts +4 -4
- package/src/modules/coa-management/command/activateAccount.generated.ts +1 -1
- package/src/modules/coa-management/command/activateAccount.test.ts +1 -1
- package/src/modules/coa-management/command/activateAccount.ts +1 -1
- package/src/modules/coa-management/command/activateChartOfAccounts.generated.ts +1 -1
- package/src/modules/coa-management/command/activateChartOfAccounts.test.ts +1 -1
- package/src/modules/coa-management/command/activateChartOfAccounts.ts +1 -1
- package/src/modules/coa-management/command/createAccount.generated.ts +1 -1
- package/src/modules/coa-management/command/createAccount.test.ts +1 -1
- package/src/modules/coa-management/command/createAccount.ts +1 -1
- package/src/modules/coa-management/command/createAccountGroup.generated.ts +1 -1
- package/src/modules/coa-management/command/createAccountGroup.test.ts +1 -1
- package/src/modules/coa-management/command/createAccountGroup.ts +1 -1
- package/src/modules/coa-management/command/createChartOfAccounts.generated.ts +1 -1
- package/src/modules/coa-management/command/createChartOfAccounts.test.ts +1 -1
- package/src/modules/coa-management/command/createChartOfAccounts.ts +1 -1
- package/src/modules/coa-management/command/deactivateAccount.generated.ts +1 -1
- package/src/modules/coa-management/command/deactivateAccount.test.ts +1 -1
- package/src/modules/coa-management/command/deactivateAccount.ts +1 -1
- package/src/modules/coa-management/command/deactivateChartOfAccounts.generated.ts +1 -1
- package/src/modules/coa-management/command/deactivateChartOfAccounts.test.ts +1 -1
- package/src/modules/coa-management/command/deactivateChartOfAccounts.ts +1 -1
- package/src/modules/coa-management/command/deleteAccount.generated.ts +1 -1
- package/src/modules/coa-management/command/deleteAccount.test.ts +1 -1
- package/src/modules/coa-management/command/deleteAccount.ts +1 -1
- package/src/modules/coa-management/command/deleteAccountGroup.generated.ts +1 -1
- package/src/modules/coa-management/command/deleteAccountGroup.test.ts +1 -1
- package/src/modules/coa-management/command/deleteAccountGroup.ts +1 -1
- package/src/modules/coa-management/command/deleteChartOfAccounts.generated.ts +1 -1
- package/src/modules/coa-management/command/deleteChartOfAccounts.test.ts +1 -1
- package/src/modules/coa-management/command/deleteChartOfAccounts.ts +1 -1
- package/src/modules/coa-management/command/moveAccountGroup.generated.ts +1 -1
- package/src/modules/coa-management/command/moveAccountGroup.test.ts +1 -1
- package/src/modules/coa-management/command/moveAccountGroup.ts +1 -1
- package/src/modules/coa-management/command/reactivateAccount.generated.ts +1 -1
- package/src/modules/coa-management/command/reactivateAccount.test.ts +1 -1
- package/src/modules/coa-management/command/reactivateAccount.ts +1 -1
- package/src/modules/coa-management/command/updateAccount.generated.ts +1 -1
- package/src/modules/coa-management/command/updateAccount.test.ts +1 -1
- package/src/modules/coa-management/command/updateAccount.ts +1 -1
- package/src/modules/coa-management/command/updateAccountGroup.generated.ts +1 -1
- package/src/modules/coa-management/command/updateAccountGroup.test.ts +1 -1
- package/src/modules/coa-management/command/updateAccountGroup.ts +1 -1
- package/src/modules/coa-management/command/updateChartOfAccounts.generated.ts +1 -1
- package/src/modules/coa-management/command/updateChartOfAccounts.test.ts +1 -1
- package/src/modules/coa-management/command/updateChartOfAccounts.ts +1 -1
- package/src/modules/coa-management/lib/errors.generated.ts +1 -1
- package/src/modules/coa-management/lib/permissions.generated.ts +1 -1
- package/src/modules/coa-management/lib/types.ts +6 -1
- package/src/modules/coa-management/module.ts +1 -1
- package/src/modules/coa-management/permissions.ts +1 -1
- package/src/modules/coa-management/query/detectCircularReference.generated.ts +1 -1
- package/src/modules/coa-management/query/detectCircularReference.ts +1 -1
- package/src/modules/coa-management/query/getAccount.generated.ts +1 -1
- package/src/modules/coa-management/query/getAccount.ts +1 -1
- package/src/modules/coa-management/query/getAccountGroup.generated.ts +1 -1
- package/src/modules/coa-management/query/getAccountGroup.ts +1 -1
- package/src/modules/coa-management/query/getChartOfAccounts.generated.ts +1 -1
- package/src/modules/coa-management/query/getChartOfAccounts.ts +1 -1
- package/src/modules/coa-management/query/listAccountGroups.generated.ts +1 -1
- package/src/modules/coa-management/query/listAccountGroups.ts +2 -2
- package/src/modules/coa-management/query/listAccounts.generated.ts +1 -1
- package/src/modules/coa-management/query/listAccounts.ts +3 -3
- package/src/modules/coa-management/query/listUnassignedAccounts.generated.ts +1 -1
- package/src/modules/coa-management/query/listUnassignedAccounts.ts +2 -2
- package/src/modules/item-management/command/activateItem.generated.ts +1 -1
- package/src/modules/item-management/command/activateItem.ts +1 -1
- package/src/modules/item-management/command/assignItemToTaxonomy.generated.ts +1 -1
- package/src/modules/item-management/command/assignItemToTaxonomy.ts +1 -1
- package/src/modules/item-management/command/createItem.generated.ts +1 -1
- package/src/modules/item-management/command/createItem.test.ts +1 -1
- package/src/modules/item-management/command/createItem.ts +1 -1
- package/src/modules/item-management/command/createTaxonomyNode.generated.ts +1 -1
- package/src/modules/item-management/command/createTaxonomyNode.test.ts +1 -1
- package/src/modules/item-management/command/createTaxonomyNode.ts +1 -1
- package/src/modules/item-management/command/deactivateItem.generated.ts +1 -1
- package/src/modules/item-management/command/deactivateItem.ts +1 -1
- package/src/modules/item-management/command/deleteItem.generated.ts +1 -1
- package/src/modules/item-management/command/deleteItem.ts +1 -1
- package/src/modules/item-management/command/deleteTaxonomyNode.generated.ts +1 -1
- package/src/modules/item-management/command/deleteTaxonomyNode.ts +1 -1
- package/src/modules/item-management/command/moveTaxonomyNode.generated.ts +1 -1
- package/src/modules/item-management/command/moveTaxonomyNode.test.ts +1 -1
- package/src/modules/item-management/command/moveTaxonomyNode.ts +1 -1
- package/src/modules/item-management/command/reactivateItem.generated.ts +1 -1
- package/src/modules/item-management/command/reactivateItem.ts +1 -1
- package/src/modules/item-management/command/removeItemFromTaxonomy.generated.ts +1 -1
- package/src/modules/item-management/command/removeItemFromTaxonomy.ts +1 -1
- package/src/modules/item-management/command/updateItem.generated.ts +1 -1
- package/src/modules/item-management/command/updateItem.test.ts +1 -1
- package/src/modules/item-management/command/updateItem.ts +1 -1
- package/src/modules/item-management/command/updateTaxonomyNode.generated.ts +1 -1
- package/src/modules/item-management/command/updateTaxonomyNode.ts +1 -1
- package/src/modules/item-management/lib/errors.generated.ts +1 -1
- package/src/modules/item-management/lib/permissions.generated.ts +1 -1
- package/src/modules/item-management/lib/types.ts +6 -1
- package/src/modules/item-management/module.ts +1 -1
- package/src/modules/item-management/query/calculateNodeDepth.generated.ts +1 -1
- package/src/modules/item-management/query/calculateNodeDepth.ts +1 -1
- package/src/modules/item-management/query/calculateSubtreeDepth.generated.ts +1 -1
- package/src/modules/item-management/query/calculateSubtreeDepth.ts +1 -1
- package/src/modules/item-management/query/detectCircularReference.generated.ts +1 -1
- package/src/modules/item-management/query/detectCircularReference.ts +1 -1
- package/src/modules/item-management/query/getItem.generated.ts +1 -1
- package/src/modules/item-management/query/getItem.ts +1 -1
- package/src/modules/item-management/query/getItemTaxonomyAssignment.generated.ts +1 -1
- package/src/modules/item-management/query/getItemTaxonomyAssignment.ts +1 -1
- package/src/modules/item-management/query/getTaxonomyNode.generated.ts +1 -1
- package/src/modules/item-management/query/getTaxonomyNode.ts +1 -1
- package/src/modules/item-management/query/getTaxonomyNodeAssignments.generated.ts +1 -1
- package/src/modules/item-management/query/getTaxonomyNodeAssignments.ts +1 -1
- package/src/modules/item-management/query/getTaxonomyNodeChildren.generated.ts +1 -1
- package/src/modules/item-management/query/getTaxonomyNodeChildren.ts +1 -1
- package/src/modules/organization/command/activateCompany.generated.ts +1 -1
- package/src/modules/organization/command/activateCompany.test.ts +1 -1
- package/src/modules/organization/command/activateCompany.ts +1 -1
- package/src/modules/organization/command/createCompany.generated.ts +1 -1
- package/src/modules/organization/command/createCompany.test.ts +1 -1
- package/src/modules/organization/command/createCompany.ts +1 -1
- package/src/modules/organization/command/createDepartment.generated.ts +1 -1
- package/src/modules/organization/command/createDepartment.ts +1 -1
- package/src/modules/organization/command/createSite.generated.ts +1 -1
- package/src/modules/organization/command/createSite.ts +1 -1
- package/src/modules/organization/command/deactivateCompany.generated.ts +1 -1
- package/src/modules/organization/command/deactivateCompany.ts +1 -1
- package/src/modules/organization/command/deactivateDepartment.generated.ts +1 -1
- package/src/modules/organization/command/deactivateDepartment.ts +1 -1
- package/src/modules/organization/command/deactivateSite.generated.ts +1 -1
- package/src/modules/organization/command/deactivateSite.ts +1 -1
- package/src/modules/organization/command/deleteCompany.generated.ts +1 -1
- package/src/modules/organization/command/deleteCompany.ts +1 -1
- package/src/modules/organization/command/reactivateCompany.generated.ts +1 -1
- package/src/modules/organization/command/reactivateCompany.ts +1 -1
- package/src/modules/organization/command/reactivateDepartment.generated.ts +1 -1
- package/src/modules/organization/command/reactivateDepartment.ts +1 -1
- package/src/modules/organization/command/reactivateSite.generated.ts +1 -1
- package/src/modules/organization/command/reactivateSite.ts +1 -1
- package/src/modules/organization/command/updateCompany.generated.ts +1 -1
- package/src/modules/organization/command/updateCompany.test.ts +1 -1
- package/src/modules/organization/command/updateCompany.ts +1 -1
- package/src/modules/organization/command/updateDepartment.generated.ts +1 -1
- package/src/modules/organization/command/updateDepartment.ts +1 -1
- package/src/modules/organization/command/updateSite.generated.ts +1 -1
- package/src/modules/organization/command/updateSite.ts +1 -1
- package/src/modules/organization/lib/errors.generated.ts +1 -1
- package/src/modules/organization/lib/permissions.generated.ts +1 -1
- package/src/modules/organization/lib/types.ts +6 -1
- package/src/modules/organization/module.ts +1 -1
- package/src/modules/organization/permissions.ts +1 -1
- package/src/modules/organization/query/detectDepartmentCircularReference.generated.ts +1 -1
- package/src/modules/organization/query/detectDepartmentCircularReference.ts +1 -1
- package/src/modules/organization/query/getCompany.generated.ts +1 -1
- package/src/modules/organization/query/getCompany.ts +1 -1
- package/src/modules/organization/query/getDepartment.generated.ts +1 -1
- package/src/modules/organization/query/getDepartment.ts +1 -1
- package/src/modules/organization/query/getDepartmentChildren.generated.ts +1 -1
- package/src/modules/organization/query/getDepartmentChildren.ts +1 -1
- package/src/modules/organization/query/getSite.generated.ts +1 -1
- package/src/modules/organization/query/getSite.ts +1 -1
- package/src/modules/organization/query/listDepartmentsByCompany.generated.ts +1 -1
- package/src/modules/organization/query/listDepartmentsByCompany.ts +2 -2
- package/src/modules/organization/query/listSitesByCompany.generated.ts +1 -1
- package/src/modules/organization/query/listSitesByCompany.ts +2 -2
- package/src/modules/primitives/command/activateCategory.generated.ts +1 -1
- package/src/modules/primitives/command/activateCategory.ts +1 -1
- package/src/modules/primitives/command/activateCurrency.generated.ts +1 -1
- package/src/modules/primitives/command/activateCurrency.ts +1 -1
- package/src/modules/primitives/command/activateUnit.generated.ts +1 -1
- package/src/modules/primitives/command/activateUnit.ts +1 -1
- package/src/modules/primitives/command/createCategory.generated.ts +1 -1
- package/src/modules/primitives/command/createCategory.ts +1 -1
- package/src/modules/primitives/command/createCurrency.generated.ts +1 -1
- package/src/modules/primitives/command/createCurrency.ts +1 -1
- package/src/modules/primitives/command/createExchangeRate.generated.ts +1 -1
- package/src/modules/primitives/command/createExchangeRate.ts +1 -1
- package/src/modules/primitives/command/createUnit.generated.ts +1 -1
- package/src/modules/primitives/command/createUnit.ts +1 -1
- package/src/modules/primitives/command/deactivateCategory.generated.ts +1 -1
- package/src/modules/primitives/command/deactivateCategory.ts +1 -1
- package/src/modules/primitives/command/deactivateCurrency.generated.ts +1 -1
- package/src/modules/primitives/command/deactivateCurrency.ts +1 -1
- package/src/modules/primitives/command/deactivateUnit.generated.ts +1 -1
- package/src/modules/primitives/command/deactivateUnit.ts +1 -1
- package/src/modules/primitives/command/setBaseCurrency.generated.ts +1 -1
- package/src/modules/primitives/command/setBaseCurrency.ts +1 -1
- package/src/modules/primitives/command/setReferenceUnit.generated.ts +1 -1
- package/src/modules/primitives/command/setReferenceUnit.ts +1 -1
- package/src/modules/primitives/lib/errors.generated.ts +1 -1
- package/src/modules/primitives/lib/permissions.generated.ts +1 -1
- package/src/modules/primitives/lib/types.ts +6 -1
- package/src/modules/primitives/module.ts +1 -1
- package/src/modules/primitives/query/convertAmount.generated.ts +1 -1
- package/src/modules/primitives/query/convertAmount.test.ts +1 -1
- package/src/modules/primitives/query/convertAmount.ts +1 -1
- package/src/modules/primitives/query/convertQuantity.generated.ts +1 -1
- package/src/modules/primitives/query/convertQuantity.test.ts +1 -1
- package/src/modules/primitives/query/convertQuantity.ts +1 -1
- package/src/modules/primitives/query/getBaseCurrency.generated.ts +1 -1
- package/src/modules/primitives/query/getBaseCurrency.test.ts +1 -1
- package/src/modules/primitives/query/getBaseCurrency.ts +1 -1
- package/src/modules/primitives/query/getCurrency.generated.ts +1 -1
- package/src/modules/primitives/query/getCurrency.ts +1 -1
- package/src/modules/primitives/query/getUnit.generated.ts +1 -1
- package/src/modules/primitives/query/getUnit.ts +1 -1
- package/src/modules/primitives/query/getUoMCategory.generated.ts +1 -1
- package/src/modules/primitives/query/getUoMCategory.ts +1 -1
- package/src/modules/primitives/query/listUnitsByCategory.generated.ts +1 -1
- package/src/modules/primitives/query/listUnitsByCategory.ts +2 -2
- package/src/modules/product-management/command/activateProduct.generated.ts +1 -1
- package/src/modules/product-management/command/activateProduct.ts +1 -1
- package/src/modules/product-management/command/assignProductToCategory.generated.ts +1 -1
- package/src/modules/product-management/command/assignProductToCategory.ts +1 -1
- package/src/modules/product-management/command/createProduct.generated.ts +1 -1
- package/src/modules/product-management/command/createProduct.test.ts +1 -1
- package/src/modules/product-management/command/createProduct.ts +1 -1
- package/src/modules/product-management/command/createProductAttribute.generated.ts +1 -1
- package/src/modules/product-management/command/createProductAttribute.ts +1 -1
- package/src/modules/product-management/command/createProductAttributeValue.generated.ts +1 -1
- package/src/modules/product-management/command/createProductAttributeValue.ts +1 -1
- package/src/modules/product-management/command/createProductCategory.generated.ts +1 -1
- package/src/modules/product-management/command/createProductCategory.test.ts +1 -1
- package/src/modules/product-management/command/createProductCategory.ts +1 -1
- package/src/modules/product-management/command/deactivateProduct.generated.ts +1 -1
- package/src/modules/product-management/command/deactivateProduct.ts +1 -1
- package/src/modules/product-management/command/deleteProduct.generated.ts +1 -1
- package/src/modules/product-management/command/deleteProduct.ts +1 -1
- package/src/modules/product-management/command/deleteProductAttribute.generated.ts +1 -1
- package/src/modules/product-management/command/deleteProductAttribute.ts +1 -1
- package/src/modules/product-management/command/deleteProductAttributeValue.generated.ts +1 -1
- package/src/modules/product-management/command/deleteProductAttributeValue.ts +1 -1
- package/src/modules/product-management/command/deleteProductCategory.generated.ts +1 -1
- package/src/modules/product-management/command/deleteProductCategory.ts +1 -1
- package/src/modules/product-management/command/generateVariants.generated.ts +1 -1
- package/src/modules/product-management/command/generateVariants.test.ts +1 -1
- package/src/modules/product-management/command/generateVariants.ts +1 -1
- package/src/modules/product-management/command/moveProductCategory.generated.ts +1 -1
- package/src/modules/product-management/command/moveProductCategory.test.ts +1 -1
- package/src/modules/product-management/command/moveProductCategory.ts +1 -1
- package/src/modules/product-management/command/reactivateProduct.generated.ts +1 -1
- package/src/modules/product-management/command/reactivateProduct.ts +1 -1
- package/src/modules/product-management/command/removeProductFromCategory.generated.ts +1 -1
- package/src/modules/product-management/command/removeProductFromCategory.ts +1 -1
- package/src/modules/product-management/command/setProductAttributeAssignment.generated.ts +1 -1
- package/src/modules/product-management/command/setProductAttributeAssignment.ts +1 -1
- package/src/modules/product-management/command/updateProduct.generated.ts +1 -1
- package/src/modules/product-management/command/updateProduct.test.ts +1 -1
- package/src/modules/product-management/command/updateProduct.ts +1 -1
- package/src/modules/product-management/command/updateProductAttribute.generated.ts +1 -1
- package/src/modules/product-management/command/updateProductAttribute.ts +1 -1
- package/src/modules/product-management/command/updateProductAttributeValue.generated.ts +1 -1
- package/src/modules/product-management/command/updateProductAttributeValue.ts +1 -1
- package/src/modules/product-management/command/updateProductCategory.generated.ts +1 -1
- package/src/modules/product-management/command/updateProductCategory.ts +1 -1
- package/src/modules/product-management/lib/errors.generated.ts +1 -1
- package/src/modules/product-management/lib/permissions.generated.ts +1 -1
- package/src/modules/product-management/lib/types.ts +6 -1
- package/src/modules/product-management/module.ts +1 -1
- package/src/modules/product-management/query/calculateCategoryDepth.generated.ts +1 -1
- package/src/modules/product-management/query/calculateCategoryDepth.ts +1 -1
- package/src/modules/product-management/query/detectCategoryCircularReference.generated.ts +1 -1
- package/src/modules/product-management/query/detectCategoryCircularReference.ts +1 -1
- package/src/modules/product-management/query/getProduct.generated.ts +1 -1
- package/src/modules/product-management/query/getProduct.ts +1 -1
- package/src/modules/product-management/query/getProductAttribute.generated.ts +1 -1
- package/src/modules/product-management/query/getProductAttribute.ts +1 -1
- package/src/modules/product-management/query/getProductAttributeAssignment.generated.ts +1 -1
- package/src/modules/product-management/query/getProductAttributeAssignment.ts +1 -1
- package/src/modules/product-management/query/getProductAttributeValue.generated.ts +1 -1
- package/src/modules/product-management/query/getProductAttributeValue.ts +1 -1
- package/src/modules/product-management/query/getProductCategory.generated.ts +1 -1
- package/src/modules/product-management/query/getProductCategory.ts +1 -1
- package/src/modules/product-management/query/getProductCategoryAssignment.generated.ts +1 -1
- package/src/modules/product-management/query/getProductCategoryAssignment.ts +1 -1
- package/src/modules/product-management/query/getProductVariant.generated.ts +1 -1
- package/src/modules/product-management/query/getProductVariant.ts +1 -1
- package/src/modules/product-management/query/listAttributeAssignmentsByAttribute.generated.ts +1 -1
- package/src/modules/product-management/query/listAttributeAssignmentsByAttribute.ts +1 -1
- package/src/modules/product-management/query/listCategoryAssignmentsByProduct.generated.ts +1 -1
- package/src/modules/product-management/query/listCategoryAssignmentsByProduct.ts +1 -1
- package/src/modules/product-management/query/listProductAttributeAssignments.generated.ts +1 -1
- package/src/modules/product-management/query/listProductAttributeAssignments.ts +1 -1
- package/src/modules/product-management/query/listProductAttributeValues.generated.ts +1 -1
- package/src/modules/product-management/query/listProductAttributeValues.ts +1 -1
- package/src/modules/product-management/query/listProductCategoryAssignments.generated.ts +1 -1
- package/src/modules/product-management/query/listProductCategoryAssignments.ts +1 -1
- package/src/modules/product-management/query/listProductCategoryChildren.generated.ts +1 -1
- package/src/modules/product-management/query/listProductCategoryChildren.ts +1 -1
- package/src/modules/product-management/query/listProductVariants.generated.ts +1 -1
- package/src/modules/product-management/query/listProductVariants.ts +1 -1
- package/src/modules/user-management/command/activateUser.generated.ts +1 -1
- package/src/modules/user-management/command/activateUser.ts +1 -1
- package/src/modules/user-management/command/assignPermissionToRole.generated.ts +1 -1
- package/src/modules/user-management/command/assignPermissionToRole.ts +1 -1
- package/src/modules/user-management/command/assignRoleToUser.generated.ts +1 -1
- package/src/modules/user-management/command/assignRoleToUser.ts +1 -1
- package/src/modules/user-management/command/createPermission.generated.ts +1 -1
- package/src/modules/user-management/command/createPermission.ts +1 -1
- package/src/modules/user-management/command/createRole.generated.ts +1 -1
- package/src/modules/user-management/command/createRole.ts +1 -1
- package/src/modules/user-management/command/createUser.generated.ts +1 -1
- package/src/modules/user-management/command/createUser.ts +1 -1
- package/src/modules/user-management/command/deactivateUser.generated.ts +1 -1
- package/src/modules/user-management/command/deactivateUser.ts +1 -1
- package/src/modules/user-management/command/reactivateUser.generated.ts +1 -1
- package/src/modules/user-management/command/reactivateUser.ts +1 -1
- package/src/modules/user-management/command/revokePermissionFromRole.generated.ts +1 -1
- package/src/modules/user-management/command/revokePermissionFromRole.ts +1 -1
- package/src/modules/user-management/command/revokeRoleFromUser.generated.ts +1 -1
- package/src/modules/user-management/command/revokeRoleFromUser.ts +1 -1
- package/src/modules/user-management/lib/errors.generated.ts +1 -1
- package/src/modules/user-management/lib/permissions.generated.ts +1 -1
- package/src/modules/user-management/lib/types.ts +6 -1
- package/src/modules/user-management/module.ts +1 -1
- package/templates/scaffold/module/lib/types.ts +6 -1
- package/templates/scaffold/module/permissions.ts +1 -1
- package/src/modules/audit/lib/errors.ts +0 -0
- package/src/modules/business-partner/lib/errors.ts +0 -2
- package/src/modules/coa-management/lib/errors.ts +0 -0
- package/src/modules/organization/lib/errors.ts +0 -1
- package/templates/scaffold/module/lib/errors.ts +0 -1
|
@@ -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
|
-
|
|
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
|
-
|
|
|
40
|
-
| ----- | -------------------------------------------------------------------------------- |
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
74
|
-
6.
|
|
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
|
|
|
@@ -52,14 +52,22 @@ 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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
|
|
56
|
+
## Step 4: Severity Validation
|
|
57
|
+
|
|
58
|
+
Subagents tend to over-classify. Before rendering the report, re-evaluate every non-pass finding:
|
|
59
|
+
|
|
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
|
|
64
|
+
|
|
65
|
+
## Step 5: Determine Verdict
|
|
66
|
+
|
|
67
|
+
- **APPROVED**: zero `critical` and zero `major`
|
|
68
|
+
- **NEEDS CHANGES**: one or more `critical` or `major`
|
|
69
|
+
|
|
70
|
+
## Step 6: Render Report
|
|
63
71
|
|
|
64
72
|
## Report Format
|
|
65
73
|
|
|
@@ -57,18 +57,25 @@ After ALL agents return:
|
|
|
57
57
|
3. Merge all `inconsistencies[]` arrays into a single list
|
|
58
58
|
4. Deduplicate: if two gaps share the same `source + target + check`, keep only one
|
|
59
59
|
5. Calculate totals across all summaries
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
|
|
61
|
+
## Step 4: Severity Validation
|
|
62
|
+
|
|
63
|
+
Subagents tend to over-classify. Before rendering the report, re-evaluate every non-pass finding:
|
|
64
|
+
|
|
65
|
+
- **"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), drop it from the report
|
|
66
|
+
- **"Does the feature doc explicitly require this?"** — Only flag gaps for capabilities the feature doc actually specifies. Do not invent requirements the feature does not mention
|
|
67
|
+
- **"Does this block implementation?"** → `critical`
|
|
68
|
+
- **"Will this cause rework during implementation?"** → `major`
|
|
69
|
+
- All no → `nit`, regardless of subagent label
|
|
70
|
+
|
|
71
|
+
## Step 5: Determine Verdict
|
|
72
|
+
|
|
73
|
+
- **APPROVED**: zero `critical` and zero `major` findings (nits only, or all pass)
|
|
74
|
+
- **NEEDS CHANGES**: one or more `critical` or `major` findings
|
|
75
|
+
|
|
76
|
+
## Step 6: Render Report
|
|
77
|
+
|
|
78
|
+
Render the aggregated results as markdown (after severity validation):
|
|
72
79
|
|
|
73
80
|
### Feature Parity Review Report
|
|
74
81
|
|
|
@@ -177,7 +177,7 @@ const units = await db
|
|
|
177
177
|
|
|
178
178
|
## Implementation Considerations
|
|
179
179
|
|
|
180
|
-
- **Error handling**: Use `ok()` / `err()` from `
|
|
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
182
|
|
|
183
183
|
## Conventions
|
|
@@ -8,8 +8,8 @@ Run `erp-kit module generate code -p <path>` to generate query shells from `docs
|
|
|
8
8
|
|
|
9
9
|
```typescript
|
|
10
10
|
// @generated — do not edit
|
|
11
|
-
import { defineQuery } from "../../../shared";
|
|
12
11
|
import { run } from "./getItem";
|
|
12
|
+
import { defineQuery } from "@tailor-platform/erp-kit/module";
|
|
13
13
|
|
|
14
14
|
export const getItem = defineQuery(run);
|
|
15
15
|
```
|
|
@@ -17,9 +17,8 @@ export const getItem = defineQuery(run);
|
|
|
17
17
|
### Hand-written implementation
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
|
-
import type { ReadonlyDB } from "../../../shared";
|
|
21
|
-
import { ok } from "../../../shared";
|
|
22
20
|
import type { DB } from "../generated/kysely-tailordb";
|
|
21
|
+
import { ok, type ReadonlyDB } from "@tailor-platform/erp-kit/module";
|
|
23
22
|
|
|
24
23
|
export type GetItemInput = { id: string } | { sku: string };
|
|
25
24
|
|
|
@@ -45,7 +44,7 @@ For queries beyond simple lookups (joins, aggregations, complex filters), write
|
|
|
45
44
|
|
|
46
45
|
- `defineQuery` wraps all queries via generated shells
|
|
47
46
|
- `ReadonlyDB<DB>` ensures read-only access
|
|
48
|
-
- All queries return Result types using `ok()` / `err()` from `
|
|
47
|
+
- All queries return Result types using `ok()` / `err()` from `@tailor-platform/erp-kit/module` — consistent with commands
|
|
49
48
|
- Get queries return `ok({ entity: T | null })` using `executeTakeFirst()`
|
|
50
49
|
- List queries return `ok(PaginatedResult<T>)` using pagination utilities — see [Paginated List Queries](#paginated-list-queries)
|
|
51
50
|
- Input types: `type` for union inputs (get), `interface` for single-shape inputs (list)
|
|
@@ -81,14 +80,14 @@ interface PaginatedResult<T> {
|
|
|
81
80
|
3. Use `buildPaginatedResult(rows, limit)` to build the response — the limit+1 strategy determines `hasNextPage` without a separate count query
|
|
82
81
|
|
|
83
82
|
```typescript
|
|
83
|
+
import type { DB } from "../generated/kysely-tailordb";
|
|
84
84
|
import {
|
|
85
85
|
ok,
|
|
86
86
|
type ReadonlyDB,
|
|
87
87
|
type PaginationInput,
|
|
88
88
|
buildPaginatedResult,
|
|
89
89
|
DEFAULT_PAGE_SIZE,
|
|
90
|
-
} from "
|
|
91
|
-
import type { DB } from "../generated/kysely-tailordb";
|
|
90
|
+
} from "@tailor-platform/erp-kit/module";
|
|
92
91
|
|
|
93
92
|
// Define sortable fields for this query
|
|
94
93
|
type UnitOrderByField = "name" | "symbol" | "createdAt";
|
|
@@ -44,7 +44,9 @@ describe("generateErrors", () => {
|
|
|
44
44
|
const result = generateErrors("item-management", docs);
|
|
45
45
|
|
|
46
46
|
expect(result).toContain("// @generated — do not edit");
|
|
47
|
-
expect(result).toContain(
|
|
47
|
+
expect(result).toContain(
|
|
48
|
+
'import { createDomainError } from "@tailor-platform/erp-kit/module";',
|
|
49
|
+
);
|
|
48
50
|
expect(result).toContain("export const DuplicateSkuError = createDomainError(");
|
|
49
51
|
expect(result).toContain('"DuplicateSkuError", "ITEM_MANAGEMENT_DUPLICATE_SKU"');
|
|
50
52
|
expect(result).toContain("export const UnitNotFoundError = createDomainError(");
|
|
@@ -92,7 +94,9 @@ describe("generatePermissions", () => {
|
|
|
92
94
|
const result = generatePermissions("item-management", commandNames);
|
|
93
95
|
|
|
94
96
|
expect(result).toContain("// @generated — do not edit");
|
|
95
|
-
expect(result).toContain(
|
|
97
|
+
expect(result).toContain(
|
|
98
|
+
'import { definePermissions } from "@tailor-platform/erp-kit/module";',
|
|
99
|
+
);
|
|
96
100
|
expect(result).toContain('"item-management"');
|
|
97
101
|
expect(result).toContain('"createItem"');
|
|
98
102
|
expect(result).toContain('"updateItem"');
|
|
@@ -128,7 +132,7 @@ describe("generateCommandShell", () => {
|
|
|
128
132
|
const result = generateCommandShell(doc);
|
|
129
133
|
|
|
130
134
|
expect(result).toContain("// @generated — do not edit");
|
|
131
|
-
expect(result).toContain('import { defineCommand } from "
|
|
135
|
+
expect(result).toContain('import { defineCommand } from "@tailor-platform/erp-kit/module";');
|
|
132
136
|
expect(result).toContain('import { permissions } from "../lib/permissions.generated";');
|
|
133
137
|
expect(result).toContain('import { run } from "./activateItem";');
|
|
134
138
|
expect(result).toContain(
|
|
@@ -145,7 +149,7 @@ describe("generateCommandShell", () => {
|
|
|
145
149
|
|
|
146
150
|
const result = generateCommandShell(doc);
|
|
147
151
|
|
|
148
|
-
expect(result).toContain('import { defineCommand } from "
|
|
152
|
+
expect(result).toContain('import { defineCommand } from "@tailor-platform/erp-kit/module";');
|
|
149
153
|
expect(result).toContain('import { run } from "./createItem";');
|
|
150
154
|
expect(result).toContain(
|
|
151
155
|
"export const createItem = defineCommand(permissions.createItem, run);",
|
|
@@ -164,7 +168,7 @@ describe("generateQueryShell", () => {
|
|
|
164
168
|
const result = generateQueryShell(doc);
|
|
165
169
|
|
|
166
170
|
expect(result).toContain("// @generated — do not edit");
|
|
167
|
-
expect(result).toContain('import { defineQuery } from "
|
|
171
|
+
expect(result).toContain('import { defineQuery } from "@tailor-platform/erp-kit/module";');
|
|
168
172
|
expect(result).toContain('import { run } from "./getTaxonomyNode";');
|
|
169
173
|
expect(result).toContain("export const getTaxonomyNode = defineQuery(run);");
|
|
170
174
|
});
|
|
@@ -180,7 +184,7 @@ describe("generateQueryStub", () => {
|
|
|
180
184
|
|
|
181
185
|
const result = generateQueryStub(doc);
|
|
182
186
|
|
|
183
|
-
expect(result).toContain('import type { ReadonlyDB } from "
|
|
187
|
+
expect(result).toContain('import type { ReadonlyDB } from "@tailor-platform/erp-kit/module";');
|
|
184
188
|
expect(result).toContain('import type { DB } from "../generated/kysely-tailordb";');
|
|
185
189
|
expect(result).toContain("export interface GetTaxonomyNodeInput {");
|
|
186
190
|
expect(result).toContain(
|
|
@@ -28,7 +28,7 @@ export function generateErrors(moduleName: string, docs: ParsedCommandDoc[]): st
|
|
|
28
28
|
if (lines.length === 0) return "";
|
|
29
29
|
|
|
30
30
|
return `// @generated — do not edit
|
|
31
|
-
import { createDomainError } from "
|
|
31
|
+
import { createDomainError } from "@tailor-platform/erp-kit/module";
|
|
32
32
|
|
|
33
33
|
${lines.join("\n")}`;
|
|
34
34
|
}
|
|
@@ -3,7 +3,7 @@ export function generatePermissions(moduleName: string, commandNames: string[]):
|
|
|
3
3
|
const entries = sorted.map((name) => ` "${name}",`).join("\n");
|
|
4
4
|
|
|
5
5
|
return `// @generated — do not edit
|
|
6
|
-
import { definePermissions } from "
|
|
6
|
+
import { definePermissions } from "@tailor-platform/erp-kit/module";
|
|
7
7
|
|
|
8
8
|
export const { permissions, own, all } = definePermissions("${moduleName}", [
|
|
9
9
|
${entries}
|
|
@@ -3,9 +3,9 @@ import type { ParsedCommandDoc } from "./parse-command-doc";
|
|
|
3
3
|
export function generateCommandShell(doc: ParsedCommandDoc): string {
|
|
4
4
|
const lines: string[] = [
|
|
5
5
|
`// @generated — do not edit`,
|
|
6
|
-
`import { defineCommand } from "../../../shared";`,
|
|
7
6
|
`import { permissions } from "../lib/permissions.generated";`,
|
|
8
7
|
`import { run } from "./${doc.commandName}";`,
|
|
8
|
+
`import { defineCommand } from "@tailor-platform/erp-kit/module";`,
|
|
9
9
|
``,
|
|
10
10
|
`export const ${doc.commandName} = defineCommand(permissions.${doc.commandName}, run);`,
|
|
11
11
|
``,
|
|
@@ -17,8 +17,8 @@ export function generateCommandShell(doc: ParsedCommandDoc): string {
|
|
|
17
17
|
export function generateQueryShell(doc: ParsedCommandDoc): string {
|
|
18
18
|
const lines: string[] = [
|
|
19
19
|
`// @generated — do not edit`,
|
|
20
|
-
`import { defineQuery } from "../../../shared";`,
|
|
21
20
|
`import { run } from "./${doc.commandName}";`,
|
|
21
|
+
`import { defineQuery } from "@tailor-platform/erp-kit/module";`,
|
|
22
22
|
``,
|
|
23
23
|
`export const ${doc.commandName} = defineQuery(run);`,
|
|
24
24
|
``,
|
|
@@ -6,8 +6,8 @@ const templates = {
|
|
|
6
6
|
command: {
|
|
7
7
|
render: (name: string) => {
|
|
8
8
|
const inputType = `${toPascal(name)}Input`;
|
|
9
|
-
return `import {
|
|
10
|
-
import type
|
|
9
|
+
return `import type { Transaction } from "../generated/kysely-tailordb";
|
|
10
|
+
import { ok, type CommandContext } from "@tailor-platform/erp-kit/module";
|
|
11
11
|
|
|
12
12
|
export interface ${inputType} {
|
|
13
13
|
// TODO: define input fields
|
|
@@ -25,9 +25,9 @@ export async function run(db: Transaction, input: ${inputType}, ctx: CommandCont
|
|
|
25
25
|
const pascal = toPascal(name);
|
|
26
26
|
return `import { describe, expect, it } from "vitest";
|
|
27
27
|
import { createMockDb } from "../../../testing/index";
|
|
28
|
-
import type { CommandContext } from "../../../shared";
|
|
29
28
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
30
29
|
import { run, ${pascal}Input } from "./${name}";
|
|
30
|
+
import type { CommandContext } from "@tailor-platform/erp-kit/module";
|
|
31
31
|
|
|
32
32
|
describe("${name} - test scenario", () => {
|
|
33
33
|
const ctx: CommandContext = {
|
|
@@ -47,8 +47,8 @@ describe("${name} - test scenario", () => {
|
|
|
47
47
|
query: {
|
|
48
48
|
render: (name: string) => {
|
|
49
49
|
const inputType = `${toPascal(name)}Input`;
|
|
50
|
-
return `import type {
|
|
51
|
-
import type {
|
|
50
|
+
return `import type { DB } from "../generated/kysely-tailordb";
|
|
51
|
+
import type { ReadonlyDB } from "@tailor-platform/erp-kit/module";
|
|
52
52
|
|
|
53
53
|
export interface ${inputType} {
|
|
54
54
|
// TODO: define input fields
|
package/src/module.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// shared
|
|
2
2
|
export { defineCommand, type Command } from "./shared/defineCommand";
|
|
3
|
+
export { ok, err, type Result, type ValueOf, type ErrorOf } from "./shared/result";
|
|
3
4
|
export { defineQuery, type Query } from "./shared/defineQuery";
|
|
4
5
|
export { definePermissions } from "./shared/definePermissions";
|
|
5
6
|
export { requirePermission } from "./shared/requirePermission";
|
|
@@ -11,12 +12,14 @@ export type {
|
|
|
11
12
|
PaginationInput,
|
|
12
13
|
PaginatedResult,
|
|
13
14
|
} from "./shared/types";
|
|
15
|
+
export { buildPaginatedResult, DEFAULT_PAGE_SIZE } from "./shared/pagination";
|
|
14
16
|
export type {
|
|
15
17
|
InferSchema,
|
|
16
18
|
Selectable,
|
|
17
19
|
Insertable,
|
|
18
20
|
Updateable,
|
|
19
21
|
FieldsToInsertable,
|
|
22
|
+
EmptyFields,
|
|
20
23
|
} from "./shared/entityTypes";
|
|
21
24
|
|
|
22
25
|
// primitives
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @generated — do not edit
|
|
2
|
-
import { defineCommand } from "../../../shared";
|
|
3
2
|
import { permissions } from "../lib/permissions.generated";
|
|
4
3
|
import { run } from "./activateAuditPolicy";
|
|
4
|
+
import { defineCommand } from "@tailor-platform/erp-kit/module";
|
|
5
5
|
|
|
6
6
|
export const activateAuditPolicy = defineCommand(permissions.activateAuditPolicy, run);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { createMockDb } from "../../../testing/index";
|
|
3
|
-
import { type CommandContext, InsufficientPermissionError } from "../../../shared";
|
|
4
3
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
5
4
|
import {
|
|
6
5
|
PolicyNotFoundError,
|
|
@@ -13,6 +12,7 @@ import {
|
|
|
13
12
|
import { draftPolicy, activePolicy, inactivePolicy, companyBoundEntity } from "../testing/fixtures";
|
|
14
13
|
import { run } from "./activateAuditPolicy";
|
|
15
14
|
import { activateAuditPolicy } from "./activateAuditPolicy.generated";
|
|
15
|
+
import { type CommandContext, InsufficientPermissionError } from "@tailor-platform/erp-kit/module";
|
|
16
16
|
|
|
17
17
|
const ctx: CommandContext = {
|
|
18
18
|
actorId: "test-actor",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ok, err, type CommandContext } from "../../../shared";
|
|
2
1
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
3
2
|
import {
|
|
4
3
|
PolicyNotFoundError,
|
|
@@ -8,6 +7,7 @@ import {
|
|
|
8
7
|
EntityTypeNotRegisteredError,
|
|
9
8
|
UnauthorizedError,
|
|
10
9
|
} from "../lib/errors.generated";
|
|
10
|
+
import { ok, err, type CommandContext } from "@tailor-platform/erp-kit/module";
|
|
11
11
|
|
|
12
12
|
export interface ActivateAuditPolicyInput {
|
|
13
13
|
policyId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @generated — do not edit
|
|
2
|
-
import { defineCommand } from "../../../shared";
|
|
3
2
|
import { permissions } from "../lib/permissions.generated";
|
|
4
3
|
import { run } from "./createAuditPolicy";
|
|
4
|
+
import { defineCommand } from "@tailor-platform/erp-kit/module";
|
|
5
5
|
|
|
6
6
|
export const createAuditPolicy = defineCommand(permissions.createAuditPolicy, run);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { createMockDb, testPermissionDenied } from "../../../testing/index";
|
|
3
|
-
import type { CommandContext } from "../../../shared";
|
|
4
3
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
5
4
|
import {
|
|
6
5
|
EntityTypeNotRegisteredError,
|
|
@@ -19,6 +18,7 @@ import {
|
|
|
19
18
|
} from "../testing/fixtures";
|
|
20
19
|
import { run } from "./createAuditPolicy";
|
|
21
20
|
import { createAuditPolicy } from "./createAuditPolicy.generated";
|
|
21
|
+
import type { CommandContext } from "@tailor-platform/erp-kit/module";
|
|
22
22
|
|
|
23
23
|
const ctx: CommandContext = {
|
|
24
24
|
actorId: "test-actor",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ok, err, type CommandContext } from "../../../shared";
|
|
2
1
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
3
2
|
import {
|
|
4
3
|
EntityTypeNotRegisteredError,
|
|
@@ -9,6 +8,7 @@ import {
|
|
|
9
8
|
InvalidSensitivityModeError,
|
|
10
9
|
UnauthorizedError,
|
|
11
10
|
} from "../lib/errors.generated";
|
|
11
|
+
import { ok, err, type CommandContext } from "@tailor-platform/erp-kit/module";
|
|
12
12
|
|
|
13
13
|
const VALID_OPERATION_TYPES = ["CREATE", "UPDATE", "DELETE"];
|
|
14
14
|
const VALID_SENSITIVITY_MODES = ["CAPTURE", "MASK", "HASH", "EXCLUDE"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @generated — do not edit
|
|
2
|
-
import { defineCommand } from "../../../shared";
|
|
3
2
|
import { permissions } from "../lib/permissions.generated";
|
|
4
3
|
import { run } from "./deactivateAuditPolicy";
|
|
4
|
+
import { defineCommand } from "@tailor-platform/erp-kit/module";
|
|
5
5
|
|
|
6
6
|
export const deactivateAuditPolicy = defineCommand(permissions.deactivateAuditPolicy, run);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { createMockDb } from "../../../testing/index";
|
|
3
|
-
import type { CommandContext } from "../../../shared";
|
|
4
|
-
import { InsufficientPermissionError } from "../../../shared/errors";
|
|
5
3
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
6
4
|
import { PolicyNotFoundError, InvalidStateError, UnauthorizedError } from "../lib/errors.generated";
|
|
7
5
|
import { draftPolicy, activePolicy, inactivePolicy } from "../testing/fixtures";
|
|
8
6
|
import { run } from "./deactivateAuditPolicy";
|
|
9
7
|
import { deactivateAuditPolicy } from "./deactivateAuditPolicy.generated";
|
|
8
|
+
import { InsufficientPermissionError } from "@tailor-platform/erp-kit/module";
|
|
9
|
+
import type { CommandContext } from "@tailor-platform/erp-kit/module";
|
|
10
10
|
|
|
11
11
|
const ctx: CommandContext = {
|
|
12
12
|
actorId: "test-actor",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ok, err, type CommandContext } from "../../../shared";
|
|
2
1
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
3
2
|
import { PolicyNotFoundError, InvalidStateError, UnauthorizedError } from "../lib/errors.generated";
|
|
3
|
+
import { ok, err, type CommandContext } from "@tailor-platform/erp-kit/module";
|
|
4
4
|
|
|
5
5
|
export interface DeactivateAuditPolicyInput {
|
|
6
6
|
policyId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @generated — do not edit
|
|
2
|
-
import { defineCommand } from "../../../shared";
|
|
3
2
|
import { permissions } from "../lib/permissions.generated";
|
|
4
3
|
import { run } from "./deleteAuditPolicy";
|
|
4
|
+
import { defineCommand } from "@tailor-platform/erp-kit/module";
|
|
5
5
|
|
|
6
6
|
export const deleteAuditPolicy = defineCommand(permissions.deleteAuditPolicy, run);
|
|
@@ -2,10 +2,10 @@ import { describe, expect, it } from "vitest";
|
|
|
2
2
|
import { createMockDb } from "../../../testing/index";
|
|
3
3
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
4
4
|
import { PolicyNotFoundError, InvalidStateError, UnauthorizedError } from "../lib/errors.generated";
|
|
5
|
-
import { InsufficientPermissionError } from "../../../shared";
|
|
6
5
|
import { draftPolicy, activePolicy, inactivePolicy } from "../testing/fixtures";
|
|
7
6
|
import { run } from "./deleteAuditPolicy";
|
|
8
7
|
import { deleteAuditPolicy } from "./deleteAuditPolicy.generated";
|
|
8
|
+
import { InsufficientPermissionError } from "@tailor-platform/erp-kit/module";
|
|
9
9
|
|
|
10
10
|
const ctx = { actorId: "test-actor", permissions: ["audit:deleteAuditPolicy"] };
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ok, err, type CommandContext } from "../../../shared";
|
|
2
1
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
3
2
|
import { PolicyNotFoundError, InvalidStateError, UnauthorizedError } from "../lib/errors.generated";
|
|
3
|
+
import { ok, err, type CommandContext } from "@tailor-platform/erp-kit/module";
|
|
4
4
|
|
|
5
5
|
export interface DeleteAuditPolicyInput {
|
|
6
6
|
policyId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @generated — do not edit
|
|
2
|
-
import { defineCommand } from "../../../shared";
|
|
3
2
|
import { permissions } from "../lib/permissions.generated";
|
|
4
3
|
import { run } from "./logAuditEvent";
|
|
4
|
+
import { defineCommand } from "@tailor-platform/erp-kit/module";
|
|
5
5
|
|
|
6
6
|
export const logAuditEvent = defineCommand(permissions.logAuditEvent, run);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { createMockDb } from "../../../testing/index";
|
|
3
|
-
import { type CommandContext, InsufficientPermissionError } from "../../../shared";
|
|
4
3
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
5
4
|
import {
|
|
6
5
|
EntityTypeNotRegisteredError,
|
|
@@ -23,6 +22,7 @@ import {
|
|
|
23
22
|
} from "../testing/fixtures";
|
|
24
23
|
import { run, type LogAuditEventInput } from "./logAuditEvent";
|
|
25
24
|
import { logAuditEvent } from "./logAuditEvent.generated";
|
|
25
|
+
import { type CommandContext, InsufficientPermissionError } from "@tailor-platform/erp-kit/module";
|
|
26
26
|
|
|
27
27
|
const ctx: CommandContext = {
|
|
28
28
|
actorId: "test-actor",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { ok, err, type CommandContext } from "../../../shared";
|
|
3
2
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
4
3
|
import {
|
|
5
4
|
EntityTypeNotRegisteredError,
|
|
@@ -10,6 +9,7 @@ import {
|
|
|
10
9
|
MissingEventIdError,
|
|
11
10
|
ValidationErrorError,
|
|
12
11
|
} from "../lib/errors.generated";
|
|
12
|
+
import { ok, err, type CommandContext } from "@tailor-platform/erp-kit/module";
|
|
13
13
|
|
|
14
14
|
const VALID_ACTOR_TYPES = ["USER", "SYSTEM", "SERVICE"];
|
|
15
15
|
const VALID_OPERATION_TYPES = ["CREATE", "UPDATE", "DELETE"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @generated — do not edit
|
|
2
|
-
import { defineCommand } from "../../../shared";
|
|
3
2
|
import { permissions } from "../lib/permissions.generated";
|
|
4
3
|
import { run } from "./reactivateAuditPolicy";
|
|
4
|
+
import { defineCommand } from "@tailor-platform/erp-kit/module";
|
|
5
5
|
|
|
6
6
|
export const reactivateAuditPolicy = defineCommand(permissions.reactivateAuditPolicy, run);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { createMockDb } from "../../../testing/index";
|
|
3
|
-
import type { CommandContext } from "../../../shared";
|
|
4
|
-
import { InsufficientPermissionError } from "../../../shared/errors";
|
|
5
3
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
6
4
|
import {
|
|
7
5
|
PolicyNotFoundError,
|
|
@@ -12,6 +10,8 @@ import {
|
|
|
12
10
|
import { draftPolicy, activePolicy, inactivePolicy } from "../testing/fixtures";
|
|
13
11
|
import { run } from "./reactivateAuditPolicy";
|
|
14
12
|
import { reactivateAuditPolicy } from "./reactivateAuditPolicy.generated";
|
|
13
|
+
import { InsufficientPermissionError } from "@tailor-platform/erp-kit/module";
|
|
14
|
+
import type { CommandContext } from "@tailor-platform/erp-kit/module";
|
|
15
15
|
|
|
16
16
|
const ctx: CommandContext = {
|
|
17
17
|
actorId: "test-actor",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ok, err, type CommandContext } from "../../../shared";
|
|
2
1
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
3
2
|
import {
|
|
4
3
|
PolicyNotFoundError,
|
|
@@ -6,6 +5,7 @@ import {
|
|
|
6
5
|
ConflictingActivePolicyError,
|
|
7
6
|
UnauthorizedError,
|
|
8
7
|
} from "../lib/errors.generated";
|
|
8
|
+
import { ok, err, type CommandContext } from "@tailor-platform/erp-kit/module";
|
|
9
9
|
|
|
10
10
|
export interface ReactivateAuditPolicyInput {
|
|
11
11
|
policyId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @generated — do not edit
|
|
2
|
-
import { defineCommand } from "../../../shared";
|
|
3
2
|
import { permissions } from "../lib/permissions.generated";
|
|
4
3
|
import { run } from "./registerAuditableEntity";
|
|
4
|
+
import { defineCommand } from "@tailor-platform/erp-kit/module";
|
|
5
5
|
|
|
6
6
|
export const registerAuditableEntity = defineCommand(permissions.registerAuditableEntity, run);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import { createMockDb } from "../../../testing/index";
|
|
3
|
-
import { type CommandContext, InsufficientPermissionError } from "../../../shared";
|
|
4
3
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
5
4
|
import {
|
|
6
5
|
InvalidEntityNameError,
|
|
@@ -11,6 +10,7 @@ import {
|
|
|
11
10
|
import { companyBoundEntity, globalEntity } from "../testing/fixtures";
|
|
12
11
|
import { run } from "./registerAuditableEntity";
|
|
13
12
|
import { registerAuditableEntity } from "./registerAuditableEntity.generated";
|
|
13
|
+
import { type CommandContext, InsufficientPermissionError } from "@tailor-platform/erp-kit/module";
|
|
14
14
|
|
|
15
15
|
const ctx: CommandContext = {
|
|
16
16
|
actorId: "test-actor",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ok, err, type CommandContext } from "../../../shared";
|
|
2
1
|
import type { Transaction } from "../generated/kysely-tailordb";
|
|
3
2
|
import {
|
|
4
3
|
InvalidEntityNameError,
|
|
@@ -6,6 +5,7 @@ import {
|
|
|
6
5
|
InvalidEntityScopeError,
|
|
7
6
|
InvalidAuditableFieldsError,
|
|
8
7
|
} from "../lib/errors.generated";
|
|
8
|
+
import { ok, err, type CommandContext } from "@tailor-platform/erp-kit/module";
|
|
9
9
|
|
|
10
10
|
interface AuditableFieldDef {
|
|
11
11
|
fieldName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @generated — do not edit
|
|
2
|
-
import { defineCommand } from "../../../shared";
|
|
3
2
|
import { permissions } from "../lib/permissions.generated";
|
|
4
3
|
import { run } from "./replaceAuditPolicy";
|
|
4
|
+
import { defineCommand } from "@tailor-platform/erp-kit/module";
|
|
5
5
|
|
|
6
6
|
export const replaceAuditPolicy = defineCommand(permissions.replaceAuditPolicy, run);
|