@happyvertical/smrt-commerce 0.56.1 → 0.56.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +22 -4
  2. package/agents/contract-money.md +6 -0
  3. package/agents/customer-vendor-ui.md +7 -1
  4. package/agents/document-money.md +4 -3
  5. package/agents/tax-summary.md +4 -2
  6. package/dist/chunks/{ContractLineItemCollection-DYjhj_pU.js → ContractLineItemCollection--BrGMtNz.js} +6 -6
  7. package/dist/chunks/ContractLineItemCollection--BrGMtNz.js.map +1 -0
  8. package/dist/chunks/{CustomerCollection-DQIujn4f.js → CustomerCollection-CjGaZSpf.js} +3 -3
  9. package/dist/chunks/{CustomerCollection-DQIujn4f.js.map → CustomerCollection-CjGaZSpf.js.map} +1 -1
  10. package/dist/chunks/{DocumentTaxCollection-BEpoqXAQ.js → DocumentTaxCollection-KOkaQT2M.js} +31 -11
  11. package/dist/chunks/DocumentTaxCollection-KOkaQT2M.js.map +1 -0
  12. package/dist/chunks/{InvoiceCollection-CKQflFjc.js → InvoiceCollection-BUe_8FT1.js} +14 -14
  13. package/dist/chunks/InvoiceCollection-BUe_8FT1.js.map +1 -0
  14. package/dist/chunks/{InvoiceLineItemCollection-CHm9zdqh.js → InvoiceLineItemCollection-CPQGghyd.js} +8 -7
  15. package/dist/chunks/InvoiceLineItemCollection-CPQGghyd.js.map +1 -0
  16. package/dist/chunks/{TaxCodeCollection-DOpzW4y8.js → TaxCodeCollection-DF2eaJed.js} +2 -2
  17. package/dist/chunks/{TaxCodeCollection-DOpzW4y8.js.map → TaxCodeCollection-DF2eaJed.js.map} +1 -1
  18. package/dist/chunks/{TaxComponentCollection-Cs2uXwEl.js → TaxComponentCollection-3x24xSNh.js} +3 -3
  19. package/dist/chunks/{TaxComponentCollection-Cs2uXwEl.js.map → TaxComponentCollection-3x24xSNh.js.map} +1 -1
  20. package/dist/chunks/{TaxSettingsCollection-BBTZDH1S.js → TaxSettingsCollection-DYYF-In-.js} +6 -6
  21. package/dist/chunks/{TaxSettingsCollection-BBTZDH1S.js.map → TaxSettingsCollection-DYYF-In-.js.map} +1 -1
  22. package/dist/chunks/{allocation-integrity-DI3G16BN.js → allocation-integrity-Cq0g6CfO.js} +3 -3
  23. package/dist/chunks/{allocation-integrity-DI3G16BN.js.map → allocation-integrity-Cq0g6CfO.js.map} +1 -1
  24. package/dist/chunks/{document-money-DNVhDJyC.js → document-money-oUDvdjOf.js} +10 -10
  25. package/dist/chunks/{document-money-DNVhDJyC.js.map → document-money-oUDvdjOf.js.map} +1 -1
  26. package/dist/chunks/{invoice-posting-BwV8g7z0.js → invoice-posting-CF3fE_Ec.js} +7 -7
  27. package/dist/chunks/{invoice-posting-BwV8g7z0.js.map → invoice-posting-CF3fE_Ec.js.map} +1 -1
  28. package/dist/chunks/{tenant-money-barrier-DjRXgMnX.js → tenant-money-barrier-y6EAa6vY.js} +2 -2
  29. package/dist/chunks/{tenant-money-barrier-DjRXgMnX.js.map → tenant-money-barrier-y6EAa6vY.js.map} +1 -1
  30. package/dist/chunks/{types-LDETvQ1C.js → types-Bbm0Xflc.js} +2 -1
  31. package/dist/chunks/types-Bbm0Xflc.js.map +1 -0
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +36 -23
  35. package/dist/index.js.map +1 -1
  36. package/dist/manifest.json +1057 -151
  37. package/dist/migrations/partyLinks.d.ts.map +1 -1
  38. package/dist/models/Contract.d.ts +10 -4
  39. package/dist/models/Contract.d.ts.map +1 -1
  40. package/dist/models/ContractLineItem.d.ts +13 -5
  41. package/dist/models/ContractLineItem.d.ts.map +1 -1
  42. package/dist/models/DocumentTax.d.ts.map +1 -1
  43. package/dist/models/Invoice.d.ts.map +1 -1
  44. package/dist/models/InvoiceLineItem.d.ts +12 -2
  45. package/dist/models/InvoiceLineItem.d.ts.map +1 -1
  46. package/dist/models/index.d.ts +1 -1
  47. package/dist/models/index.d.ts.map +1 -1
  48. package/dist/smrt-knowledge.json +2925 -5578
  49. package/dist/types/index.d.ts +1 -0
  50. package/dist/types/index.d.ts.map +1 -1
  51. package/package.json +13 -13
  52. package/dist/chunks/ContractLineItemCollection-DYjhj_pU.js.map +0 -1
  53. package/dist/chunks/DocumentTaxCollection-BEpoqXAQ.js.map +0 -1
  54. package/dist/chunks/InvoiceCollection-CKQflFjc.js.map +0 -1
  55. package/dist/chunks/InvoiceLineItemCollection-CHm9zdqh.js.map +0 -1
  56. package/dist/chunks/types-LDETvQ1C.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tenant-money-barrier-DjRXgMnX.js","names":[],"sources":["../../src/tenant-money-barrier.ts"],"sourcesContent":["/** Shared tenant serialization barrier for commerce money runtime and migration. */\n\nimport type { DatabaseInterface } from '@happyvertical/smrt-core/migrations';\nimport { TaxSettingsCollection } from './collections/TaxSettingsCollection.js';\nimport { withDocumentMoneyTransaction } from './document-money-internal.js';\nimport type { TaxSettings } from './models/TaxSettings.js';\nimport { MoneyValidationError } from './money.js';\n\nexport type TenantMoneyRuntimeRequirement = 'legacy-or-v2' | 'v2';\n\nexport type TenantMoneyRuntimeBarrier =\n | {\n readonly moneyModel: 'legacy';\n readonly settings: null;\n readonly persistedBarrier: false;\n }\n | {\n readonly moneyModel: 'legacy';\n readonly settings: TaxSettings;\n readonly persistedBarrier: true;\n }\n | {\n readonly moneyModel: 'v2';\n readonly settings: TaxSettings;\n readonly persistedBarrier: true;\n };\n\ndeclare const tenantMoneyScopeBrand: unique symbol;\n\n/** Transaction-affine proof that a tenant marker is locked on `db`. */\nexport interface TenantMoneyRuntimeScope {\n readonly db: DatabaseInterface;\n readonly tenantId: string;\n readonly barrier: TenantMoneyRuntimeBarrier;\n readonly phase: 'runtime';\n readonly [tenantMoneyScopeBrand]: true;\n}\n\ndeclare const tenantMoneyMigrationScopeBrand: unique symbol;\n\n/** Transaction-affine proof held only by the active migration owner. */\nexport interface TenantMoneyMigrationScope {\n readonly db: DatabaseInterface;\n readonly tenantId: string;\n readonly migrationId: string;\n readonly settings: TaxSettings;\n readonly phase: 'migration';\n readonly [tenantMoneyMigrationScopeBrand]: true;\n}\n\nfunction requiredText(value: string, label: string): string {\n if (!value || value.trim() !== value)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n `${label} must be a nonempty trimmed string`,\n );\n return value;\n}\n\nasync function hasSettingsStorage(db: DatabaseInterface): Promise<boolean> {\n return !db.tableExists || (await db.tableExists('tax_settings'));\n}\n\nconst activeRuntimeScopes = new WeakMap<\n object,\n Map<string, TenantMoneyRuntimeScope>\n>();\nconst activeMigrationScopes = new WeakMap<\n object,\n Map<string, TenantMoneyMigrationScope>\n>();\n\nfunction runtimeScope(\n db: DatabaseInterface,\n tenantId: string,\n barrier: TenantMoneyRuntimeBarrier,\n): TenantMoneyRuntimeScope {\n return {\n db,\n tenantId,\n barrier,\n phase: 'runtime',\n } as TenantMoneyRuntimeScope;\n}\n\n/**\n * Lock and re-read the tenant money marker before any runtime money work.\n *\n * Older schemas without TaxSettings stay byte-compatible legacy and are never\n * modified. Once the table exists, a missing deterministic legacy row is\n * materialized solely to provide the serialization point shared by migration.\n */\nexport async function lockTenantMoneyRuntime(\n tx: DatabaseInterface,\n tenantId: string,\n requirement: TenantMoneyRuntimeRequirement = 'legacy-or-v2',\n): Promise<TenantMoneyRuntimeBarrier> {\n requiredText(tenantId, 'Money tenant');\n if (!(await hasSettingsStorage(tx))) {\n if (requirement === 'v2')\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Money v2 requires tenant tax settings storage',\n );\n return {\n moneyModel: 'legacy',\n settings: null,\n persistedBarrier: false,\n };\n }\n const collection = await TaxSettingsCollection.create({ db: tx });\n const settings = await collection.lockForTenant(tenantId);\n if (!settings)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant money settings could not be materialized',\n );\n if (settings.moneyModel === 'migrating')\n throw new MoneyValidationError(\n 'FROZEN_DOCUMENT',\n 'Tenant money migration is in progress',\n );\n if (settings.moneyModel === 'v2')\n return { moneyModel: 'v2', settings, persistedBarrier: true };\n if (requirement === 'v2')\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Money v2 is not active for this tenant',\n );\n return { moneyModel: 'legacy', settings, persistedBarrier: true };\n}\n\n/**\n * Run tenant money work under the shared marker lock on exactly one executor.\n *\n * Supplying an existing scope proves re-entry on the same executor. Calls made\n * through the owning transaction wrapper also reuse its exact registered\n * executor. No optional adapter-property heuristic can grant this capability.\n */\nexport async function withTenantMoneyRuntime<T>(\n db: DatabaseInterface,\n tenantId: string,\n requirement: TenantMoneyRuntimeRequirement,\n operation: (scope: TenantMoneyRuntimeScope) => Promise<T>,\n existingScope?: TenantMoneyRuntimeScope,\n): Promise<T> {\n requiredText(tenantId, 'Money tenant');\n if (existingScope) {\n if (\n existingScope.phase !== 'runtime' ||\n existingScope.db !== db ||\n existingScope.tenantId !== tenantId ||\n (requirement === 'v2' && existingScope.barrier.moneyModel !== 'v2')\n )\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant money runtime scope does not match the requested executor',\n );\n return operation(existingScope);\n }\n return withDocumentMoneyTransaction(db, async (tx) => {\n const active = activeRuntimeScopes.get(tx as object)?.get(tenantId);\n if (active) {\n if (requirement === 'v2' && active.barrier.moneyModel !== 'v2')\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Money v2 is not active for this tenant',\n );\n return operation(active);\n }\n const barrier = await lockTenantMoneyRuntime(tx, tenantId, requirement);\n const scope = runtimeScope(tx, tenantId, barrier);\n const scopes = activeRuntimeScopes.get(tx as object) ?? new Map();\n scopes.set(tenantId, scope);\n activeRuntimeScopes.set(tx as object, scopes);\n try {\n return await operation(scope);\n } finally {\n scopes.delete(tenantId);\n if (scopes.size === 0) activeRuntimeScopes.delete(tx as object);\n }\n });\n}\n\n/**\n * Run migration work under the exact owner marker and transaction executor.\n * This is the only scope that lets guarded collections read while the marker\n * is `migrating`; possession cannot be inferred from adapter shape.\n */\nexport async function withTenantMoneyMigration<T>(\n db: DatabaseInterface,\n tenantId: string,\n migrationId: string,\n operation: (scope: TenantMoneyMigrationScope) => Promise<T>,\n existingScope?: TenantMoneyMigrationScope,\n): Promise<T> {\n requiredText(tenantId, 'Money migration tenant');\n requiredText(migrationId, 'Money migration owner');\n if (existingScope) {\n if (\n existingScope.phase !== 'migration' ||\n existingScope.db !== db ||\n existingScope.tenantId !== tenantId ||\n existingScope.migrationId !== migrationId\n )\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant money migration scope does not match the requested executor',\n );\n return operation(existingScope);\n }\n return withDocumentMoneyTransaction(db, async (tx) => {\n const active = activeMigrationScopes.get(tx as object)?.get(tenantId);\n if (active) {\n if (active.migrationId !== migrationId)\n throw new MoneyValidationError(\n 'FROZEN_DOCUMENT',\n 'Tenant money migration owner does not match',\n );\n return operation(active);\n }\n const settings = await lockTenantMoneyMigrationOwner(\n tx,\n tenantId,\n migrationId,\n );\n const scope = {\n db: tx,\n tenantId,\n migrationId,\n settings,\n phase: 'migration',\n } as TenantMoneyMigrationScope;\n const scopes = activeMigrationScopes.get(tx as object) ?? new Map();\n scopes.set(tenantId, scope);\n activeMigrationScopes.set(tx as object, scopes);\n try {\n return await operation(scope);\n } finally {\n scopes.delete(tenantId);\n if (scopes.size === 0) activeMigrationScopes.delete(tx as object);\n }\n });\n}\n\n/** @internal Guard a generated collection read for runtime or migration. */\nexport async function withTenantMoneyCollectionRead<T>(\n db: DatabaseInterface,\n tenantId: string,\n operation: (boundDb: DatabaseInterface) => Promise<T>,\n): Promise<T> {\n const migration = activeMigrationScopes.get(db as object)?.get(tenantId);\n if (migration) return operation(migration.db);\n return withTenantMoneyRuntime(db, tenantId, 'legacy-or-v2', (scope) =>\n operation(scope.db),\n );\n}\n\n/** Lock a tenant at the legacy marker before the caller claims migration. */\nexport async function lockTenantMoneyMigrationClaim(\n tx: DatabaseInterface,\n tenantId: string,\n): Promise<TaxSettings> {\n requiredText(tenantId, 'Money migration tenant');\n if (!(await hasSettingsStorage(tx)))\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Money migration requires installed tax settings storage',\n );\n const collection = await TaxSettingsCollection.create({ db: tx });\n const settings = await collection.lockForTenant(tenantId);\n if (!settings)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant money settings could not be materialized',\n );\n if (settings.moneyModel === 'v2')\n throw new MoneyValidationError(\n 'FROZEN_DOCUMENT',\n 'Tenant money model is already v2',\n );\n if (settings.moneyModel === 'migrating')\n throw new MoneyValidationError(\n 'FROZEN_DOCUMENT',\n 'Tenant money migration is already in progress',\n );\n return settings;\n}\n\n/** Lock and verify the exact owner of an active tenant migration. */\nexport async function lockTenantMoneyMigrationOwner(\n tx: DatabaseInterface,\n tenantId: string,\n migrationId: string,\n): Promise<TaxSettings> {\n requiredText(tenantId, 'Money migration tenant');\n requiredText(migrationId, 'Money migration owner');\n if (!(await hasSettingsStorage(tx)))\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Money migration requires installed tax settings storage',\n );\n const collection = await TaxSettingsCollection.create({ db: tx });\n const settings = await collection.lockForTenant(tenantId, false);\n if (\n settings?.moneyModel !== 'migrating' ||\n settings.moneyMigrationId !== migrationId\n )\n throw new MoneyValidationError(\n 'FROZEN_DOCUMENT',\n 'Tenant money migration owner does not match',\n );\n return settings;\n}\n"],"mappings":";;;;;;;;;;;;AAkDA,SAAS,aAAa,OAAe,OAAuB;CAC1D,IAAI,CAAC,SAAS,MAAM,KAAK,MAAM,OAC7B,MAAM,IAAI,qBACR,uBACA,GAAG,MAAK,mCACV;CACF,OAAO;AACT;AAEA,eAAe,mBAAmB,IAAyC;CACzE,OAAO,CAAC,GAAG,eAAgB,MAAM,GAAG,YAAY,cAAc;AAChE;AAEA,IAAM,sCAAsB,IAAI,QAG9B;AACF,IAAM,wCAAwB,IAAI,QAGhC;AAEF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Q;CACvE,IAAI,WAAW,OAAO,UAAU,UAAU,EAAE;CAC5C,OAAO,uBAAuB,IAAI,UAAU,iBAAiB,UAC3D,UAAU,MAAM,EAAE,CACpB;AACF;AAGA,eAAsB,8BACpB,IACA,UACsB;CACtB,aAAa,UAAU,wBAAwB;CAC/C,IAAI,CAAE,MAAM,mBAAmB,EAAE,GAC/B,MAAM,IAAI,qBACR,uBACA,yDACF;CAEF,MAAM,WAAW,OAAM,MADE,sBAAsB,OAAO,EAAE,IAAI,GAAG,CAAC,EAAA,CAC9B,cAAc,QAAQ;CACxD,IAAI,CAAC,UACH,MAAM,IAAI,qBACR,uBACA,iDACF;CACF,IAAI,SAAS,eAAe,MAC1B,MAAM,IAAI,qBACR,mBACA,kCACF;CACF,IAAI,SAAS,eAAe,aAC1B,MAAM,IAAI,qBACR,mBACA,+CACF;CACF,OAAO;AACT;AAGA,eAAsB,8BACpB,IACA,UACA,aACsB;CACtB,aAAa,UAAU,wBAAwB;CAC/C,aAAa,aAAa,uBAAuB;CACjD,IAAI,CAAE,MAAM,mBAAmB,EAAE,GAC/B,MAAM,IAAI,qBACR,uBACA,yDACF;CAEF,MAAM,WAAW,OAAM,MADE,sBAAsB,OAAO,EAAE,IAAI,GAAG,CAAC,EAAA,CAC9B,cAAc,UAAU,KAAK;CAC/D,IACE,UAAU,eAAe,eACzB,SAAS,qBAAqB,aAE9B,MAAM,IAAI,qBACR,mBACA,6CACF;CACF,OAAO;AACT"}
1
+ {"version":3,"file":"tenant-money-barrier-y6EAa6vY.js","names":[],"sources":["../../src/tenant-money-barrier.ts"],"sourcesContent":["/** Shared tenant serialization barrier for commerce money runtime and migration. */\n\nimport type { DatabaseInterface } from '@happyvertical/smrt-core/migrations';\nimport { TaxSettingsCollection } from './collections/TaxSettingsCollection.js';\nimport { withDocumentMoneyTransaction } from './document-money-internal.js';\nimport type { TaxSettings } from './models/TaxSettings.js';\nimport { MoneyValidationError } from './money.js';\n\nexport type TenantMoneyRuntimeRequirement = 'legacy-or-v2' | 'v2';\n\nexport type TenantMoneyRuntimeBarrier =\n | {\n readonly moneyModel: 'legacy';\n readonly settings: null;\n readonly persistedBarrier: false;\n }\n | {\n readonly moneyModel: 'legacy';\n readonly settings: TaxSettings;\n readonly persistedBarrier: true;\n }\n | {\n readonly moneyModel: 'v2';\n readonly settings: TaxSettings;\n readonly persistedBarrier: true;\n };\n\ndeclare const tenantMoneyScopeBrand: unique symbol;\n\n/** Transaction-affine proof that a tenant marker is locked on `db`. */\nexport interface TenantMoneyRuntimeScope {\n readonly db: DatabaseInterface;\n readonly tenantId: string;\n readonly barrier: TenantMoneyRuntimeBarrier;\n readonly phase: 'runtime';\n readonly [tenantMoneyScopeBrand]: true;\n}\n\ndeclare const tenantMoneyMigrationScopeBrand: unique symbol;\n\n/** Transaction-affine proof held only by the active migration owner. */\nexport interface TenantMoneyMigrationScope {\n readonly db: DatabaseInterface;\n readonly tenantId: string;\n readonly migrationId: string;\n readonly settings: TaxSettings;\n readonly phase: 'migration';\n readonly [tenantMoneyMigrationScopeBrand]: true;\n}\n\nfunction requiredText(value: string, label: string): string {\n if (!value || value.trim() !== value)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n `${label} must be a nonempty trimmed string`,\n );\n return value;\n}\n\nasync function hasSettingsStorage(db: DatabaseInterface): Promise<boolean> {\n return !db.tableExists || (await db.tableExists('tax_settings'));\n}\n\nconst activeRuntimeScopes = new WeakMap<\n object,\n Map<string, TenantMoneyRuntimeScope>\n>();\nconst activeMigrationScopes = new WeakMap<\n object,\n Map<string, TenantMoneyMigrationScope>\n>();\n\nfunction runtimeScope(\n db: DatabaseInterface,\n tenantId: string,\n barrier: TenantMoneyRuntimeBarrier,\n): TenantMoneyRuntimeScope {\n return {\n db,\n tenantId,\n barrier,\n phase: 'runtime',\n } as TenantMoneyRuntimeScope;\n}\n\n/**\n * Lock and re-read the tenant money marker before any runtime money work.\n *\n * Older schemas without TaxSettings stay byte-compatible legacy and are never\n * modified. Once the table exists, a missing deterministic legacy row is\n * materialized solely to provide the serialization point shared by migration.\n */\nexport async function lockTenantMoneyRuntime(\n tx: DatabaseInterface,\n tenantId: string,\n requirement: TenantMoneyRuntimeRequirement = 'legacy-or-v2',\n): Promise<TenantMoneyRuntimeBarrier> {\n requiredText(tenantId, 'Money tenant');\n if (!(await hasSettingsStorage(tx))) {\n if (requirement === 'v2')\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Money v2 requires tenant tax settings storage',\n );\n return {\n moneyModel: 'legacy',\n settings: null,\n persistedBarrier: false,\n };\n }\n const collection = await TaxSettingsCollection.create({ db: tx });\n const settings = await collection.lockForTenant(tenantId);\n if (!settings)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant money settings could not be materialized',\n );\n if (settings.moneyModel === 'migrating')\n throw new MoneyValidationError(\n 'FROZEN_DOCUMENT',\n 'Tenant money migration is in progress',\n );\n if (settings.moneyModel === 'v2')\n return { moneyModel: 'v2', settings, persistedBarrier: true };\n if (requirement === 'v2')\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Money v2 is not active for this tenant',\n );\n return { moneyModel: 'legacy', settings, persistedBarrier: true };\n}\n\n/**\n * Run tenant money work under the shared marker lock on exactly one executor.\n *\n * Supplying an existing scope proves re-entry on the same executor. Calls made\n * through the owning transaction wrapper also reuse its exact registered\n * executor. No optional adapter-property heuristic can grant this capability.\n */\nexport async function withTenantMoneyRuntime<T>(\n db: DatabaseInterface,\n tenantId: string,\n requirement: TenantMoneyRuntimeRequirement,\n operation: (scope: TenantMoneyRuntimeScope) => Promise<T>,\n existingScope?: TenantMoneyRuntimeScope,\n): Promise<T> {\n requiredText(tenantId, 'Money tenant');\n if (existingScope) {\n if (\n existingScope.phase !== 'runtime' ||\n existingScope.db !== db ||\n existingScope.tenantId !== tenantId ||\n (requirement === 'v2' && existingScope.barrier.moneyModel !== 'v2')\n )\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant money runtime scope does not match the requested executor',\n );\n return operation(existingScope);\n }\n return withDocumentMoneyTransaction(db, async (tx) => {\n const active = activeRuntimeScopes.get(tx as object)?.get(tenantId);\n if (active) {\n if (requirement === 'v2' && active.barrier.moneyModel !== 'v2')\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Money v2 is not active for this tenant',\n );\n return operation(active);\n }\n const barrier = await lockTenantMoneyRuntime(tx, tenantId, requirement);\n const scope = runtimeScope(tx, tenantId, barrier);\n const scopes = activeRuntimeScopes.get(tx as object) ?? new Map();\n scopes.set(tenantId, scope);\n activeRuntimeScopes.set(tx as object, scopes);\n try {\n return await operation(scope);\n } finally {\n scopes.delete(tenantId);\n if (scopes.size === 0) activeRuntimeScopes.delete(tx as object);\n }\n });\n}\n\n/**\n * Run migration work under the exact owner marker and transaction executor.\n * This is the only scope that lets guarded collections read while the marker\n * is `migrating`; possession cannot be inferred from adapter shape.\n */\nexport async function withTenantMoneyMigration<T>(\n db: DatabaseInterface,\n tenantId: string,\n migrationId: string,\n operation: (scope: TenantMoneyMigrationScope) => Promise<T>,\n existingScope?: TenantMoneyMigrationScope,\n): Promise<T> {\n requiredText(tenantId, 'Money migration tenant');\n requiredText(migrationId, 'Money migration owner');\n if (existingScope) {\n if (\n existingScope.phase !== 'migration' ||\n existingScope.db !== db ||\n existingScope.tenantId !== tenantId ||\n existingScope.migrationId !== migrationId\n )\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant money migration scope does not match the requested executor',\n );\n return operation(existingScope);\n }\n return withDocumentMoneyTransaction(db, async (tx) => {\n const active = activeMigrationScopes.get(tx as object)?.get(tenantId);\n if (active) {\n if (active.migrationId !== migrationId)\n throw new MoneyValidationError(\n 'FROZEN_DOCUMENT',\n 'Tenant money migration owner does not match',\n );\n return operation(active);\n }\n const settings = await lockTenantMoneyMigrationOwner(\n tx,\n tenantId,\n migrationId,\n );\n const scope = {\n db: tx,\n tenantId,\n migrationId,\n settings,\n phase: 'migration',\n } as TenantMoneyMigrationScope;\n const scopes = activeMigrationScopes.get(tx as object) ?? new Map();\n scopes.set(tenantId, scope);\n activeMigrationScopes.set(tx as object, scopes);\n try {\n return await operation(scope);\n } finally {\n scopes.delete(tenantId);\n if (scopes.size === 0) activeMigrationScopes.delete(tx as object);\n }\n });\n}\n\n/** @internal Guard a generated collection read for runtime or migration. */\nexport async function withTenantMoneyCollectionRead<T>(\n db: DatabaseInterface,\n tenantId: string,\n operation: (boundDb: DatabaseInterface) => Promise<T>,\n): Promise<T> {\n const migration = activeMigrationScopes.get(db as object)?.get(tenantId);\n if (migration) return operation(migration.db);\n return withTenantMoneyRuntime(db, tenantId, 'legacy-or-v2', (scope) =>\n operation(scope.db),\n );\n}\n\n/** Lock a tenant at the legacy marker before the caller claims migration. */\nexport async function lockTenantMoneyMigrationClaim(\n tx: DatabaseInterface,\n tenantId: string,\n): Promise<TaxSettings> {\n requiredText(tenantId, 'Money migration tenant');\n if (!(await hasSettingsStorage(tx)))\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Money migration requires installed tax settings storage',\n );\n const collection = await TaxSettingsCollection.create({ db: tx });\n const settings = await collection.lockForTenant(tenantId);\n if (!settings)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant money settings could not be materialized',\n );\n if (settings.moneyModel === 'v2')\n throw new MoneyValidationError(\n 'FROZEN_DOCUMENT',\n 'Tenant money model is already v2',\n );\n if (settings.moneyModel === 'migrating')\n throw new MoneyValidationError(\n 'FROZEN_DOCUMENT',\n 'Tenant money migration is already in progress',\n );\n return settings;\n}\n\n/** Lock and verify the exact owner of an active tenant migration. */\nexport async function lockTenantMoneyMigrationOwner(\n tx: DatabaseInterface,\n tenantId: string,\n migrationId: string,\n): Promise<TaxSettings> {\n requiredText(tenantId, 'Money migration tenant');\n requiredText(migrationId, 'Money migration owner');\n if (!(await hasSettingsStorage(tx)))\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Money migration requires installed tax settings storage',\n );\n const collection = await TaxSettingsCollection.create({ db: tx });\n const settings = await collection.lockForTenant(tenantId, false);\n if (\n settings?.moneyModel !== 'migrating' ||\n settings.moneyMigrationId !== migrationId\n )\n throw new MoneyValidationError(\n 'FROZEN_DOCUMENT',\n 'Tenant money migration owner does not match',\n );\n return settings;\n}\n"],"mappings":";;;;;;;;;;;;AAkDA,SAAS,aAAa,OAAe,OAAuB;CAC1D,IAAI,CAAC,SAAS,MAAM,KAAK,MAAM,OAC7B,MAAM,IAAI,qBACR,uBACA,GAAG,MAAK,mCACV;CACF,OAAO;AACT;AAEA,eAAe,mBAAmB,IAAyC;CACzE,OAAO,CAAC,GAAG,eAAgB,MAAM,GAAG,YAAY,cAAc;AAChE;AAEA,IAAM,sCAAsB,IAAI,QAG9B;AACF,IAAM,wCAAwB,IAAI,QAGhC;AAEF,SAAS,aACP,IACA,UACA,SACyB;CACzB,OAAO;EACL;EACA;EACA;EACA,OAAO;CACT;AACF;AASA,eAAsB,uBACpB,IACA,UACA,cAA6C,gBACT;CACpC,aAAa,UAAU,cAAc;CACrC,IAAI,CAAE,MAAM,mBAAmB,EAAE,GAAI;EACnC,IAAI,gBAAgB,MAClB,MAAM,IAAI,qBACR,uBACA,+CACF;EACF,OAAO;GACL,YAAY;GACZ,UAAU;GACV,kBAAkB;EACpB;CACF;CAEA,MAAM,WAAW,OAAM,MADE,sBAAsB,OAAO,EAAE,IAAI,GAAG,CAAC,EAAA,CAC9B,cAAc,QAAQ;CACxD,IAAI,CAAC,UACH,MAAM,IAAI,qBACR,uBACA,iDACF;CACF,IAAI,SAAS,eAAe,aAC1B,MAAM,IAAI,qBACR,mBACA,uCACF;CACF,IAAI,SAAS,eAAe,MAC1B,OAAO;EAAE,YAAY;EAAM;EAAU,kBAAkB;CAAK;CAC9D,IAAI,gBAAgB,MAClB,MAAM,IAAI,qBACR,uBACA,wCACF;CACF,OAAO;EAAE,YAAY;EAAU;EAAU,kBAAkB;CAAK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I,qBACR,uBACA,yDACF;CAEF,MAAM,WAAW,OAAM,MADE,sBAAsB,OAAO,EAAE,IAAI,GAAG,CAAC,EAAA,CAC9B,cAAc,UAAU,KAAK;CAC/D,IACE,UAAU,eAAe,eACzB,SAAS,qBAAqB,aAE9B,MAAM,IAAI,qBACR,mBACA,6CACF;CACF,OAAO;AACT"}
@@ -38,6 +38,7 @@ var ContractType = /* @__PURE__ */ ((ContractType2) => {
38
38
  ContractType2["ORDER"] = "order";
39
39
  ContractType2["LEASE"] = "lease";
40
40
  ContractType2["AGREEMENT"] = "agreement";
41
+ ContractType2["SUPPLIER_QUOTE"] = "supplier_quote";
41
42
  ContractType2["PURCHASE_ORDER"] = "purchase_order";
42
43
  ContractType2["WHOLESALE_ORDER"] = "wholesale_order";
43
44
  ContractType2["PRODUCTION_ORDER"] = "production_order";
@@ -123,4 +124,4 @@ var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
123
124
  //#endregion
124
125
  export { FulfillmentStatus as a, PaymentInstrumentStatus as c, PaymentStatus as d, PayoutStatus as f, CustomerType as i, PaymentIntentStatus as l, types_exports as m, ContractType as n, FulfillmentType as o, VendorStatus as p, CustomerStatus as r, InvoiceStatus as s, ContractStatus as t, PaymentMethod as u };
125
126
 
126
- //# sourceMappingURL=types-LDETvQ1C.js.map
127
+ //# sourceMappingURL=types-Bbm0Xflc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-Bbm0Xflc.js","names":["CustomerStatus","CustomerType","VendorStatus","ContractType","ContractStatus","FulfillmentType","FulfillmentStatus","PaymentMethod","PaymentStatus","PaymentInstrumentStatus","PayoutStatus","PaymentIntentStatus","InvoiceStatus"],"sources":["../../src/types/index.ts"],"sourcesContent":["/**\n * Commerce package type definitions\n * @packageDocumentation\n */\n\nimport type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport type {\n InvoiceCalculationContext,\n InvoiceLineDraft,\n} from '../svelte/invoices/calculations.js';\n\n// ============================================================================\n// Customer/Vendor Types\n// ============================================================================\n\nexport enum CustomerStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n SUSPENDED = 'suspended',\n}\n\n/**\n * Customer classification — drives channel access, pricing tier, and credit terms.\n *\n * - DTC: direct-to-consumer (end shopper). Pays via storefront checkout.\n * - WHOLESALE: B2B buyer with negotiated terms (NET-30, line sheets, etc.).\n * - RETAIL: in-store walk-in / point-of-sale customer.\n */\nexport enum CustomerType {\n DTC = 'dtc',\n WHOLESALE = 'wholesale',\n RETAIL = 'retail',\n}\n\nexport enum VendorStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n SUSPENDED = 'suspended',\n}\n\n// ============================================================================\n// Contract Types\n// ============================================================================\n\nexport enum ContractType {\n ESTIMATE = 'estimate',\n ORDER = 'order',\n LEASE = 'lease',\n AGREEMENT = 'agreement',\n SUPPLIER_QUOTE = 'supplier_quote',\n PURCHASE_ORDER = 'purchase_order',\n WHOLESALE_ORDER = 'wholesale_order',\n PRODUCTION_ORDER = 'production_order',\n CART = 'cart',\n /**\n * Industry-neutral licensing primitive. The `LicenseSale` STI subtype\n * carries an immutable rights snapshot, a licensee email, optional\n * legal-entity / jurisdiction fields, and a signed-PDF reference.\n * Any application that sells rights for a fee (stock media,\n * music licensing, code-asset marketplace, license keys, etc.)\n * uses this subtype.\n */\n LICENSE_SALE = 'license_sale',\n}\n\nexport enum ContractStatus {\n DRAFT = 'draft',\n SENT = 'sent',\n ACCEPTED = 'accepted',\n DECLINED = 'declined',\n COMPLETED = 'completed',\n CANCELLED = 'cancelled',\n}\n\n// ============================================================================\n// Fulfillment Types\n// ============================================================================\n\nexport enum FulfillmentType {\n SHIPMENT = 'shipment',\n DELIVERY = 'delivery',\n PICKUP = 'pickup',\n DIGITAL = 'digital',\n SERVICE = 'service',\n}\n\nexport enum FulfillmentStatus {\n PENDING = 'pending',\n PROCESSING = 'processing',\n SHIPPED = 'shipped',\n DELIVERED = 'delivered',\n CANCELLED = 'cancelled',\n}\n\n// ============================================================================\n// Payment Types\n// ============================================================================\n\nexport enum PaymentMethod {\n CASH = 'cash',\n CHECK = 'check',\n CREDIT_CARD = 'credit_card',\n BANK_TRANSFER = 'bank_transfer',\n CRYPTO = 'crypto',\n OTHER = 'other',\n}\n\nexport enum PaymentStatus {\n PENDING = 'pending',\n COMPLETED = 'completed',\n FAILED = 'failed',\n REFUNDED = 'refunded',\n CANCELLED = 'cancelled',\n}\n\nexport type PaymentKind = 'payment' | 'refund';\n\n/**\n * Lifecycle status for a saved {@link PaymentInstrument} (card on file).\n * `active` while chargeable, `expired` once the card lapses, `removed` when the\n * customer detaches it.\n */\nexport enum PaymentInstrumentStatus {\n ACTIVE = 'active',\n EXPIRED = 'expired',\n REMOVED = 'removed',\n}\n\n// ============================================================================\n// Payout Types\n// ============================================================================\n\n/**\n * Status machine for {@link Payout}.\n *\n * `pending → sent → confirmed → failed`. `failed` is terminal but the\n * model exposes a dedicated `resetFromFailed()` so an operator can\n * deliberately requeue a payout after fixing the underlying problem;\n * the reset moves the row back to `pending` and clears the failure\n * metadata.\n *\n * Skipping intermediate states is rejected — a `pending` payout cannot\n * jump straight to `confirmed`, and a `sent` payout cannot regress to\n * `pending` without going through `resetFromFailed()` first.\n */\nexport enum PayoutStatus {\n PENDING = 'pending',\n SENT = 'sent',\n CONFIRMED = 'confirmed',\n FAILED = 'failed',\n}\n\n// ============================================================================\n// PaymentIntent Types\n// ============================================================================\n\n/**\n * Status machine for {@link PaymentIntent}.\n *\n * `awaiting_payment → paid → (issued | retired)`, with `expired` and\n * `cancelled` as alternate terminal states reachable from\n * `awaiting_payment`.\n *\n * - `AWAITING_PAYMENT` — open quote, accepting any of the listed\n * payment options.\n * - `PAID` — one option was satisfied by an incoming payment. The\n * other options are implicitly retired; later inbound funds to a\n * retired option must be flagged for refund by the consumer.\n * - `ISSUED` — downstream rights / contract / fulfillment have been\n * created and linked. Terminal happy-path state.\n * - `RETIRED` — paid but the satisfaction was reversed (refund,\n * chargeback, etc.). Terminal.\n * - `EXPIRED` — the USD-price-lock window passed without payment.\n * Terminal.\n * - `CANCELLED` — the buyer or the system explicitly cancelled the\n * intent before it was paid. Terminal.\n */\nexport enum PaymentIntentStatus {\n AWAITING_PAYMENT = 'awaiting_payment',\n PAID = 'paid',\n ISSUED = 'issued',\n RETIRED = 'retired',\n EXPIRED = 'expired',\n CANCELLED = 'cancelled',\n}\n\n/**\n * One way for a {@link PaymentIntent} to be satisfied. The intent lists\n * an array of these; satisfying any one of them transitions the intent\n * to `PAID` and implicitly retires the rest.\n *\n * Industry-neutral: a marketplace that accepts USDC-on-Base and BTC\n * lists two options; a SaaS billing flow that accepts Stripe and\n * PayPal lists two; a kiosk that accepts only one rail lists one.\n */\nexport interface PaymentOption {\n /**\n * Stable id of the `PaymentBackend` adapter that fulfills this\n * option — must match a `backendId` the consumer's payment-routing\n * layer recognises. Examples: `base-usdc`, `solana-usdc`, `btc`,\n * `stripe`, `paypal`.\n */\n backendId: string;\n /**\n * Payout-rail-qualified currency code, e.g. `USDC-base`, `BTC`,\n * `USD-stripe`. The same convention used by\n * `Vendor.payoutAddresses` and `Payment.nativeCurrency`.\n */\n currency: string;\n /**\n * Optional chain identifier for blockchain-backed options (`base`,\n * `ethereum`, `solana`, ...). Pure-fiat options leave this empty.\n */\n chain?: string;\n /**\n * Destination address / account id the buyer should send funds to\n * for this option (EVM address, BTC address, Stripe payment-intent\n * id, etc.).\n */\n payTo: string;\n /**\n * Amount denominated in `currency`. Stored at decimal precision —\n * a USDC option might be `199.0`, a BTC option `0.00713`.\n */\n nativeAmount: number;\n /**\n * Optional on-chain memo / payment reference (Solana memo, BTC OP_RETURN\n * tag, Stripe metadata key). Some backends use this to disambiguate\n * which intent an inbound payment satisfies.\n */\n memo?: string;\n /**\n * Whether this option supports the x402 HTTP-402 payment-required\n * flow. Consumers that build agent-driven flows use this flag to\n * filter the offered options.\n */\n x402Capable?: boolean;\n /**\n * Optional per-option expiry — when a single rail's quote becomes\n * stale earlier than the intent-wide price-lock window (e.g. a\n * volatile-currency option that re-quotes more aggressively). ISO\n * 8601 string. Empty / missing means \"inherit the intent's\n * `priceLockExpiresAt`\".\n */\n expiresAt?: string;\n}\n\n// ============================================================================\n// Invoice Types\n// ============================================================================\n\nexport enum InvoiceStatus {\n DRAFT = 'draft',\n SENT = 'sent',\n VIEWED = 'viewed',\n PARTIAL = 'partial',\n PAID = 'paid',\n OVERDUE = 'overdue',\n CANCELLED = 'cancelled',\n WRITTEN_OFF = 'written_off',\n}\n\n// ============================================================================\n// Common Interfaces\n// ============================================================================\n\n/**\n * Address structure used for billing and shipping\n */\nexport interface Address {\n street1?: string;\n street2?: string;\n city?: string;\n state?: string;\n postalCode?: string;\n country?: string;\n}\n\n/**\n * A person to reach at a customer or vendor, stored on the party row\n * (`Customer.contacts` / `Vendor.contacts`, #3501). Every field is plain\n * text; `id` is a stable random identifier assigned when the row is first\n * saved. Write rows through `savePartyContacts()`.\n */\nexport interface PartyContact {\n id: string;\n name: string;\n /** Role or relationship, for example \"Accounts payable\". */\n label: string;\n email: string;\n phone: string;\n address: string;\n}\n\n/**\n * Options for recording a payment with ledger integration\n */\nexport interface RecordPaymentOptions {\n /** The ledger to record the journal entry in */\n ledgerId: string;\n /** Account ID for receivables (credit side) */\n receivablesAccountId: string;\n /** Account ID for cash/bank (debit side) */\n cashAccountId: string;\n}\n\n/**\n * Options for recognizing revenue on an invoice\n */\nexport interface RecognizeRevenueOptions {\n /** Account ID for accounts receivable (debit side) */\n arAccountId: string;\n /** Account ID for revenue (credit side) */\n revenueAccountId: string;\n /** Account ID for tax payable (credit side, optional) */\n taxAccountId?: string;\n /** Explicit ledger book currency. Required when the tenant uses money v2. */\n bookCurrency?: string;\n}\n\n/** Options for atomically cancelling a posted money-v2 invoice. */\nexport interface CancelRevenueOptions {\n /** Explicit ledger book currency; required for money-v2 cancellation. */\n bookCurrency?: string;\n}\n\n// ============================================================================\n// Accounting-provider sync shapes\n// ============================================================================\n\n/**\n * A single line item in the format expected by `@happyvertical/accounting`\n * providers (QBO, Stripe, …). Mirrors the object built by\n * {@link InvoiceLineItem.toAccountingLineItem}. The SDK isn't a dependency of\n * this package, so the shape is declared locally rather than imported.\n */\nexport interface AccountingLineItemInput {\n description: string;\n sku?: string;\n quantity: number;\n unitPrice: number;\n discount?: number;\n taxRate?: number;\n amount: number;\n periodStart?: Date;\n periodEnd?: Date;\n}\n\n/**\n * An invoice in the format expected by `@happyvertical/accounting` providers.\n * Mirrors the object built by {@link Invoice.toAccountingInput}; money is in\n * currency **major** units, as the SDK expects.\n */\nexport interface AccountingInvoiceInput {\n id: string;\n externalId?: string;\n invoiceNumber: string;\n customerId: string;\n customerExternalId?: string;\n issueDate: Date;\n dueDate: Date;\n lineItems: AccountingLineItemInput[];\n subtotal: number;\n taxAmount: number;\n totalAmount: number;\n currency: string;\n reference?: string;\n memo?: string;\n idempotencyKey?: string;\n quickbooksRequest?: {\n readonly requestId: string;\n readonly realmId: string;\n readonly environment: 'sandbox' | 'production';\n readonly payloadHash: string;\n };\n quickbooksMapping?: {\n globalTaxCalculation: 'TaxExcluded' | 'NotApplicable';\n };\n}\n\n// ============================================================================\n// Model constructor option interfaces\n//\n// Each model's `constructor(options)` accepts a partial bag of its own fields.\n// Declaring a dedicated `XxxOptions extends SmrtObjectOptions` interface keeps\n// the constructors strongly typed (no `any`) while still allowing the\n// framework's base options (db, ai, fs, _className, …) through.\n// ============================================================================\n\n/**\n * Constructor options for {@link Customer}.\n */\nexport interface CustomerOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n profileId?: string;\n creditLimit?: number;\n paymentTerms?: string;\n taxExempt?: boolean;\n taxId?: string;\n defaultTaxCodeId?: string;\n defaultShippingAddress?: Address;\n defaultBillingAddress?: Address;\n status?: CustomerStatus;\n customerType?: CustomerType | null;\n notes?: string;\n contacts?: PartyContact[] | string | null;\n}\n\n/**\n * Constructor options for {@link Vendor}.\n */\nexport interface VendorOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n profileId?: string;\n leadTimeDays?: number;\n minimumOrderAmount?: number;\n paymentTerms?: string;\n currency?: string;\n taxId?: string;\n defaultTaxCodeId?: string;\n defaultContactEmail?: string;\n defaultContactPhone?: string;\n status?: VendorStatus;\n notes?: string;\n payoutAddresses?: Record<string, string> | string | null;\n contacts?: PartyContact[] | string | null;\n}\n\n/** A component reference stored in a tax code's ordered component list. */\nexport interface TaxCodePart {\n taxComponentId: string;\n compound: boolean;\n}\n\nexport interface TaxComponentOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n name?: string;\n percent?: string;\n liabilityAccountId?: string;\n recoverable?: boolean;\n active?: boolean;\n}\n\nexport interface TaxCodeOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n code?: string;\n name?: string;\n kind?: 'taxable' | 'zero-rated' | 'exempt' | 'out-of-scope';\n appliesTo?: 'sales' | 'purchases' | 'both';\n components?: TaxCodePart[];\n active?: boolean;\n}\n\nexport interface TaxRegistrationOptions {\n taxComponentId: string;\n number: string;\n label: string;\n}\n\nexport interface TaxSettingsOptions extends SmrtObjectOptions {\n tenantId?: string;\n defaultSalesTaxCodeId?: string;\n defaultPurchaseTaxCodeId?: string;\n defaultLineAmountType?: 'exclusive' | 'inclusive' | 'none';\n taxRoundingScope?: 'line' | 'document';\n taxRegistrations?: TaxRegistrationOptions[];\n moneyModel?: 'legacy' | 'migrating' | 'v2';\n moneyMigrationId?: string;\n}\n\n/**\n * Constructor options for {@link Contract} and its STI subtypes.\n */\nexport interface ContractOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n contractType?: ContractType;\n status?: ContractStatus;\n subtotal?: number;\n discountTotal?: number;\n taxAmount?: number;\n totalAmount?: number;\n currency?: string;\n issueDate?: Date;\n dueDate?: Date | null;\n expiryDate?: Date | null;\n reference?: string;\n notes?: string;\n terms?: string;\n channelId?: string;\n lineAmountType?: 'exclusive' | 'inclusive' | 'none';\n taxRoundingScope?: 'line' | 'document';\n sellerTaxRegistrations?: TaxRegistrationOptions[];\n sellerTaxRegistrationsJson?: string;\n partyTaxId?: string;\n moneySnapshotId?: string;\n}\n\nexport interface SalesContractOptions extends ContractOptions {\n customerId?: string | null;\n}\n\nexport interface PurchaseContractOptions extends ContractOptions {\n vendorId?: string | null;\n}\n\n/** Purchase-order header options stored in the existing STI metadata. */\nexport interface PurchaseOrderOptions extends PurchaseContractOptions {\n /** Expected delivery calendar date (YYYY-MM-DD); empty means unspecified. */\n expectedDate?: string;\n /** Delivery address/instructions snapshot. */\n shipTo?: string;\n}\n\n/**\n * Constructor options for {@link LicenseSale} (Contract STI subtype). Extends\n * {@link ContractOptions} with the licensing-specific meta fields.\n */\nexport interface LicenseSaleOptions extends SalesContractOptions {\n skuId?: string;\n paymentId?: string;\n licenseeEmail?: string;\n licenseeLegalEntity?: string;\n licenseeJurisdiction?: string;\n rightsMedium?: string;\n rightsDistributionScope?: string;\n rightsExclusivity?: string;\n rightsDuration?: string;\n rightsTerritory?: string;\n rightsSublicensing?: boolean;\n rightsDerivatives?: boolean;\n pdfUrl?: string;\n pdfHash?: string;\n onChainHashRegistryRef?: string;\n}\n\n/**\n * Constructor options for {@link ContractLineItem}.\n */\nexport interface ContractLineItemOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n contractId?: string;\n description?: string;\n quantity?: number;\n unitPrice?: number;\n discount?: number;\n discountType?: 'none' | 'percent' | 'amount';\n discountRate?: string;\n taxRate?: number;\n taxMode?: 'inherit' | 'override';\n taxCodeId?: string | null;\n taxCodeCode?: string | null;\n taxCodeName?: string | null;\n taxComponents?: ContractTaxComponentSnapshot[];\n taxComponentsJson?: string | null;\n taxAmount?: number;\n legacyAmount?: number | null;\n moneySnapshotId?: string;\n amount?: number;\n productId?: string;\n sku?: string;\n startDate?: Date | null;\n endDate?: Date | null;\n billingPeriod?: string;\n sortOrder?: number;\n}\n\n/** Immutable component tax allocation for one Contract line. */\nexport interface ContractTaxComponentSnapshot {\n taxComponentId: string;\n name: string;\n percent: string;\n taxMinor: number;\n}\n\n/**\n * How the provider collects an invoice (#3190): `charge_automatically`\n * charges the payer's saved card; `send_invoice` asks the payer to pay. Empty\n * for an invoice never pushed to a provider, or pushed before it was recorded.\n */\nexport type InvoiceCollectionMethod =\n | ''\n | 'send_invoice'\n | 'charge_automatically';\n\nexport type InvoiceKind = 'invoice' | 'credit_note';\n\n/** Frozen source pricing plus the one authoritative credit calculation basis. */\nexport type InvoiceCreditCalculationBasis =\n | {\n kind: 'quantity';\n quantity: string;\n sourceQuantity: string;\n sourceUnitPrice: number;\n sourceDiscountType: 'none' | 'percent' | 'amount';\n sourceDiscountRate: string;\n sourceDiscountMinor: number;\n }\n | {\n kind: 'net_amount';\n netMinor: number;\n sourceQuantity: string;\n sourceUnitPrice: number;\n sourceDiscountType: 'none' | 'percent' | 'amount';\n sourceDiscountRate: string;\n sourceDiscountMinor: number;\n };\n\n/**\n * Constructor options for {@link Invoice}.\n */\nexport interface InvoiceOptions extends SmrtObjectOptions {\n kind?: InvoiceKind;\n creditedInvoiceId?: string | null;\n creditedAmount?: number;\n tenantId?: string | null;\n customerId?: string;\n contractId?: string;\n invoiceNumber?: string;\n reference?: string;\n issueDate?: Date;\n dueDate?: Date;\n paidDate?: Date | null;\n subtotal?: number;\n taxAmount?: number;\n providerTaxAmount?: number;\n totalAmount?: number;\n amountPaid?: number;\n currency?: string;\n status?: InvoiceStatus;\n arJournalId?: string;\n arReversalJournalId?: string | null;\n revenueJournalId?: string;\n externalId?: string;\n customerExternalId?: string;\n externalProvider?: string;\n syncedAt?: Date | null;\n collectionMethod?: InvoiceCollectionMethod;\n sentAt?: Date | null;\n viewedAt?: Date | null;\n remindersSent?: number;\n lastReminderAt?: Date | null;\n notes?: string;\n customerNotes?: string;\n terms?: string;\n lineAmountType?: 'exclusive' | 'inclusive' | 'none';\n taxRoundingScope?: 'line' | 'document';\n discountTotal?: number;\n sellerTaxRegistrations?: TaxRegistrationOptions[];\n sellerTaxRegistrationsJson?: string;\n partyTaxId?: string;\n moneySnapshotId?: string;\n accountingSyncStateJson?: string;\n}\n\nexport interface InvoiceTaxComponentSnapshot {\n taxComponentId: string;\n name: string;\n percent: string;\n taxMinor: number;\n}\n\n/** Retained editing modes, validated against resolved model fields before reuse. */\nexport interface InvoiceLineEditorState {\n /** Lossless editor draft; never authoritative for ordinary model saves. */\n draft: InvoiceLineDraft;\n /** Context used to resolve that draft; caller authority must still match on reload. */\n context: InvoiceCalculationContext;\n}\n\n/** Constructor options for {@link InvoiceLineItem}. */\nexport interface InvoiceLineItemOptions extends SmrtObjectOptions {\n creditedLineId?: string | null;\n creditCalculationBasis?: InvoiceCreditCalculationBasis | null;\n creditCalculationBasisJson?: string;\n /** Optional retained editor modes and their original calculation context. */\n invoiceEditorState?: InvoiceLineEditorState | null;\n /** Serialized editor state loaded from persistence; malformed JSON is ignored. */\n invoiceEditorStateJson?: string;\n tenantId?: string | null;\n invoiceId?: string;\n description?: string;\n sku?: string;\n productId?: string | null;\n quantity?: number;\n unitPrice?: number;\n discount?: number;\n discountType?: 'none' | 'percent' | 'amount';\n discountRate?: string;\n taxRate?: number;\n taxMode?: 'inherit' | 'override';\n taxCodeId?: string | null;\n taxCodeCode?: string | null;\n taxCodeName?: string | null;\n taxComponents?: InvoiceTaxComponentSnapshot[];\n taxComponentsJson?: string | null;\n taxAmount?: number;\n legacyAmount?: number | null;\n moneySnapshotId?: string;\n amount?: number;\n sourceType?: string;\n sourceId?: string;\n periodStart?: Date | null;\n periodEnd?: Date | null;\n revenueAccountId?: string | null;\n sortOrder?: number;\n}\n\n/**\n * Constructor options for {@link Fulfillment}.\n */\nexport interface FulfillmentOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n contractId?: string;\n fulfillmentType?: FulfillmentType;\n status?: FulfillmentStatus;\n trackingNumber?: string;\n carrier?: string;\n shippingAddress?: Address;\n shippedAt?: Date | null;\n deliveredAt?: Date | null;\n estimatedDelivery?: Date | null;\n notes?: string;\n}\n\n/**\n * Constructor options for {@link FulfillmentLineItem}.\n */\nexport interface FulfillmentLineItemOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n fulfillmentId?: string;\n contractLineItemId?: string;\n quantityFulfilled?: number;\n notes?: string;\n}\n\n/**\n * Constructor options for {@link Payment}.\n */\nexport interface PaymentOptions extends SmrtObjectOptions {\n kind?: PaymentKind;\n tenantId?: string | null;\n contractId?: string | null;\n customerId?: string | null;\n amount?: number;\n currency?: string;\n method?: PaymentMethod;\n status?: PaymentStatus;\n transactionId?: string;\n reference?: string;\n journalId?: string;\n paidAt?: Date | null;\n notes?: string;\n externalId?: string;\n externalProvider?: string;\n syncedAt?: Date | null;\n backendId?: string;\n backendTxRef?: string;\n nativeAmount?: number;\n nativeCurrency?: string;\n usdAtQuote?: number;\n usdAtConfirmation?: number;\n}\n\n/**\n * Constructor options for {@link PaymentInstrument}.\n */\nexport interface PaymentInstrumentOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n customerId?: string;\n backendId?: string;\n providerCustomerId?: string;\n providerPaymentMethodId?: string;\n type?: string;\n brand?: string;\n last4?: string;\n expMonth?: number;\n expYear?: number;\n isDefault?: boolean;\n status?: PaymentInstrumentStatus;\n}\n\n/**\n * Constructor options for {@link PaymentAllocation}.\n */\nexport interface PaymentAllocationOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n paymentId?: string;\n invoiceId?: string;\n amount?: number;\n allocatedAt?: Date;\n allocatedBy?: string;\n notes?: string;\n}\n\n/**\n * Constructor options for {@link PaymentIntent}.\n */\nexport interface PaymentIntentOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n skuId?: string;\n offeringRef?: string;\n licenseeEmail?: string;\n customerId?: string;\n paymentOptions?: PaymentOption[] | string;\n usdPriceLocked?: number;\n priceLockWindowMs?: number;\n priceLockExpiresAt?: Date | number | string | null;\n status?: PaymentIntentStatus;\n idempotencyKey?: string;\n paidOptionBackendId?: string;\n paymentId?: string;\n paidAt?: Date | number | string | null;\n issuedAt?: Date | number | string | null;\n expiredAt?: Date | number | string | null;\n cancelledAt?: Date | number | string | null;\n retiredAt?: Date | number | string | null;\n notes?: string;\n}\n\n/**\n * Constructor options for {@link Payout}.\n */\nexport interface PayoutOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n paymentId?: string;\n vendorId?: string;\n grossAmount?: number;\n operatorFee?: number;\n supplierNet?: number;\n currency?: string;\n backendId?: string;\n backendTxRef?: string;\n status?: PayoutStatus;\n sentAt?: Date | number | string | null;\n confirmedAt?: Date | number | string | null;\n failedAt?: Date | number | string | null;\n failureReason?: string;\n notes?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAeO,IAAK,iBAAL,kBAAKA,oBAAL;CACLA,gBAAA,YAAS;CACTA,gBAAA,cAAW;CACXA,gBAAA,eAAY;CAHF,OAAAA;AAAA,EAAA,CAAA,kBAAA,CAAA,CAAA;AAaL,IAAK,eAAL,kBAAKC,kBAAL;CACLA,cAAA,SAAM;CACNA,cAAA,eAAY;CACZA,cAAA,YAAS;CAHC,OAAAA;AAAA,EAAA,CAAA,gBAAA,CAAA,CAAA;AAML,IAAK,eAAL,kBAAKC,kBAAL;CACLA,cAAA,YAAS;CACTA,cAAA,cAAW;CACXA,cAAA,eAAY;CAHF,OAAAA;AAAA,EAAA,CAAA,gBAAA,CAAA,CAAA;AAUL,IAAK,eAAL,kBAAKC,kBAAL;CACLA,cAAA,cAAW;CACXA,cAAA,WAAQ;CACRA,cAAA,WAAQ;CACRA,cAAA,eAAY;CACZA,cAAA,oBAAiB;CACjBA,cAAA,oBAAiB;CACjBA,cAAA,qBAAkB;CAClBA,cAAA,sBAAmB;CACnBA,cAAA,UAAO;CASPA,cAAA,kBAAe;CAlBL,OAAAA;AAAA,EAAA,CAAA,gBAAA,CAAA,CAAA;AAqBL,IAAK,iBAAL,kBAAKC,oBAAL;CACLA,gBAAA,WAAQ;CACRA,gBAAA,UAAO;CACPA,gBAAA,cAAW;CACXA,gBAAA,cAAW;CACXA,gBAAA,eAAY;CACZA,gBAAA,eAAY;CANF,OAAAA;AAAA,EAAA,CAAA,kBAA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AA,uBAAA,CAAA,CAAA;AA0EL,IAAK,gBAAL,kBAAKC,mBAAL;CACLA,eAAA,WAAQ;CACRA,eAAA,UAAO;CACPA,eAAA,YAAS;CACTA,eAAA,aAAU;CACVA,eAAA,UAAO;CACPA,eAAA,aAAU;CACVA,eAAA,eAAY;CACZA,eAAA,iBAAc;CARJ,OAAAA;AAAA,EAAA,CAAA,iBAAA,CAAA,CAAA"}
package/dist/index.d.ts CHANGED
@@ -73,7 +73,7 @@ export { type CommerceLineAmountDocumentReport, type CommerceLineAmountReasonCod
73
73
  export { type InvoiceEditorStorageEngine, type InvoiceEditorStorageMigrationResult, type InvoiceEditorStoragePreflight, migrateInvoiceEditorStorage, preflightInvoiceEditorStorage, } from './migrations/invoiceEditorStorage.js';
74
74
  export { COMMERCE_MONEY_COLUMNS, COMMERCE_MONEY_MINOR_UNITS_BACKFILL, COMMERCE_NATIVE_UNIT_COLUMNS, migrateCommerceMoneyToMinorUnits, preflightCommerceMoneyMinorUnits, } from './migrations/moneyMinorUnits.js';
75
75
  export { type CommerceContractTypeGroup, type CommercePartyLinkRow, type CommercePartyLinksPreflight, preflightCommercePartyLinks, } from './migrations/partyLinks.js';
76
- export { Agreement, BillingAccount, type BillingCloseKind, BillingLineSource, type BillingLineSourceType, BillingPaymentAttempt, type BillingPaymentAttemptFlag, type BillingPaymentAttemptPurpose, type BillingPaymentAttemptTransition, BillingPeriodClose, type BillingPeriodCloseStatus, type BillingStanding, Cart, type CommerceDocumentType, Contract, ContractLineItem, Customer, DocumentTax, type DocumentTaxOptions, Estimate, Fulfillment, FulfillmentLineItem, Invoice, InvoiceLineItem, Lease, type LicenseRightsSnapshot, LicenseSale, MoneyMigrationDocument, type MoneyMigrationDocumentOptions, type MoneyMigrationDocumentState, type MoneyMigrationDocumentType, Order, Payment, PaymentAllocation, PaymentInstrument, PaymentIntent, Payout, ProductionOrder, PurchaseContract, PurchaseOrder, SalesContract, TaxCode, TaxComponent, TaxSettings, TaxSummaryReport, type TaxSummaryReportRowKind, Vendor, WholesaleOrder, } from './models/index.js';
76
+ export { Agreement, BillingAccount, type BillingCloseKind, BillingLineSource, type BillingLineSourceType, BillingPaymentAttempt, type BillingPaymentAttemptFlag, type BillingPaymentAttemptPurpose, type BillingPaymentAttemptTransition, BillingPeriodClose, type BillingPeriodCloseStatus, type BillingStanding, Cart, type CommerceDocumentType, Contract, ContractLineItem, Customer, DocumentTax, type DocumentTaxOptions, Estimate, Fulfillment, FulfillmentLineItem, Invoice, InvoiceLineItem, Lease, type LicenseRightsSnapshot, LicenseSale, MoneyMigrationDocument, type MoneyMigrationDocumentOptions, type MoneyMigrationDocumentState, type MoneyMigrationDocumentType, Order, Payment, PaymentAllocation, PaymentInstrument, PaymentIntent, Payout, ProductionOrder, PurchaseContract, PurchaseOrder, SalesContract, SupplierQuote, TaxCode, TaxComponent, TaxSettings, TaxSummaryReport, type TaxSummaryReportRowKind, Vendor, WholesaleOrder, } from './models/index.js';
77
77
  export { assertIntegerMinorUnits, calculateMoneyDocument, type LineAmountType, type MoneyDiscountInput, type MoneyDocumentResult, type MoneyDocumentTaxResult, type MoneyLineInput, type MoneyLineResult, type MoneyTaxCodeInput, type MoneyValidationCode, MoneyValidationError, type ResolvableTaxCodeInput, type ResolvedLineTaxCode, type ResolveLineTaxCodeContext, type ResolveLineTaxCodeInput, resolveLineTaxCode, type TaxCodeAppliesTo, type TaxCodeKind, type TaxCodeResolutionSource, type TaxComponentInput, type TaxRoundingScope, } from './money.js';
78
78
  export { applyPartyContactIntent, DEFAULT_PARTY_CONTACT_FIELD_NAMES, normalizePartyContacts, PARTY_CONTACT_MAX_LENGTHS, type PartyContactErrorCode, type PartyContactField, type PartyContactFieldNames, type PartyContactFormSource, type PartyContactInput, type PartyContactIntents, PartyContactPartyNotFoundError, PartyContactPayloadError, type PartyContactRowErrors, PartyContactValidationError, readPartyContactRows, type SavePartyContactsOptions, savePartyContacts, validatePartyContactRows, } from './party-contacts.js';
79
79
  export { AgreementsRecipe, CustomersRecipe, EstimatesRecipe, FulfillmentRecipe, InvoicingRecipe, LeasesRecipe, LicensesRecipe, PurchasesRecipe, SalesRecipe, VendorsRecipe, WholesaleRecipe, } from './recipes.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAKH,OAAO,wBAAwB,CAAC;AAGhC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,2BAA2B,EAChC,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,qBAAqB,EACrB,6BAA6B,EAC7B,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,gCAAgC,EAChC,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,KAAK,8BAA8B,EACnC,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,8BAA8B,EACnC,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,iCAAiC,EACtC,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EACpC,KAAK,sBAAsB,EAC3B,0BAA0B,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,eAAe,EACf,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mCAAmC,EACnC,sCAAsC,EACtC,kCAAkC,EAClC,iCAAiC,EACjC,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAA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