@happyvertical/smrt-commerce 0.56.2 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/AGENTS.md +24 -11
  2. package/README.md +137 -89
  3. package/agents/accounting-snapshot-mapper.md +3 -3
  4. package/agents/commercial-ui.md +2 -2
  5. package/agents/contract-money.md +9 -12
  6. package/agents/cost-billing.md +3 -6
  7. package/agents/customer-vendor-ui.md +1 -2
  8. package/agents/document-money.md +58 -31
  9. package/agents/invoice-calculations.md +31 -56
  10. package/agents/invoice-preparation.md +62 -73
  11. package/agents/invoice-quantity.md +9 -21
  12. package/agents/minor-unit-migration.md +4 -4
  13. package/agents/money-calculator.md +7 -8
  14. package/agents/money-model.md +18 -22
  15. package/agents/money-upgrade.md +92 -0
  16. package/agents/revenue-journal.md +2 -2
  17. package/agents/tax-codes.md +17 -14
  18. package/agents/tax-summary.md +8 -6
  19. package/dist/billing/period-close.d.ts.map +1 -1
  20. package/dist/billing/runtime.d.ts +5 -2
  21. package/dist/billing/runtime.d.ts.map +1 -1
  22. package/dist/chunks/{ContractLineItemCollection--BrGMtNz.js → ContractLineItemCollection-BZcrlrrY.js} +19 -24
  23. package/dist/chunks/ContractLineItemCollection-BZcrlrrY.js.map +1 -0
  24. package/dist/chunks/{CustomerCollection-CjGaZSpf.js → CustomerCollection-BIPH2ZUx.js} +2 -2
  25. package/dist/chunks/{CustomerCollection-CjGaZSpf.js.map → CustomerCollection-BIPH2ZUx.js.map} +1 -1
  26. package/dist/chunks/{DocumentTaxCollection-KOkaQT2M.js → DocumentTaxCollection-DDzlywMW.js} +14 -7
  27. package/dist/chunks/DocumentTaxCollection-DDzlywMW.js.map +1 -0
  28. package/dist/chunks/{InvoiceCollection-BUe_8FT1.js → InvoiceCollection-cinzAqt6.js} +50 -161
  29. package/dist/chunks/InvoiceCollection-cinzAqt6.js.map +1 -0
  30. package/dist/chunks/{TaxCodeCollection-DF2eaJed.js → TaxCodeCollection-DaBOPG9c.js} +11 -4
  31. package/dist/chunks/{TaxCodeCollection-DF2eaJed.js.map → TaxCodeCollection-DaBOPG9c.js.map} +1 -1
  32. package/dist/chunks/{TaxComponentCollection-3x24xSNh.js → TaxComponentCollection-C4zxnyVu.js} +3 -3
  33. package/dist/chunks/{TaxComponentCollection-3x24xSNh.js.map → TaxComponentCollection-C4zxnyVu.js.map} +1 -1
  34. package/dist/chunks/VendorCollection-D6ZcUYy8.js +100 -0
  35. package/dist/chunks/VendorCollection-D6ZcUYy8.js.map +1 -0
  36. package/dist/chunks/{allocation-integrity-Cq0g6CfO.js → allocation-integrity-WmWyXhtG.js} +6 -6
  37. package/dist/chunks/{allocation-integrity-Cq0g6CfO.js.map → allocation-integrity-WmWyXhtG.js.map} +1 -1
  38. package/dist/chunks/calculations-C9daQLsh.js +82 -0
  39. package/dist/chunks/calculations-C9daQLsh.js.map +1 -0
  40. package/dist/chunks/contract-money-EuToOghh.js +301 -0
  41. package/dist/chunks/contract-money-EuToOghh.js.map +1 -0
  42. package/dist/chunks/detect-CY9ufaFb.js +328 -0
  43. package/dist/chunks/detect-CY9ufaFb.js.map +1 -0
  44. package/dist/chunks/{document-money-oUDvdjOf.js → document-money-DV5t4vlK.js} +388 -62
  45. package/dist/chunks/document-money-DV5t4vlK.js.map +1 -0
  46. package/dist/chunks/{invoice-posting-CF3fE_Ec.js → invoice-posting-C2i5dOVZ.js} +20 -22
  47. package/dist/chunks/invoice-posting-C2i5dOVZ.js.map +1 -0
  48. package/dist/chunks/{revenue-journal-DY9fro8E.js → revenue-journal-LLA9Kh_i.js} +3 -14
  49. package/dist/chunks/revenue-journal-LLA9Kh_i.js.map +1 -0
  50. package/dist/chunks/tenant-money-barrier-6TlqUeVj.js +255 -0
  51. package/dist/chunks/tenant-money-barrier-6TlqUeVj.js.map +1 -0
  52. package/dist/chunks/types-Bbm0Xflc.js.map +1 -1
  53. package/dist/chunks/{units-CNcjH_eE.js → units-8ElbjVZK.js} +18 -3
  54. package/dist/chunks/units-8ElbjVZK.js.map +1 -0
  55. package/dist/collections/ContractCollection.d.ts.map +1 -1
  56. package/dist/collections/ContractLineItemCollection.d.ts.map +1 -1
  57. package/dist/collections/InvoiceCollection.d.ts.map +1 -1
  58. package/dist/collections/InvoiceLineItemCollection.d.ts +0 -30
  59. package/dist/collections/InvoiceLineItemCollection.d.ts.map +1 -1
  60. package/dist/collections/TaxCodeCollection.d.ts +5 -1
  61. package/dist/collections/TaxCodeCollection.d.ts.map +1 -1
  62. package/dist/collections/TaxSettingsCollection.d.ts +15 -8
  63. package/dist/collections/TaxSettingsCollection.d.ts.map +1 -1
  64. package/dist/collections/TaxSummaryReportCollection.d.ts +3 -3
  65. package/dist/collections/TaxSummaryReportCollection.d.ts.map +1 -1
  66. package/dist/collections/index.d.ts +0 -1
  67. package/dist/collections/index.d.ts.map +1 -1
  68. package/dist/commerce-money-tools.d.ts.map +1 -1
  69. package/dist/contract-money.d.ts +1 -13
  70. package/dist/contract-money.d.ts.map +1 -1
  71. package/dist/document-money-internal.d.ts +7 -3
  72. package/dist/document-money-internal.d.ts.map +1 -1
  73. package/dist/document-money.d.ts +1 -11
  74. package/dist/document-money.d.ts.map +1 -1
  75. package/dist/index.d.ts +6 -5
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +667 -1650
  78. package/dist/index.js.map +1 -1
  79. package/dist/invoice-accounting-sync.d.ts.map +1 -1
  80. package/dist/invoice-mcp.d.ts +3 -3
  81. package/dist/invoice-mcp.d.ts.map +1 -1
  82. package/dist/invoice-posting.d.ts +11 -5
  83. package/dist/invoice-posting.d.ts.map +1 -1
  84. package/dist/invoice-record-screen.d.ts +1 -1
  85. package/dist/invoice-record-screen.d.ts.map +1 -1
  86. package/dist/invoices.d.ts +6 -1
  87. package/dist/invoices.d.ts.map +1 -1
  88. package/dist/invoices.js +2 -2
  89. package/dist/manifest.json +37 -765
  90. package/dist/migrations/invoiceEditorStorage.d.ts +2 -4
  91. package/dist/migrations/invoiceEditorStorage.d.ts.map +1 -1
  92. package/dist/models/Contract.d.ts.map +1 -1
  93. package/dist/models/ContractLineItem.d.ts +6 -22
  94. package/dist/models/ContractLineItem.d.ts.map +1 -1
  95. package/dist/models/Invoice.d.ts +18 -48
  96. package/dist/models/Invoice.d.ts.map +1 -1
  97. package/dist/models/InvoiceLineItem.d.ts +8 -37
  98. package/dist/models/InvoiceLineItem.d.ts.map +1 -1
  99. package/dist/models/TaxSettings.d.ts +0 -10
  100. package/dist/models/TaxSettings.d.ts.map +1 -1
  101. package/dist/models/index.d.ts +0 -1
  102. package/dist/models/index.d.ts.map +1 -1
  103. package/dist/playground.js +1 -1
  104. package/dist/playground.js.map +1 -1
  105. package/dist/recipes.d.ts +8 -11
  106. package/dist/recipes.d.ts.map +1 -1
  107. package/dist/revenue-journal.d.ts +0 -8
  108. package/dist/revenue-journal.d.ts.map +1 -1
  109. package/dist/smrt-knowledge.json +79 -661
  110. package/dist/svelte/components/InvoiceEditor.svelte +7 -148
  111. package/dist/svelte/components/InvoiceEditor.svelte.d.ts +4 -1
  112. package/dist/svelte/components/InvoiceEditor.svelte.d.ts.map +1 -1
  113. package/dist/svelte/components/InvoiceTotals.svelte +14 -118
  114. package/dist/svelte/components/InvoiceTotals.svelte.d.ts +4 -27
  115. package/dist/svelte/components/InvoiceTotals.svelte.d.ts.map +1 -1
  116. package/dist/svelte/components/MoneyInvoiceEditor.svelte +3 -23
  117. package/dist/svelte/components/MoneyInvoiceEditor.svelte.d.ts +3 -26
  118. package/dist/svelte/components/MoneyInvoiceEditor.svelte.d.ts.map +1 -1
  119. package/dist/svelte/index.d.ts +2 -3
  120. package/dist/svelte/index.d.ts.map +1 -1
  121. package/dist/svelte/index.js +1 -2
  122. package/dist/svelte/invoices/calculations.d.ts +3 -108
  123. package/dist/svelte/invoices/calculations.d.ts.map +1 -1
  124. package/dist/svelte/invoices/calculations.js +12 -309
  125. package/dist/svelte/invoices/messages.d.ts +1 -37
  126. package/dist/svelte/invoices/messages.d.ts.map +1 -1
  127. package/dist/svelte/invoices/messages.js +1 -37
  128. package/dist/svelte/invoices/money-editor.d.ts +1 -1
  129. package/dist/svelte/invoices/money-editor.d.ts.map +1 -1
  130. package/dist/svelte/invoices/types.d.ts +14 -114
  131. package/dist/svelte/invoices/types.d.ts.map +1 -1
  132. package/dist/svelte/playground/InvoicePreparationPreview.svelte +85 -94
  133. package/dist/svelte/playground/InvoicePreparationPreview.svelte.d.ts.map +1 -1
  134. package/dist/svelte/playground.js +1 -1
  135. package/dist/tax/index.d.ts +2 -1
  136. package/dist/tax/index.d.ts.map +1 -1
  137. package/dist/tax/standard-codes.d.ts +12 -0
  138. package/dist/tax/standard-codes.d.ts.map +1 -0
  139. package/dist/tax/tenant-bootstrap.d.ts +29 -0
  140. package/dist/tax/tenant-bootstrap.d.ts.map +1 -0
  141. package/dist/tenant-money-barrier.d.ts +12 -44
  142. package/dist/tenant-money-barrier.d.ts.map +1 -1
  143. package/dist/types/index.d.ts +10 -23
  144. package/dist/types/index.d.ts.map +1 -1
  145. package/dist/ui.js +1 -1
  146. package/dist/ui.js.map +1 -1
  147. package/dist/upgrade/detect.d.ts +129 -0
  148. package/dist/upgrade/detect.d.ts.map +1 -0
  149. package/dist/upgrade/money-v2.d.ts +81 -0
  150. package/dist/upgrade/money-v2.d.ts.map +1 -0
  151. package/package.json +14 -13
  152. package/agents/line-amount-migration.md +0 -50
  153. package/dist/chunks/ContractLineItemCollection--BrGMtNz.js.map +0 -1
  154. package/dist/chunks/DocumentTaxCollection-KOkaQT2M.js.map +0 -1
  155. package/dist/chunks/InvoiceCollection-BUe_8FT1.js.map +0 -1
  156. package/dist/chunks/InvoiceLineItemCollection-CPQGghyd.js +0 -468
  157. package/dist/chunks/InvoiceLineItemCollection-CPQGghyd.js.map +0 -1
  158. package/dist/chunks/TaxSettingsCollection-DYYF-In-.js +0 -319
  159. package/dist/chunks/TaxSettingsCollection-DYYF-In-.js.map +0 -1
  160. package/dist/chunks/calculations-DaHR17il.js +0 -333
  161. package/dist/chunks/calculations-DaHR17il.js.map +0 -1
  162. package/dist/chunks/document-money-oUDvdjOf.js.map +0 -1
  163. package/dist/chunks/invoice-posting-CF3fE_Ec.js.map +0 -1
  164. package/dist/chunks/revenue-journal-DY9fro8E.js.map +0 -1
  165. package/dist/chunks/tenant-money-barrier-y6EAa6vY.js +0 -135
  166. package/dist/chunks/tenant-money-barrier-y6EAa6vY.js.map +0 -1
  167. package/dist/chunks/units-CNcjH_eE.js.map +0 -1
  168. package/dist/collections/MoneyMigrationDocumentCollection.d.ts +0 -12
  169. package/dist/collections/MoneyMigrationDocumentCollection.d.ts.map +0 -1
  170. package/dist/migrations/commerceLineAmounts.d.ts +0 -84
  171. package/dist/migrations/commerceLineAmounts.d.ts.map +0 -1
  172. package/dist/models/MoneyMigrationDocument.d.ts +0 -28
  173. package/dist/models/MoneyMigrationDocument.d.ts.map +0 -1
  174. package/dist/svelte/components/InvoiceLineEditor.svelte +0 -92
  175. package/dist/svelte/components/InvoiceLineEditor.svelte.d.ts +0 -8
  176. package/dist/svelte/components/InvoiceLineEditor.svelte.d.ts.map +0 -1
  177. package/dist/svelte/invoices/fields.d.ts +0 -6
  178. package/dist/svelte/invoices/fields.d.ts.map +0 -1
  179. package/dist/svelte/invoices/fields.js +0 -22
  180. package/dist/tax/legacy.d.ts +0 -48
  181. package/dist/tax/legacy.d.ts.map +0 -1
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-commerce",
5
- "packageVersion": "0.56.2",
5
+ "packageVersion": "0.57.0",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-commerce:ContractCollection": {
8
8
  "name": "contractcollection",
@@ -556,7 +556,7 @@
556
556
  "collectionExportName": "ContractLineItemCollectionCollection",
557
557
  "schema": {
558
558
  "tableName": "contract_line_items",
559
- "ddl": "CREATE TABLE IF NOT EXISTS \"contract_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"description\" TEXT DEFAULT '',\n \"quantity\" REAL DEFAULT 1,\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"discount_type\" TEXT DEFAULT 'none',\n \"discount_rate\" REAL,\n \"tax_rate\" REAL DEFAULT 0,\n \"tax_mode\" TEXT DEFAULT 'inherit',\n \"tax_code_id\" UUID,\n \"tax_code_code\" TEXT,\n \"tax_code_name\" TEXT,\n \"tax_components_json\" TEXT,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"legacy_amount\" INTEGER,\n \"money_snapshot_id\" TEXT,\n \"amount\" INTEGER DEFAULT 0,\n \"product_id\" UUID,\n \"sku\" TEXT DEFAULT '',\n \"start_date\" TIMESTAMP,\n \"end_date\" TIMESTAMP,\n \"billing_period\" TEXT DEFAULT '',\n \"sort_order\" INTEGER DEFAULT 0\n);",
559
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contract_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"description\" TEXT DEFAULT '',\n \"quantity\" REAL DEFAULT 1,\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"discount_type\" TEXT DEFAULT 'none',\n \"discount_rate\" REAL,\n \"tax_rate\" REAL DEFAULT 0,\n \"tax_mode\" TEXT DEFAULT 'inherit',\n \"tax_code_id\" UUID,\n \"tax_code_code\" TEXT,\n \"tax_code_name\" TEXT,\n \"tax_components_json\" TEXT,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"money_snapshot_id\" TEXT,\n \"amount\" INTEGER DEFAULT 0,\n \"product_id\" UUID,\n \"sku\" TEXT DEFAULT '',\n \"start_date\" TIMESTAMP,\n \"end_date\" TIMESTAMP,\n \"billing_period\" TEXT DEFAULT '',\n \"sort_order\" INTEGER DEFAULT 0\n);",
560
560
  "columns": {
561
561
  "id": {
562
562
  "type": "UUID",
@@ -674,10 +674,6 @@
674
674
  "notNull": false,
675
675
  "default": 0
676
676
  },
677
- "legacy_amount": {
678
- "type": "INTEGER",
679
- "notNull": false
680
- },
681
677
  "money_snapshot_id": {
682
678
  "type": "TEXT",
683
679
  "notNull": false
@@ -760,7 +756,7 @@
760
756
  ]
761
757
  }
762
758
  ],
763
- "version": "51d46553"
759
+ "version": "ef59fe1c"
764
760
  },
765
761
  "importPath": "@happyvertical/smrt-commerce"
766
762
  },
@@ -2499,34 +2495,6 @@
2499
2495
  "isStatic": false,
2500
2496
  "isPublic": true
2501
2497
  },
2502
- "getSubtotalForInvoice": {
2503
- "name": "getSubtotalForInvoice",
2504
- "async": true,
2505
- "parameters": [
2506
- {
2507
- "name": "invoiceId",
2508
- "type": "string",
2509
- "optional": false
2510
- }
2511
- ],
2512
- "returnType": "Promise<number>",
2513
- "isStatic": false,
2514
- "isPublic": true
2515
- },
2516
- "getTaxForInvoice": {
2517
- "name": "getTaxForInvoice",
2518
- "async": true,
2519
- "parameters": [
2520
- {
2521
- "name": "invoiceId",
2522
- "type": "string",
2523
- "optional": false
2524
- }
2525
- ],
2526
- "returnType": "Promise<number>",
2527
- "isStatic": false,
2528
- "isPublic": true
2529
- },
2530
2498
  "getNextSortOrder": {
2531
2499
  "name": "getNextSortOrder",
2532
2500
  "async": true,
@@ -2541,34 +2509,6 @@
2541
2509
  "isStatic": false,
2542
2510
  "isPublic": true
2543
2511
  },
2544
- "recalculateAmounts": {
2545
- "name": "recalculateAmounts",
2546
- "async": true,
2547
- "parameters": [
2548
- {
2549
- "name": "invoiceId",
2550
- "type": "string",
2551
- "optional": false
2552
- }
2553
- ],
2554
- "returnType": "Promise<InvoiceLineItem[]>",
2555
- "isStatic": false,
2556
- "isPublic": true
2557
- },
2558
- "toAccountingLineItems": {
2559
- "name": "toAccountingLineItems",
2560
- "async": true,
2561
- "parameters": [
2562
- {
2563
- "name": "invoiceId",
2564
- "type": "string",
2565
- "optional": false
2566
- }
2567
- ],
2568
- "returnType": "Promise<AccountingLineItemInput[]>",
2569
- "isStatic": false,
2570
- "isPublic": true
2571
- },
2572
2512
  "findByTenant": {
2573
2513
  "name": "findByTenant",
2574
2514
  "async": true,
@@ -2629,7 +2569,7 @@
2629
2569
  "collectionExportName": "InvoiceLineItemCollectionCollection",
2630
2570
  "schema": {
2631
2571
  "tableName": "invoice_line_items",
2632
- "ddl": "CREATE TABLE IF NOT EXISTS \"invoice_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"invoice_id\" UUID,\n \"credited_line_id\" UUID,\n \"credit_calculation_basis_json\" TEXT,\n \"description\" TEXT DEFAULT '',\n \"sku\" TEXT DEFAULT '',\n \"product_id\" UUID,\n \"quantity\" REAL DEFAULT 1,\n \"invoice_editor_state_json\" TEXT DEFAULT '',\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"discount_type\" TEXT DEFAULT 'none',\n \"discount_rate\" REAL,\n \"tax_rate\" REAL DEFAULT 0,\n \"tax_mode\" TEXT DEFAULT 'inherit',\n \"tax_code_id\" UUID,\n \"tax_code_code\" TEXT,\n \"tax_code_name\" TEXT,\n \"tax_components_json\" TEXT,\n \"tax_amount\" INTEGER NOT NULL DEFAULT 0,\n \"legacy_amount\" INTEGER,\n \"money_snapshot_id\" TEXT,\n \"amount\" INTEGER DEFAULT 0,\n \"source_type\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"revenue_account_id\" UUID,\n \"sort_order\" INTEGER DEFAULT 0\n);",
2572
+ "ddl": "CREATE TABLE IF NOT EXISTS \"invoice_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"invoice_id\" UUID,\n \"credited_line_id\" UUID,\n \"credit_calculation_basis_json\" TEXT,\n \"description\" TEXT DEFAULT '',\n \"sku\" TEXT DEFAULT '',\n \"product_id\" UUID,\n \"quantity\" REAL DEFAULT 1,\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"discount_type\" TEXT DEFAULT 'none',\n \"discount_rate\" REAL,\n \"tax_rate\" REAL DEFAULT 0,\n \"tax_mode\" TEXT DEFAULT 'inherit',\n \"tax_code_id\" UUID,\n \"tax_code_code\" TEXT,\n \"tax_code_name\" TEXT,\n \"tax_components_json\" TEXT,\n \"tax_amount\" INTEGER NOT NULL DEFAULT 0,\n \"money_snapshot_id\" TEXT,\n \"amount\" INTEGER DEFAULT 0,\n \"source_type\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"revenue_account_id\" UUID,\n \"sort_order\" INTEGER DEFAULT 0\n);",
2633
2573
  "columns": {
2634
2574
  "id": {
2635
2575
  "type": "UUID",
@@ -2715,12 +2655,6 @@
2715
2655
  "unique": false,
2716
2656
  "default": 1
2717
2657
  },
2718
- "invoice_editor_state_json": {
2719
- "type": "TEXT",
2720
- "notNull": false,
2721
- "unique": false,
2722
- "default": ""
2723
- },
2724
2658
  "unit_price": {
2725
2659
  "type": "INTEGER",
2726
2660
  "notNull": false,
@@ -2789,11 +2723,6 @@
2789
2723
  "unique": false,
2790
2724
  "default": 0
2791
2725
  },
2792
- "legacy_amount": {
2793
- "type": "INTEGER",
2794
- "notNull": false,
2795
- "unique": false
2796
- },
2797
2726
  "money_snapshot_id": {
2798
2727
  "type": "TEXT",
2799
2728
  "notNull": false,
@@ -2889,172 +2818,7 @@
2889
2818
  ]
2890
2819
  }
2891
2820
  ],
2892
- "version": "76aa2ef6"
2893
- },
2894
- "importPath": "@happyvertical/smrt-commerce"
2895
- },
2896
- "@happyvertical/smrt-commerce:MoneyMigrationDocumentCollection": {
2897
- "name": "moneymigrationdocumentcollection",
2898
- "className": "MoneyMigrationDocumentCollection",
2899
- "qualifiedName": "@happyvertical/smrt-commerce:MoneyMigrationDocumentCollection",
2900
- "collection": "moneymigrationdocuments",
2901
- "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/collections/MoneyMigrationDocumentCollection.ts",
2902
- "packageName": "@happyvertical/smrt-commerce",
2903
- "fields": {},
2904
- "methods": {
2905
- "findDocument": {
2906
- "name": "findDocument",
2907
- "async": true,
2908
- "parameters": [
2909
- {
2910
- "name": "input",
2911
- "type": "object",
2912
- "optional": false,
2913
- "memberTypes": [
2914
- "string",
2915
- "'invoice' | 'contract'"
2916
- ]
2917
- }
2918
- ],
2919
- "returnType": "Promise<MoneyMigrationDocument | null>",
2920
- "isStatic": false,
2921
- "isPublic": true
2922
- }
2923
- },
2924
- "decoratorConfig": {
2925
- "tableName": "commerce_money_migration_documents",
2926
- "api": false,
2927
- "mcp": false,
2928
- "cli": false
2929
- },
2930
- "extends": "SmrtCollection",
2931
- "extendsTypeArg": "MoneyMigrationDocument",
2932
- "exportName": "MoneyMigrationDocumentCollection",
2933
- "collectionExportName": "MoneyMigrationDocumentCollectionCollection",
2934
- "schema": {
2935
- "tableName": "commerce_money_migration_documents",
2936
- "ddl": "CREATE TABLE IF NOT EXISTS \"commerce_money_migration_documents\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"migration_id\" TEXT,\n \"document_type\" TEXT DEFAULT 'invoice',\n \"document_id\" TEXT,\n \"state\" TEXT DEFAULT 'prepared',\n \"pre_image_json\" TEXT,\n \"pre_checksum\" TEXT,\n \"post_image_json\" TEXT,\n \"post_checksum\" TEXT\n);",
2937
- "columns": {
2938
- "id": {
2939
- "type": "UUID",
2940
- "primaryKey": true,
2941
- "referenceKind": "id",
2942
- "notNull": true
2943
- },
2944
- "slug": {
2945
- "type": "TEXT",
2946
- "notNull": true
2947
- },
2948
- "context": {
2949
- "type": "TEXT",
2950
- "notNull": true,
2951
- "default": ""
2952
- },
2953
- "created_at": {
2954
- "type": "TIMESTAMP",
2955
- "notNull": true,
2956
- "default": "current_timestamp"
2957
- },
2958
- "updated_at": {
2959
- "type": "TIMESTAMP",
2960
- "notNull": true,
2961
- "default": "current_timestamp"
2962
- },
2963
- "tenant_id": {
2964
- "type": "UUID",
2965
- "referenceKind": "tenantId",
2966
- "notNull": true,
2967
- "unique": false
2968
- },
2969
- "migration_id": {
2970
- "type": "TEXT",
2971
- "notNull": false,
2972
- "unique": false
2973
- },
2974
- "document_type": {
2975
- "type": "TEXT",
2976
- "notNull": false,
2977
- "unique": false,
2978
- "default": "invoice"
2979
- },
2980
- "document_id": {
2981
- "type": "TEXT",
2982
- "notNull": false,
2983
- "unique": false
2984
- },
2985
- "state": {
2986
- "type": "TEXT",
2987
- "notNull": false,
2988
- "unique": false,
2989
- "default": "prepared"
2990
- },
2991
- "pre_image_json": {
2992
- "type": "TEXT",
2993
- "notNull": false,
2994
- "unique": false
2995
- },
2996
- "pre_checksum": {
2997
- "type": "TEXT",
2998
- "notNull": false,
2999
- "unique": false
3000
- },
3001
- "post_image_json": {
3002
- "type": "TEXT",
3003
- "notNull": false,
3004
- "unique": false
3005
- },
3006
- "post_checksum": {
3007
- "type": "TEXT",
3008
- "notNull": false,
3009
- "unique": false
3010
- }
3011
- },
3012
- "indexes": [
3013
- {
3014
- "name": "commerce_money_migration_documents_tenant_id_migration_id_idx",
3015
- "columns": [
3016
- "tenant_id",
3017
- "migration_id",
3018
- "document_type",
3019
- "document_id"
3020
- ],
3021
- "unique": true,
3022
- "nullsNotDistinct": true
3023
- },
3024
- {
3025
- "name": "commerce_money_migration_documents_slug_context_idx",
3026
- "columns": [
3027
- "slug",
3028
- "context"
3029
- ]
3030
- },
3031
- {
3032
- "name": "commerce_money_migration_documents_migration_id_idx",
3033
- "columns": [
3034
- "migration_id"
3035
- ]
3036
- },
3037
- {
3038
- "name": "commerce_money_migration_documents_document_type_idx",
3039
- "columns": [
3040
- "document_type"
3041
- ]
3042
- },
3043
- {
3044
- "name": "commerce_money_migration_documents_document_id_idx",
3045
- "columns": [
3046
- "document_id"
3047
- ]
3048
- },
3049
- {
3050
- "name": "commerce_money_migration_documents_tenant_id_created_at_idx",
3051
- "columns": [
3052
- "tenant_id",
3053
- "created_at"
3054
- ]
3055
- }
3056
- ],
3057
- "version": "c84f4bd2"
2821
+ "version": "9b493ddb"
3058
2822
  },
3059
2823
  "importPath": "@happyvertical/smrt-commerce"
3060
2824
  },
@@ -5250,6 +5014,11 @@
5250
5014
  "name": "code",
5251
5015
  "type": "string",
5252
5016
  "optional": false
5017
+ },
5018
+ {
5019
+ "name": "tenantId",
5020
+ "type": "string",
5021
+ "optional": true
5253
5022
  }
5254
5023
  ],
5255
5024
  "returnType": "Promise<TaxCode | null>",
@@ -5541,90 +5310,9 @@
5541
5310
  "name": "tenantId",
5542
5311
  "type": "string",
5543
5312
  "optional": false
5544
- },
5545
- {
5546
- "name": "create",
5547
- "type": "any",
5548
- "optional": true
5549
- }
5550
- ],
5551
- "returnType": "Promise<TaxSettings | null>",
5552
- "isStatic": false,
5553
- "isPublic": true
5554
- },
5555
- "beginMoneyMigration": {
5556
- "name": "beginMoneyMigration",
5557
- "async": true,
5558
- "parameters": [
5559
- {
5560
- "name": "tenantId",
5561
- "type": "string",
5562
- "optional": false
5563
- },
5564
- {
5565
- "name": "requestedMigrationId",
5566
- "type": "string",
5567
- "optional": true
5568
- }
5569
- ],
5570
- "returnType": "Promise<string>",
5571
- "isStatic": false,
5572
- "isPublic": true
5573
- },
5574
- "activateMoneyV2": {
5575
- "name": "activateMoneyV2",
5576
- "async": true,
5577
- "parameters": [
5578
- {
5579
- "name": "tenantId",
5580
- "type": "string",
5581
- "optional": false
5582
- },
5583
- {
5584
- "name": "migrationId",
5585
- "type": "string",
5586
- "optional": false
5587
- }
5588
- ],
5589
- "returnType": "Promise<void>",
5590
- "isStatic": false,
5591
- "isPublic": true
5592
- },
5593
- "restoreLegacyMoneyModel": {
5594
- "name": "restoreLegacyMoneyModel",
5595
- "async": true,
5596
- "parameters": [
5597
- {
5598
- "name": "tenantId",
5599
- "type": "string",
5600
- "optional": false
5601
- },
5602
- {
5603
- "name": "migrationId",
5604
- "type": "string",
5605
- "optional": false
5606
- }
5607
- ],
5608
- "returnType": "Promise<void>",
5609
- "isStatic": false,
5610
- "isPublic": true
5611
- },
5612
- "beginMoneyRollback": {
5613
- "name": "beginMoneyRollback",
5614
- "async": true,
5615
- "parameters": [
5616
- {
5617
- "name": "tenantId",
5618
- "type": "string",
5619
- "optional": false
5620
- },
5621
- {
5622
- "name": "migrationId",
5623
- "type": "string",
5624
- "optional": false
5625
5313
  }
5626
5314
  ],
5627
- "returnType": "Promise<void>",
5315
+ "returnType": "Promise<TaxSettings>",
5628
5316
  "isStatic": false,
5629
5317
  "isPublic": true
5630
5318
  }
@@ -5649,7 +5337,7 @@
5649
5337
  "collectionExportName": "TaxSettingsCollectionCollection",
5650
5338
  "schema": {
5651
5339
  "tableName": "tax_settings",
5652
- "ddl": "CREATE TABLE IF NOT EXISTS \"tax_settings\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"default_line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"tax_registrations_json\" TEXT,\n \"money_model\" TEXT DEFAULT 'legacy',\n \"money_migration_id\" TEXT\n);",
5340
+ "ddl": "CREATE TABLE IF NOT EXISTS \"tax_settings\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"default_line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"tax_registrations_json\" TEXT\n);",
5653
5341
  "columns": {
5654
5342
  "id": {
5655
5343
  "type": "UUID",
@@ -5722,17 +5410,6 @@
5722
5410
  "type": "TEXT",
5723
5411
  "notNull": false,
5724
5412
  "unique": false
5725
- },
5726
- "money_model": {
5727
- "type": "TEXT",
5728
- "notNull": false,
5729
- "unique": false,
5730
- "default": "legacy"
5731
- },
5732
- "money_migration_id": {
5733
- "type": "TEXT",
5734
- "notNull": false,
5735
- "unique": false
5736
5413
  }
5737
5414
  },
5738
5415
  "indexes": [
@@ -5770,7 +5447,7 @@
5770
5447
  ]
5771
5448
  }
5772
5449
  ],
5773
- "version": "8622db2f"
5450
+ "version": "2af5863d"
5774
5451
  },
5775
5452
  "importPath": "@happyvertical/smrt-commerce"
5776
5453
  },
@@ -13706,13 +13383,6 @@
13706
13383
  }
13707
13384
  }
13708
13385
  },
13709
- "legacyAmount": {
13710
- "type": "integer",
13711
- "required": false,
13712
- "_meta": {
13713
- "nullable": true
13714
- }
13715
- },
13716
13386
  "moneySnapshotId": {
13717
13387
  "type": "text",
13718
13388
  "required": false
@@ -13782,11 +13452,11 @@
13782
13452
  "isStatic": false,
13783
13453
  "isPublic": true
13784
13454
  },
13785
- "calculateAmount": {
13786
- "name": "calculateAmount",
13787
- "async": false,
13455
+ "initialize": {
13456
+ "name": "initialize",
13457
+ "async": true,
13788
13458
  "parameters": [],
13789
- "returnType": "number",
13459
+ "returnType": "Promise<this>",
13790
13460
  "isStatic": false,
13791
13461
  "isPublic": true
13792
13462
  },
@@ -13806,11 +13476,6 @@
13806
13476
  "name": "capability",
13807
13477
  "type": "DocumentMoneyWriteCapability",
13808
13478
  "optional": false
13809
- },
13810
- {
13811
- "name": "legacy",
13812
- "type": "boolean",
13813
- "optional": false
13814
13479
  }
13815
13480
  ],
13816
13481
  "returnType": "Promise<this>",
@@ -13915,7 +13580,7 @@
13915
13580
  ],
13916
13581
  "schema": {
13917
13582
  "tableName": "contract_line_items",
13918
- "ddl": "CREATE TABLE IF NOT EXISTS \"contract_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"description\" TEXT DEFAULT '',\n \"quantity\" REAL DEFAULT 1,\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"discount_type\" TEXT DEFAULT 'none',\n \"discount_rate\" REAL,\n \"tax_rate\" REAL DEFAULT 0,\n \"tax_mode\" TEXT DEFAULT 'inherit',\n \"tax_code_id\" UUID,\n \"tax_code_code\" TEXT,\n \"tax_code_name\" TEXT,\n \"tax_components_json\" TEXT,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"legacy_amount\" INTEGER,\n \"money_snapshot_id\" TEXT,\n \"amount\" INTEGER DEFAULT 0,\n \"product_id\" UUID,\n \"sku\" TEXT DEFAULT '',\n \"start_date\" TIMESTAMP,\n \"end_date\" TIMESTAMP,\n \"billing_period\" TEXT DEFAULT '',\n \"sort_order\" INTEGER DEFAULT 0\n);",
13583
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contract_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"description\" TEXT DEFAULT '',\n \"quantity\" REAL DEFAULT 1,\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"discount_type\" TEXT DEFAULT 'none',\n \"discount_rate\" REAL,\n \"tax_rate\" REAL DEFAULT 0,\n \"tax_mode\" TEXT DEFAULT 'inherit',\n \"tax_code_id\" UUID,\n \"tax_code_code\" TEXT,\n \"tax_code_name\" TEXT,\n \"tax_components_json\" TEXT,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"money_snapshot_id\" TEXT,\n \"amount\" INTEGER DEFAULT 0,\n \"product_id\" UUID,\n \"sku\" TEXT DEFAULT '',\n \"start_date\" TIMESTAMP,\n \"end_date\" TIMESTAMP,\n \"billing_period\" TEXT DEFAULT '',\n \"sort_order\" INTEGER DEFAULT 0\n);",
13919
13584
  "columns": {
13920
13585
  "id": {
13921
13586
  "type": "UUID",
@@ -14033,10 +13698,6 @@
14033
13698
  "notNull": false,
14034
13699
  "default": 0
14035
13700
  },
14036
- "legacy_amount": {
14037
- "type": "INTEGER",
14038
- "notNull": false
14039
- },
14040
13701
  "money_snapshot_id": {
14041
13702
  "type": "TEXT",
14042
13703
  "notNull": false
@@ -14119,7 +13780,7 @@
14119
13780
  ]
14120
13781
  }
14121
13782
  ],
14122
- "version": "51d46553"
13783
+ "version": "ef59fe1c"
14123
13784
  },
14124
13785
  "importPath": "@happyvertical/smrt-commerce"
14125
13786
  },
@@ -15865,14 +15526,6 @@
15865
15526
  "name": "capability",
15866
15527
  "type": "DocumentMoneyWriteCapability",
15867
15528
  "optional": false
15868
- },
15869
- {
15870
- "name": "options",
15871
- "type": "object",
15872
- "optional": false,
15873
- "memberTypes": [
15874
- "boolean"
15875
- ]
15876
15529
  }
15877
15530
  ],
15878
15531
  "returnType": "Promise<this>",
@@ -16022,7 +15675,7 @@
16022
15675
  "optional": false
16023
15676
  }
16024
15677
  ],
16025
- "returnType": "Promise<Journal | null>",
15678
+ "returnType": "Promise<Journal>",
16026
15679
  "isStatic": false,
16027
15680
  "isPublic": true
16028
15681
  },
@@ -16555,11 +16208,6 @@
16555
16208
  "description": "How many."
16556
16209
  }
16557
16210
  },
16558
- "invoiceEditorStateJson": {
16559
- "type": "text",
16560
- "required": false,
16561
- "default": ""
16562
- },
16563
16211
  "unitPrice": {
16564
16212
  "type": "integer",
16565
16213
  "required": false,
@@ -16645,13 +16293,6 @@
16645
16293
  }
16646
16294
  }
16647
16295
  },
16648
- "legacyAmount": {
16649
- "type": "integer",
16650
- "required": false,
16651
- "_meta": {
16652
- "nullable": true
16653
- }
16654
- },
16655
16296
  "moneySnapshotId": {
16656
16297
  "type": "text",
16657
16298
  "required": false
@@ -16720,60 +16361,11 @@
16720
16361
  "isStatic": false,
16721
16362
  "isPublic": true
16722
16363
  },
16723
- "calculateAmount": {
16724
- "name": "calculateAmount",
16725
- "async": false,
16726
- "parameters": [],
16727
- "returnType": "number",
16728
- "isStatic": false,
16729
- "isPublic": true
16730
- },
16731
- "getSubtotal": {
16732
- "name": "getSubtotal",
16733
- "async": false,
16734
- "parameters": [],
16735
- "returnType": "number",
16736
- "isStatic": false,
16737
- "isPublic": true
16738
- },
16739
- "getTaxAmount": {
16740
- "name": "getTaxAmount",
16741
- "async": false,
16364
+ "initialize": {
16365
+ "name": "initialize",
16366
+ "async": true,
16742
16367
  "parameters": [],
16743
- "returnType": "number",
16744
- "isStatic": false,
16745
- "isPublic": true
16746
- },
16747
- "applyEditorDraft": {
16748
- "name": "applyEditorDraft",
16749
- "async": false,
16750
- "parameters": [
16751
- {
16752
- "name": "draft",
16753
- "type": "InvoiceLineDraft",
16754
- "optional": false
16755
- },
16756
- {
16757
- "name": "context",
16758
- "type": "InvoiceCalculationContext",
16759
- "optional": false
16760
- }
16761
- ],
16762
- "returnType": "void",
16763
- "isStatic": false,
16764
- "isPublic": true
16765
- },
16766
- "getEditorDraft": {
16767
- "name": "getEditorDraft",
16768
- "async": false,
16769
- "parameters": [
16770
- {
16771
- "name": "authorizedContext",
16772
- "type": "InvoiceCalculationContext",
16773
- "optional": false
16774
- }
16775
- ],
16776
- "returnType": "InvoiceLineDraft | null",
16368
+ "returnType": "Promise<this>",
16777
16369
  "isStatic": false,
16778
16370
  "isPublic": true
16779
16371
  },
@@ -16791,12 +16383,7 @@
16791
16383
  "parameters": [
16792
16384
  {
16793
16385
  "name": "capability",
16794
- "type": "DocumentMoneyWriteCapability",
16795
- "optional": false
16796
- },
16797
- {
16798
- "name": "legacy",
16799
- "type": "boolean",
16386
+ "type": "DocumentMoneyWriteCapability",
16800
16387
  "optional": false
16801
16388
  }
16802
16389
  ],
@@ -16858,20 +16445,6 @@
16858
16445
  "returnType": "boolean",
16859
16446
  "isStatic": false,
16860
16447
  "isPublic": true
16861
- },
16862
- "toAccountingLineItem": {
16863
- "name": "toAccountingLineItem",
16864
- "async": false,
16865
- "parameters": [
16866
- {
16867
- "name": "currency",
16868
- "type": "string",
16869
- "optional": true
16870
- }
16871
- ],
16872
- "returnType": "AccountingLineItemInput",
16873
- "isStatic": false,
16874
- "isPublic": true
16875
16448
  }
16876
16449
  },
16877
16450
  "decoratorConfig": {
@@ -16934,7 +16507,7 @@
16934
16507
  ],
16935
16508
  "schema": {
16936
16509
  "tableName": "invoice_line_items",
16937
- "ddl": "CREATE TABLE IF NOT EXISTS \"invoice_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"invoice_id\" UUID,\n \"credited_line_id\" UUID,\n \"credit_calculation_basis_json\" TEXT,\n \"description\" TEXT DEFAULT '',\n \"sku\" TEXT DEFAULT '',\n \"product_id\" UUID,\n \"quantity\" REAL DEFAULT 1,\n \"invoice_editor_state_json\" TEXT DEFAULT '',\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"discount_type\" TEXT DEFAULT 'none',\n \"discount_rate\" REAL,\n \"tax_rate\" REAL DEFAULT 0,\n \"tax_mode\" TEXT DEFAULT 'inherit',\n \"tax_code_id\" UUID,\n \"tax_code_code\" TEXT,\n \"tax_code_name\" TEXT,\n \"tax_components_json\" TEXT,\n \"tax_amount\" INTEGER NOT NULL DEFAULT 0,\n \"legacy_amount\" INTEGER,\n \"money_snapshot_id\" TEXT,\n \"amount\" INTEGER DEFAULT 0,\n \"source_type\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"revenue_account_id\" UUID,\n \"sort_order\" INTEGER DEFAULT 0\n);",
16510
+ "ddl": "CREATE TABLE IF NOT EXISTS \"invoice_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"invoice_id\" UUID,\n \"credited_line_id\" UUID,\n \"credit_calculation_basis_json\" TEXT,\n \"description\" TEXT DEFAULT '',\n \"sku\" TEXT DEFAULT '',\n \"product_id\" UUID,\n \"quantity\" REAL DEFAULT 1,\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"discount_type\" TEXT DEFAULT 'none',\n \"discount_rate\" REAL,\n \"tax_rate\" REAL DEFAULT 0,\n \"tax_mode\" TEXT DEFAULT 'inherit',\n \"tax_code_id\" UUID,\n \"tax_code_code\" TEXT,\n \"tax_code_name\" TEXT,\n \"tax_components_json\" TEXT,\n \"tax_amount\" INTEGER NOT NULL DEFAULT 0,\n \"money_snapshot_id\" TEXT,\n \"amount\" INTEGER DEFAULT 0,\n \"source_type\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"revenue_account_id\" UUID,\n \"sort_order\" INTEGER DEFAULT 0\n);",
16938
16511
  "columns": {
16939
16512
  "id": {
16940
16513
  "type": "UUID",
@@ -17020,12 +16593,6 @@
17020
16593
  "unique": false,
17021
16594
  "default": 1
17022
16595
  },
17023
- "invoice_editor_state_json": {
17024
- "type": "TEXT",
17025
- "notNull": false,
17026
- "unique": false,
17027
- "default": ""
17028
- },
17029
16596
  "unit_price": {
17030
16597
  "type": "INTEGER",
17031
16598
  "notNull": false,
@@ -17094,11 +16661,6 @@
17094
16661
  "unique": false,
17095
16662
  "default": 0
17096
16663
  },
17097
- "legacy_amount": {
17098
- "type": "INTEGER",
17099
- "notNull": false,
17100
- "unique": false
17101
- },
17102
16664
  "money_snapshot_id": {
17103
16665
  "type": "TEXT",
17104
16666
  "notNull": false,
@@ -17194,241 +16756,7 @@
17194
16756
  ]
17195
16757
  }
17196
16758
  ],
17197
- "version": "76aa2ef6"
17198
- },
17199
- "importPath": "@happyvertical/smrt-commerce"
17200
- },
17201
- "@happyvertical/smrt-commerce:MoneyMigrationDocument": {
17202
- "name": "moneymigrationdocument",
17203
- "className": "MoneyMigrationDocument",
17204
- "qualifiedName": "@happyvertical/smrt-commerce:MoneyMigrationDocument",
17205
- "collection": "moneymigrationdocuments",
17206
- "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/MoneyMigrationDocument.ts",
17207
- "packageName": "@happyvertical/smrt-commerce",
17208
- "fields": {
17209
- "tenantId": {
17210
- "type": "text",
17211
- "required": true,
17212
- "_meta": {
17213
- "sqlType": "UUID",
17214
- "__tenancy": {
17215
- "isTenantIdField": true,
17216
- "autoFilter": true,
17217
- "required": true,
17218
- "autoPopulate": true,
17219
- "nullable": false,
17220
- "mode": "required",
17221
- "field": "tenantId",
17222
- "allowSuperAdminBypass": false
17223
- }
17224
- }
17225
- },
17226
- "migrationId": {
17227
- "type": "text",
17228
- "required": false,
17229
- "_meta": {
17230
- "indexed": true
17231
- }
17232
- },
17233
- "documentType": {
17234
- "type": "text",
17235
- "required": false,
17236
- "default": "invoice",
17237
- "_meta": {
17238
- "indexed": true
17239
- },
17240
- "enum": [
17241
- "invoice",
17242
- "contract"
17243
- ]
17244
- },
17245
- "documentId": {
17246
- "type": "text",
17247
- "required": false,
17248
- "_meta": {
17249
- "indexed": true
17250
- }
17251
- },
17252
- "state": {
17253
- "type": "text",
17254
- "required": false,
17255
- "default": "prepared",
17256
- "enum": [
17257
- "prepared",
17258
- "applied",
17259
- "rolled_back"
17260
- ]
17261
- },
17262
- "preImageJson": {
17263
- "type": "text",
17264
- "required": false,
17265
- "_meta": {
17266
- "sensitive": true
17267
- },
17268
- "sensitive": true
17269
- },
17270
- "preChecksum": {
17271
- "type": "text",
17272
- "required": false
17273
- },
17274
- "postImageJson": {
17275
- "type": "text",
17276
- "required": false,
17277
- "_meta": {
17278
- "sensitive": true
17279
- },
17280
- "sensitive": true
17281
- },
17282
- "postChecksum": {
17283
- "type": "text",
17284
- "required": false
17285
- }
17286
- },
17287
- "methods": {},
17288
- "decoratorConfig": {
17289
- "tableName": "commerce_money_migration_documents",
17290
- "conflictColumns": [
17291
- "tenant_id",
17292
- "migration_id",
17293
- "document_type",
17294
- "document_id"
17295
- ],
17296
- "sensitive": true,
17297
- "api": false,
17298
- "mcp": false,
17299
- "cli": false,
17300
- "tenantScoped": {
17301
- "mode": "required"
17302
- }
17303
- },
17304
- "extends": "SmrtObject",
17305
- "exportName": "MoneyMigrationDocument",
17306
- "collectionExportName": "MoneyMigrationDocumentCollection",
17307
- "validationRules": [],
17308
- "schema": {
17309
- "tableName": "commerce_money_migration_documents",
17310
- "ddl": "CREATE TABLE IF NOT EXISTS \"commerce_money_migration_documents\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"migration_id\" TEXT,\n \"document_type\" TEXT DEFAULT 'invoice',\n \"document_id\" TEXT,\n \"state\" TEXT DEFAULT 'prepared',\n \"pre_image_json\" TEXT,\n \"pre_checksum\" TEXT,\n \"post_image_json\" TEXT,\n \"post_checksum\" TEXT\n);",
17311
- "columns": {
17312
- "id": {
17313
- "type": "UUID",
17314
- "primaryKey": true,
17315
- "referenceKind": "id",
17316
- "notNull": true
17317
- },
17318
- "slug": {
17319
- "type": "TEXT",
17320
- "notNull": true
17321
- },
17322
- "context": {
17323
- "type": "TEXT",
17324
- "notNull": true,
17325
- "default": ""
17326
- },
17327
- "created_at": {
17328
- "type": "TIMESTAMP",
17329
- "notNull": true,
17330
- "default": "current_timestamp"
17331
- },
17332
- "updated_at": {
17333
- "type": "TIMESTAMP",
17334
- "notNull": true,
17335
- "default": "current_timestamp"
17336
- },
17337
- "tenant_id": {
17338
- "type": "UUID",
17339
- "referenceKind": "tenantId",
17340
- "notNull": true,
17341
- "unique": false
17342
- },
17343
- "migration_id": {
17344
- "type": "TEXT",
17345
- "notNull": false,
17346
- "unique": false
17347
- },
17348
- "document_type": {
17349
- "type": "TEXT",
17350
- "notNull": false,
17351
- "unique": false,
17352
- "default": "invoice"
17353
- },
17354
- "document_id": {
17355
- "type": "TEXT",
17356
- "notNull": false,
17357
- "unique": false
17358
- },
17359
- "state": {
17360
- "type": "TEXT",
17361
- "notNull": false,
17362
- "unique": false,
17363
- "default": "prepared"
17364
- },
17365
- "pre_image_json": {
17366
- "type": "TEXT",
17367
- "notNull": false,
17368
- "unique": false
17369
- },
17370
- "pre_checksum": {
17371
- "type": "TEXT",
17372
- "notNull": false,
17373
- "unique": false
17374
- },
17375
- "post_image_json": {
17376
- "type": "TEXT",
17377
- "notNull": false,
17378
- "unique": false
17379
- },
17380
- "post_checksum": {
17381
- "type": "TEXT",
17382
- "notNull": false,
17383
- "unique": false
17384
- }
17385
- },
17386
- "indexes": [
17387
- {
17388
- "name": "commerce_money_migration_documents_tenant_id_migration_id_idx",
17389
- "columns": [
17390
- "tenant_id",
17391
- "migration_id",
17392
- "document_type",
17393
- "document_id"
17394
- ],
17395
- "unique": true,
17396
- "nullsNotDistinct": true
17397
- },
17398
- {
17399
- "name": "commerce_money_migration_documents_slug_context_idx",
17400
- "columns": [
17401
- "slug",
17402
- "context"
17403
- ]
17404
- },
17405
- {
17406
- "name": "commerce_money_migration_documents_migration_id_idx",
17407
- "columns": [
17408
- "migration_id"
17409
- ]
17410
- },
17411
- {
17412
- "name": "commerce_money_migration_documents_document_type_idx",
17413
- "columns": [
17414
- "document_type"
17415
- ]
17416
- },
17417
- {
17418
- "name": "commerce_money_migration_documents_document_id_idx",
17419
- "columns": [
17420
- "document_id"
17421
- ]
17422
- },
17423
- {
17424
- "name": "commerce_money_migration_documents_tenant_id_created_at_idx",
17425
- "columns": [
17426
- "tenant_id",
17427
- "created_at"
17428
- ]
17429
- }
17430
- ],
17431
- "version": "c84f4bd2"
16759
+ "version": "9b493ddb"
17432
16760
  },
17433
16761
  "importPath": "@happyvertical/smrt-commerce"
17434
16762
  },
@@ -19976,20 +19304,6 @@
19976
19304
  "taxRegistrationsJson": {
19977
19305
  "type": "text",
19978
19306
  "required": false
19979
- },
19980
- "moneyModel": {
19981
- "type": "text",
19982
- "required": false,
19983
- "default": "legacy",
19984
- "enum": [
19985
- "legacy",
19986
- "migrating",
19987
- "v2"
19988
- ]
19989
- },
19990
- "moneyMigrationId": {
19991
- "type": "text",
19992
- "required": false
19993
19307
  }
19994
19308
  },
19995
19309
  "methods": {
@@ -20000,34 +19314,6 @@
20000
19314
  "returnType": "Promise<this>",
20001
19315
  "isStatic": false,
20002
19316
  "isPublic": true
20003
- },
20004
- "saveMoneyModel": {
20005
- "name": "saveMoneyModel",
20006
- "async": true,
20007
- "parameters": [
20008
- {
20009
- "name": "capability",
20010
- "type": "MoneyMigrationWriteCapability",
20011
- "optional": false
20012
- }
20013
- ],
20014
- "returnType": "Promise<this>",
20015
- "isStatic": false,
20016
- "isPublic": true
20017
- },
20018
- "saveMoneyModelOnTransaction": {
20019
- "name": "saveMoneyModelOnTransaction",
20020
- "async": true,
20021
- "parameters": [
20022
- {
20023
- "name": "capability",
20024
- "type": "MoneyMigrationWriteCapability",
20025
- "optional": false
20026
- }
20027
- ],
20028
- "returnType": "Promise<this>",
20029
- "isStatic": false,
20030
- "isPublic": true
20031
19317
  }
20032
19318
  },
20033
19319
  "decoratorConfig": {
@@ -20066,7 +19352,7 @@
20066
19352
  "validationRules": [],
20067
19353
  "schema": {
20068
19354
  "tableName": "tax_settings",
20069
- "ddl": "CREATE TABLE IF NOT EXISTS \"tax_settings\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"default_line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"tax_registrations_json\" TEXT,\n \"money_model\" TEXT DEFAULT 'legacy',\n \"money_migration_id\" TEXT\n);",
19355
+ "ddl": "CREATE TABLE IF NOT EXISTS \"tax_settings\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"default_line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"tax_registrations_json\" TEXT\n);",
20070
19356
  "columns": {
20071
19357
  "id": {
20072
19358
  "type": "UUID",
@@ -20139,17 +19425,6 @@
20139
19425
  "type": "TEXT",
20140
19426
  "notNull": false,
20141
19427
  "unique": false
20142
- },
20143
- "money_model": {
20144
- "type": "TEXT",
20145
- "notNull": false,
20146
- "unique": false,
20147
- "default": "legacy"
20148
- },
20149
- "money_migration_id": {
20150
- "type": "TEXT",
20151
- "notNull": false,
20152
- "unique": false
20153
19428
  }
20154
19429
  },
20155
19430
  "indexes": [
@@ -20187,7 +19462,7 @@
20187
19462
  ]
20188
19463
  }
20189
19464
  ],
20190
- "version": "8622db2f"
19465
+ "version": "2af5863d"
20191
19466
  },
20192
19467
  "importPath": "@happyvertical/smrt-commerce"
20193
19468
  },
@@ -23638,7 +22913,7 @@
23638
22913
  "visibility": "hidden"
23639
22914
  },
23640
22915
  "taxRate": {
23641
- "help": "Stored fraction: 0.05 means 5%."
22916
+ "visibility": "hidden"
23642
22917
  }
23643
22918
  }
23644
22919
  },
@@ -23795,7 +23070,7 @@
23795
23070
  "visibility": "hidden"
23796
23071
  },
23797
23072
  "taxRate": {
23798
- "help": "Stored fraction: 0.05 means 5%."
23073
+ "visibility": "hidden"
23799
23074
  }
23800
23075
  }
23801
23076
  }
@@ -23990,9 +23265,6 @@
23990
23265
  },
23991
23266
  "@happyvertical/smrt-commerce:InvoiceLineItem": {
23992
23267
  "fields": {
23993
- "invoiceEditorStateJson": {
23994
- "visibility": "hidden"
23995
- },
23996
23268
  "sourceType": {
23997
23269
  "visibility": "hidden"
23998
23270
  },
@@ -24018,7 +23290,7 @@
24018
23290
  "visibility": "hidden"
24019
23291
  },
24020
23292
  "taxRate": {
24021
- "help": "Stored fraction: 0.05 means 5%."
23293
+ "visibility": "hidden"
24022
23294
  }
24023
23295
  }
24024
23296
  },
@@ -24166,7 +23438,7 @@
24166
23438
  "visibility": "hidden"
24167
23439
  },
24168
23440
  "taxRate": {
24169
- "help": "Stored fraction: 0.05 means 5%."
23441
+ "visibility": "hidden"
24170
23442
  }
24171
23443
  }
24172
23444
  }
@@ -24267,7 +23539,7 @@
24267
23539
  "visibility": "hidden"
24268
23540
  },
24269
23541
  "taxRate": {
24270
- "help": "Stored fraction: 0.05 means 5%."
23542
+ "visibility": "hidden"
24271
23543
  }
24272
23544
  }
24273
23545
  }
@@ -24360,7 +23632,7 @@
24360
23632
  "visibility": "hidden"
24361
23633
  },
24362
23634
  "taxRate": {
24363
- "help": "Stored fraction: 0.05 means 5%."
23635
+ "visibility": "hidden"
24364
23636
  }
24365
23637
  }
24366
23638
  }
@@ -24462,7 +23734,7 @@
24462
23734
  "visibility": "hidden"
24463
23735
  },
24464
23736
  "taxRate": {
24465
- "help": "Stored fraction: 0.05 means 5%."
23737
+ "visibility": "hidden"
24466
23738
  }
24467
23739
  }
24468
23740
  }
@@ -24619,7 +23891,7 @@
24619
23891
  "visibility": "hidden"
24620
23892
  },
24621
23893
  "taxRate": {
24622
- "help": "Stored fraction: 0.05 means 5%."
23894
+ "visibility": "hidden"
24623
23895
  }
24624
23896
  }
24625
23897
  }