@happyvertical/smrt-commerce 0.58.0 → 0.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/accounting-snapshot-mapper.md +3 -0
- package/agents/quickbooks-pilot.md +56 -0
- package/dist/chunks/{ContractLineItemCollection-D74LbDOI.js → ContractLineItemCollection-BFWJ2e6a.js} +4 -4
- package/dist/chunks/{ContractLineItemCollection-D74LbDOI.js.map → ContractLineItemCollection-BFWJ2e6a.js.map} +1 -1
- package/dist/chunks/{DocumentTaxCollection-BmKyJGZi.js → DocumentTaxCollection-MFfprLH-.js} +9 -9
- package/dist/chunks/{DocumentTaxCollection-BmKyJGZi.js.map → DocumentTaxCollection-MFfprLH-.js.map} +1 -1
- package/dist/chunks/{InvoiceCollection-BPEzXaKm.js → InvoiceCollection-D_8NXuaw.js} +9 -9
- package/dist/chunks/{InvoiceCollection-BPEzXaKm.js.map → InvoiceCollection-D_8NXuaw.js.map} +1 -1
- package/dist/chunks/{TaxCodeCollection-DpQeIqP4.js → TaxCodeCollection-Bc-Z8alx.js} +2 -2
- package/dist/chunks/{TaxCodeCollection-DpQeIqP4.js.map → TaxCodeCollection-Bc-Z8alx.js.map} +1 -1
- package/dist/chunks/{TaxComponentCollection-wFGWOaxy.js → TaxComponentCollection-DUY7A2sU.js} +3 -3
- package/dist/chunks/{TaxComponentCollection-wFGWOaxy.js.map → TaxComponentCollection-DUY7A2sU.js.map} +1 -1
- package/dist/chunks/{allocation-integrity-DgnPec2a.js → allocation-integrity-ri5cUYXB.js} +6 -6
- package/dist/chunks/{allocation-integrity-DgnPec2a.js.map → allocation-integrity-ri5cUYXB.js.map} +1 -1
- package/dist/chunks/{contract-money-BxvY2Kcp.js → contract-money-By1XIzp_.js} +6 -6
- package/dist/chunks/{contract-money-BxvY2Kcp.js.map → contract-money-By1XIzp_.js.map} +1 -1
- package/dist/chunks/{invoice-posting-C1q3CIYz.js → invoice-posting-BfnOyqBR.js} +3 -3
- package/dist/chunks/{invoice-posting-C1q3CIYz.js.map → invoice-posting-BfnOyqBR.js.map} +1 -1
- package/dist/chunks/{retention-accounting-BAKsmbwJ.js → retention-accounting-CASwH8OH.js} +239 -74
- package/dist/chunks/retention-accounting-CASwH8OH.js.map +1 -0
- package/dist/chunks/{tenant-money-barrier-j1m0r6pe.js → tenant-money-barrier-BbbInDGP.js} +3 -3
- package/dist/chunks/{tenant-money-barrier-j1m0r6pe.js.map → tenant-money-barrier-BbbInDGP.js.map} +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/invoice-accounting-sync.d.ts +33 -1
- package/dist/invoice-accounting-sync.d.ts.map +1 -1
- package/dist/invoices.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/quickbooks-pilot-evidence.d.ts +47 -0
- package/dist/quickbooks-pilot-evidence.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +3 -3
- package/package.json +13 -13
- package/dist/chunks/retention-accounting-BAKsmbwJ.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-
|
|
67
|
-
const { TaxComponentCollection } = await import("./TaxComponentCollection-
|
|
66
|
+
const { TaxCodeCollection } = await import("./TaxCodeCollection-Bc-Z8alx.js").then((n) => n.n);
|
|
67
|
+
const { TaxComponentCollection } = await import("./TaxComponentCollection-DUY7A2sU.js").then((n) => n.n);
|
|
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-
|
|
255
|
+
//# sourceMappingURL=tenant-money-barrier-BbbInDGP.js.map
|
package/dist/chunks/{tenant-money-barrier-j1m0r6pe.js.map → tenant-money-barrier-BbbInDGP.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant-money-barrier-j1m0r6pe.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,MAA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MAAM,IAAI,qBACR,uBACA,GAAG,MAAK,mCACV;CACF,OAAO;AACT;AAEA,IAAM,sCAAsB,IAAI,QAG9B;AAOF,eAAsB,uBACpB,IACA,UACsB;CACtB,aAAa,UAAU,cAAc;CACrC,MAAM,yBAAyB,IAAI,QAAQ;CAC3C,QAAQ,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-BbbInDGP.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;E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,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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ export type * from './historical-customer-funds-types.js';
|
|
|
78
78
|
export { getHistoricalSalesMoney, readHistoricalSalesLines, recordHistoricalSalesMoney, validateHistoricalSalesMoneyFacts, } from './historical-sales-money.js';
|
|
79
79
|
export { type HistoricalSalesHeaderReportFact, HistoricalSalesTaxClassificationRequired, listHistoricalSalesHeaderFacts, } from './historical-sales-reports.js';
|
|
80
80
|
export type * from './historical-sales-types.js';
|
|
81
|
-
export { type FrozenAccountingReconciliationReady, type FrozenAccountingSyncResult, type FrozenInvoiceAccountingInput, type FrozenInvoiceAccountingOptions, type FrozenInvoiceAccountingSnapshot, loadFrozenInvoiceAccountingSnapshot, type QuickBooksFrozenInvoiceMapping, type ReconcileFrozenInvoiceAccountingInput, readFrozenAccountingSyncState, reconcileFrozenInvoiceAccountingSync, type SyncFrozenInvoiceToAccountingInput, syncFrozenInvoiceToAccounting, toFrozenInvoiceAccountingInput, } from './invoice-accounting-sync.js';
|
|
81
|
+
export { type FrozenAccountingReconciliationReady, type FrozenAccountingSyncResult, type FrozenInvoiceAccountingInput, type FrozenInvoiceAccountingOptions, type FrozenInvoiceAccountingSnapshot, loadFrozenInvoiceAccountingSnapshot, type QuickBooksFrozenInvoiceMapping, type QuickBooksPilotCommand, type QuickBooksPilotFixture, type ReconcileFrozenInvoiceAccountingInput, readFrozenAccountingSyncState, reconcileFrozenInvoiceAccountingSync, runQuickBooksPilot, type SyncFrozenInvoiceToAccountingInput, syncFrozenInvoiceToAccounting, toFrozenInvoiceAccountingInput, } from './invoice-accounting-sync.js';
|
|
82
82
|
export { type InvoiceMcpGetResult, serializeInvoiceMcpGet, } from './invoice-mcp.js';
|
|
83
83
|
export { type InvoiceRecordCreditNote, type InvoiceRecordScreenData, type InvoiceRecordStoredTotals, type InvoiceRecordTaxComponent, invoiceRecordStoredTotals, type LoadInvoiceRecordScreenDataInput, loadInvoiceRecordScreenData, } from './invoice-record-screen.js';
|
|
84
84
|
export { configureInvoiceRetention, type InvoiceRetentionCommand, releaseInvoiceRetention, } from './invoice-retention.js';
|
|
@@ -94,6 +94,7 @@ export { assertIntegerMinorUnits, calculateMoneyDocument, type LineAmountType, t
|
|
|
94
94
|
export * from './observed-purchase-price.js';
|
|
95
95
|
export { loadOrdinaryCreditAccountingSnapshot, type OrdinaryCreditReviewScope, type OrdinaryInvoiceAccountingState, type ReconcileOrdinaryAccountingStepInput, type ReconcileOrdinaryCreditAccountingInput, readOrdinaryInvoiceAccountingState, reconcileOrdinaryAccountingStep, reconcileOrdinaryBaseInvoice, reconcileOrdinaryCreditAccounting, type SyncOrdinaryCreditToAccountingInput, type SyncOrdinaryInvoiceToAccountingInput, type SyncOrdinaryRefundToAccountingInput, syncOrdinaryCreditToAccounting, syncOrdinaryInvoiceToAccounting, syncOrdinaryRefundToAccounting, toOrdinaryCreditAccountingInput, } from './ordinary-accounting.js';
|
|
96
96
|
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';
|
|
97
|
+
export { type QuickBooksPilotAcceptance, type QuickBooksPilotInvoiceEvidence, type QuickBooksPilotProjection, type QuickBooksPilotScope, type QuickBooksPilotTransaction, quickBooksPilotInvoiceId, } from './quickbooks-pilot-evidence.js';
|
|
97
98
|
export { getReceivedPurchaseMoney, getReceivedSalesContractMoney, type ReceivedPurchaseMoneyFacts, type ReceivedPurchaseMoneyLine, type ReceivedPurchaseMoneySnapshot, type ReceivedPurchaseQuoteSource, ReceivedPurchaseTaxClassificationRequired, type ReceivedPurchaseTaxComponent, type ReceivedSalesContractMoneyFacts, type ReceivedSalesContractMoneySnapshot, type RecordReceivedPurchaseMoneyInput, type RecordReceivedSalesContractMoneyInput, recordReceivedPurchaseMoney, recordReceivedSalesContractMoney, validateReceivedPurchaseMoneyFacts, } from './received-purchase-money.js';
|
|
98
99
|
export { AgreementsRecipe, CustomersRecipe, EstimatesRecipe, FulfillmentRecipe, InvoicingRecipe, LeasesRecipe, LicensesRecipe, PurchasesRecipe, SalesRecipe, VendorsRecipe, WholesaleRecipe, } from './recipes.js';
|
|
99
100
|
export type { ReconcileRetainedAccountingStepInput, ReconcileRetainedCreditAccountingInput, ReleaseRetainedInvoiceToAccountingInput, RetainedInvoiceAccountingState, SyncRetainedCreditToAccountingInput, SyncRetainedInvoiceToAccountingInput, SyncRetainedRefundToAccountingInput, } from './retention-accounting.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAKH,OAAO,wBA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