@happyvertical/smrt-commerce 0.62.5 → 0.62.6

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 (74) hide show
  1. package/AGENTS.md +1 -0
  2. package/agents/accounting-connection.md +76 -0
  3. package/agents/accounting-live-gate.md +40 -0
  4. package/agents/accounting-mapping.md +60 -0
  5. package/agents/accounting-payment-sync.md +76 -0
  6. package/agents/ordinary-accounting.md +3 -0
  7. package/dist/accounting-connection.d.ts +179 -0
  8. package/dist/accounting-connection.d.ts.map +1 -0
  9. package/dist/accounting-live-gate.d.ts +50 -0
  10. package/dist/accounting-live-gate.d.ts.map +1 -0
  11. package/dist/accounting-mapping.d.ts +189 -0
  12. package/dist/accounting-mapping.d.ts.map +1 -0
  13. package/dist/accounting-payment-sync.d.ts +233 -0
  14. package/dist/accounting-payment-sync.d.ts.map +1 -0
  15. package/dist/chunks/{InvoiceCollection-Cc-fJrHy.js → InvoiceCollection-xooQnUwq.js} +10 -10
  16. package/dist/chunks/{InvoiceCollection-Cc-fJrHy.js.map → InvoiceCollection-xooQnUwq.js.map} +1 -1
  17. package/dist/chunks/{allocation-integrity-CvXQm3wK.js → allocation-integrity-C4SZJcao.js} +6 -6
  18. package/dist/chunks/{allocation-integrity-CvXQm3wK.js.map → allocation-integrity-C4SZJcao.js.map} +1 -1
  19. package/dist/chunks/{contract-money-BoKHNfV6.js → contract-money-ATacxU6t.js} +4 -7
  20. package/dist/chunks/{contract-money-BoKHNfV6.js.map → contract-money-ATacxU6t.js.map} +1 -1
  21. package/dist/chunks/{invoice-posting-DlR_-TG1.js → invoice-posting-CDfxug3Q.js} +4 -5
  22. package/dist/chunks/{invoice-posting-DlR_-TG1.js.map → invoice-posting-CDfxug3Q.js.map} +1 -1
  23. package/dist/chunks/retention-accounting-BA4wXUQc.js +8710 -0
  24. package/dist/chunks/retention-accounting-BA4wXUQc.js.map +1 -0
  25. package/dist/chunks/{tenant-money-barrier-Bmu4YiID.js → tenant-money-barrier-BdyXIVT5.js} +3 -3
  26. package/dist/chunks/{tenant-money-barrier-Bmu4YiID.js.map → tenant-money-barrier-BdyXIVT5.js.map} +1 -1
  27. package/dist/collections/AccountingConnectionCollection.d.ts +27 -0
  28. package/dist/collections/AccountingConnectionCollection.d.ts.map +1 -0
  29. package/dist/collections/AccountingMappingCollection.d.ts +24 -0
  30. package/dist/collections/AccountingMappingCollection.d.ts.map +1 -0
  31. package/dist/collections/AccountingSyncRecordCollections.d.ts +27 -0
  32. package/dist/collections/AccountingSyncRecordCollections.d.ts.map +1 -0
  33. package/dist/collections/index.d.ts +3 -0
  34. package/dist/collections/index.d.ts.map +1 -1
  35. package/dist/index.d.ts +10 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1532 -21
  38. package/dist/index.js.map +1 -1
  39. package/dist/invoice-accounting-sync.d.ts +6 -0
  40. package/dist/invoice-accounting-sync.d.ts.map +1 -1
  41. package/dist/invoices.js +1 -1
  42. package/dist/manifest.json +6303 -3740
  43. package/dist/models/AccountingConnection.d.ts +101 -0
  44. package/dist/models/AccountingConnection.d.ts.map +1 -0
  45. package/dist/models/AccountingMapping.d.ts +85 -0
  46. package/dist/models/AccountingMapping.d.ts.map +1 -0
  47. package/dist/models/AccountingSyncRecords.d.ts +95 -0
  48. package/dist/models/AccountingSyncRecords.d.ts.map +1 -0
  49. package/dist/models/index.d.ts +3 -0
  50. package/dist/models/index.d.ts.map +1 -1
  51. package/dist/ordinary-accounting.d.ts +1 -0
  52. package/dist/ordinary-accounting.d.ts.map +1 -1
  53. package/dist/recipes.d.ts +1 -1
  54. package/dist/retention-accounting.d.ts +1 -0
  55. package/dist/retention-accounting.d.ts.map +1 -1
  56. package/dist/smrt-knowledge.json +1327 -99
  57. package/dist/smrt-knowledge.okf.md +55 -23
  58. package/package.json +15 -15
  59. package/dist/chunks/ContractLineItemCollection-BKHy-nR8.js +0 -260
  60. package/dist/chunks/ContractLineItemCollection-BKHy-nR8.js.map +0 -1
  61. package/dist/chunks/DocumentTaxCollection-BRebznXF.js +0 -4649
  62. package/dist/chunks/DocumentTaxCollection-BRebznXF.js.map +0 -1
  63. package/dist/chunks/TaxCodeCollection-BBqCugs5.js +0 -155
  64. package/dist/chunks/TaxCodeCollection-BBqCugs5.js.map +0 -1
  65. package/dist/chunks/TaxComponentCollection-BHJjbQxq.js +0 -134
  66. package/dist/chunks/TaxComponentCollection-BHJjbQxq.js.map +0 -1
  67. package/dist/chunks/credit-allocation-yspz0Lab.js +0 -121
  68. package/dist/chunks/credit-allocation-yspz0Lab.js.map +0 -1
  69. package/dist/chunks/retention-accounting-D0KzSw3f.js +0 -3069
  70. package/dist/chunks/retention-accounting-D0KzSw3f.js.map +0 -1
  71. package/dist/chunks/retention-accounting-internal-DNxLLVvK.js +0 -30
  72. package/dist/chunks/retention-accounting-internal-DNxLLVvK.js.map +0 -1
  73. package/dist/chunks/units-8ElbjVZK.js +0 -60
  74. package/dist/chunks/units-8ElbjVZK.js.map +0 -1
@@ -63,8 +63,8 @@ var TaxSettings = class extends SmrtObject {
63
63
  await assertTenantMoneyCurrent(this.db, firstTenant);
64
64
  }
65
65
  return this.withTransaction(async () => {
66
- const { TaxCodeCollection } = await import("./TaxCodeCollection-BBqCugs5.js").then((n) => n.n);
67
- const { TaxComponentCollection } = await import("./TaxComponentCollection-BHJjbQxq.js").then((n) => n.n);
66
+ const { TaxCodeCollection } = await import("./retention-accounting-BA4wXUQc.js").then((n) => n.Mt);
67
+ const { TaxComponentCollection } = await import("./retention-accounting-BA4wXUQc.js").then((n) => n.kt);
68
68
  const codes = await TaxCodeCollection.create({ db: this.db });
69
69
  const components = await TaxComponentCollection.create({ db: this.db });
70
70
  for (const id of [this.defaultSalesTaxCodeId, this.defaultPurchaseTaxCodeId].filter(Boolean)) {
@@ -252,4 +252,4 @@ async function withTenantMoneyCollectionRead(db, tenantId, operation) {
252
252
  //#endregion
253
253
  export { materializeTenantTaxSettings as a, TaxSettings as c, TaxSettingsCollection as i, withTenantMoneyCollectionRead as n, createOrLoadTaxSeed as o, withTenantMoneyRuntime as r, deterministicTaxId as s, lockTenantMoneyRuntime as t };
254
254
 
255
- //# sourceMappingURL=tenant-money-barrier-Bmu4YiID.js.map
255
+ //# sourceMappingURL=tenant-money-barrier-BdyXIVT5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenant-money-barrier-Bmu4YiID.js","names":[],"sources":["../../src/models/TaxSettings.ts","../../src/tax/identity.ts","../../src/collections/TaxSettingsCollection.ts","../../src/tenant-money-barrier.ts"],"sourcesContent":["import {\n field,\n foreignKey,\n SmrtObject,\n type SmrtSaveOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport {\n getTenantId,\n TenantScoped,\n tenantId,\n} from '@happyvertical/smrt-tenancy';\nimport type { TaxSettingsOptions } from '../types/index.js';\n\nexport interface TaxRegistration {\n taxComponentId: string;\n number: string;\n label: string;\n}\n\n/** Tenant-level defaults and registration numbers for tax determination. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n conflictColumns: ['tenant_id'],\n api: {\n include: ['get', 'create', 'update'],\n writable: [\n 'defaultSalesTaxCodeId',\n 'defaultPurchaseTaxCodeId',\n 'defaultLineAmountType',\n 'taxRoundingScope',\n 'taxRegistrations',\n ],\n },\n mcp: { include: ['get'] },\n cli: { skipApiCheck: true },\n})\nexport class TaxSettings extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-commerce\";\n @tenantId()\n tenantId = '';\n\n @foreignKey('TaxCode', {\n description: 'The default tax code for sales documents.',\n })\n defaultSalesTaxCodeId = '';\n\n @foreignKey('TaxCode', {\n description: 'The default tax code for purchase documents.',\n })\n defaultPurchaseTaxCodeId = '';\n\n @field({\n description:\n 'Whether new document amounts are exclusive, inclusive or out of scope.',\n })\n defaultLineAmountType: 'exclusive' | 'inclusive' | 'none' = 'exclusive';\n\n @field({ description: 'Whether components round per line or per document.' })\n taxRoundingScope: 'line' | 'document' = 'line';\n\n /** Stored JSON is guarded through the typed accessor below. */\n taxRegistrationsJson = '[]';\n\n @field({\n sensitive: true,\n transient: true,\n description:\n 'Registration numbers by tax component, for issued-document snapshots.',\n })\n get taxRegistrations(): TaxRegistration[] {\n try {\n const value: unknown = JSON.parse(this.taxRegistrationsJson);\n if (!Array.isArray(value)) return [];\n return value.filter(\n (entry): entry is TaxRegistration =>\n !!entry &&\n typeof entry === 'object' &&\n typeof (entry as TaxRegistration).taxComponentId === 'string' &&\n typeof (entry as TaxRegistration).number === 'string' &&\n typeof (entry as TaxRegistration).label === 'string',\n );\n } catch {\n return [];\n }\n }\n\n set taxRegistrations(value: TaxRegistration[] | string) {\n this.taxRegistrationsJson =\n typeof value === 'string' ? value : JSON.stringify(value);\n }\n\n constructor(options: TaxSettingsOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.defaultSalesTaxCodeId !== undefined)\n this.defaultSalesTaxCodeId = options.defaultSalesTaxCodeId;\n if (options.defaultPurchaseTaxCodeId !== undefined)\n this.defaultPurchaseTaxCodeId = options.defaultPurchaseTaxCodeId;\n if (options.defaultLineAmountType !== undefined)\n this.defaultLineAmountType = options.defaultLineAmountType;\n if (options.taxRoundingScope !== undefined)\n this.taxRoundingScope = options.taxRoundingScope;\n if (options.taxRegistrations !== undefined)\n this.taxRegistrations = structuredClone(options.taxRegistrations);\n }\n\n override async save(options?: SmrtSaveOptions): Promise<this> {\n if (\n !['exclusive', 'inclusive', 'none'].includes(this.defaultLineAmountType)\n )\n throw new Error('Tax settings defaultLineAmountType is invalid');\n if (!['line', 'document'].includes(this.taxRoundingScope))\n throw new Error('Tax settings taxRoundingScope is invalid');\n const registrations = this.parsedRegistrations();\n if (!registrations)\n throw new Error('Tax registrations must be a valid JSON array');\n if (\n registrations.some(\n (entry) =>\n !entry.taxComponentId || !entry.number.trim() || !entry.label.trim(),\n )\n )\n throw new Error('Tax registrations require component, number and label');\n // A tenant's first settings row must not adopt documents an earlier\n // version wrote: that tenant needs the upgrade, not fresh defaults.\n // The tenant may still be empty here: tenancy stamps it during save.\n const firstTenant = this.isPersisted\n ? ''\n : this.tenantId || getTenantId() || '';\n if (firstTenant) {\n const { assertTenantMoneyCurrent } = await import('../upgrade/detect.js');\n await assertTenantMoneyCurrent(this.db, firstTenant);\n }\n return this.withTransaction(async () => {\n const { TaxCodeCollection } = await import(\n '../collections/TaxCodeCollection.js'\n );\n const { TaxComponentCollection } = await import(\n '../collections/TaxComponentCollection.js'\n );\n const codes = await TaxCodeCollection.create({ db: this.db });\n const components = await TaxComponentCollection.create({ db: this.db });\n for (const id of [\n this.defaultSalesTaxCodeId,\n this.defaultPurchaseTaxCodeId,\n ].filter(Boolean)) {\n const code = await codes.get({ id }, { cache: false });\n if (!code || code.tenantId !== this.tenantId)\n throw new Error(\n 'Tax setting default codes must belong to its tenant',\n );\n }\n for (const registration of registrations) {\n const component = await components.get(\n { id: registration.taxComponentId },\n { cache: false },\n );\n if (!component || component.tenantId !== this.tenantId)\n throw new Error(\n 'Tax setting registrations must belong to its tenant',\n );\n }\n return (await super.save(options)) as this;\n });\n }\n\n private parsedRegistrations(): TaxRegistration[] | null {\n try {\n const value: unknown = JSON.parse(this.taxRegistrationsJson);\n if (!Array.isArray(value)) return null;\n if (\n value.some(\n (entry) =>\n !entry ||\n typeof entry !== 'object' ||\n typeof (entry as TaxRegistration).taxComponentId !== 'string' ||\n typeof (entry as TaxRegistration).number !== 'string' ||\n typeof (entry as TaxRegistration).label !== 'string',\n )\n )\n return null;\n return value as TaxRegistration[];\n } catch {\n return null;\n }\n }\n}\n","/** Stable UUID identities make tenant tax bootstrap retry and race safe. */\nexport async function deterministicTaxId(\n tenantId: string,\n kind: 'code' | 'component' | 'settings' | 'report',\n key: string,\n): Promise<string> {\n if (!tenantId.trim() || !key.trim())\n throw new Error('Tax bootstrap identity requires tenant and key');\n const bytes = new TextEncoder().encode(\n JSON.stringify(['commerce-tax', tenantId, kind, key]),\n );\n const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', bytes));\n const uuid = digest.slice(0, 16);\n uuid[6] = (uuid[6] & 0x0f) | 0x50;\n uuid[8] = (uuid[8] & 0x3f) | 0x80;\n const hex = Array.from(uuid, (byte) => byte.toString(16).padStart(2, '0'));\n const joined = hex.join('');\n return `${joined.slice(0, 8)}-${joined.slice(8, 12)}-${joined.slice(12, 16)}-${joined.slice(16, 20)}-${joined.slice(20)}`;\n}\n\n/** A racing deterministic insert loses safely and reloads the committed row. */\nexport async function createOrLoadTaxSeed<T>(\n create: () => Promise<T>,\n load: () => Promise<T | null | undefined>,\n): Promise<T> {\n for (let attempt = 0; attempt < 3; attempt++) {\n try {\n return await create();\n } catch (error) {\n const code = (error as { code?: unknown } | null)?.code;\n if (code === 'RUNTIME_REVISION_CONFLICT' && attempt < 2) continue;\n if (code !== 'VALIDATION_UNIQUE_CONSTRAINT' && code !== '23505')\n throw error;\n const winner = await load();\n if (!winner) throw error;\n return winner;\n }\n }\n throw new Error('Tax seed retry exhausted');\n}\n","import {\n isEmbeddedDatabase,\n isPostgresDatabase,\n SmrtCollection,\n withEmbeddedWriteTransaction,\n} from '@happyvertical/smrt-core';\nimport type { DatabaseInterface } from '@happyvertical/smrt-core/migrations';\nimport { lockDocumentMoneyParents } from '../document-money-internal.js';\nimport { TaxSettings } from '../models/TaxSettings.js';\nimport { MoneyValidationError } from '../money.js';\nimport { createOrLoadTaxSeed, deterministicTaxId } from '../tax/identity.js';\nimport { assertTenantMoneyCurrent } from '../upgrade/detect.js';\n\n/**\n * Serialize settings-row creation for one tenant on PostgreSQL. The lock is\n * transaction-scoped; embedded engines are already single-writer through the\n * core embedded write queue that every model transaction enters.\n */\nasync function lockTenantSettingsCreation(\n db: DatabaseInterface,\n tenantId: string,\n): Promise<void> {\n if (!isPostgresDatabase(db)) return;\n await db.query(\n 'SELECT pg_advisory_xact_lock(hashtext(CAST(? AS TEXT)))',\n `smrt-commerce-tax-settings:${tenantId}`,\n );\n}\n\n/**\n * @internal Create a tenant's missing settings row exactly once, with the\n * model defaults. Creation serializes on a tenant advisory lock (PostgreSQL)\n * or the embedded write queue and re-reads before inserting, so racing first\n * writers converge on one row. An existing row is never changed.\n */\nexport async function materializeTenantTaxSettings(\n db: DatabaseInterface,\n tenantId: string,\n): Promise<void> {\n const id = await deterministicTaxId(tenantId, 'settings', 'default');\n await withEmbeddedWriteTransaction(db, isEmbeddedDatabase(db), async (tx) => {\n await lockTenantSettingsCreation(tx, tenantId);\n const settings = await TaxSettingsCollection.create({ db: tx });\n if (await settings.getForTenant(tenantId)) return;\n await createOrLoadTaxSeed(\n () => settings.create({ id, tenantId }),\n async () =>\n (await settings.list({ where: { tenantId }, limit: 1 }))[0] ?? null,\n );\n });\n}\n\nexport class TaxSettingsCollection extends SmrtCollection<TaxSettings> {\n static readonly _itemClass = TaxSettings;\n\n /**\n * Load the tenant's settings row, creating it once when missing. A tenant\n * whose stored documents predate tenant tax settings is refused with\n * `COMMERCE_DATA_NEEDS_UPGRADE` rather than given fresh defaults.\n */\n async getOrCreateForTenant(tenantId: string): Promise<TaxSettings> {\n await assertTenantMoneyCurrent(this.db, tenantId);\n const existing = await this.getForTenant(tenantId);\n if (existing) return existing;\n await materializeTenantTaxSettings(this.db, tenantId);\n const created = await this.getForTenant(tenantId);\n if (!created)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant tax settings could not be materialized',\n );\n return created;\n }\n\n async getForTenant(tenantId: string): Promise<TaxSettings | null> {\n const listed = (await this.list({ where: { tenantId }, limit: 1 }))[0];\n if (!listed?.id) return listed ?? null;\n return (await this.get({ id: listed.id }, { cache: false })) ?? null;\n }\n\n /** @internal Lock and re-read the tenant's settings row on this transaction. */\n async lockForTenant(tenantId: string): Promise<TaxSettings> {\n const first = await this.getOrCreateForTenant(tenantId);\n if (!first.id)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant tax settings have no identity',\n );\n await lockDocumentMoneyParents([\n { id: first.id, tenantId, collection: this },\n ]);\n const locked = await this.getForTenant(tenantId);\n if (!locked || locked.id !== first.id)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant tax settings changed while acquiring the lock',\n );\n return locked;\n }\n}\n","/** Tenant serialization point for commerce money runtime work. */\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';\nimport { assertTenantMoneyCurrent } from './upgrade/detect.js';\n\ndeclare const tenantMoneyScopeBrand: unique symbol;\n\n/** Transaction-affine proof that a tenant's settings row is locked on `db`. */\nexport interface TenantMoneyRuntimeScope {\n readonly db: DatabaseInterface;\n readonly tenantId: string;\n readonly settings: TaxSettings;\n readonly phase: 'runtime';\n readonly [tenantMoneyScopeBrand]: 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\nconst activeRuntimeScopes = new WeakMap<\n object,\n Map<string, TenantMoneyRuntimeScope>\n>();\n\n/**\n * Lock and re-read the tenant's tax settings row before runtime money work,\n * creating it once when missing. Old-format money data is refused first with\n * `COMMERCE_DATA_NEEDS_UPGRADE`.\n */\nexport async function lockTenantMoneyRuntime(\n tx: DatabaseInterface,\n tenantId: string,\n): Promise<TaxSettings> {\n requiredText(tenantId, 'Money tenant');\n await assertTenantMoneyCurrent(tx, tenantId);\n return (await TaxSettingsCollection.create({ db: tx })).lockForTenant(\n tenantId,\n );\n}\n\n/**\n * Run tenant money work under the tenant settings lock on exactly one\n * 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 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 )\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) return operation(active);\n const settings = await lockTenantMoneyRuntime(tx, tenantId);\n const scope = {\n db: tx,\n tenantId,\n settings,\n phase: 'runtime',\n } as TenantMoneyRuntimeScope;\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 * @internal Guard a generated money-document collection read: a tenant whose\n * data predates the current money model is refused before any row is read.\n */\nexport async function withTenantMoneyCollectionRead<T>(\n db: DatabaseInterface,\n tenantId: string,\n operation: (boundDb: DatabaseInterface) => Promise<T>,\n): Promise<T> {\n await assertTenantMoneyCurrent(db, tenantId);\n return operation(db);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqCO,IAAM,cAAN,cAA0B,WAAW;CAE1C,WAAW;CAKX,wBAAwB;CAKxB,2BAA2B;CAM3B,wBAA4D;CAG5D,mBAAwC;;CAGxC,uBAAuB;CAQvB,IAAI,mBAAsC;EACxC,IAAI;GACF,MAAM,QAAiB,KAAK,MAAM,KAAK,oBAAoB;GAC3D,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO,CAAC;GACnC,OAAO,MAAM,QACV,UACC,CAAC,CAAC,SACF,OAAO,UAAU,YACjB,OAAQ,MAA0B,mBAAmB,YACrD,OAAQ,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Q,MAAM,sBAAsB,OAAO,EAAE,IAAI,GAAG,CAAC,EAAA,CAAG,cACtD,QACF;AACF;AAUA,eAAsB,uBACpB,IACA,UACA,WACA,eACY;CACZ,aAAa,UAAU,cAAc;CACrC,IAAI,eAAe;EACjB,IACE,cAAc,UAAU,aACxB,cAAc,OAAO,MACrB,cAAc,aAAa,UAE3B,MAAM,IAAI,qBACR,uBACA,kEACF;EACF,OAAO,UAAU,aAAa;CAChC;CACA,OAAO,6BAA6B,IAAI,OAAO,OAAO;EACpD,MAAM,SAAS,oBAAoB,IAAI,EAAY,CAAA,EAAG,IAAI,QAAQ;EAClE,IAAI,QAAQ,OAAO,UAAU,MAAM;EAEnC,MAAM,QAAQ;GACZ,IAAI;GACJ;GACA,UAAA,MAJqB,uBAAuB,IAAI,QAAQ;GAKxD,OAAO;EACT;EACA,MAAM,SAAS,oBAAoB,IAAI,EAAY,qBAAK,IAAI,IAAI;EAChE,OAAO,IAAI,UAAU,KAAK;EAC1B,oBAAoB,IAAI,IAAc,MAAM;EAC5C,IAAI;GACF,OAAO,MAAM,UAAU,KAAK;EAC9B,UAAE;GACA,OAAO,OAAO,QAAQ;GACtB,IAAI,OAAO,SAAS,GAAG,oBAAoB,OAAO,EAAY;EAChE;CACF,CAAC;AACH;AAMA,eAAsB,8BACpB,IACA,UACA,WACY;CACZ,MAAM,yBAAyB,IAAI,QAAQ;CAC3C,OAAO,UAAU,EAAE;AACrB"}
1
+ {"version":3,"file":"tenant-money-barrier-BdyXIVT5.js","names":[],"sources":["../../src/models/TaxSettings.ts","../../src/tax/identity.ts","../../src/collections/TaxSettingsCollection.ts","../../src/tenant-money-barrier.ts"],"sourcesContent":["import {\n field,\n foreignKey,\n SmrtObject,\n type SmrtSaveOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport {\n getTenantId,\n TenantScoped,\n tenantId,\n} from '@happyvertical/smrt-tenancy';\nimport type { TaxSettingsOptions } from '../types/index.js';\n\nexport interface TaxRegistration {\n taxComponentId: string;\n number: string;\n label: string;\n}\n\n/** Tenant-level defaults and registration numbers for tax determination. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n conflictColumns: ['tenant_id'],\n api: {\n include: ['get', 'create', 'update'],\n writable: [\n 'defaultSalesTaxCodeId',\n 'defaultPurchaseTaxCodeId',\n 'defaultLineAmountType',\n 'taxRoundingScope',\n 'taxRegistrations',\n ],\n },\n mcp: { include: ['get'] },\n cli: { skipApiCheck: true },\n})\nexport class TaxSettings extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-commerce\";\n @tenantId()\n tenantId = '';\n\n @foreignKey('TaxCode', {\n description: 'The default tax code for sales documents.',\n })\n defaultSalesTaxCodeId = '';\n\n @foreignKey('TaxCode', {\n description: 'The default tax code for purchase documents.',\n })\n defaultPurchaseTaxCodeId = '';\n\n @field({\n description:\n 'Whether new document amounts are exclusive, inclusive or out of scope.',\n })\n defaultLineAmountType: 'exclusive' | 'inclusive' | 'none' = 'exclusive';\n\n @field({ description: 'Whether components round per line or per document.' })\n taxRoundingScope: 'line' | 'document' = 'line';\n\n /** Stored JSON is guarded through the typed accessor below. */\n taxRegistrationsJson = '[]';\n\n @field({\n sensitive: true,\n transient: true,\n description:\n 'Registration numbers by tax component, for issued-document snapshots.',\n })\n get taxRegistrations(): TaxRegistration[] {\n try {\n const value: unknown = JSON.parse(this.taxRegistrationsJson);\n if (!Array.isArray(value)) return [];\n return value.filter(\n (entry): entry is TaxRegistration =>\n !!entry &&\n typeof entry === 'object' &&\n typeof (entry as TaxRegistration).taxComponentId === 'string' &&\n typeof (entry as TaxRegistration).number === 'string' &&\n typeof (entry as TaxRegistration).label === 'string',\n );\n } catch {\n return [];\n }\n }\n\n set taxRegistrations(value: TaxRegistration[] | string) {\n this.taxRegistrationsJson =\n typeof value === 'string' ? value : JSON.stringify(value);\n }\n\n constructor(options: TaxSettingsOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.defaultSalesTaxCodeId !== undefined)\n this.defaultSalesTaxCodeId = options.defaultSalesTaxCodeId;\n if (options.defaultPurchaseTaxCodeId !== undefined)\n this.defaultPurchaseTaxCodeId = options.defaultPurchaseTaxCodeId;\n if (options.defaultLineAmountType !== undefined)\n this.defaultLineAmountType = options.defaultLineAmountType;\n if (options.taxRoundingScope !== undefined)\n this.taxRoundingScope = options.taxRoundingScope;\n if (options.taxRegistrations !== undefined)\n this.taxRegistrations = structuredClone(options.taxRegistrations);\n }\n\n override async save(options?: SmrtSaveOptions): Promise<this> {\n if (\n !['exclusive', 'inclusive', 'none'].includes(this.defaultLineAmountType)\n )\n throw new Error('Tax settings defaultLineAmountType is invalid');\n if (!['line', 'document'].includes(this.taxRoundingScope))\n throw new Error('Tax settings taxRoundingScope is invalid');\n const registrations = this.parsedRegistrations();\n if (!registrations)\n throw new Error('Tax registrations must be a valid JSON array');\n if (\n registrations.some(\n (entry) =>\n !entry.taxComponentId || !entry.number.trim() || !entry.label.trim(),\n )\n )\n throw new Error('Tax registrations require component, number and label');\n // A tenant's first settings row must not adopt documents an earlier\n // version wrote: that tenant needs the upgrade, not fresh defaults.\n // The tenant may still be empty here: tenancy stamps it during save.\n const firstTenant = this.isPersisted\n ? ''\n : this.tenantId || getTenantId() || '';\n if (firstTenant) {\n const { assertTenantMoneyCurrent } = await import('../upgrade/detect.js');\n await assertTenantMoneyCurrent(this.db, firstTenant);\n }\n return this.withTransaction(async () => {\n const { TaxCodeCollection } = await import(\n '../collections/TaxCodeCollection.js'\n );\n const { TaxComponentCollection } = await import(\n '../collections/TaxComponentCollection.js'\n );\n const codes = await TaxCodeCollection.create({ db: this.db });\n const components = await TaxComponentCollection.create({ db: this.db });\n for (const id of [\n this.defaultSalesTaxCodeId,\n this.defaultPurchaseTaxCodeId,\n ].filter(Boolean)) {\n const code = await codes.get({ id }, { cache: false });\n if (!code || code.tenantId !== this.tenantId)\n throw new Error(\n 'Tax setting default codes must belong to its tenant',\n );\n }\n for (const registration of registrations) {\n const component = await components.get(\n { id: registration.taxComponentId },\n { cache: false },\n );\n if (!component || component.tenantId !== this.tenantId)\n throw new Error(\n 'Tax setting registrations must belong to its tenant',\n );\n }\n return (await super.save(options)) as this;\n });\n }\n\n private parsedRegistrations(): TaxRegistration[] | null {\n try {\n const value: unknown = JSON.parse(this.taxRegistrationsJson);\n if (!Array.isArray(value)) return null;\n if (\n value.some(\n (entry) =>\n !entry ||\n typeof entry !== 'object' ||\n typeof (entry as TaxRegistration).taxComponentId !== 'string' ||\n typeof (entry as TaxRegistration).number !== 'string' ||\n typeof (entry as TaxRegistration).label !== 'string',\n )\n )\n return null;\n return value as TaxRegistration[];\n } catch {\n return null;\n }\n }\n}\n","/** Stable UUID identities make tenant tax bootstrap retry and race safe. */\nexport async function deterministicTaxId(\n tenantId: string,\n kind: 'code' | 'component' | 'settings' | 'report',\n key: string,\n): Promise<string> {\n if (!tenantId.trim() || !key.trim())\n throw new Error('Tax bootstrap identity requires tenant and key');\n const bytes = new TextEncoder().encode(\n JSON.stringify(['commerce-tax', tenantId, kind, key]),\n );\n const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', bytes));\n const uuid = digest.slice(0, 16);\n uuid[6] = (uuid[6] & 0x0f) | 0x50;\n uuid[8] = (uuid[8] & 0x3f) | 0x80;\n const hex = Array.from(uuid, (byte) => byte.toString(16).padStart(2, '0'));\n const joined = hex.join('');\n return `${joined.slice(0, 8)}-${joined.slice(8, 12)}-${joined.slice(12, 16)}-${joined.slice(16, 20)}-${joined.slice(20)}`;\n}\n\n/** A racing deterministic insert loses safely and reloads the committed row. */\nexport async function createOrLoadTaxSeed<T>(\n create: () => Promise<T>,\n load: () => Promise<T | null | undefined>,\n): Promise<T> {\n for (let attempt = 0; attempt < 3; attempt++) {\n try {\n return await create();\n } catch (error) {\n const code = (error as { code?: unknown } | null)?.code;\n if (code === 'RUNTIME_REVISION_CONFLICT' && attempt < 2) continue;\n if (code !== 'VALIDATION_UNIQUE_CONSTRAINT' && code !== '23505')\n throw error;\n const winner = await load();\n if (!winner) throw error;\n return winner;\n }\n }\n throw new Error('Tax seed retry exhausted');\n}\n","import {\n isEmbeddedDatabase,\n isPostgresDatabase,\n SmrtCollection,\n withEmbeddedWriteTransaction,\n} from '@happyvertical/smrt-core';\nimport type { DatabaseInterface } from '@happyvertical/smrt-core/migrations';\nimport { lockDocumentMoneyParents } from '../document-money-internal.js';\nimport { TaxSettings } from '../models/TaxSettings.js';\nimport { MoneyValidationError } from '../money.js';\nimport { createOrLoadTaxSeed, deterministicTaxId } from '../tax/identity.js';\nimport { assertTenantMoneyCurrent } from '../upgrade/detect.js';\n\n/**\n * Serialize settings-row creation for one tenant on PostgreSQL. The lock is\n * transaction-scoped; embedded engines are already single-writer through the\n * core embedded write queue that every model transaction enters.\n */\nasync function lockTenantSettingsCreation(\n db: DatabaseInterface,\n tenantId: string,\n): Promise<void> {\n if (!isPostgresDatabase(db)) return;\n await db.query(\n 'SELECT pg_advisory_xact_lock(hashtext(CAST(? AS TEXT)))',\n `smrt-commerce-tax-settings:${tenantId}`,\n );\n}\n\n/**\n * @internal Create a tenant's missing settings row exactly once, with the\n * model defaults. Creation serializes on a tenant advisory lock (PostgreSQL)\n * or the embedded write queue and re-reads before inserting, so racing first\n * writers converge on one row. An existing row is never changed.\n */\nexport async function materializeTenantTaxSettings(\n db: DatabaseInterface,\n tenantId: string,\n): Promise<void> {\n const id = await deterministicTaxId(tenantId, 'settings', 'default');\n await withEmbeddedWriteTransaction(db, isEmbeddedDatabase(db), async (tx) => {\n await lockTenantSettingsCreation(tx, tenantId);\n const settings = await TaxSettingsCollection.create({ db: tx });\n if (await settings.getForTenant(tenantId)) return;\n await createOrLoadTaxSeed(\n () => settings.create({ id, tenantId }),\n async () =>\n (await settings.list({ where: { tenantId }, limit: 1 }))[0] ?? null,\n );\n });\n}\n\nexport class TaxSettingsCollection extends SmrtCollection<TaxSettings> {\n static readonly _itemClass = TaxSettings;\n\n /**\n * Load the tenant's settings row, creating it once when missing. A tenant\n * whose stored documents predate tenant tax settings is refused with\n * `COMMERCE_DATA_NEEDS_UPGRADE` rather than given fresh defaults.\n */\n async getOrCreateForTenant(tenantId: string): Promise<TaxSettings> {\n await assertTenantMoneyCurrent(this.db, tenantId);\n const existing = await this.getForTenant(tenantId);\n if (existing) return existing;\n await materializeTenantTaxSettings(this.db, tenantId);\n const created = await this.getForTenant(tenantId);\n if (!created)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant tax settings could not be materialized',\n );\n return created;\n }\n\n async getForTenant(tenantId: string): Promise<TaxSettings | null> {\n const listed = (await this.list({ where: { tenantId }, limit: 1 }))[0];\n if (!listed?.id) return listed ?? null;\n return (await this.get({ id: listed.id }, { cache: false })) ?? null;\n }\n\n /** @internal Lock and re-read the tenant's settings row on this transaction. */\n async lockForTenant(tenantId: string): Promise<TaxSettings> {\n const first = await this.getOrCreateForTenant(tenantId);\n if (!first.id)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant tax settings have no identity',\n );\n await lockDocumentMoneyParents([\n { id: first.id, tenantId, collection: this },\n ]);\n const locked = await this.getForTenant(tenantId);\n if (!locked || locked.id !== first.id)\n throw new MoneyValidationError(\n 'INVALID_MONEY_INPUT',\n 'Tenant tax settings changed while acquiring the lock',\n );\n return locked;\n }\n}\n","/** Tenant serialization point for commerce money runtime work. */\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';\nimport { assertTenantMoneyCurrent } from './upgrade/detect.js';\n\ndeclare const tenantMoneyScopeBrand: unique symbol;\n\n/** Transaction-affine proof that a tenant's settings row is locked on `db`. */\nexport interface TenantMoneyRuntimeScope {\n readonly db: DatabaseInterface;\n readonly tenantId: string;\n readonly settings: TaxSettings;\n readonly phase: 'runtime';\n readonly [tenantMoneyScopeBrand]: 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\nconst activeRuntimeScopes = new WeakMap<\n object,\n Map<string, TenantMoneyRuntimeScope>\n>();\n\n/**\n * Lock and re-read the tenant's tax settings row before runtime money work,\n * creating it once when missing. Old-format money data is refused first with\n * `COMMERCE_DATA_NEEDS_UPGRADE`.\n */\nexport async function lockTenantMoneyRuntime(\n tx: DatabaseInterface,\n tenantId: string,\n): Promise<TaxSettings> {\n requiredText(tenantId, 'Money tenant');\n await assertTenantMoneyCurrent(tx, tenantId);\n return (await TaxSettingsCollection.create({ db: tx })).lockForTenant(\n tenantId,\n );\n}\n\n/**\n * Run tenant money work under the tenant settings lock on exactly one\n * 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 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 )\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) return operation(active);\n const settings = await lockTenantMoneyRuntime(tx, tenantId);\n const scope = {\n db: tx,\n tenantId,\n settings,\n phase: 'runtime',\n } as TenantMoneyRuntimeScope;\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 * @internal Guard a generated money-document collection read: a tenant whose\n * data predates the current money model is refused before any row is read.\n */\nexport async function withTenantMoneyCollectionRead<T>(\n db: DatabaseInterface,\n tenantId: string,\n operation: (boundDb: DatabaseInterface) => Promise<T>,\n): Promise<T> {\n await assertTenantMoneyCurrent(db, tenantId);\n return operation(db);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqCO,IAAM,cAAN,cAA0B,WAAW;CAE1C,WAAW;CAKX,wBAAwB;CAKxB,2BAA2B;CAM3B,wBAA4D;CAG5D,mBAAwC;;CAGxC,uBAAuB;CAQvB,IAAI,mBAAsC;EACxC,IAAI;GACF,MAAM,QAAiB,KAAK,MAAM,KAAK,oBAAoB;GAC3D,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO,CAAC;GACnC,OAAO,MAAM,QACV,UACC,CAAC,CAAC,SACF,OAAO,UAAU,YACjB,OAAQ,MAA0B,mBAAmB,YACrD,OAAQ,MAA0B,WAAW,YAC7C,OAAQ,MAA0B,UAAU,QAChD;EACF,QAAQ;GACN,OAAO,CAAC;EACV;CACF;CAEA,IAAI,iBAAiB,OAAmC;EACtD,KAAK,uBACH,OAAO,UAAU,WAAW,QAAQ,KAAK,UAAU,KAAK;CAC5D;CAEA,YAAY,UAA8B,CAAC,GAAG;EAC5C,MAAM,OAAO;EACb,IAAI,QAAQ,aAAa,KAAA,GAAW,KAAK,WAAW,QAAQ;EAC5D,IAAI,QAAQ,0BAA0B,KAAA,GACpC,KAAK,wBAAwB,QAAQ;EACvC,IAAI,QAAQ,6BAA6B,KAAA,GACvC,KAAK,2BAA2B,QAAQ;EAC1C,IAAI,QAAQ,0BAA0B,KAAA,GACpC,KAAK,wBAAwB,QAAQ;EACvC,IAAI,QAAQ,qBAAqB,KAAA,GAC/B,KAAK,mBAAmB,QAAQ;EAClC,IAAI,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EAAY,qBAAK,IAAI,IAAI;EAChE,OAAO,IAAI,UAAU,KAAK;EAC1B,oBAAoB,IAAI,IAAc,MAAM;EAC5C,IAAI;GACF,OAAO,MAAM,UAAU,KAAK;EAC9B,UAAE;GACA,OAAO,OAAO,QAAQ;GACtB,IAAI,OAAO,SAAS,GAAG,oBAAoB,OAAO,EAAY;EAChE;CACF,CAAC;AACH;AAMA,eAAsB,8BACpB,IACA,UACA,WACY;CACZ,MAAM,yBAAyB,IAAI,QAAQ;CAC3C,OAAO,UAAU,EAAE;AACrB"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * AccountingConnectionCollection - tenant accounting connections (#5136).
3
+ * Writes go through the accounting-connection commands; see
4
+ * `agents/accounting-connection.md`.
5
+ * @packageDocumentation
6
+ */
7
+ import { SmrtCollection } from '@happyvertical/smrt-core';
8
+ import { AccountingConnection, type AccountingConnectionProvider } from '../models/AccountingConnection.js';
9
+ export declare class AccountingConnectionCollection extends SmrtCollection<AccountingConnection> {
10
+ static readonly _itemClass: typeof AccountingConnection;
11
+ /**
12
+ * @internal An unsaved connection for the accounting-connection commands,
13
+ * which own every write (`save()` refuses any other caller).
14
+ */
15
+ build(options: Parameters<SmrtCollection<AccountingConnection>['create']>[0]): Promise<AccountingConnection>;
16
+ /**
17
+ * The tenant's connection for a provider, or `null`.
18
+ *
19
+ * @param args - Tenant and provider
20
+ * @returns The connection or null
21
+ */
22
+ findForTenant(args: {
23
+ tenantId: string;
24
+ provider: AccountingConnectionProvider;
25
+ }): Promise<AccountingConnection | null>;
26
+ }
27
+ //# sourceMappingURL=AccountingConnectionCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountingConnectionCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AccountingConnectionCollection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,KAAK,4BAA4B,EAClC,MAAM,mCAAmC,CAAC;AAE3C,qBAAa,8BAA+B,SAAQ,cAAc,CAAC,oBAAoB,CAAC;IACtF,MAAM,CAAC,QAAQ,CAAC,UAAU,8BAAwB;IAElD;;;OAGG;IACG,KAAK,CACT,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GACrE,OAAO,CAAC,oBAAoB,CAAC;IAIhC;;;;;OAKG;IACG,aAAa,CAAC,IAAI,EAAE;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,4BAA4B,CAAC;KACxC,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;CAWzC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * AccountingMappingCollection - accounting mappings (#5137). Writes go through
3
+ * the accounting-mapping commands; see `agents/accounting-mapping.md`.
4
+ * @packageDocumentation
5
+ */
6
+ import { SmrtCollection } from '@happyvertical/smrt-core';
7
+ import { AccountingMapping, type AccountingMappingKind } from '../models/AccountingMapping.js';
8
+ /** Realm and environment a mapping set belongs to. */
9
+ export interface AccountingMappingScope {
10
+ readonly tenantId: string;
11
+ readonly provider: 'quickbooks';
12
+ readonly realmId: string;
13
+ readonly environment: 'sandbox' | 'production';
14
+ }
15
+ export declare class AccountingMappingCollection extends SmrtCollection<AccountingMapping> {
16
+ static readonly _itemClass: typeof AccountingMapping;
17
+ /** @internal An unsaved mapping for the commands, which own every write. */
18
+ build(options: Parameters<SmrtCollection<AccountingMapping>['create']>[0]): Promise<AccountingMapping>;
19
+ /** The mapping for one local key in a scope, or `null` (any status). */
20
+ findByKey(scope: AccountingMappingScope, kind: AccountingMappingKind, localId: string): Promise<AccountingMapping | null>;
21
+ /** Active mappings in a scope, optionally of one kind. */
22
+ listActive(scope: AccountingMappingScope, kind?: AccountingMappingKind): Promise<AccountingMapping[]>;
23
+ }
24
+ //# sourceMappingURL=AccountingMappingCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountingMappingCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AccountingMappingCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC3B,MAAM,gCAAgC,CAAC;AAExC,sDAAsD;AACtD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,SAAS,GAAG,YAAY,CAAC;CAChD;AAED,qBAAa,2BAA4B,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,UAAU,2BAAqB;IAE/C,4EAA4E;IACtE,KAAK,CACT,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAClE,OAAO,CAAC,iBAAiB,CAAC;IAI7B,wEAAwE;IAClE,SAAS,CACb,KAAK,EAAE,sBAAsB,EAC7B,IAAI,EAAE,qBAAqB,EAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IASpC,0DAA0D;IACpD,UAAU,CACd,KAAK,EAAE,sBAAsB,EAC7B,IAAI,CAAC,EAAE,qBAAqB,GAC3B,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAKhC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Collections for the accounting payment-sync and readback records (#5139).
3
+ * Writes go through `accounting-payment-sync.ts`.
4
+ * @packageDocumentation
5
+ */
6
+ import { SmrtCollection } from '@happyvertical/smrt-core';
7
+ import { AccountingInvoiceReadback, AccountingPaymentSync } from '../models/AccountingSyncRecords.js';
8
+ export declare class AccountingPaymentSyncCollection extends SmrtCollection<AccountingPaymentSync> {
9
+ static readonly _itemClass: typeof AccountingPaymentSync;
10
+ /** @internal An unsaved record for the commands, which own every write. */
11
+ build(options: Parameters<SmrtCollection<AccountingPaymentSync>['create']>[0]): Promise<AccountingPaymentSync>;
12
+ /** The push record for one payment in a company and environment, or `null`. */
13
+ findForPayment(args: {
14
+ tenantId: string;
15
+ realmId: string;
16
+ environment: 'sandbox' | 'production';
17
+ paymentId: string;
18
+ }): Promise<AccountingPaymentSync | null>;
19
+ }
20
+ export declare class AccountingInvoiceReadbackCollection extends SmrtCollection<AccountingInvoiceReadback> {
21
+ static readonly _itemClass: typeof AccountingInvoiceReadback;
22
+ /** @internal An unsaved record for the commands, which own every write. */
23
+ build(options: Parameters<SmrtCollection<AccountingInvoiceReadback>['create']>[0]): Promise<AccountingInvoiceReadback>;
24
+ /** The stored readback of one invoice, or `null`. */
25
+ findForInvoice(tenantId: string, invoiceId: string): Promise<AccountingInvoiceReadback | null>;
26
+ }
27
+ //# sourceMappingURL=AccountingSyncRecordCollections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountingSyncRecordCollections.d.ts","sourceRoot":"","sources":["../../src/collections/AccountingSyncRecordCollections.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,oCAAoC,CAAC;AAE5C,qBAAa,+BAAgC,SAAQ,cAAc,CAAC,qBAAqB,CAAC;IACxF,MAAM,CAAC,QAAQ,CAAC,UAAU,+BAAyB;IAEnD,2EAA2E;IACrE,KAAK,CACT,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GACtE,OAAO,CAAC,qBAAqB,CAAC;IAIjC,+EAA+E;IACzE,cAAc,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,SAAS,GAAG,YAAY,CAAC;QACtC,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;CAQ1C;AAED,qBAAa,mCAAoC,SAAQ,cAAc,CAAC,yBAAyB,CAAC;IAChG,MAAM,CAAC,QAAQ,CAAC,UAAU,mCAA6B;IAEvD,2EAA2E;IACrE,KAAK,CACT,OAAO,EAAE,UAAU,CAAC,cAAc,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1E,OAAO,CAAC,yBAAyB,CAAC;IAIrC,qDAAqD;IAC/C,cAAc,CAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC;CAK7C"}
@@ -2,6 +2,9 @@
2
2
  * Collection exports for smrt-commerce
3
3
  * @packageDocumentation
4
4
  */
5
+ export { AccountingConnectionCollection } from './AccountingConnectionCollection.js';
6
+ export { AccountingMappingCollection } from './AccountingMappingCollection.js';
7
+ export { AccountingInvoiceReadbackCollection, AccountingPaymentSyncCollection, } from './AccountingSyncRecordCollections.js';
5
8
  export { ContractCollection } from './ContractCollection.js';
6
9
  export { ContractLineItemCollection } from './ContractLineItemCollection.js';
7
10
  export { CustomerCollection } from './CustomerCollection.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B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AK,2BAA2B,EAChC,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACL,KAAK,8BAA8B,EACnC,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,GACnC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -61,7 +61,14 @@
61
61
  * @packageDocumentation
62
62
  */
63
63
  import './__smrt-register__.js';
64
+ export * from './accounting-connection.js';
65
+ export * from './accounting-live-gate.js';
66
+ export * from './accounting-mapping.js';
67
+ export * from './accounting-payment-sync.js';
64
68
  export * from './billing/index.js';
69
+ export { AccountingConnectionCollection } from './collections/AccountingConnectionCollection.js';
70
+ export { AccountingMappingCollection } from './collections/AccountingMappingCollection.js';
71
+ export { AccountingInvoiceReadbackCollection, AccountingPaymentSyncCollection, } from './collections/AccountingSyncRecordCollections.js';
65
72
  export { HistoricalCustomerFundsAllocationCollection, HistoricalCustomerFundsCollection, } from './collections/HistoricalCustomerFundsCollections.js';
66
73
  export { HistoricalSalesLineCollection } from './collections/HistoricalSalesLineCollection.js';
67
74
  export { ContractCollection, ContractLineItemCollection, type CreatePayoutFromPaymentArgs, CustomerCollection, DocumentTaxCollection, type DocumentTaxReportFact, type DocumentTaxReportFactsOptions, FulfillmentCollection, FulfillmentLineItemCollection, InvoiceCollection, InvoiceLineItemCollection, type InvoiceNumberOptions, type InvoiceTaxReportFact, type InvoiceTaxReportFactsOptions, PaymentAllocationCollection, PaymentCollection, PaymentInstrumentCollection, PaymentIntentCollection, type PaymentIntentIdempotencyArgs, type PaymentIntentSeed, PayoutCollection, PurchaseContractCollection, type RefreshTaxSummaryReportOptions, SalesContractCollection, TaxCodeCollection, TaxComponentCollection, TaxSettingsCollection, type TaxSummaryContributorDrilldown, type TaxSummaryContributorDrilldownOptions, type TaxSummaryDrilldownContributor, type TaxSummaryDrilldownPending, type TaxSummaryExpenseSource, type TaxSummaryInvoiceDrilldownOptions, type TaxSummaryLedgerDrilldownFact, type TaxSummaryLedgerDrilldownSource, type TaxSummaryLedgerSource, TaxSummaryReportCollection, type TaxSummaryReportMeasure, type TaxSummaryReportRefreshResult, TenantPaymentAccountCollection, UNPAID_STATUSES, VendorCollection, } from './collections/index.js';
@@ -88,6 +95,9 @@ export { bindInvoiceLineSource, type InvoiceSourceBindingHandler, registerInvoic
88
95
  export { type InvoiceEditorStorageEngine, type InvoiceEditorStorageMigrationResult, type InvoiceEditorStoragePreflight, migrateInvoiceEditorStorage, preflightInvoiceEditorStorage, } from './migrations/invoiceEditorStorage.js';
89
96
  export { COMMERCE_MONEY_COLUMNS, COMMERCE_MONEY_MINOR_UNITS_BACKFILL, COMMERCE_NATIVE_UNIT_COLUMNS, migrateCommerceMoneyToMinorUnits, preflightCommerceMoneyMinorUnits, } from './migrations/moneyMinorUnits.js';
90
97
  export { type CommerceContractTypeGroup, type CommercePartyLinkRow, type CommercePartyLinksPreflight, preflightCommercePartyLinks, } from './migrations/partyLinks.js';
98
+ export { AccountingConnection, type AccountingConnectionEnvironment, type AccountingConnectionOptions, type AccountingConnectionProvider, type AccountingConnectionStatus, } from './models/AccountingConnection.js';
99
+ export { AccountingMapping, type AccountingMappingKind, type AccountingMappingOptions, type AccountingMappingStatus, } from './models/AccountingMapping.js';
100
+ export { AccountingInvoiceReadback, AccountingPaymentSync, type AccountingPaymentSyncStatus, type AccountingReadbackStatus, } from './models/AccountingSyncRecords.js';
91
101
  export { HistoricalCustomerFunds, type HistoricalCustomerFundsOptions, } from './models/HistoricalCustomerFunds.js';
92
102
  export { HistoricalCustomerFundsAllocation, type HistoricalCustomerFundsAllocationOptions, } from './models/HistoricalCustomerFundsAllocation.js';
93
103
  export { HistoricalSalesLine, type HistoricalSalesLineOptions, } from './models/HistoricalSalesLine.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,2CAA2C,EAC3C,iCAAiC,GAClC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAC/F,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,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,KAAK,8BAA8B,EACnC,uBAAuB,EAC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