@tailor-platform/erp-kit 0.5.1 → 0.7.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 +29 -0
- package/README.md +10 -10
- package/dist/cli.mjs +499 -81
- package/package.json +1 -1
- package/skills/erp-kit-app-1-requirements/SKILL.md +33 -17
- package/skills/erp-kit-app-2-requirements-review/SKILL.md +12 -0
- package/skills/erp-kit-app-3-plan/SKILL.md +18 -4
- package/skills/erp-kit-app-3-plan/references/resolver-extraction.md +1 -1
- package/skills/erp-kit-app-3-plan/references/screen-extraction.md +1 -1
- package/skills/erp-kit-app-4-plan-review/SKILL.md +12 -0
- package/skills/erp-kit-app-5-impl-backend/SKILL.md +19 -4
- package/skills/erp-kit-app-6-impl-frontend/SKILL.md +12 -0
- package/skills/erp-kit-app-7-impl-review/SKILL.md +14 -2
- package/skills/erp-kit-app-shared/references/progress-protocol.md +77 -0
- package/skills/erp-kit-mock-scenario/SKILL.md +1 -1
- package/skills/erp-kit-module-1-requirements/SKILL.md +1 -1
- package/skills/erp-kit-module-3-plan/SKILL.md +3 -3
- package/skills/erp-kit-module-3-update-plan/SKILL.md +3 -3
- package/skills/erp-kit-module-5-impl/SKILL.md +1 -1
- package/skills/erp-kit-module-6-impl-review/SKILL.md +39 -17
- package/src/commands/app/index.ts +2 -0
- package/src/commands/app/progress/git-context.ts +16 -0
- package/src/commands/app/progress/index.ts +45 -0
- package/src/commands/app/progress/log.ts +49 -0
- package/src/commands/app/progress/progress.test.ts +128 -0
- package/src/commands/app/progress/schema-cmd.ts +10 -0
- package/src/commands/check.test.ts +4 -4
- package/src/commands/generate-doc.ts +1 -1
- package/src/commands/lib/discovery.test.ts +18 -10
- package/src/commands/lib/discovery.ts +17 -9
- package/src/commands/lib/paths.ts +4 -2
- package/src/commands/lib/sync-check-source.test.ts +1 -1
- package/src/commands/lib/sync-check-source.ts +6 -1
- package/src/commands/lib/sync-check-tests.test.ts +127 -6
- package/src/commands/lib/sync-check-tests.ts +82 -4
- package/src/commands/sync-check.ts +10 -3
- package/src/generator/generate-app-code.test.ts +0 -6
- package/src/generator/generate-app-code.ts +47 -22
- package/src/generator/generate-code.test.ts +10 -40
- package/src/generator/generate-code.ts +6 -12
- package/src/generator/stub-templates.test.ts +9 -5
- package/src/generator/stub-templates.ts +16 -9
- package/src/modules/finance-ledger/README.md +50 -0
- package/src/modules/finance-ledger/command/.gitkeep +0 -0
- package/src/modules/finance-ledger/command/addJournalLine.generated.ts +6 -0
- package/src/modules/finance-ledger/command/addJournalLine.test.ts +438 -0
- package/src/modules/finance-ledger/command/addJournalLine.ts +122 -0
- package/src/modules/finance-ledger/command/approveAndLockPeriod.generated.ts +6 -0
- package/src/modules/finance-ledger/command/approveAndLockPeriod.test.ts +107 -0
- package/src/modules/finance-ledger/command/approveAndLockPeriod.ts +72 -0
- package/src/modules/finance-ledger/command/beginClose.generated.ts +6 -0
- package/src/modules/finance-ledger/command/beginClose.test.ts +106 -0
- package/src/modules/finance-ledger/command/beginClose.ts +58 -0
- package/src/modules/finance-ledger/command/closePeriod.generated.ts +6 -0
- package/src/modules/finance-ledger/command/closePeriod.test.ts +87 -0
- package/src/modules/finance-ledger/command/closePeriod.ts +44 -0
- package/src/modules/finance-ledger/command/createAccountingPeriod.generated.ts +6 -0
- package/src/modules/finance-ledger/command/createAccountingPeriod.test.ts +425 -0
- package/src/modules/finance-ledger/command/createAccountingPeriod.ts +133 -0
- package/src/modules/finance-ledger/command/createFiscalYear.generated.ts +6 -0
- package/src/modules/finance-ledger/command/createFiscalYear.test.ts +197 -0
- package/src/modules/finance-ledger/command/createFiscalYear.ts +70 -0
- package/src/modules/finance-ledger/command/createJournalEntry.generated.ts +6 -0
- package/src/modules/finance-ledger/command/createJournalEntry.test.ts +261 -0
- package/src/modules/finance-ledger/command/createJournalEntry.ts +121 -0
- package/src/modules/finance-ledger/command/deleteAccountingPeriod.generated.ts +6 -0
- package/src/modules/finance-ledger/command/deleteAccountingPeriod.test.ts +71 -0
- package/src/modules/finance-ledger/command/deleteAccountingPeriod.ts +55 -0
- package/src/modules/finance-ledger/command/deleteFiscalYear.generated.ts +6 -0
- package/src/modules/finance-ledger/command/deleteFiscalYear.test.ts +38 -0
- package/src/modules/finance-ledger/command/deleteFiscalYear.ts +34 -0
- package/src/modules/finance-ledger/command/deleteJournalEntry.generated.ts +6 -0
- package/src/modules/finance-ledger/command/deleteJournalEntry.test.ts +58 -0
- package/src/modules/finance-ledger/command/deleteJournalEntry.ts +43 -0
- package/src/modules/finance-ledger/command/executeYearEndClose.generated.ts +6 -0
- package/src/modules/finance-ledger/command/executeYearEndClose.test.ts +239 -0
- package/src/modules/finance-ledger/command/executeYearEndClose.ts +415 -0
- package/src/modules/finance-ledger/command/finalCloseAndLockPeriod.generated.ts +6 -0
- package/src/modules/finance-ledger/command/finalCloseAndLockPeriod.test.ts +102 -0
- package/src/modules/finance-ledger/command/finalCloseAndLockPeriod.ts +76 -0
- package/src/modules/finance-ledger/command/finalizeFinancialStatement.generated.ts +6 -0
- package/src/modules/finance-ledger/command/finalizeFinancialStatement.test.ts +73 -0
- package/src/modules/finance-ledger/command/finalizeFinancialStatement.ts +73 -0
- package/src/modules/finance-ledger/command/generateFinancialStatement.generated.ts +6 -0
- package/src/modules/finance-ledger/command/generateFinancialStatement.test.ts +311 -0
- package/src/modules/finance-ledger/command/generateFinancialStatement.ts +275 -0
- package/src/modules/finance-ledger/command/generatePreliminaryStatements.generated.ts +6 -0
- package/src/modules/finance-ledger/command/generatePreliminaryStatements.test.ts +152 -0
- package/src/modules/finance-ledger/command/generatePreliminaryStatements.ts +140 -0
- package/src/modules/finance-ledger/command/generateTrialBalance.generated.ts +6 -0
- package/src/modules/finance-ledger/command/generateTrialBalance.test.ts +439 -0
- package/src/modules/finance-ledger/command/generateTrialBalance.ts +268 -0
- package/src/modules/finance-ledger/command/initiatePeriodClose.generated.ts +6 -0
- package/src/modules/finance-ledger/command/initiatePeriodClose.test.ts +153 -0
- package/src/modules/finance-ledger/command/initiatePeriodClose.ts +84 -0
- package/src/modules/finance-ledger/command/openForAdvanceEntry.generated.ts +6 -0
- package/src/modules/finance-ledger/command/openForAdvanceEntry.test.ts +87 -0
- package/src/modules/finance-ledger/command/openForAdvanceEntry.ts +44 -0
- package/src/modules/finance-ledger/command/openPeriod.generated.ts +6 -0
- package/src/modules/finance-ledger/command/openPeriod.test.ts +90 -0
- package/src/modules/finance-ledger/command/openPeriod.ts +44 -0
- package/src/modules/finance-ledger/command/permanentlyClosePeriod.generated.ts +6 -0
- package/src/modules/finance-ledger/command/permanentlyClosePeriod.test.ts +87 -0
- package/src/modules/finance-ledger/command/permanentlyClosePeriod.ts +48 -0
- package/src/modules/finance-ledger/command/postAdjustingEntries.generated.ts +6 -0
- package/src/modules/finance-ledger/command/postAdjustingEntries.test.ts +392 -0
- package/src/modules/finance-ledger/command/postAdjustingEntries.ts +156 -0
- package/src/modules/finance-ledger/command/postJournalEntry.generated.ts +6 -0
- package/src/modules/finance-ledger/command/postJournalEntry.test.ts +346 -0
- package/src/modules/finance-ledger/command/postJournalEntry.ts +160 -0
- package/src/modules/finance-ledger/command/processInventoryHandoff.generated.ts +6 -0
- package/src/modules/finance-ledger/command/processInventoryHandoff.test.ts +211 -0
- package/src/modules/finance-ledger/command/processInventoryHandoff.ts +133 -0
- package/src/modules/finance-ledger/command/processManufacturingHandoff.generated.ts +6 -0
- package/src/modules/finance-ledger/command/processManufacturingHandoff.test.ts +221 -0
- package/src/modules/finance-ledger/command/processManufacturingHandoff.ts +133 -0
- package/src/modules/finance-ledger/command/processPurchaseHandoff.generated.ts +6 -0
- package/src/modules/finance-ledger/command/processPurchaseHandoff.test.ts +222 -0
- package/src/modules/finance-ledger/command/processPurchaseHandoff.ts +133 -0
- package/src/modules/finance-ledger/command/processSalesHandoff.generated.ts +6 -0
- package/src/modules/finance-ledger/command/processSalesHandoff.test.ts +257 -0
- package/src/modules/finance-ledger/command/processSalesHandoff.ts +135 -0
- package/src/modules/finance-ledger/command/regenerateFinancialStatement.generated.ts +6 -0
- package/src/modules/finance-ledger/command/regenerateFinancialStatement.test.ts +129 -0
- package/src/modules/finance-ledger/command/regenerateFinancialStatement.ts +186 -0
- package/src/modules/finance-ledger/command/removeJournalLine.generated.ts +6 -0
- package/src/modules/finance-ledger/command/removeJournalLine.test.ts +65 -0
- package/src/modules/finance-ledger/command/removeJournalLine.ts +39 -0
- package/src/modules/finance-ledger/command/reopenPeriod.generated.ts +6 -0
- package/src/modules/finance-ledger/command/reopenPeriod.test.ts +87 -0
- package/src/modules/finance-ledger/command/reopenPeriod.ts +44 -0
- package/src/modules/finance-ledger/command/reverseJournalEntry.generated.ts +6 -0
- package/src/modules/finance-ledger/command/reverseJournalEntry.test.ts +337 -0
- package/src/modules/finance-ledger/command/reverseJournalEntry.ts +140 -0
- package/src/modules/finance-ledger/command/revertSoftLock.generated.ts +6 -0
- package/src/modules/finance-ledger/command/revertSoftLock.test.ts +96 -0
- package/src/modules/finance-ledger/command/revertSoftLock.ts +67 -0
- package/src/modules/finance-ledger/command/updateFiscalYear.generated.ts +6 -0
- package/src/modules/finance-ledger/command/updateFiscalYear.test.ts +138 -0
- package/src/modules/finance-ledger/command/updateFiscalYear.ts +85 -0
- package/src/modules/finance-ledger/command/updateJournalEntry.generated.ts +6 -0
- package/src/modules/finance-ledger/command/updateJournalEntry.test.ts +195 -0
- package/src/modules/finance-ledger/command/updateJournalEntry.ts +86 -0
- package/src/modules/finance-ledger/command/updateJournalLine.generated.ts +6 -0
- package/src/modules/finance-ledger/command/updateJournalLine.test.ts +385 -0
- package/src/modules/finance-ledger/command/updateJournalLine.ts +155 -0
- package/src/modules/finance-ledger/command/verifySubledgerTransfers.generated.ts +6 -0
- package/src/modules/finance-ledger/command/verifySubledgerTransfers.test.ts +201 -0
- package/src/modules/finance-ledger/command/verifySubledgerTransfers.ts +113 -0
- package/src/modules/finance-ledger/command/verifyTrialBalance.generated.ts +6 -0
- package/src/modules/finance-ledger/command/verifyTrialBalance.test.ts +136 -0
- package/src/modules/finance-ledger/command/verifyTrialBalance.ts +97 -0
- package/src/modules/finance-ledger/db/.gitkeep +0 -0
- package/src/modules/finance-ledger/db/accountingPeriod.ts +58 -0
- package/src/modules/finance-ledger/db/financialStatement.ts +92 -0
- package/src/modules/finance-ledger/db/financialStatementLineItem.ts +76 -0
- package/src/modules/finance-ledger/db/fiscalYear.ts +41 -0
- package/src/modules/finance-ledger/db/journalEntry.ts +101 -0
- package/src/modules/finance-ledger/db/journalLine.ts +64 -0
- package/src/modules/finance-ledger/db/periodClose.ts +97 -0
- package/src/modules/finance-ledger/db/trialBalance.ts +63 -0
- package/src/modules/finance-ledger/db/trialBalanceLine.ts +63 -0
- package/src/modules/finance-ledger/docs/commands/AddJournalLine.md +74 -0
- package/src/modules/finance-ledger/docs/commands/ApproveAndLockPeriod.md +53 -0
- package/src/modules/finance-ledger/docs/commands/BeginClose.md +47 -0
- package/src/modules/finance-ledger/docs/commands/ClosePeriod.md +45 -0
- package/src/modules/finance-ledger/docs/commands/CreateAccountingPeriod.md +69 -0
- package/src/modules/finance-ledger/docs/commands/CreateFiscalYear.md +56 -0
- package/src/modules/finance-ledger/docs/commands/CreateJournalEntry.md +63 -0
- package/src/modules/finance-ledger/docs/commands/DeleteAccountingPeriod.md +46 -0
- package/src/modules/finance-ledger/docs/commands/DeleteFiscalYear.md +40 -0
- package/src/modules/finance-ledger/docs/commands/DeleteJournalEntry.md +44 -0
- package/src/modules/finance-ledger/docs/commands/ExecuteYearEndClose.md +81 -0
- package/src/modules/finance-ledger/docs/commands/FinalCloseAndLockPeriod.md +49 -0
- package/src/modules/finance-ledger/docs/commands/FinalizeFinancialStatement.md +43 -0
- package/src/modules/finance-ledger/docs/commands/GenerateFinancialStatement.md +86 -0
- package/src/modules/finance-ledger/docs/commands/GeneratePreliminaryStatements.md +53 -0
- package/src/modules/finance-ledger/docs/commands/GenerateTrialBalance.md +75 -0
- package/src/modules/finance-ledger/docs/commands/InitiatePeriodClose.md +58 -0
- package/src/modules/finance-ledger/docs/commands/OpenForAdvanceEntry.md +44 -0
- package/src/modules/finance-ledger/docs/commands/OpenPeriod.md +45 -0
- package/src/modules/finance-ledger/docs/commands/PermanentlyClosePeriod.md +45 -0
- package/src/modules/finance-ledger/docs/commands/PostAdjustingEntries.md +61 -0
- package/src/modules/finance-ledger/docs/commands/PostJournalEntry.md +81 -0
- package/src/modules/finance-ledger/docs/commands/ProcessInventoryHandoff.md +72 -0
- package/src/modules/finance-ledger/docs/commands/ProcessManufacturingHandoff.md +68 -0
- package/src/modules/finance-ledger/docs/commands/ProcessPurchaseHandoff.md +68 -0
- package/src/modules/finance-ledger/docs/commands/ProcessSalesHandoff.md +71 -0
- package/src/modules/finance-ledger/docs/commands/RegenerateFinancialStatement.md +60 -0
- package/src/modules/finance-ledger/docs/commands/RemoveJournalLine.md +42 -0
- package/src/modules/finance-ledger/docs/commands/ReopenPeriod.md +45 -0
- package/src/modules/finance-ledger/docs/commands/ReverseJournalEntry.md +62 -0
- package/src/modules/finance-ledger/docs/commands/RevertSoftLock.md +49 -0
- package/src/modules/finance-ledger/docs/commands/UpdateFiscalYear.md +60 -0
- package/src/modules/finance-ledger/docs/commands/UpdateJournalEntry.md +50 -0
- package/src/modules/finance-ledger/docs/commands/UpdateJournalLine.md +61 -0
- package/src/modules/finance-ledger/docs/commands/VerifySubledgerTransfers.md +59 -0
- package/src/modules/finance-ledger/docs/commands/VerifyTrialBalance.md +53 -0
- package/src/modules/finance-ledger/docs/features/accounting-period-management.md +110 -0
- package/src/modules/finance-ledger/docs/features/financial-statement-generation.md +115 -0
- package/src/modules/finance-ledger/docs/features/journal-entry-management.md +138 -0
- package/src/modules/finance-ledger/docs/features/period-end-close.md +102 -0
- package/src/modules/finance-ledger/docs/features/subledger-integration.md +141 -0
- package/src/modules/finance-ledger/docs/features/trial-balance.md +99 -0
- package/src/modules/finance-ledger/docs/features/year-end-close.md +84 -0
- package/src/modules/finance-ledger/docs/models/AccountingPeriod.md +71 -0
- package/src/modules/finance-ledger/docs/models/FinancialStatement.md +76 -0
- package/src/modules/finance-ledger/docs/models/FinancialStatementLineItem.md +41 -0
- package/src/modules/finance-ledger/docs/models/FiscalYear.md +41 -0
- package/src/modules/finance-ledger/docs/models/JournalEntry.md +80 -0
- package/src/modules/finance-ledger/docs/models/JournalLine.md +47 -0
- package/src/modules/finance-ledger/docs/models/PeriodClose.md +83 -0
- package/src/modules/finance-ledger/docs/models/TrialBalance.md +56 -0
- package/src/modules/finance-ledger/docs/models/TrialBalanceLine.md +37 -0
- package/src/modules/finance-ledger/docs/queries/GetAccountingPeriod.md +35 -0
- package/src/modules/finance-ledger/docs/queries/GetFinancialStatement.md +38 -0
- package/src/modules/finance-ledger/docs/queries/GetFiscalYear.md +35 -0
- package/src/modules/finance-ledger/docs/queries/GetJournalEntry.md +37 -0
- package/src/modules/finance-ledger/docs/queries/GetPeriodByDate.md +38 -0
- package/src/modules/finance-ledger/docs/queries/GetPeriodClose.md +36 -0
- package/src/modules/finance-ledger/docs/queries/GetSubledgerTransferStatus.md +45 -0
- package/src/modules/finance-ledger/docs/queries/GetTrialBalance.md +38 -0
- package/src/modules/finance-ledger/docs/queries/ListAccountingPeriods.md +46 -0
- package/src/modules/finance-ledger/docs/queries/ListFinancialStatements.md +46 -0
- package/src/modules/finance-ledger/docs/queries/ListFiscalYears.md +42 -0
- package/src/modules/finance-ledger/docs/queries/ListJournalEntries.md +48 -0
- package/src/modules/finance-ledger/docs/queries/ListPeriodCloses.md +46 -0
- package/src/modules/finance-ledger/docs/queries/ListTrialBalances.md +51 -0
- package/src/modules/finance-ledger/executor/.gitkeep +0 -0
- package/src/modules/finance-ledger/generated/enums.ts +109 -0
- package/src/modules/finance-ledger/generated/kysely-tailordb.ts +202 -0
- package/src/modules/finance-ledger/index.ts +2 -0
- package/src/modules/finance-ledger/lib/_db_deps.ts +56 -0
- package/src/modules/finance-ledger/lib/errors.generated.ts +332 -0
- package/src/modules/finance-ledger/lib/permissions.generated.ts +41 -0
- package/src/modules/finance-ledger/lib/types.ts +66 -0
- package/src/modules/finance-ledger/module.ts +262 -0
- package/src/modules/finance-ledger/package.json +26 -0
- package/src/modules/finance-ledger/permissions.ts +3 -0
- package/src/modules/finance-ledger/query/.gitkeep +0 -0
- package/src/modules/finance-ledger/query/getAccountingPeriod.generated.ts +5 -0
- package/src/modules/finance-ledger/query/getAccountingPeriod.test.ts +31 -0
- package/src/modules/finance-ledger/query/getAccountingPeriod.ts +21 -0
- package/src/modules/finance-ledger/query/getFinancialStatement.generated.ts +5 -0
- package/src/modules/finance-ledger/query/getFinancialStatement.test.ts +35 -0
- package/src/modules/finance-ledger/query/getFinancialStatement.ts +29 -0
- package/src/modules/finance-ledger/query/getFiscalYear.generated.ts +5 -0
- package/src/modules/finance-ledger/query/getFiscalYear.test.ts +31 -0
- package/src/modules/finance-ledger/query/getFiscalYear.ts +21 -0
- package/src/modules/finance-ledger/query/getJournalEntry.generated.ts +5 -0
- package/src/modules/finance-ledger/query/getJournalEntry.test.ts +35 -0
- package/src/modules/finance-ledger/query/getJournalEntry.ts +29 -0
- package/src/modules/finance-ledger/query/getPeriodByDate.generated.ts +5 -0
- package/src/modules/finance-ledger/query/getPeriodByDate.test.ts +53 -0
- package/src/modules/finance-ledger/query/getPeriodByDate.ts +27 -0
- package/src/modules/finance-ledger/query/getPeriodClose.generated.ts +5 -0
- package/src/modules/finance-ledger/query/getPeriodClose.test.ts +31 -0
- package/src/modules/finance-ledger/query/getPeriodClose.ts +21 -0
- package/src/modules/finance-ledger/query/getSubledgerTransferStatus.generated.ts +5 -0
- package/src/modules/finance-ledger/query/getSubledgerTransferStatus.test.ts +101 -0
- package/src/modules/finance-ledger/query/getSubledgerTransferStatus.ts +68 -0
- package/src/modules/finance-ledger/query/getTrialBalance.generated.ts +5 -0
- package/src/modules/finance-ledger/query/getTrialBalance.test.ts +33 -0
- package/src/modules/finance-ledger/query/getTrialBalance.ts +30 -0
- package/src/modules/finance-ledger/query/listAccountingPeriods.generated.ts +5 -0
- package/src/modules/finance-ledger/query/listAccountingPeriods.test.ts +81 -0
- package/src/modules/finance-ledger/query/listAccountingPeriods.ts +61 -0
- package/src/modules/finance-ledger/query/listFinancialStatements.generated.ts +5 -0
- package/src/modules/finance-ledger/query/listFinancialStatements.test.ts +76 -0
- package/src/modules/finance-ledger/query/listFinancialStatements.ts +62 -0
- package/src/modules/finance-ledger/query/listFiscalYears.generated.ts +5 -0
- package/src/modules/finance-ledger/query/listFiscalYears.test.ts +63 -0
- package/src/modules/finance-ledger/query/listFiscalYears.ts +45 -0
- package/src/modules/finance-ledger/query/listJournalEntries.generated.ts +5 -0
- package/src/modules/finance-ledger/query/listJournalEntries.test.ts +91 -0
- package/src/modules/finance-ledger/query/listJournalEntries.ts +64 -0
- package/src/modules/finance-ledger/query/listPeriodCloses.generated.ts +5 -0
- package/src/modules/finance-ledger/query/listPeriodCloses.test.ts +63 -0
- package/src/modules/finance-ledger/query/listPeriodCloses.ts +64 -0
- package/src/modules/finance-ledger/query/listTrialBalances.generated.ts +5 -0
- package/src/modules/finance-ledger/query/listTrialBalances.test.ts +78 -0
- package/src/modules/finance-ledger/query/listTrialBalances.ts +56 -0
- package/src/modules/finance-ledger/seed/index.ts +19 -0
- package/src/modules/finance-ledger/tailor.config.ts +13 -0
- package/src/modules/finance-ledger/tailor.d.ts +13 -0
- package/src/modules/finance-ledger/testing/commandTestUtils.ts +35 -0
- package/src/modules/finance-ledger/testing/fixtures.ts +382 -0
- package/src/modules/finance-ledger/tsconfig.json +16 -0
- package/src/modules/inventory/docs/features/inventory-adjustment.md +2 -1
- package/src/modules/inventory/docs/features/scrap-management.md +39 -1
- package/src/modules/manufacturing/README.md +63 -0
- package/src/modules/manufacturing/command/.gitkeep +0 -0
- package/src/modules/manufacturing/command/activateBillOfMaterial.generated.ts +6 -0
- package/src/modules/manufacturing/command/activateBillOfMaterial.test.ts +166 -0
- package/src/modules/manufacturing/command/activateBillOfMaterial.ts +173 -0
- package/src/modules/manufacturing/command/activateRouting.generated.ts +6 -0
- package/src/modules/manufacturing/command/activateRouting.test.ts +152 -0
- package/src/modules/manufacturing/command/activateRouting.ts +92 -0
- package/src/modules/manufacturing/command/activateWorkCenter.generated.ts +6 -0
- package/src/modules/manufacturing/command/activateWorkCenter.test.ts +135 -0
- package/src/modules/manufacturing/command/activateWorkCenter.ts +91 -0
- package/src/modules/manufacturing/command/cancelProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/cancelProductionOrder.test.ts +151 -0
- package/src/modules/manufacturing/command/cancelProductionOrder.ts +114 -0
- package/src/modules/manufacturing/command/closeProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/closeProductionOrder.test.ts +126 -0
- package/src/modules/manufacturing/command/closeProductionOrder.ts +87 -0
- package/src/modules/manufacturing/command/completeProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/completeProductionOrder.test.ts +132 -0
- package/src/modules/manufacturing/command/completeProductionOrder.ts +97 -0
- package/src/modules/manufacturing/command/completeWorkOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/completeWorkOrder.test.ts +369 -0
- package/src/modules/manufacturing/command/completeWorkOrder.ts +212 -0
- package/src/modules/manufacturing/command/createBillOfMaterial.generated.ts +6 -0
- package/src/modules/manufacturing/command/createBillOfMaterial.test.ts +210 -0
- package/src/modules/manufacturing/command/createBillOfMaterial.ts +176 -0
- package/src/modules/manufacturing/command/createProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/createProductionOrder.test.ts +160 -0
- package/src/modules/manufacturing/command/createProductionOrder.ts +129 -0
- package/src/modules/manufacturing/command/createRouting.generated.ts +6 -0
- package/src/modules/manufacturing/command/createRouting.test.ts +168 -0
- package/src/modules/manufacturing/command/createRouting.ts +128 -0
- package/src/modules/manufacturing/command/createWorkCenter.generated.ts +6 -0
- package/src/modules/manufacturing/command/createWorkCenter.test.ts +148 -0
- package/src/modules/manufacturing/command/createWorkCenter.ts +131 -0
- package/src/modules/manufacturing/command/deactivateBillOfMaterial.generated.ts +6 -0
- package/src/modules/manufacturing/command/deactivateBillOfMaterial.test.ts +103 -0
- package/src/modules/manufacturing/command/deactivateBillOfMaterial.ts +78 -0
- package/src/modules/manufacturing/command/deactivateRouting.generated.ts +6 -0
- package/src/modules/manufacturing/command/deactivateRouting.test.ts +112 -0
- package/src/modules/manufacturing/command/deactivateRouting.ts +76 -0
- package/src/modules/manufacturing/command/deactivateWorkCenter.generated.ts +6 -0
- package/src/modules/manufacturing/command/deactivateWorkCenter.test.ts +113 -0
- package/src/modules/manufacturing/command/deactivateWorkCenter.ts +85 -0
- package/src/modules/manufacturing/command/pauseWorkOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/pauseWorkOrder.test.ts +118 -0
- package/src/modules/manufacturing/command/pauseWorkOrder.ts +82 -0
- package/src/modules/manufacturing/command/recordInventoryIssueOutcome.generated.ts +6 -0
- package/src/modules/manufacturing/command/recordInventoryIssueOutcome.test.ts +183 -0
- package/src/modules/manufacturing/command/recordInventoryIssueOutcome.ts +139 -0
- package/src/modules/manufacturing/command/recordManufacturingCostSettlementAcknowledgment.generated.ts +6 -0
- package/src/modules/manufacturing/command/recordManufacturingCostSettlementAcknowledgment.test.ts +120 -0
- package/src/modules/manufacturing/command/recordManufacturingCostSettlementAcknowledgment.ts +110 -0
- package/src/modules/manufacturing/command/releaseProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/releaseProductionOrder.test.ts +220 -0
- package/src/modules/manufacturing/command/releaseProductionOrder.ts +450 -0
- package/src/modules/manufacturing/command/reopenProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/reopenProductionOrder.test.ts +196 -0
- package/src/modules/manufacturing/command/reopenProductionOrder.ts +98 -0
- package/src/modules/manufacturing/command/reportWorkOrderProgress.generated.ts +6 -0
- package/src/modules/manufacturing/command/reportWorkOrderProgress.test.ts +204 -0
- package/src/modules/manufacturing/command/reportWorkOrderProgress.ts +129 -0
- package/src/modules/manufacturing/command/rescheduleProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/rescheduleProductionOrder.test.ts +185 -0
- package/src/modules/manufacturing/command/rescheduleProductionOrder.ts +95 -0
- package/src/modules/manufacturing/command/resumeWorkOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/resumeWorkOrder.test.ts +122 -0
- package/src/modules/manufacturing/command/resumeWorkOrder.ts +94 -0
- package/src/modules/manufacturing/command/reviewManufacturingCostSummary.generated.ts +6 -0
- package/src/modules/manufacturing/command/reviewManufacturingCostSummary.test.ts +231 -0
- package/src/modules/manufacturing/command/reviewManufacturingCostSummary.ts +137 -0
- package/src/modules/manufacturing/command/startWorkOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/startWorkOrder.test.ts +118 -0
- package/src/modules/manufacturing/command/startWorkOrder.ts +126 -0
- package/src/modules/manufacturing/command/technicallyCompleteProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/technicallyCompleteProductionOrder.test.ts +153 -0
- package/src/modules/manufacturing/command/technicallyCompleteProductionOrder.ts +106 -0
- package/src/modules/manufacturing/command/unreleaseProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/unreleaseProductionOrder.test.ts +140 -0
- package/src/modules/manufacturing/command/unreleaseProductionOrder.ts +131 -0
- package/src/modules/manufacturing/command/updateBillOfMaterial.generated.ts +6 -0
- package/src/modules/manufacturing/command/updateBillOfMaterial.test.ts +149 -0
- package/src/modules/manufacturing/command/updateBillOfMaterial.ts +174 -0
- package/src/modules/manufacturing/command/updateProductionOrder.generated.ts +6 -0
- package/src/modules/manufacturing/command/updateProductionOrder.test.ts +112 -0
- package/src/modules/manufacturing/command/updateProductionOrder.ts +145 -0
- package/src/modules/manufacturing/command/updateRouting.generated.ts +6 -0
- package/src/modules/manufacturing/command/updateRouting.test.ts +211 -0
- package/src/modules/manufacturing/command/updateRouting.ts +124 -0
- package/src/modules/manufacturing/command/updateWorkCenter.generated.ts +6 -0
- package/src/modules/manufacturing/command/updateWorkCenter.test.ts +152 -0
- package/src/modules/manufacturing/command/updateWorkCenter.ts +137 -0
- package/src/modules/manufacturing/db/.gitkeep +0 -0
- package/src/modules/manufacturing/db/billOfMaterial.ts +70 -0
- package/src/modules/manufacturing/db/billOfMaterialLine.ts +49 -0
- package/src/modules/manufacturing/db/costVarianceLine.ts +53 -0
- package/src/modules/manufacturing/db/manufacturingCostLine.ts +35 -0
- package/src/modules/manufacturing/db/manufacturingCostSettlementRecord.ts +39 -0
- package/src/modules/manufacturing/db/manufacturingCostSummary.ts +59 -0
- package/src/modules/manufacturing/db/productionOrder.ts +83 -0
- package/src/modules/manufacturing/db/productionOrderBomSnapshot.ts +44 -0
- package/src/modules/manufacturing/db/productionOrderCostBaseline.ts +44 -0
- package/src/modules/manufacturing/db/productionOrderMaterialRequirement.ts +57 -0
- package/src/modules/manufacturing/db/productionOrderRoutingSnapshot.ts +43 -0
- package/src/modules/manufacturing/db/routing.ts +63 -0
- package/src/modules/manufacturing/db/routingOperation.ts +57 -0
- package/src/modules/manufacturing/db/workCenter.ts +87 -0
- package/src/modules/manufacturing/db/workOrder.ts +65 -0
- package/src/modules/manufacturing/db/workOrderExecutionEvent.ts +54 -0
- package/src/modules/manufacturing/docs/commands/ActivateBillOfMaterial.md +50 -0
- package/src/modules/manufacturing/docs/commands/ActivateRouting.md +48 -0
- package/src/modules/manufacturing/docs/commands/ActivateWorkCenter.md +49 -0
- package/src/modules/manufacturing/docs/commands/CancelProductionOrder.md +48 -0
- package/src/modules/manufacturing/docs/commands/CloseProductionOrder.md +46 -0
- package/src/modules/manufacturing/docs/commands/CompleteProductionOrder.md +48 -0
- package/src/modules/manufacturing/docs/commands/CompleteWorkOrder.md +66 -0
- package/src/modules/manufacturing/docs/commands/CreateBillOfMaterial.md +54 -0
- package/src/modules/manufacturing/docs/commands/CreateProductionOrder.md +49 -0
- package/src/modules/manufacturing/docs/commands/CreateRouting.md +50 -0
- package/src/modules/manufacturing/docs/commands/CreateWorkCenter.md +51 -0
- package/src/modules/manufacturing/docs/commands/DeactivateBillOfMaterial.md +45 -0
- package/src/modules/manufacturing/docs/commands/DeactivateRouting.md +45 -0
- package/src/modules/manufacturing/docs/commands/DeactivateWorkCenter.md +45 -0
- package/src/modules/manufacturing/docs/commands/PauseWorkOrder.md +44 -0
- package/src/modules/manufacturing/docs/commands/RecordInventoryIssueOutcome.md +59 -0
- package/src/modules/manufacturing/docs/commands/RecordManufacturingCostSettlementAcknowledgment.md +49 -0
- package/src/modules/manufacturing/docs/commands/ReleaseProductionOrder.md +57 -0
- package/src/modules/manufacturing/docs/commands/ReopenProductionOrder.md +54 -0
- package/src/modules/manufacturing/docs/commands/ReportWorkOrderProgress.md +53 -0
- package/src/modules/manufacturing/docs/commands/RescheduleProductionOrder.md +45 -0
- package/src/modules/manufacturing/docs/commands/ResumeWorkOrder.md +44 -0
- package/src/modules/manufacturing/docs/commands/ReviewManufacturingCostSummary.md +52 -0
- package/src/modules/manufacturing/docs/commands/StartWorkOrder.md +46 -0
- package/src/modules/manufacturing/docs/commands/TechnicallyCompleteProductionOrder.md +51 -0
- package/src/modules/manufacturing/docs/commands/UnreleaseProductionOrder.md +46 -0
- package/src/modules/manufacturing/docs/commands/UpdateBillOfMaterial.md +48 -0
- package/src/modules/manufacturing/docs/commands/UpdateProductionOrder.md +48 -0
- package/src/modules/manufacturing/docs/commands/UpdateRouting.md +52 -0
- package/src/modules/manufacturing/docs/commands/UpdateWorkCenter.md +48 -0
- package/src/modules/manufacturing/docs/features/bill-of-material-management.md +83 -0
- package/src/modules/manufacturing/docs/features/manufacturing-cost-and-variance.md +191 -0
- package/src/modules/manufacturing/docs/features/production-order-lifecycle.md +103 -0
- package/src/modules/manufacturing/docs/features/routing-and-work-center-definition.md +63 -0
- package/src/modules/manufacturing/docs/features/work-order-execution.md +115 -0
- package/src/modules/manufacturing/docs/models/BillOfMaterial.md +60 -0
- package/src/modules/manufacturing/docs/models/ManufacturingCostSummary.md +66 -0
- package/src/modules/manufacturing/docs/models/ProductionOrder.md +76 -0
- package/src/modules/manufacturing/docs/models/Routing.md +58 -0
- package/src/modules/manufacturing/docs/models/WorkCenter.md +56 -0
- package/src/modules/manufacturing/docs/models/WorkOrder.md +63 -0
- package/src/modules/manufacturing/docs/queries/DetectBillOfMaterialCircularReference.md +39 -0
- package/src/modules/manufacturing/docs/queries/ExplodeBillOfMaterial.md +56 -0
- package/src/modules/manufacturing/docs/queries/GetBillOfMaterial.md +37 -0
- package/src/modules/manufacturing/docs/queries/GetManufacturingCostSummary.md +39 -0
- package/src/modules/manufacturing/docs/queries/GetProductionOrder.md +37 -0
- package/src/modules/manufacturing/docs/queries/GetRouting.md +39 -0
- package/src/modules/manufacturing/docs/queries/GetWorkCenter.md +35 -0
- package/src/modules/manufacturing/docs/queries/GetWorkOrder.md +38 -0
- package/src/modules/manufacturing/docs/queries/ListBillOfMaterialsByItem.md +42 -0
- package/src/modules/manufacturing/docs/queries/ListManufacturingCostSummariesByStatus.md +41 -0
- package/src/modules/manufacturing/docs/queries/ListProductionOrdersByStatus.md +41 -0
- package/src/modules/manufacturing/docs/queries/ListRoutingsByItem.md +42 -0
- package/src/modules/manufacturing/docs/queries/ListWorkCentersBySite.md +38 -0
- package/src/modules/manufacturing/docs/queries/ListWorkOrdersByProductionOrder.md +39 -0
- package/src/modules/manufacturing/docs/queries/ListWorkOrdersByWorkCenter.md +43 -0
- package/src/modules/manufacturing/executor/.gitkeep +0 -0
- package/src/modules/manufacturing/generated/enums.ts +113 -0
- package/src/modules/manufacturing/generated/kysely-tailordb.ts +247 -0
- package/src/modules/manufacturing/index.ts +2 -0
- package/src/modules/manufacturing/lib/_db_deps.ts +22 -0
- package/src/modules/manufacturing/lib/errors.generated.ts +592 -0
- package/src/modules/manufacturing/lib/permissions.generated.ts +35 -0
- package/src/modules/manufacturing/lib/types.ts +111 -0
- package/src/modules/manufacturing/module.ts +226 -0
- package/src/modules/manufacturing/permissions.ts +3 -0
- package/src/modules/manufacturing/query/.gitkeep +0 -0
- package/src/modules/manufacturing/query/detectBillOfMaterialCircularReference.generated.ts +5 -0
- package/src/modules/manufacturing/query/detectBillOfMaterialCircularReference.test.ts +115 -0
- package/src/modules/manufacturing/query/detectBillOfMaterialCircularReference.ts +79 -0
- package/src/modules/manufacturing/query/explodeBillOfMaterial.generated.ts +5 -0
- package/src/modules/manufacturing/query/explodeBillOfMaterial.test.ts +445 -0
- package/src/modules/manufacturing/query/explodeBillOfMaterial.ts +306 -0
- package/src/modules/manufacturing/query/getBillOfMaterial.generated.ts +5 -0
- package/src/modules/manufacturing/query/getBillOfMaterial.test.ts +64 -0
- package/src/modules/manufacturing/query/getBillOfMaterial.ts +27 -0
- package/src/modules/manufacturing/query/getManufacturingCostSummary.generated.ts +5 -0
- package/src/modules/manufacturing/query/getManufacturingCostSummary.test.ts +147 -0
- package/src/modules/manufacturing/query/getManufacturingCostSummary.ts +46 -0
- package/src/modules/manufacturing/query/getProductionOrder.generated.ts +5 -0
- package/src/modules/manufacturing/query/getProductionOrder.test.ts +139 -0
- package/src/modules/manufacturing/query/getProductionOrder.ts +84 -0
- package/src/modules/manufacturing/query/getRouting.generated.ts +5 -0
- package/src/modules/manufacturing/query/getRouting.test.ts +71 -0
- package/src/modules/manufacturing/query/getRouting.ts +34 -0
- package/src/modules/manufacturing/query/getWorkCenter.generated.ts +5 -0
- package/src/modules/manufacturing/query/getWorkCenter.test.ts +37 -0
- package/src/modules/manufacturing/query/getWorkCenter.ts +21 -0
- package/src/modules/manufacturing/query/getWorkOrder.generated.ts +5 -0
- package/src/modules/manufacturing/query/getWorkOrder.test.ts +73 -0
- package/src/modules/manufacturing/query/getWorkOrder.ts +28 -0
- package/src/modules/manufacturing/query/listBillOfMaterialsByItem.generated.ts +5 -0
- package/src/modules/manufacturing/query/listBillOfMaterialsByItem.test.ts +107 -0
- package/src/modules/manufacturing/query/listBillOfMaterialsByItem.ts +58 -0
- package/src/modules/manufacturing/query/listManufacturingCostSummariesByStatus.generated.ts +5 -0
- package/src/modules/manufacturing/query/listManufacturingCostSummariesByStatus.test.ts +96 -0
- package/src/modules/manufacturing/query/listManufacturingCostSummariesByStatus.ts +77 -0
- package/src/modules/manufacturing/query/listProductionOrdersByStatus.generated.ts +5 -0
- package/src/modules/manufacturing/query/listProductionOrdersByStatus.test.ts +121 -0
- package/src/modules/manufacturing/query/listProductionOrdersByStatus.ts +83 -0
- package/src/modules/manufacturing/query/listRoutingsByItem.generated.ts +5 -0
- package/src/modules/manufacturing/query/listRoutingsByItem.test.ts +110 -0
- package/src/modules/manufacturing/query/listRoutingsByItem.ts +54 -0
- package/src/modules/manufacturing/query/listWorkCentersBySite.generated.ts +5 -0
- package/src/modules/manufacturing/query/listWorkCentersBySite.test.ts +81 -0
- package/src/modules/manufacturing/query/listWorkCentersBySite.ts +70 -0
- package/src/modules/manufacturing/query/listWorkOrdersByProductionOrder.generated.ts +5 -0
- package/src/modules/manufacturing/query/listWorkOrdersByProductionOrder.test.ts +102 -0
- package/src/modules/manufacturing/query/listWorkOrdersByProductionOrder.ts +53 -0
- package/src/modules/manufacturing/query/listWorkOrdersByWorkCenter.generated.ts +5 -0
- package/src/modules/manufacturing/query/listWorkOrdersByWorkCenter.test.ts +143 -0
- package/src/modules/manufacturing/query/listWorkOrdersByWorkCenter.ts +56 -0
- package/src/modules/manufacturing/seed/index.ts +19 -0
- package/src/modules/manufacturing/tailor.config.ts +13 -0
- package/src/modules/manufacturing/tailor.d.ts +13 -0
- package/src/modules/manufacturing/testing/commandTestUtils.ts +29 -0
- package/src/modules/manufacturing/testing/fixtures.ts +402 -0
- package/src/progress/schema.test.ts +161 -0
- package/src/progress/schema.ts +316 -0
- package/templates/scaffold/app/backend/package.json +7 -2
- package/templates/scaffold/app/backend/src/tests/utils/graphql-client.ts +66 -0
- package/templates/scaffold/app/backend/src/tests/utils/setup.ts +21 -0
- package/templates/scaffold/app/backend/tsconfig.json +9 -2
- package/templates/scaffold/app/backend/vitest.config.ts +18 -0
- package/templates/scaffold/app/frontend/package.json +2 -2
- package/src/generator/generate-stubs.ts +0 -31
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
FiscalYear,
|
|
3
|
+
AccountingPeriod,
|
|
4
|
+
JournalEntry,
|
|
5
|
+
JournalLine,
|
|
6
|
+
PeriodClose,
|
|
7
|
+
TrialBalance,
|
|
8
|
+
TrialBalanceLine,
|
|
9
|
+
FinancialStatement,
|
|
10
|
+
FinancialStatementLineItem,
|
|
11
|
+
Schema,
|
|
12
|
+
} from "../lib/types";
|
|
13
|
+
|
|
14
|
+
const createdAt = new Date("2024-01-01T00:00:00.000Z");
|
|
15
|
+
|
|
16
|
+
export const baseCompany = {
|
|
17
|
+
id: "company-1",
|
|
18
|
+
status: "ACTIVE",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const baseAccount = {
|
|
22
|
+
id: "account-1",
|
|
23
|
+
code: "1000",
|
|
24
|
+
name: "Cash",
|
|
25
|
+
classification: "ASSET",
|
|
26
|
+
status: "ACTIVE",
|
|
27
|
+
successorAccountId: null,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const baseAccount2 = {
|
|
31
|
+
id: "account-2",
|
|
32
|
+
code: "2000",
|
|
33
|
+
name: "Accounts Payable",
|
|
34
|
+
classification: "LIABILITY",
|
|
35
|
+
status: "ACTIVE",
|
|
36
|
+
successorAccountId: null,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const receivableAccount = {
|
|
40
|
+
id: "account-receivable",
|
|
41
|
+
code: "1100",
|
|
42
|
+
name: "Accounts Receivable",
|
|
43
|
+
classification: "RECEIVABLE",
|
|
44
|
+
status: "ACTIVE",
|
|
45
|
+
successorAccountId: null,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const payableAccount = {
|
|
49
|
+
id: "account-payable",
|
|
50
|
+
code: "2100",
|
|
51
|
+
name: "Accounts Payable Control",
|
|
52
|
+
classification: "PAYABLE",
|
|
53
|
+
status: "ACTIVE",
|
|
54
|
+
successorAccountId: null,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const inactiveAccount = {
|
|
58
|
+
...baseAccount,
|
|
59
|
+
id: "account-inactive",
|
|
60
|
+
status: "INACTIVE",
|
|
61
|
+
successorAccountId: null,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const deprecatedAccount = {
|
|
65
|
+
...baseAccount,
|
|
66
|
+
id: "account-deprecated",
|
|
67
|
+
status: "DEPRECATED",
|
|
68
|
+
successorAccountId: baseAccount.id,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const retainedEarningsAccount = {
|
|
72
|
+
id: "account-retained-earnings",
|
|
73
|
+
code: "3100",
|
|
74
|
+
name: "Retained Earnings",
|
|
75
|
+
classification: "RETAINED_EARNINGS",
|
|
76
|
+
status: "ACTIVE",
|
|
77
|
+
successorAccountId: null,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const revenueAccount = {
|
|
81
|
+
id: "account-revenue",
|
|
82
|
+
code: "4000",
|
|
83
|
+
name: "Sales Revenue",
|
|
84
|
+
classification: "REVENUE",
|
|
85
|
+
status: "ACTIVE",
|
|
86
|
+
successorAccountId: null,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const expenseAccount = {
|
|
90
|
+
id: "account-expense",
|
|
91
|
+
code: "5000",
|
|
92
|
+
name: "Cost of Goods Sold",
|
|
93
|
+
classification: "EXPENSE",
|
|
94
|
+
status: "ACTIVE",
|
|
95
|
+
successorAccountId: null,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const baseAccountGroup = {
|
|
99
|
+
id: "account-group-1",
|
|
100
|
+
name: "Current Assets",
|
|
101
|
+
code: "CA",
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const baseChartOfAccounts = {
|
|
105
|
+
id: "coa-1",
|
|
106
|
+
companyId: baseCompany.id,
|
|
107
|
+
status: "ACTIVE",
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const baseCurrency = {
|
|
111
|
+
id: "currency-1",
|
|
112
|
+
code: "USD",
|
|
113
|
+
isActive: true,
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export const baseUser = {
|
|
117
|
+
id: "user-1",
|
|
118
|
+
status: "ACTIVE",
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const baseFiscalYear = {
|
|
122
|
+
id: "fiscal-year-1",
|
|
123
|
+
companyId: baseCompany.id,
|
|
124
|
+
name: "FY 2024",
|
|
125
|
+
startDate: new Date("2024-01-01"),
|
|
126
|
+
endDate: new Date("2024-12-31"),
|
|
127
|
+
yearEndCloseExecuted: false,
|
|
128
|
+
createdAt,
|
|
129
|
+
updatedAt: null,
|
|
130
|
+
} as const satisfies FiscalYear<Schema>;
|
|
131
|
+
|
|
132
|
+
export const baseFiscalYear2 = {
|
|
133
|
+
...baseFiscalYear,
|
|
134
|
+
id: "fiscal-year-2",
|
|
135
|
+
name: "FY 2025",
|
|
136
|
+
startDate: new Date("2025-01-01"),
|
|
137
|
+
endDate: new Date("2025-12-31"),
|
|
138
|
+
} as const satisfies FiscalYear<Schema>;
|
|
139
|
+
|
|
140
|
+
export const baseAccountingPeriod = {
|
|
141
|
+
id: "period-1",
|
|
142
|
+
companyId: baseCompany.id,
|
|
143
|
+
fiscalYearId: baseFiscalYear.id,
|
|
144
|
+
name: "January 2024",
|
|
145
|
+
startDate: new Date("2024-01-01"),
|
|
146
|
+
endDate: new Date("2024-01-31"),
|
|
147
|
+
periodType: "OPERATING",
|
|
148
|
+
status: "OPEN",
|
|
149
|
+
createdAt,
|
|
150
|
+
updatedAt: null,
|
|
151
|
+
} as const satisfies AccountingPeriod<Schema>;
|
|
152
|
+
|
|
153
|
+
export const neverOpenedPeriod = {
|
|
154
|
+
...baseAccountingPeriod,
|
|
155
|
+
id: "period-never-opened",
|
|
156
|
+
status: "NEVER_OPENED",
|
|
157
|
+
} as const satisfies AccountingPeriod<Schema>;
|
|
158
|
+
|
|
159
|
+
export const futureEnterablePeriod = {
|
|
160
|
+
...baseAccountingPeriod,
|
|
161
|
+
id: "period-future-enterable",
|
|
162
|
+
status: "FUTURE_ENTERABLE",
|
|
163
|
+
} as const satisfies AccountingPeriod<Schema>;
|
|
164
|
+
|
|
165
|
+
export const closedPeriod = {
|
|
166
|
+
...baseAccountingPeriod,
|
|
167
|
+
id: "period-closed",
|
|
168
|
+
status: "CLOSED",
|
|
169
|
+
} as const satisfies AccountingPeriod<Schema>;
|
|
170
|
+
|
|
171
|
+
export const permanentlyClosedPeriod = {
|
|
172
|
+
...baseAccountingPeriod,
|
|
173
|
+
id: "period-permanently-closed",
|
|
174
|
+
status: "PERMANENTLY_CLOSED",
|
|
175
|
+
} as const satisfies AccountingPeriod<Schema>;
|
|
176
|
+
|
|
177
|
+
export const lastPeriodOfYear = {
|
|
178
|
+
...baseAccountingPeriod,
|
|
179
|
+
id: "period-last",
|
|
180
|
+
name: "December 2024",
|
|
181
|
+
startDate: new Date("2024-12-01"),
|
|
182
|
+
endDate: new Date("2024-12-31"),
|
|
183
|
+
} as const satisfies AccountingPeriod<Schema>;
|
|
184
|
+
|
|
185
|
+
export const baseJournalEntry = {
|
|
186
|
+
id: "journal-entry-1",
|
|
187
|
+
companyId: baseCompany.id,
|
|
188
|
+
accountingPeriodId: baseAccountingPeriod.id,
|
|
189
|
+
entryDate: new Date("2024-01-15"),
|
|
190
|
+
journalType: "MISCELLANEOUS",
|
|
191
|
+
referenceNumber: "JE-001",
|
|
192
|
+
status: "DRAFT",
|
|
193
|
+
description: "Test journal entry",
|
|
194
|
+
sourceDocumentReference: null,
|
|
195
|
+
adjustingEntryType: null,
|
|
196
|
+
reversalOfId: null,
|
|
197
|
+
postedAt: null,
|
|
198
|
+
createdAt,
|
|
199
|
+
updatedAt: null,
|
|
200
|
+
} as const satisfies JournalEntry<Schema>;
|
|
201
|
+
|
|
202
|
+
export const postedJournalEntry = {
|
|
203
|
+
...baseJournalEntry,
|
|
204
|
+
id: "journal-entry-2",
|
|
205
|
+
referenceNumber: "JE-002",
|
|
206
|
+
status: "POSTED",
|
|
207
|
+
postedAt: createdAt,
|
|
208
|
+
} as const satisfies JournalEntry<Schema>;
|
|
209
|
+
|
|
210
|
+
export const reversedJournalEntry = {
|
|
211
|
+
...baseJournalEntry,
|
|
212
|
+
id: "journal-entry-3",
|
|
213
|
+
referenceNumber: "JE-003",
|
|
214
|
+
status: "REVERSED",
|
|
215
|
+
postedAt: createdAt,
|
|
216
|
+
} as const satisfies JournalEntry<Schema>;
|
|
217
|
+
|
|
218
|
+
export const baseJournalLine = {
|
|
219
|
+
id: "journal-line-1",
|
|
220
|
+
journalEntryId: baseJournalEntry.id,
|
|
221
|
+
accountId: baseAccount.id,
|
|
222
|
+
debitAmount: 1000,
|
|
223
|
+
creditAmount: null,
|
|
224
|
+
description: "Debit line",
|
|
225
|
+
currencyCode: null,
|
|
226
|
+
exchangeRate: null,
|
|
227
|
+
functionalDebitAmount: 1000,
|
|
228
|
+
functionalCreditAmount: null,
|
|
229
|
+
createdAt,
|
|
230
|
+
updatedAt: null,
|
|
231
|
+
} as const satisfies JournalLine<Schema>;
|
|
232
|
+
|
|
233
|
+
export const baseJournalLine2 = {
|
|
234
|
+
id: "journal-line-2",
|
|
235
|
+
journalEntryId: baseJournalEntry.id,
|
|
236
|
+
accountId: baseAccount2.id,
|
|
237
|
+
debitAmount: null,
|
|
238
|
+
creditAmount: 1000,
|
|
239
|
+
description: "Credit line",
|
|
240
|
+
currencyCode: null,
|
|
241
|
+
exchangeRate: null,
|
|
242
|
+
functionalDebitAmount: null,
|
|
243
|
+
functionalCreditAmount: 1000,
|
|
244
|
+
createdAt,
|
|
245
|
+
updatedAt: null,
|
|
246
|
+
} as const satisfies JournalLine<Schema>;
|
|
247
|
+
|
|
248
|
+
export const basePeriodClose = {
|
|
249
|
+
id: "period-close-1",
|
|
250
|
+
accountingPeriodId: baseAccountingPeriod.id,
|
|
251
|
+
status: "NOT_STARTED",
|
|
252
|
+
initiatedByUserId: baseUser.id,
|
|
253
|
+
completionPercentage: 0,
|
|
254
|
+
subledgerVerificationDetails: null,
|
|
255
|
+
trialBalanceId: null,
|
|
256
|
+
preliminaryStatementIds: null,
|
|
257
|
+
approvedByUserId: null,
|
|
258
|
+
finalizedByUserId: null,
|
|
259
|
+
yearEndCloseExecuted: false,
|
|
260
|
+
createdAt,
|
|
261
|
+
updatedAt: null,
|
|
262
|
+
} as const satisfies PeriodClose<Schema>;
|
|
263
|
+
|
|
264
|
+
export const inProgressPeriodClose = {
|
|
265
|
+
...basePeriodClose,
|
|
266
|
+
id: "period-close-in-progress",
|
|
267
|
+
status: "IN_PROGRESS",
|
|
268
|
+
completionPercentage: 12,
|
|
269
|
+
} as const satisfies PeriodClose<Schema>;
|
|
270
|
+
|
|
271
|
+
export const subledgersVerifiedPeriodClose = {
|
|
272
|
+
...basePeriodClose,
|
|
273
|
+
id: "period-close-subledgers-verified",
|
|
274
|
+
status: "SUBLEDGERS_VERIFIED",
|
|
275
|
+
completionPercentage: 25,
|
|
276
|
+
} as const satisfies PeriodClose<Schema>;
|
|
277
|
+
|
|
278
|
+
export const adjustmentsPostedPeriodClose = {
|
|
279
|
+
...basePeriodClose,
|
|
280
|
+
id: "period-close-adjustments-posted",
|
|
281
|
+
status: "ADJUSTMENTS_POSTED",
|
|
282
|
+
completionPercentage: 50,
|
|
283
|
+
} as const satisfies PeriodClose<Schema>;
|
|
284
|
+
|
|
285
|
+
export const trialBalanceVerifiedPeriodClose = {
|
|
286
|
+
...basePeriodClose,
|
|
287
|
+
id: "period-close-tb-verified",
|
|
288
|
+
status: "TRIAL_BALANCE_VERIFIED",
|
|
289
|
+
completionPercentage: 62,
|
|
290
|
+
} as const satisfies PeriodClose<Schema>;
|
|
291
|
+
|
|
292
|
+
export const underReviewPeriodClose = {
|
|
293
|
+
...basePeriodClose,
|
|
294
|
+
id: "period-close-under-review",
|
|
295
|
+
status: "UNDER_REVIEW",
|
|
296
|
+
completionPercentage: 75,
|
|
297
|
+
} as const satisfies PeriodClose<Schema>;
|
|
298
|
+
|
|
299
|
+
export const softLockedPeriodClose = {
|
|
300
|
+
...basePeriodClose,
|
|
301
|
+
id: "period-close-soft-locked",
|
|
302
|
+
status: "SOFT_LOCKED",
|
|
303
|
+
completionPercentage: 87,
|
|
304
|
+
approvedByUserId: baseUser.id,
|
|
305
|
+
} as const satisfies PeriodClose<Schema>;
|
|
306
|
+
|
|
307
|
+
export const permanentlyClosedPeriodClose = {
|
|
308
|
+
...basePeriodClose,
|
|
309
|
+
id: "period-close-permanently-closed",
|
|
310
|
+
status: "PERMANENTLY_CLOSED",
|
|
311
|
+
completionPercentage: 100,
|
|
312
|
+
} as const satisfies PeriodClose<Schema>;
|
|
313
|
+
|
|
314
|
+
export const baseTrialBalance = {
|
|
315
|
+
id: "trial-balance-1",
|
|
316
|
+
companyId: baseCompany.id,
|
|
317
|
+
accountingPeriodId: baseAccountingPeriod.id,
|
|
318
|
+
chartOfAccountsId: baseChartOfAccounts.id,
|
|
319
|
+
variant: "PRE_CLOSE",
|
|
320
|
+
generatedAt: createdAt,
|
|
321
|
+
totalDebits: 10000,
|
|
322
|
+
totalCredits: 10000,
|
|
323
|
+
isBalanced: true,
|
|
324
|
+
createdAt,
|
|
325
|
+
updatedAt: null,
|
|
326
|
+
} as const satisfies TrialBalance<Schema>;
|
|
327
|
+
|
|
328
|
+
export const baseTrialBalanceLine = {
|
|
329
|
+
id: "trial-balance-line-1",
|
|
330
|
+
trialBalanceId: baseTrialBalance.id,
|
|
331
|
+
accountId: baseAccount.id,
|
|
332
|
+
accountGroupId: baseAccountGroup.id,
|
|
333
|
+
accountCode: "1000",
|
|
334
|
+
accountName: "Cash",
|
|
335
|
+
openingBalance: 0,
|
|
336
|
+
periodDebits: 5000,
|
|
337
|
+
periodCredits: 2000,
|
|
338
|
+
closingBalance: 3000,
|
|
339
|
+
sortOrder: 1,
|
|
340
|
+
createdAt,
|
|
341
|
+
updatedAt: null,
|
|
342
|
+
} as const satisfies TrialBalanceLine<Schema>;
|
|
343
|
+
|
|
344
|
+
export const baseFinancialStatement = {
|
|
345
|
+
id: "financial-statement-1",
|
|
346
|
+
companyId: baseCompany.id,
|
|
347
|
+
chartOfAccountsId: baseChartOfAccounts.id,
|
|
348
|
+
trialBalanceId: baseTrialBalance.id,
|
|
349
|
+
comparativePeriodTrialBalanceId: null,
|
|
350
|
+
statementType: "BALANCE_SHEET",
|
|
351
|
+
status: "DRAFT",
|
|
352
|
+
reportingDate: new Date("2024-01-31"),
|
|
353
|
+
startDate: null,
|
|
354
|
+
endDate: null,
|
|
355
|
+
cashFlowMethod: null,
|
|
356
|
+
generatedAt: createdAt,
|
|
357
|
+
finalizedAt: null,
|
|
358
|
+
createdAt,
|
|
359
|
+
updatedAt: null,
|
|
360
|
+
} as const satisfies FinancialStatement<Schema>;
|
|
361
|
+
|
|
362
|
+
export const finalizedFinancialStatement = {
|
|
363
|
+
...baseFinancialStatement,
|
|
364
|
+
id: "financial-statement-2",
|
|
365
|
+
status: "FINALIZED",
|
|
366
|
+
finalizedAt: createdAt,
|
|
367
|
+
} as const satisfies FinancialStatement<Schema>;
|
|
368
|
+
|
|
369
|
+
export const baseFinancialStatementLineItem = {
|
|
370
|
+
id: "fs-line-item-1",
|
|
371
|
+
financialStatementId: baseFinancialStatement.id,
|
|
372
|
+
accountId: baseAccount.id,
|
|
373
|
+
accountGroupId: baseAccountGroup.id,
|
|
374
|
+
label: "Cash",
|
|
375
|
+
amount: 3000,
|
|
376
|
+
comparativeAmount: null,
|
|
377
|
+
lineType: "DETAIL",
|
|
378
|
+
sectionType: "Current Assets",
|
|
379
|
+
sortOrder: 1,
|
|
380
|
+
createdAt,
|
|
381
|
+
updatedAt: null,
|
|
382
|
+
} as const satisfies FinancialStatementLineItem<Schema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"allowSyntheticDefaultImports": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"types": ["node", "@tailor-platform/function-types"]
|
|
14
|
+
},
|
|
15
|
+
"include": ["**/*.ts"]
|
|
16
|
+
}
|
|
@@ -39,7 +39,7 @@ flowchart TD
|
|
|
39
39
|
- **Shrinkage / theft**: Periodic checks or count results show missing inventory with no corresponding shipment. A negative adjustment with reason code "Shrinkage" records the loss.
|
|
40
40
|
- **Counting error correction**: A cycle count reveals more units on the shelf than the system shows. A positive adjustment with reason code "Counting Error" increases the on-hand balance.
|
|
41
41
|
- **Receiving error correction**: Goods receipt recorded the wrong quantity. A positive or negative adjustment with reason code "Receiving Error" corrects the discrepancy.
|
|
42
|
-
- **Production variance**: Actual yield differs from
|
|
42
|
+
- **Production variance fallback**: Actual yield differs from expected output, but the site is not using the manufacturing module or the discrepancy is discovered with no resolvable production-order or work-order source document. In that limited case, a direct adjustment with reason code "Production Variance" reconciles the difference.
|
|
43
43
|
- **Threshold-based approval**: An adjustment exceeding a configured quantity or value limit is routed to a supervisor for approval before confirmation.
|
|
44
44
|
- **Bulk post-count adjustment**: After a full physical inventory count, the system generates one adjustment record per variance line, allowing batch review, reason-code assignment, and confirmation.
|
|
45
45
|
|
|
@@ -56,6 +56,7 @@ flowchart TD
|
|
|
56
56
|
- Adjustments originating from an inventory count link back to the count session for traceability
|
|
57
57
|
- Confirmed adjustments update inventory valuation consistent with the organization's costing method
|
|
58
58
|
- Adjustments are immutable after confirmation; corrections require a new, offsetting adjustment
|
|
59
|
+
- A direct adjustment with reason code `Production Variance` must be rejected or rerouted when a resolvable manufacturing `productionOrderReference` or `workOrderReference` exists; those cases must enter inventory through `ManufacturingScrapHandoff`
|
|
59
60
|
|
|
60
61
|
## Reference Links
|
|
61
62
|
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
Scrap management handles the controlled removal of damaged, expired, defective, or obsolete stock from usable inventory. Scrap is modeled as an InventoryAdjustment with `adjustmentType = SCRAP`. When confirmed, the adjustment moves stock from the source storage location to a virtual "scrap" location, effectively removing it from available stock and reducing inventory valuation.
|
|
5
|
+
Scrap management handles the controlled removal of damaged, expired, defective, or obsolete stock from usable inventory. Scrap is modeled as an `InventoryAdjustment` with `adjustmentType = SCRAP`. When confirmed, the adjustment moves stock from the source storage location to a virtual "scrap" location, effectively removing it from available stock and reducing inventory valuation.
|
|
6
6
|
|
|
7
7
|
Organizations may enforce approval workflows for scrap adjustments that exceed a defined value threshold, ensuring proper oversight of material losses. Scrap adjustments follow the same approval workflow as correction adjustments (DRAFT → PENDING_APPROVAL → CONFIRMED). Once confirmed, the adjustment is immutable — if scrap was created in error, a new CORRECTION adjustment with a positive quantityDelta can restore the stock.
|
|
8
8
|
|
|
9
|
+
Inventory accepts scrap input both from direct inventory users and from upstream manufacturing execution. Manufacturing-originated scrap enters inventory through the `ManufacturingScrapHandoff` contract defined in manufacturing `work-order-execution.md`, after which inventory creates or updates the `InventoryAdjustment` that owns stock and valuation effects.
|
|
10
|
+
|
|
9
11
|
## Business Purpose
|
|
10
12
|
|
|
11
13
|
- Remove physically damaged, expired, or quality-rejected stock from available inventory so it is not accidentally picked, sold, or consumed
|
|
@@ -38,9 +40,42 @@ flowchart TD
|
|
|
38
40
|
- **Quality failure scrap**: Items that fail incoming or in-process quality inspection are immediately scrapped, with the quality rejection linked as the scrap reason
|
|
39
41
|
- **Obsolescence write-off**: Slow-moving or discontinued items are scrapped as part of a periodic inventory review to reflect their true recoverable value
|
|
40
42
|
- **High-value approval scrap**: A scrap adjustment exceeds the organization's value threshold, triggering a manager approval step before the stock movement is executed
|
|
43
|
+
- **Manufacturing-originated scrap**: A work order reports scrap and sends `ManufacturingScrapHandoff`; inventory resolves the source location, creates a SCRAP adjustment, and runs the same approval policy as any other scrap event
|
|
41
44
|
- **Scrap error correction**: A scrap adjustment is found to have been created in error; a new CORRECTION adjustment with positive quantityDelta restores the stock to the source location
|
|
42
45
|
- **Lot/serial-tracked scrap**: Specific lots or serial numbers are scrapped, maintaining full traceability from receipt through disposal. Serial numbers transition to SCRAPPED state on confirmation.
|
|
43
46
|
|
|
47
|
+
Inventory accepts `ManufacturingScrapHandoff` from manufacturing work-order execution with the following minimum fields:
|
|
48
|
+
|
|
49
|
+
- `productionOrderReference`
|
|
50
|
+
- `workOrderReference`
|
|
51
|
+
- `itemReference`
|
|
52
|
+
- `scrapQuantity`
|
|
53
|
+
- `unitOfMeasure`
|
|
54
|
+
- `scrapReasonCode`
|
|
55
|
+
- `siteReference`
|
|
56
|
+
- `postingDate`
|
|
57
|
+
|
|
58
|
+
Optional and conditional fields:
|
|
59
|
+
|
|
60
|
+
- `sourceStorageLocationReference`: optional when inventory can derive the source location from prior issue, backflush, or site-level manufacturing scrap policy; otherwise required
|
|
61
|
+
- `inventoryLotReference`: required when the scrapped item is lot-tracked
|
|
62
|
+
- `serialReferences`: required when the scrapped item is serial-tracked
|
|
63
|
+
- `scrapDispositionCode`: optional classification retained for downstream analysis
|
|
64
|
+
|
|
65
|
+
Inventory maps the handoff into an inventory-owned `InventoryAdjustment` as follows:
|
|
66
|
+
|
|
67
|
+
- `adjustmentType = SCRAP`
|
|
68
|
+
- `itemReference`, `siteReference`, `postingDate`, and reason fields come directly from the handoff
|
|
69
|
+
- `productionOrderReference` and `workOrderReference` are retained as source-document traceability fields on the adjustment
|
|
70
|
+
- `sourceStorageLocationReference` is taken from the payload when present; otherwise inventory must derive it from manufacturing issue history, staging-location policy, or other site-level configuration before the adjustment can proceed
|
|
71
|
+
- `inventoryLotReference` and `serialReferences` flow into the same lot or serial validation rules used by direct inventory scrap
|
|
72
|
+
|
|
73
|
+
Approval and confirmation rules are inventory-owned:
|
|
74
|
+
|
|
75
|
+
- If the resulting scrap value exceeds the configured approval threshold, inventory creates the adjustment in `PENDING_APPROVAL`
|
|
76
|
+
- If the threshold is not exceeded, inventory may confirm the adjustment immediately
|
|
77
|
+
- If location, lot, serial, or quantity resolution fails, inventory rejects the handoff and does not mutate stock
|
|
78
|
+
|
|
44
79
|
## Test Cases
|
|
45
80
|
|
|
46
81
|
- Creating a SCRAP adjustment with positive quantityDelta is rejected
|
|
@@ -55,6 +90,9 @@ flowchart TD
|
|
|
55
90
|
- Scrapped items cannot re-enter available stock without a new CORRECTION adjustment
|
|
56
91
|
- Scrap reason is mandatory and must be one of the defined reason categories
|
|
57
92
|
- Listing adjustments filtered by `adjustmentType = SCRAP` returns only scrap records
|
|
93
|
+
- A valid `ManufacturingScrapHandoff` must create or update a SCRAP adjustment that preserves the production-order and work-order references for traceability
|
|
94
|
+
- Manufacturing-originated scrap must follow the same approval threshold policy as manually entered scrap adjustments
|
|
95
|
+
- If inventory cannot resolve the source storage location required for `ManufacturingScrapHandoff`, the handoff must be rejected without mutating stock
|
|
58
96
|
|
|
59
97
|
## Reference Links
|
|
60
98
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# README
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Manufacturing module manages production planning and execution from recipe and process definition through order release, shop-floor progress tracking, completion, and cost capture. It owns the master and transactional records that explain what should be produced, how it should be produced, where capacity exists to produce it, what work is in progress, what quantities were consumed or completed, and how actual manufacturing results differ from the plan.
|
|
6
|
+
|
|
7
|
+
Manufacturing sits between upstream demand or supply signals and downstream stock or finance execution. It references items from item-management, company and site context from organization, units and currencies from primitives, and coordinates with inventory for component issue, finished-goods receipt, and scrap posting. That coordination includes named cross-module contracts such as `ManufacturingReceiptHandoff`, `ManufacturingScrapHandoff`, `InventoryIssueOutcomeEvent`, and `ManufacturingCostSettlementAcknowledgment`, which let inventory and downstream accounting remain the owners of stock movement, valuation, and settlement while manufacturing remains the owner of production intent and variance analysis. It may prepare cost and account-reference data for downstream accounting, but journal posting and ledger ownership remain outside the module.
|
|
8
|
+
|
|
9
|
+
## Key Features
|
|
10
|
+
|
|
11
|
+
- **[Bill of Material Management](docs/features/bill-of-material-management.md)**: Define versioned multi-level bills of material for finished goods and subassemblies, including component quantities, scrap assumptions, effectivity, and default selection rules used by production orders
|
|
12
|
+
- **[Routing and Work Center Definition](docs/features/routing-and-work-center-definition.md)**: Define routings as ordered manufacturing steps and configure work centers with capacity, calendars, standard times, and cost rates used for planning and execution
|
|
13
|
+
- **[Production Order Lifecycle](docs/features/production-order-lifecycle.md)**: Create, schedule, release, reschedule, cancel, complete, technically complete, and close production orders with BOM and routing snapshots plus progress visibility from planned order through settled closeout
|
|
14
|
+
- **[Work Order Execution](docs/features/work-order-execution.md)**: Execute operation-level work orders with start, pause, report, complete, material issue or backflush, scrap capture, and finished or intermediate receipt handoff to inventory
|
|
15
|
+
- **[Manufacturing Cost and Variance](docs/features/manufacturing-cost-and-variance.md)**: Capture planned versus actual component, labor, machine, and overhead cost at production-order level and classify manufacturing variances for downstream accounting consumption
|
|
16
|
+
|
|
17
|
+
## Module Scope
|
|
18
|
+
|
|
19
|
+
### In Scope
|
|
20
|
+
|
|
21
|
+
- Bill of material ownership, including component lines, versioning, effectivity windows, multi-level subassembly references, and `bomType` semantics for `MANUFACTURE`, `PHANTOM`, and `KIT`
|
|
22
|
+
- Routing ownership, including ordered operations, standard setup or run times, operation instructions, and work-center assignment
|
|
23
|
+
- Work center master data, including company or site scope, availability calendar, capacity assumptions, and standard cost rates
|
|
24
|
+
- Production order planning and control, including creation, scheduling, BOM or routing selection, release, cancellation, completion, technical completion, and closeout
|
|
25
|
+
- Work order execution at operation level, including start, pause, resume, quantity reporting, time capture, scrap reporting, and exception notes
|
|
26
|
+
- Material requirement handoff to inventory for reservation, issue, backflush, finished-goods receipt, intermediate receipt, and scrap posting
|
|
27
|
+
- Planned-versus-actual manufacturing cost rollup using component issue values from inventory plus labor or machine rates from work centers, with explicit variance categories and downstream account references
|
|
28
|
+
- Production status, progress, and auditability scoped by company and site
|
|
29
|
+
|
|
30
|
+
### Out of Scope
|
|
31
|
+
|
|
32
|
+
- Forecasting, MRP netting, replenishment proposals, and automated procurement planning
|
|
33
|
+
- Advanced finite-capacity optimization, drag-and-drop scheduling boards, and AI or rules-based sequencing
|
|
34
|
+
- Quality inspection plans, nonconformance, CAPA, rework loops, and regulated electronic batch record workflows
|
|
35
|
+
- Subcontracting, outside processing, contract manufacturing, and supplier-operated work centers
|
|
36
|
+
- Co-products, by-products, and joint-production costing
|
|
37
|
+
- Detailed operator kiosk UX, barcode device workflows, PLC or IoT machine integration, and MES hardware connectivity
|
|
38
|
+
- Warehouse ownership, stock balances, lot or serial master records, and inventory valuation logic
|
|
39
|
+
- Journal entry posting, WIP settlement, period close, and general-ledger balance ownership
|
|
40
|
+
- Preventive maintenance, OEE analytics, and HR or payroll-driven labor management
|
|
41
|
+
|
|
42
|
+
### Scope Decision Rationale
|
|
43
|
+
|
|
44
|
+
Manufacturing is scoped to the **production definition and execution layer**: product recipe, process steps, capacity context, production order control, and operation-level reporting. These concepts depend on one another and change together, so they belong in one module rather than being split prematurely across planning, execution, and costing.
|
|
45
|
+
|
|
46
|
+
Inventory remains the owner of **physical stock state**. Manufacturing decides that materials should be issued, scrap should be recorded, or finished goods should be received, but inventory owns the resulting stock movement, lot or serial handling, warehouse location state, and valuation basis. Manufacturing can request issue execution, but actual material cost becomes manufacturing-visible only when inventory returns the named `InventoryIssueOutcomeEvent` after inventory-owned valuation is complete. This keeps manufacturing focused on production intent and progress rather than warehouse internals.
|
|
47
|
+
|
|
48
|
+
Sales and purchase remain the owners of **commercial demand and supply commitments**. Manufacturing can consume sales demand, open supply status, or manual planner input when creating production orders, but it must not own customer orders, purchase orders, or supplier receipts. That separation preserves clean module boundaries and allows manufacturing to serve both make-to-stock and make-to-order flows without duplicating commercial logic.
|
|
49
|
+
|
|
50
|
+
Accounting remains the owner of **financial posting and settlement**. Manufacturing can capture planned and actual production cost, classify variances into price, usage, rate, efficiency, scrap, and yield categories, and reference WIP or variance accounts from coa-management, but posting journal entries and enforcing period-close rules belong to downstream accounting modules. This keeps cost insight in manufacturing without pulling ledger behavior into the shop-floor domain.
|
|
51
|
+
|
|
52
|
+
## Module Dependencies
|
|
53
|
+
|
|
54
|
+
- [item-management](../item-management/README.md) — Finished goods, subassemblies, raw materials, and consumables are referenced as Items or SKUs
|
|
55
|
+
- [organization](../organization/README.md) — Company and Site scope for BOM defaults, work centers, and production execution context
|
|
56
|
+
- [primitives](../primitives/README.md) — Unit-of-measure conversions for component and output quantities plus currency references for costing
|
|
57
|
+
- [inventory](../inventory/README.md) — Downstream execution of component issue, backflush, finished-goods receipt, intermediate receipt, scrap, lot assignment, and actual material cost sourcing through `InventoryIssueOutcomeEvent`
|
|
58
|
+
- [user-management](../user-management/README.md) — Permissions for create, release, reschedule, start, complete, technically complete, cancel, close, and cost-review actions
|
|
59
|
+
- [audit](../audit/README.md) — Immutable audit trail for BOM revisions, routing changes, order transitions, and execution events
|
|
60
|
+
- [coa-management](../coa-management/README.md) — WIP, absorption, material price, material usage, labor rate, labor efficiency, machine rate, machine efficiency, scrap, and yield account references for downstream cost posting
|
|
61
|
+
- [sales](../sales/README.md) — Optional demand signal source for make-to-order or priority-driven production planning
|
|
62
|
+
- [purchase](../purchase/README.md) — Optional material availability and ETA signal source for release decisions and shortage visibility
|
|
63
|
+
- [product-management](../product-management/README.md) — Optional product or variant metadata source when aligning commercial catalog structure to manufacturing definitions
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @generated — do not edit
|
|
2
|
+
import { permissions } from "../lib/permissions.generated";
|
|
3
|
+
import { run } from "./activateBillOfMaterial";
|
|
4
|
+
import { defineCommand } from "@tailor-platform/erp-kit/module";
|
|
5
|
+
|
|
6
|
+
export const activateBillOfMaterial = defineCommand(permissions.activateBillOfMaterial, run);
|