@happyvertical/smrt-commerce 0.57.9 → 0.57.11

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 (63) hide show
  1. package/AGENTS.md +1 -0
  2. package/README.md +61 -0
  3. package/agents/connected-payments.md +135 -0
  4. package/agents/contract-billing-schedules.md +6 -0
  5. package/agents/money-upgrade.md +5 -0
  6. package/dist/chunks/{ContractLineItemCollection-DQZqRiZi.js → ContractLineItemCollection-DkBeBR7a.js} +4 -4
  7. package/dist/chunks/{ContractLineItemCollection-DQZqRiZi.js.map → ContractLineItemCollection-DkBeBR7a.js.map} +1 -1
  8. package/dist/chunks/{DocumentTaxCollection-Dg942m_Z.js → DocumentTaxCollection-D85ut-Fo.js} +14 -10
  9. package/dist/chunks/{DocumentTaxCollection-Dg942m_Z.js.map → DocumentTaxCollection-D85ut-Fo.js.map} +1 -1
  10. package/dist/chunks/{InvoiceCollection-XPcPyibo.js → InvoiceCollection-Datg_eZM.js} +9 -9
  11. package/dist/chunks/{InvoiceCollection-XPcPyibo.js.map → InvoiceCollection-Datg_eZM.js.map} +1 -1
  12. package/dist/chunks/{TaxCodeCollection-CbTBWO8z.js → TaxCodeCollection-CIC1skxr.js} +2 -2
  13. package/dist/chunks/{TaxCodeCollection-CbTBWO8z.js.map → TaxCodeCollection-CIC1skxr.js.map} +1 -1
  14. package/dist/chunks/{TaxComponentCollection-VZ_cGr2n.js → TaxComponentCollection-BHBV-_1J.js} +3 -3
  15. package/dist/chunks/{TaxComponentCollection-VZ_cGr2n.js.map → TaxComponentCollection-BHBV-_1J.js.map} +1 -1
  16. package/dist/chunks/{allocation-integrity-Kr8uceRx.js → allocation-integrity-B2SyO1mu.js} +6 -6
  17. package/dist/chunks/{allocation-integrity-Kr8uceRx.js.map → allocation-integrity-B2SyO1mu.js.map} +1 -1
  18. package/dist/chunks/{contract-money-DGNqQwf0.js → contract-money-C61kGBkU.js} +7 -6
  19. package/dist/chunks/contract-money-C61kGBkU.js.map +1 -0
  20. package/dist/chunks/{invoice-posting-DVSkfSUm.js → invoice-posting-uLfdyLIi.js} +3 -3
  21. package/dist/chunks/{invoice-posting-DVSkfSUm.js.map → invoice-posting-uLfdyLIi.js.map} +1 -1
  22. package/dist/chunks/{retention-accounting-Ct5Df6xx.js → retention-accounting-DGuXzt9g.js} +149 -11
  23. package/dist/chunks/retention-accounting-DGuXzt9g.js.map +1 -0
  24. package/dist/chunks/{tenant-money-barrier-CG78Xxja.js → tenant-money-barrier-DXnJWxiZ.js} +3 -3
  25. package/dist/chunks/{tenant-money-barrier-CG78Xxja.js.map → tenant-money-barrier-DXnJWxiZ.js.map} +1 -1
  26. package/dist/chunks/types-Bbm0Xflc.js.map +1 -1
  27. package/dist/collections/TenantPaymentAccountCollection.d.ts +28 -0
  28. package/dist/collections/TenantPaymentAccountCollection.d.ts.map +1 -0
  29. package/dist/collections/index.d.ts +1 -0
  30. package/dist/collections/index.d.ts.map +1 -1
  31. package/dist/connected-payments-internal.d.ts +5 -0
  32. package/dist/connected-payments-internal.d.ts.map +1 -0
  33. package/dist/connected-payments.d.ts +361 -0
  34. package/dist/connected-payments.d.ts.map +1 -0
  35. package/dist/contract-money.d.ts.map +1 -1
  36. package/dist/index.d.ts +3 -2
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +1241 -160
  39. package/dist/index.js.map +1 -1
  40. package/dist/invoices.js +1 -1
  41. package/dist/manifest.json +1404 -129
  42. package/dist/models/Contract.d.ts +5 -1
  43. package/dist/models/Contract.d.ts.map +1 -1
  44. package/dist/models/Payment.d.ts +33 -0
  45. package/dist/models/Payment.d.ts.map +1 -1
  46. package/dist/models/PaymentIntent.d.ts +35 -0
  47. package/dist/models/PaymentIntent.d.ts.map +1 -1
  48. package/dist/models/TenantPaymentAccount.d.ts +121 -0
  49. package/dist/models/TenantPaymentAccount.d.ts.map +1 -0
  50. package/dist/models/TenantPaymentWebhookEvent.d.ts +50 -0
  51. package/dist/models/TenantPaymentWebhookEvent.d.ts.map +1 -0
  52. package/dist/models/index.d.ts +2 -0
  53. package/dist/models/index.d.ts.map +1 -1
  54. package/dist/recipes.d.ts +15 -0
  55. package/dist/recipes.d.ts.map +1 -1
  56. package/dist/smrt-knowledge.json +622 -27
  57. package/dist/types/index.d.ts +16 -0
  58. package/dist/types/index.d.ts.map +1 -1
  59. package/dist/upgrade/money-v2.d.ts +2 -0
  60. package/dist/upgrade/money-v2.d.ts.map +1 -1
  61. package/package.json +16 -16
  62. package/dist/chunks/contract-money-DGNqQwf0.js.map +0 -1
  63. package/dist/chunks/retention-accounting-Ct5Df6xx.js.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.57.9",
5
+ "packageVersion": "0.57.11",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-commerce:ContractCollection": {
8
8
  "name": "contractcollection",
@@ -239,7 +239,7 @@
239
239
  "collectionExportName": "ContractCollectionCollection",
240
240
  "schema": {
241
241
  "tableName": "contracts",
242
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
242
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
243
243
  "columns": {
244
244
  "id": {
245
245
  "type": "UUID",
@@ -323,7 +323,8 @@
323
323
  },
324
324
  "billing_schedule_json": {
325
325
  "type": "TEXT",
326
- "notNull": false
326
+ "notNull": false,
327
+ "default": ""
327
328
  },
328
329
  "line_amount_type": {
329
330
  "type": "TEXT",
@@ -440,7 +441,7 @@
440
441
  ]
441
442
  }
442
443
  ],
443
- "version": "3c9923b5"
444
+ "version": "0aadbada"
444
445
  },
445
446
  "importPath": "@happyvertical/smrt-commerce"
446
447
  },
@@ -4043,7 +4044,7 @@
4043
4044
  "collectionExportName": "PaymentCollectionCollection",
4044
4045
  "schema": {
4045
4046
  "tableName": "payments",
4046
- "ddl": "CREATE TABLE IF NOT EXISTS \"payments\" (\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 \"kind\" TEXT DEFAULT 'payment',\n \"customer_funds_json\" TEXT,\n \"retention_accounting_binding_json\" TEXT,\n \"ordinary_accounting_binding_json\" TEXT,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"customer_id\" UUID,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"method\" TEXT,\n \"status\" TEXT,\n \"transaction_id\" TEXT DEFAULT '',\n \"reference\" TEXT DEFAULT '',\n \"journal_id\" UUID,\n \"paid_at\" TIMESTAMP,\n \"notes\" TEXT DEFAULT '',\n \"external_id\" TEXT DEFAULT '',\n \"external_provider\" TEXT DEFAULT '',\n \"synced_at\" TIMESTAMP,\n \"backend_id\" TEXT DEFAULT '',\n \"backend_tx_ref\" TEXT DEFAULT '',\n \"native_amount\" INTEGER DEFAULT 0,\n \"native_currency\" TEXT DEFAULT '',\n \"usd_at_quote\" INTEGER DEFAULT 0,\n \"usd_at_confirmation\" INTEGER DEFAULT 0\n);",
4047
+ "ddl": "CREATE TABLE IF NOT EXISTS \"payments\" (\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 \"kind\" TEXT DEFAULT 'payment',\n \"customer_funds_json\" TEXT,\n \"retention_accounting_binding_json\" TEXT,\n \"ordinary_accounting_binding_json\" TEXT,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"customer_id\" UUID,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"method\" TEXT,\n \"status\" TEXT,\n \"transaction_id\" TEXT DEFAULT '',\n \"reference\" TEXT DEFAULT '',\n \"journal_id\" UUID,\n \"paid_at\" TIMESTAMP,\n \"notes\" TEXT DEFAULT '',\n \"external_id\" TEXT DEFAULT '',\n \"external_provider\" TEXT DEFAULT '',\n \"synced_at\" TIMESTAMP,\n \"backend_id\" TEXT DEFAULT '',\n \"backend_tx_ref\" TEXT DEFAULT '',\n \"native_amount\" INTEGER DEFAULT 0,\n \"native_currency\" TEXT DEFAULT '',\n \"usd_at_quote\" INTEGER DEFAULT 0,\n \"usd_at_confirmation\" INTEGER DEFAULT 0,\n \"connected_account_id\" TEXT DEFAULT '',\n \"application_fee_cents\" INTEGER DEFAULT 0,\n \"refund_of_payment_id\" TEXT DEFAULT '',\n \"connected_refund_state\" TEXT DEFAULT '',\n \"application_fee_refunded\" BOOLEAN DEFAULT FALSE\n);",
4047
4048
  "columns": {
4048
4049
  "id": {
4049
4050
  "type": "UUID",
@@ -4224,6 +4225,36 @@
4224
4225
  "notNull": false,
4225
4226
  "unique": false,
4226
4227
  "default": 0
4228
+ },
4229
+ "connected_account_id": {
4230
+ "type": "TEXT",
4231
+ "notNull": false,
4232
+ "unique": false,
4233
+ "default": ""
4234
+ },
4235
+ "application_fee_cents": {
4236
+ "type": "INTEGER",
4237
+ "notNull": false,
4238
+ "unique": false,
4239
+ "default": 0
4240
+ },
4241
+ "refund_of_payment_id": {
4242
+ "type": "TEXT",
4243
+ "notNull": false,
4244
+ "unique": false,
4245
+ "default": ""
4246
+ },
4247
+ "connected_refund_state": {
4248
+ "type": "TEXT",
4249
+ "notNull": false,
4250
+ "unique": false,
4251
+ "default": ""
4252
+ },
4253
+ "application_fee_refunded": {
4254
+ "type": "BOOLEAN",
4255
+ "notNull": false,
4256
+ "unique": false,
4257
+ "default": false
4227
4258
  }
4228
4259
  },
4229
4260
  "indexes": [
@@ -4263,7 +4294,7 @@
4263
4294
  ]
4264
4295
  }
4265
4296
  ],
4266
- "version": "f1f74425"
4297
+ "version": "00e17122"
4267
4298
  },
4268
4299
  "importPath": "@happyvertical/smrt-commerce"
4269
4300
  },
@@ -4698,7 +4729,7 @@
4698
4729
  "collectionExportName": "PaymentIntentCollectionCollection",
4699
4730
  "schema": {
4700
4731
  "tableName": "payment_intents",
4701
- "ddl": "CREATE TABLE IF NOT EXISTS \"payment_intents\" (\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 \"sku_id\" TEXT DEFAULT '',\n \"offering_ref\" TEXT DEFAULT '',\n \"licensee_email\" TEXT DEFAULT '',\n \"customer_id\" TEXT DEFAULT '',\n \"payment_options\" JSON DEFAULT '[]',\n \"usd_price_locked\" INTEGER DEFAULT 0,\n \"price_lock_window_ms\" INTEGER,\n \"price_lock_expires_at\" TIMESTAMP,\n \"status\" TEXT,\n \"idempotency_key\" TEXT DEFAULT '',\n \"paid_option_backend_id\" TEXT DEFAULT '',\n \"payment_id\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"issued_at\" TIMESTAMP,\n \"expired_at\" TIMESTAMP,\n \"cancelled_at\" TIMESTAMP,\n \"retired_at\" TIMESTAMP,\n \"notes\" TEXT DEFAULT ''\n);",
4732
+ "ddl": "CREATE TABLE IF NOT EXISTS \"payment_intents\" (\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 \"sku_id\" TEXT DEFAULT '',\n \"offering_ref\" TEXT DEFAULT '',\n \"licensee_email\" TEXT DEFAULT '',\n \"customer_id\" TEXT DEFAULT '',\n \"payment_options\" JSON DEFAULT '[]',\n \"usd_price_locked\" INTEGER DEFAULT 0,\n \"price_lock_window_ms\" INTEGER,\n \"price_lock_expires_at\" TIMESTAMP,\n \"status\" TEXT,\n \"idempotency_key\" TEXT DEFAULT '',\n \"paid_option_backend_id\" TEXT DEFAULT '',\n \"payment_id\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"issued_at\" TIMESTAMP,\n \"expired_at\" TIMESTAMP,\n \"cancelled_at\" TIMESTAMP,\n \"retired_at\" TIMESTAMP,\n \"notes\" TEXT DEFAULT '',\n \"connected_account_id\" TEXT DEFAULT '',\n \"application_fee_cents\" INTEGER DEFAULT 0,\n \"connected_environment\" TEXT DEFAULT '',\n \"connected_amount\" INTEGER DEFAULT 0,\n \"connected_currency\" TEXT DEFAULT ''\n);",
4702
4733
  "columns": {
4703
4734
  "id": {
4704
4735
  "type": "UUID",
@@ -4830,6 +4861,36 @@
4830
4861
  "notNull": false,
4831
4862
  "unique": false,
4832
4863
  "default": ""
4864
+ },
4865
+ "connected_account_id": {
4866
+ "type": "TEXT",
4867
+ "notNull": false,
4868
+ "unique": false,
4869
+ "default": ""
4870
+ },
4871
+ "application_fee_cents": {
4872
+ "type": "INTEGER",
4873
+ "notNull": false,
4874
+ "unique": false,
4875
+ "default": 0
4876
+ },
4877
+ "connected_environment": {
4878
+ "type": "TEXT",
4879
+ "notNull": false,
4880
+ "unique": false,
4881
+ "default": ""
4882
+ },
4883
+ "connected_amount": {
4884
+ "type": "INTEGER",
4885
+ "notNull": false,
4886
+ "unique": false,
4887
+ "default": 0
4888
+ },
4889
+ "connected_currency": {
4890
+ "type": "TEXT",
4891
+ "notNull": false,
4892
+ "unique": false,
4893
+ "default": ""
4833
4894
  }
4834
4895
  },
4835
4896
  "indexes": [
@@ -4859,7 +4920,7 @@
4859
4920
  ]
4860
4921
  }
4861
4922
  ],
4862
- "version": "c565aaef"
4923
+ "version": "84a9cd3d"
4863
4924
  },
4864
4925
  "importPath": "@happyvertical/smrt-commerce"
4865
4926
  },
@@ -5252,7 +5313,7 @@
5252
5313
  "collectionExportName": "PurchaseContractCollectionCollection",
5253
5314
  "schema": {
5254
5315
  "tableName": "contracts",
5255
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
5316
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
5256
5317
  "columns": {
5257
5318
  "id": {
5258
5319
  "type": "UUID",
@@ -5336,7 +5397,8 @@
5336
5397
  },
5337
5398
  "billing_schedule_json": {
5338
5399
  "type": "TEXT",
5339
- "notNull": false
5400
+ "notNull": false,
5401
+ "default": ""
5340
5402
  },
5341
5403
  "line_amount_type": {
5342
5404
  "type": "TEXT",
@@ -5453,7 +5515,7 @@
5453
5515
  ]
5454
5516
  }
5455
5517
  ],
5456
- "version": "e60c6000"
5518
+ "version": "7ce53239"
5457
5519
  },
5458
5520
  "importPath": "@happyvertical/smrt-commerce"
5459
5521
  },
@@ -5621,7 +5683,7 @@
5621
5683
  "collectionExportName": "SalesContractCollectionCollection",
5622
5684
  "schema": {
5623
5685
  "tableName": "contracts",
5624
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
5686
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
5625
5687
  "columns": {
5626
5688
  "id": {
5627
5689
  "type": "UUID",
@@ -5705,7 +5767,8 @@
5705
5767
  },
5706
5768
  "billing_schedule_json": {
5707
5769
  "type": "TEXT",
5708
- "notNull": false
5770
+ "notNull": false,
5771
+ "default": ""
5709
5772
  },
5710
5773
  "line_amount_type": {
5711
5774
  "type": "TEXT",
@@ -5822,7 +5885,7 @@
5822
5885
  ]
5823
5886
  }
5824
5887
  ],
5825
- "version": "8931b2df"
5888
+ "version": "3b81860a"
5826
5889
  },
5827
5890
  "importPath": "@happyvertical/smrt-commerce"
5828
5891
  },
@@ -6610,6 +6673,220 @@
6610
6673
  },
6611
6674
  "importPath": "@happyvertical/smrt-commerce"
6612
6675
  },
6676
+ "@happyvertical/smrt-commerce:TenantPaymentAccountCollection": {
6677
+ "name": "tenantpaymentaccountcollection",
6678
+ "className": "TenantPaymentAccountCollection",
6679
+ "qualifiedName": "@happyvertical/smrt-commerce:TenantPaymentAccountCollection",
6680
+ "collection": "tenantpaymentaccounts",
6681
+ "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/collections/TenantPaymentAccountCollection.ts",
6682
+ "packageName": "@happyvertical/smrt-commerce",
6683
+ "fields": {},
6684
+ "methods": {
6685
+ "build": {
6686
+ "name": "build",
6687
+ "async": true,
6688
+ "parameters": [
6689
+ {
6690
+ "name": "options",
6691
+ "type": "any",
6692
+ "optional": false,
6693
+ "typeUnresolved": true
6694
+ }
6695
+ ],
6696
+ "returnType": "Promise<TenantPaymentAccount>",
6697
+ "isStatic": false,
6698
+ "isPublic": true
6699
+ },
6700
+ "findForTenant": {
6701
+ "name": "findForTenant",
6702
+ "async": true,
6703
+ "parameters": [
6704
+ {
6705
+ "name": "args",
6706
+ "type": "object",
6707
+ "optional": false,
6708
+ "memberTypes": [
6709
+ "string",
6710
+ "TenantPaymentEnvironment"
6711
+ ]
6712
+ }
6713
+ ],
6714
+ "returnType": "Promise<TenantPaymentAccount | null>",
6715
+ "isStatic": false,
6716
+ "isPublic": true
6717
+ }
6718
+ },
6719
+ "decoratorConfig": {
6720
+ "tableName": "tenant_payment_accounts",
6721
+ "api": {
6722
+ "include": [
6723
+ "list",
6724
+ "get"
6725
+ ]
6726
+ },
6727
+ "mcp": {
6728
+ "include": [
6729
+ "list",
6730
+ "get"
6731
+ ]
6732
+ },
6733
+ "cli": {
6734
+ "include": [
6735
+ "list",
6736
+ "get"
6737
+ ],
6738
+ "skipApiCheck": true
6739
+ }
6740
+ },
6741
+ "extends": "SmrtCollection",
6742
+ "extendsTypeArg": "TenantPaymentAccount",
6743
+ "exportName": "TenantPaymentAccountCollection",
6744
+ "collectionExportName": "TenantPaymentAccountCollectionCollection",
6745
+ "schema": {
6746
+ "tableName": "tenant_payment_accounts",
6747
+ "ddl": "CREATE TABLE IF NOT EXISTS \"tenant_payment_accounts\" (\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 \"backend_id\" TEXT NOT NULL DEFAULT 'stripe',\n \"environment\" TEXT NOT NULL DEFAULT 'test',\n \"provider_account_id\" TEXT NOT NULL DEFAULT '',\n \"status\" TEXT DEFAULT 'pending',\n \"charges_enabled\" BOOLEAN DEFAULT FALSE,\n \"details_submitted\" BOOLEAN DEFAULT FALSE,\n \"payouts_enabled\" BOOLEAN DEFAULT FALSE,\n \"capabilities_json\" TEXT,\n \"capabilities_observed_at\" TIMESTAMP,\n \"fee_policy_ref\" TEXT DEFAULT '',\n \"disabled_at\" TIMESTAMP,\n \"disabled_reason\" TEXT DEFAULT ''\n);",
6748
+ "columns": {
6749
+ "id": {
6750
+ "type": "UUID",
6751
+ "primaryKey": true,
6752
+ "referenceKind": "id",
6753
+ "notNull": true
6754
+ },
6755
+ "slug": {
6756
+ "type": "TEXT",
6757
+ "notNull": true
6758
+ },
6759
+ "context": {
6760
+ "type": "TEXT",
6761
+ "notNull": true,
6762
+ "default": ""
6763
+ },
6764
+ "created_at": {
6765
+ "type": "TIMESTAMP",
6766
+ "notNull": true,
6767
+ "default": "current_timestamp"
6768
+ },
6769
+ "updated_at": {
6770
+ "type": "TIMESTAMP",
6771
+ "notNull": true,
6772
+ "default": "current_timestamp"
6773
+ },
6774
+ "tenant_id": {
6775
+ "type": "UUID",
6776
+ "referenceKind": "tenantId",
6777
+ "notNull": true,
6778
+ "unique": false
6779
+ },
6780
+ "backend_id": {
6781
+ "type": "TEXT",
6782
+ "notNull": true,
6783
+ "unique": false,
6784
+ "default": "stripe"
6785
+ },
6786
+ "environment": {
6787
+ "type": "TEXT",
6788
+ "notNull": true,
6789
+ "unique": false,
6790
+ "default": "test"
6791
+ },
6792
+ "provider_account_id": {
6793
+ "type": "TEXT",
6794
+ "notNull": true,
6795
+ "unique": false,
6796
+ "default": ""
6797
+ },
6798
+ "status": {
6799
+ "type": "TEXT",
6800
+ "notNull": false,
6801
+ "unique": false,
6802
+ "default": "pending"
6803
+ },
6804
+ "charges_enabled": {
6805
+ "type": "BOOLEAN",
6806
+ "notNull": false,
6807
+ "unique": false,
6808
+ "default": false
6809
+ },
6810
+ "details_submitted": {
6811
+ "type": "BOOLEAN",
6812
+ "notNull": false,
6813
+ "unique": false,
6814
+ "default": false
6815
+ },
6816
+ "payouts_enabled": {
6817
+ "type": "BOOLEAN",
6818
+ "notNull": false,
6819
+ "unique": false,
6820
+ "default": false
6821
+ },
6822
+ "capabilities_json": {
6823
+ "type": "TEXT",
6824
+ "notNull": false,
6825
+ "unique": false
6826
+ },
6827
+ "capabilities_observed_at": {
6828
+ "type": "TIMESTAMP",
6829
+ "notNull": false,
6830
+ "unique": false
6831
+ },
6832
+ "fee_policy_ref": {
6833
+ "type": "TEXT",
6834
+ "notNull": false,
6835
+ "unique": false,
6836
+ "default": ""
6837
+ },
6838
+ "disabled_at": {
6839
+ "type": "TIMESTAMP",
6840
+ "notNull": false,
6841
+ "unique": false
6842
+ },
6843
+ "disabled_reason": {
6844
+ "type": "TEXT",
6845
+ "notNull": false,
6846
+ "unique": false,
6847
+ "default": ""
6848
+ }
6849
+ },
6850
+ "indexes": [
6851
+ {
6852
+ "name": "tenant_payment_accounts_slug_context_idx",
6853
+ "columns": [
6854
+ "tenant_id",
6855
+ "slug",
6856
+ "context"
6857
+ ],
6858
+ "unique": true
6859
+ },
6860
+ {
6861
+ "name": "tenant_payment_accounts_tenant_backend_environment",
6862
+ "columns": [
6863
+ "tenant_id",
6864
+ "backend_id",
6865
+ "environment"
6866
+ ],
6867
+ "unique": true
6868
+ },
6869
+ {
6870
+ "name": "tenant_payment_accounts_provider_account",
6871
+ "columns": [
6872
+ "backend_id",
6873
+ "environment",
6874
+ "provider_account_id"
6875
+ ],
6876
+ "unique": true
6877
+ },
6878
+ {
6879
+ "name": "tenant_payment_accounts_tenant_id_created_at_idx",
6880
+ "columns": [
6881
+ "tenant_id",
6882
+ "created_at"
6883
+ ]
6884
+ }
6885
+ ],
6886
+ "version": "7559c6fe"
6887
+ },
6888
+ "importPath": "@happyvertical/smrt-commerce"
6889
+ },
6613
6890
  "@happyvertical/smrt-commerce:VendorCollection": {
6614
6891
  "name": "vendorcollection",
6615
6892
  "className": "VendorCollection",
@@ -7038,7 +7315,10 @@
7038
7315
  "billingScheduleJson": {
7039
7316
  "type": "text",
7040
7317
  "required": false,
7041
- "_meta": {}
7318
+ "default": "",
7319
+ "_meta": {
7320
+ "default": ""
7321
+ }
7042
7322
  },
7043
7323
  "lineAmountType": {
7044
7324
  "type": "text",
@@ -7313,7 +7593,7 @@
7313
7593
  "collectionExportName": "ContractCollection",
7314
7594
  "schema": {
7315
7595
  "tableName": "contracts",
7316
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
7596
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
7317
7597
  "columns": {
7318
7598
  "id": {
7319
7599
  "type": "UUID",
@@ -7397,7 +7677,8 @@
7397
7677
  },
7398
7678
  "billing_schedule_json": {
7399
7679
  "type": "TEXT",
7400
- "notNull": false
7680
+ "notNull": false,
7681
+ "default": ""
7401
7682
  },
7402
7683
  "line_amount_type": {
7403
7684
  "type": "TEXT",
@@ -7514,7 +7795,7 @@
7514
7795
  ]
7515
7796
  }
7516
7797
  ],
7517
- "version": "3c9923b5"
7798
+ "version": "0aadbada"
7518
7799
  },
7519
7800
  "importPath": "@happyvertical/smrt-commerce"
7520
7801
  },
@@ -7667,7 +7948,10 @@
7667
7948
  "billingScheduleJson": {
7668
7949
  "type": "text",
7669
7950
  "required": false,
7670
- "_meta": {}
7951
+ "default": "",
7952
+ "_meta": {
7953
+ "default": ""
7954
+ }
7671
7955
  },
7672
7956
  "lineAmountType": {
7673
7957
  "type": "text",
@@ -7995,7 +8279,7 @@
7995
8279
  "abstractDeclaredApi": null,
7996
8280
  "schema": {
7997
8281
  "tableName": "contracts",
7998
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
8282
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
7999
8283
  "columns": {
8000
8284
  "id": {
8001
8285
  "type": "UUID",
@@ -8079,7 +8363,8 @@
8079
8363
  },
8080
8364
  "billing_schedule_json": {
8081
8365
  "type": "TEXT",
8082
- "notNull": false
8366
+ "notNull": false,
8367
+ "default": ""
8083
8368
  },
8084
8369
  "line_amount_type": {
8085
8370
  "type": "TEXT",
@@ -8196,7 +8481,7 @@
8196
8481
  ]
8197
8482
  }
8198
8483
  ],
8199
- "version": "8931b2df"
8484
+ "version": "3b81860a"
8200
8485
  },
8201
8486
  "importPath": "@happyvertical/smrt-commerce"
8202
8487
  },
@@ -8349,7 +8634,10 @@
8349
8634
  "billingScheduleJson": {
8350
8635
  "type": "text",
8351
8636
  "required": false,
8352
- "_meta": {}
8637
+ "default": "",
8638
+ "_meta": {
8639
+ "default": ""
8640
+ }
8353
8641
  },
8354
8642
  "lineAmountType": {
8355
8643
  "type": "text",
@@ -8677,7 +8965,7 @@
8677
8965
  "abstractDeclaredApi": null,
8678
8966
  "schema": {
8679
8967
  "tableName": "contracts",
8680
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
8968
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
8681
8969
  "columns": {
8682
8970
  "id": {
8683
8971
  "type": "UUID",
@@ -8761,7 +9049,8 @@
8761
9049
  },
8762
9050
  "billing_schedule_json": {
8763
9051
  "type": "TEXT",
8764
- "notNull": false
9052
+ "notNull": false,
9053
+ "default": ""
8765
9054
  },
8766
9055
  "line_amount_type": {
8767
9056
  "type": "TEXT",
@@ -8878,7 +9167,7 @@
8878
9167
  ]
8879
9168
  }
8880
9169
  ],
8881
- "version": "e60c6000"
9170
+ "version": "7ce53239"
8882
9171
  },
8883
9172
  "importPath": "@happyvertical/smrt-commerce"
8884
9173
  },
@@ -9015,7 +9304,10 @@
9015
9304
  "billingScheduleJson": {
9016
9305
  "type": "text",
9017
9306
  "required": false,
9018
- "_meta": {}
9307
+ "default": "",
9308
+ "_meta": {
9309
+ "default": ""
9310
+ }
9019
9311
  },
9020
9312
  "lineAmountType": {
9021
9313
  "type": "text",
@@ -9300,7 +9592,7 @@
9300
9592
  ],
9301
9593
  "schema": {
9302
9594
  "tableName": "contracts",
9303
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
9595
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
9304
9596
  "columns": {
9305
9597
  "id": {
9306
9598
  "type": "UUID",
@@ -9384,7 +9676,8 @@
9384
9676
  },
9385
9677
  "billing_schedule_json": {
9386
9678
  "type": "TEXT",
9387
- "notNull": false
9679
+ "notNull": false,
9680
+ "default": ""
9388
9681
  },
9389
9682
  "line_amount_type": {
9390
9683
  "type": "TEXT",
@@ -9501,7 +9794,7 @@
9501
9794
  ]
9502
9795
  }
9503
9796
  ],
9504
- "version": "c317664d"
9797
+ "version": "1241e8c4"
9505
9798
  },
9506
9799
  "importPath": "@happyvertical/smrt-commerce"
9507
9800
  },
@@ -9638,7 +9931,10 @@
9638
9931
  "billingScheduleJson": {
9639
9932
  "type": "text",
9640
9933
  "required": false,
9641
- "_meta": {}
9934
+ "default": "",
9935
+ "_meta": {
9936
+ "default": ""
9937
+ }
9642
9938
  },
9643
9939
  "lineAmountType": {
9644
9940
  "type": "text",
@@ -9923,7 +10219,7 @@
9923
10219
  ],
9924
10220
  "schema": {
9925
10221
  "tableName": "contracts",
9926
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
10222
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
9927
10223
  "columns": {
9928
10224
  "id": {
9929
10225
  "type": "UUID",
@@ -10007,7 +10303,8 @@
10007
10303
  },
10008
10304
  "billing_schedule_json": {
10009
10305
  "type": "TEXT",
10010
- "notNull": false
10306
+ "notNull": false,
10307
+ "default": ""
10011
10308
  },
10012
10309
  "line_amount_type": {
10013
10310
  "type": "TEXT",
@@ -10124,7 +10421,7 @@
10124
10421
  ]
10125
10422
  }
10126
10423
  ],
10127
- "version": "1709d78e"
10424
+ "version": "676dd80d"
10128
10425
  },
10129
10426
  "importPath": "@happyvertical/smrt-commerce"
10130
10427
  },
@@ -10261,7 +10558,10 @@
10261
10558
  "billingScheduleJson": {
10262
10559
  "type": "text",
10263
10560
  "required": false,
10264
- "_meta": {}
10561
+ "default": "",
10562
+ "_meta": {
10563
+ "default": ""
10564
+ }
10265
10565
  },
10266
10566
  "lineAmountType": {
10267
10567
  "type": "text",
@@ -10546,7 +10846,7 @@
10546
10846
  ],
10547
10847
  "schema": {
10548
10848
  "tableName": "contracts",
10549
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
10849
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
10550
10850
  "columns": {
10551
10851
  "id": {
10552
10852
  "type": "UUID",
@@ -10630,7 +10930,8 @@
10630
10930
  },
10631
10931
  "billing_schedule_json": {
10632
10932
  "type": "TEXT",
10633
- "notNull": false
10933
+ "notNull": false,
10934
+ "default": ""
10634
10935
  },
10635
10936
  "line_amount_type": {
10636
10937
  "type": "TEXT",
@@ -10747,7 +11048,7 @@
10747
11048
  ]
10748
11049
  }
10749
11050
  ],
10750
- "version": "7bca65dc"
11051
+ "version": "a5c13e17"
10751
11052
  },
10752
11053
  "importPath": "@happyvertical/smrt-commerce"
10753
11054
  },
@@ -10884,7 +11185,10 @@
10884
11185
  "billingScheduleJson": {
10885
11186
  "type": "text",
10886
11187
  "required": false,
10887
- "_meta": {}
11188
+ "default": "",
11189
+ "_meta": {
11190
+ "default": ""
11191
+ }
10888
11192
  },
10889
11193
  "lineAmountType": {
10890
11194
  "type": "text",
@@ -11169,7 +11473,7 @@
11169
11473
  ],
11170
11474
  "schema": {
11171
11475
  "tableName": "contracts",
11172
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
11476
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
11173
11477
  "columns": {
11174
11478
  "id": {
11175
11479
  "type": "UUID",
@@ -11253,7 +11557,8 @@
11253
11557
  },
11254
11558
  "billing_schedule_json": {
11255
11559
  "type": "TEXT",
11256
- "notNull": false
11560
+ "notNull": false,
11561
+ "default": ""
11257
11562
  },
11258
11563
  "line_amount_type": {
11259
11564
  "type": "TEXT",
@@ -11370,7 +11675,7 @@
11370
11675
  ]
11371
11676
  }
11372
11677
  ],
11373
- "version": "c2f171f5"
11678
+ "version": "38bc3d3c"
11374
11679
  },
11375
11680
  "importPath": "@happyvertical/smrt-commerce"
11376
11681
  },
@@ -11507,7 +11812,10 @@
11507
11812
  "billingScheduleJson": {
11508
11813
  "type": "text",
11509
11814
  "required": false,
11510
- "_meta": {}
11815
+ "default": "",
11816
+ "_meta": {
11817
+ "default": ""
11818
+ }
11511
11819
  },
11512
11820
  "lineAmountType": {
11513
11821
  "type": "text",
@@ -11792,7 +12100,7 @@
11792
12100
  ],
11793
12101
  "schema": {
11794
12102
  "tableName": "contracts",
11795
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
12103
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
11796
12104
  "columns": {
11797
12105
  "id": {
11798
12106
  "type": "UUID",
@@ -11876,7 +12184,8 @@
11876
12184
  },
11877
12185
  "billing_schedule_json": {
11878
12186
  "type": "TEXT",
11879
- "notNull": false
12187
+ "notNull": false,
12188
+ "default": ""
11880
12189
  },
11881
12190
  "line_amount_type": {
11882
12191
  "type": "TEXT",
@@ -11993,7 +12302,7 @@
11993
12302
  ]
11994
12303
  }
11995
12304
  ],
11996
- "version": "c619ea38"
12305
+ "version": "5c718175"
11997
12306
  },
11998
12307
  "importPath": "@happyvertical/smrt-commerce"
11999
12308
  },
@@ -12130,7 +12439,10 @@
12130
12439
  "billingScheduleJson": {
12131
12440
  "type": "text",
12132
12441
  "required": false,
12133
- "_meta": {}
12442
+ "default": "",
12443
+ "_meta": {
12444
+ "default": ""
12445
+ }
12134
12446
  },
12135
12447
  "lineAmountType": {
12136
12448
  "type": "text",
@@ -12435,7 +12747,7 @@
12435
12747
  ],
12436
12748
  "schema": {
12437
12749
  "tableName": "contracts",
12438
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
12750
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
12439
12751
  "columns": {
12440
12752
  "id": {
12441
12753
  "type": "UUID",
@@ -12519,7 +12831,8 @@
12519
12831
  },
12520
12832
  "billing_schedule_json": {
12521
12833
  "type": "TEXT",
12522
- "notNull": false
12834
+ "notNull": false,
12835
+ "default": ""
12523
12836
  },
12524
12837
  "line_amount_type": {
12525
12838
  "type": "TEXT",
@@ -12636,7 +12949,7 @@
12636
12949
  ]
12637
12950
  }
12638
12951
  ],
12639
- "version": "6aca1c7a"
12952
+ "version": "3c02fa0f"
12640
12953
  },
12641
12954
  "importPath": "@happyvertical/smrt-commerce"
12642
12955
  },
@@ -12773,7 +13086,10 @@
12773
13086
  "billingScheduleJson": {
12774
13087
  "type": "text",
12775
13088
  "required": false,
12776
- "_meta": {}
13089
+ "default": "",
13090
+ "_meta": {
13091
+ "default": ""
13092
+ }
12777
13093
  },
12778
13094
  "lineAmountType": {
12779
13095
  "type": "text",
@@ -13058,7 +13374,7 @@
13058
13374
  ],
13059
13375
  "schema": {
13060
13376
  "tableName": "contracts",
13061
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
13377
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
13062
13378
  "columns": {
13063
13379
  "id": {
13064
13380
  "type": "UUID",
@@ -13142,7 +13458,8 @@
13142
13458
  },
13143
13459
  "billing_schedule_json": {
13144
13460
  "type": "TEXT",
13145
- "notNull": false
13461
+ "notNull": false,
13462
+ "default": ""
13146
13463
  },
13147
13464
  "line_amount_type": {
13148
13465
  "type": "TEXT",
@@ -13259,7 +13576,7 @@
13259
13576
  ]
13260
13577
  }
13261
13578
  ],
13262
- "version": "046aa0ba"
13579
+ "version": "5a3127e9"
13263
13580
  },
13264
13581
  "importPath": "@happyvertical/smrt-commerce"
13265
13582
  },
@@ -13396,7 +13713,10 @@
13396
13713
  "billingScheduleJson": {
13397
13714
  "type": "text",
13398
13715
  "required": false,
13399
- "_meta": {}
13716
+ "default": "",
13717
+ "_meta": {
13718
+ "default": ""
13719
+ }
13400
13720
  },
13401
13721
  "lineAmountType": {
13402
13722
  "type": "text",
@@ -13690,7 +14010,7 @@
13690
14010
  "collectionExportName": "ProductionOrderCollection",
13691
14011
  "schema": {
13692
14012
  "tableName": "contracts",
13693
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
14013
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
13694
14014
  "columns": {
13695
14015
  "id": {
13696
14016
  "type": "UUID",
@@ -13774,7 +14094,8 @@
13774
14094
  },
13775
14095
  "billing_schedule_json": {
13776
14096
  "type": "TEXT",
13777
- "notNull": false
14097
+ "notNull": false,
14098
+ "default": ""
13778
14099
  },
13779
14100
  "line_amount_type": {
13780
14101
  "type": "TEXT",
@@ -13891,7 +14212,7 @@
13891
14212
  ]
13892
14213
  }
13893
14214
  ],
13894
- "version": "56cb641b"
14215
+ "version": "3270e4fe"
13895
14216
  },
13896
14217
  "importPath": "@happyvertical/smrt-commerce"
13897
14218
  },
@@ -14028,7 +14349,10 @@
14028
14349
  "billingScheduleJson": {
14029
14350
  "type": "text",
14030
14351
  "required": false,
14031
- "_meta": {}
14352
+ "default": "",
14353
+ "_meta": {
14354
+ "default": ""
14355
+ }
14032
14356
  },
14033
14357
  "lineAmountType": {
14034
14358
  "type": "text",
@@ -14306,7 +14630,7 @@
14306
14630
  "collectionExportName": "CartCollection",
14307
14631
  "schema": {
14308
14632
  "tableName": "contracts",
14309
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
14633
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
14310
14634
  "columns": {
14311
14635
  "id": {
14312
14636
  "type": "UUID",
@@ -14390,7 +14714,8 @@
14390
14714
  },
14391
14715
  "billing_schedule_json": {
14392
14716
  "type": "TEXT",
14393
- "notNull": false
14717
+ "notNull": false,
14718
+ "default": ""
14394
14719
  },
14395
14720
  "line_amount_type": {
14396
14721
  "type": "TEXT",
@@ -14507,7 +14832,7 @@
14507
14832
  ]
14508
14833
  }
14509
14834
  ],
14510
- "version": "d3d4a808"
14835
+ "version": "37e4ec59"
14511
14836
  },
14512
14837
  "importPath": "@happyvertical/smrt-commerce"
14513
14838
  },
@@ -14644,7 +14969,10 @@
14644
14969
  "billingScheduleJson": {
14645
14970
  "type": "text",
14646
14971
  "required": false,
14647
- "_meta": {}
14972
+ "default": "",
14973
+ "_meta": {
14974
+ "default": ""
14975
+ }
14648
14976
  },
14649
14977
  "lineAmountType": {
14650
14978
  "type": "text",
@@ -15058,7 +15386,7 @@
15058
15386
  "collectionExportName": "LicenseSaleCollection",
15059
15387
  "schema": {
15060
15388
  "tableName": "contracts",
15061
- "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT,\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
15389
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contracts\" (\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_type\" TEXT,\n \"status\" TEXT,\n \"subtotal\" INTEGER DEFAULT 0,\n \"discount_total\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"money_authority\" TEXT DEFAULT 'calculated',\n \"received_purchase_money_json\" TEXT,\n \"billing_schedule_json\" TEXT DEFAULT '',\n \"line_amount_type\" TEXT DEFAULT 'exclusive',\n \"tax_rounding_scope\" TEXT DEFAULT 'line',\n \"seller_tax_registrations_json\" TEXT,\n \"party_tax_id\" TEXT,\n \"money_snapshot_id\" TEXT,\n \"issue_date\" TIMESTAMP,\n \"due_date\" TIMESTAMP,\n \"expiry_date\" TIMESTAMP,\n \"reference\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT '',\n \"terms\" TEXT DEFAULT '',\n \"channel_id\" TEXT DEFAULT '',\n \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
15062
15390
  "columns": {
15063
15391
  "id": {
15064
15392
  "type": "UUID",
@@ -15142,7 +15470,8 @@
15142
15470
  },
15143
15471
  "billing_schedule_json": {
15144
15472
  "type": "TEXT",
15145
- "notNull": false
15473
+ "notNull": false,
15474
+ "default": ""
15146
15475
  },
15147
15476
  "line_amount_type": {
15148
15477
  "type": "TEXT",
@@ -15259,7 +15588,7 @@
15259
15588
  ]
15260
15589
  }
15261
15590
  ],
15262
- "version": "ec260efa"
15591
+ "version": "05d74d70"
15263
15592
  },
15264
15593
  "importPath": "@happyvertical/smrt-commerce"
15265
15594
  },
@@ -20165,6 +20494,38 @@
20165
20494
  "type": "integer",
20166
20495
  "required": false,
20167
20496
  "default": 0
20497
+ },
20498
+ "connectedAccountId": {
20499
+ "type": "text",
20500
+ "required": false,
20501
+ "default": ""
20502
+ },
20503
+ "applicationFeeCents": {
20504
+ "type": "integer",
20505
+ "required": false,
20506
+ "default": 0
20507
+ },
20508
+ "refundOfPaymentId": {
20509
+ "type": "text",
20510
+ "required": false,
20511
+ "default": ""
20512
+ },
20513
+ "connectedRefundState": {
20514
+ "type": "text",
20515
+ "required": false,
20516
+ "default": "",
20517
+ "enum": [
20518
+ "",
20519
+ "requested",
20520
+ "pending",
20521
+ "succeeded",
20522
+ "failed"
20523
+ ]
20524
+ },
20525
+ "applicationFeeRefunded": {
20526
+ "type": "boolean",
20527
+ "required": false,
20528
+ "default": false
20168
20529
  }
20169
20530
  },
20170
20531
  "methods": {
@@ -20340,7 +20701,7 @@
20340
20701
  "collectionExportName": "PaymentCollection",
20341
20702
  "schema": {
20342
20703
  "tableName": "payments",
20343
- "ddl": "CREATE TABLE IF NOT EXISTS \"payments\" (\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 \"kind\" TEXT DEFAULT 'payment',\n \"customer_funds_json\" TEXT,\n \"retention_accounting_binding_json\" TEXT,\n \"ordinary_accounting_binding_json\" TEXT,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"customer_id\" UUID,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"method\" TEXT,\n \"status\" TEXT,\n \"transaction_id\" TEXT DEFAULT '',\n \"reference\" TEXT DEFAULT '',\n \"journal_id\" UUID,\n \"paid_at\" TIMESTAMP,\n \"notes\" TEXT DEFAULT '',\n \"external_id\" TEXT DEFAULT '',\n \"external_provider\" TEXT DEFAULT '',\n \"synced_at\" TIMESTAMP,\n \"backend_id\" TEXT DEFAULT '',\n \"backend_tx_ref\" TEXT DEFAULT '',\n \"native_amount\" INTEGER DEFAULT 0,\n \"native_currency\" TEXT DEFAULT '',\n \"usd_at_quote\" INTEGER DEFAULT 0,\n \"usd_at_confirmation\" INTEGER DEFAULT 0\n);",
20704
+ "ddl": "CREATE TABLE IF NOT EXISTS \"payments\" (\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 \"kind\" TEXT DEFAULT 'payment',\n \"customer_funds_json\" TEXT,\n \"retention_accounting_binding_json\" TEXT,\n \"ordinary_accounting_binding_json\" TEXT,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"customer_id\" UUID,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\n \"method\" TEXT,\n \"status\" TEXT,\n \"transaction_id\" TEXT DEFAULT '',\n \"reference\" TEXT DEFAULT '',\n \"journal_id\" UUID,\n \"paid_at\" TIMESTAMP,\n \"notes\" TEXT DEFAULT '',\n \"external_id\" TEXT DEFAULT '',\n \"external_provider\" TEXT DEFAULT '',\n \"synced_at\" TIMESTAMP,\n \"backend_id\" TEXT DEFAULT '',\n \"backend_tx_ref\" TEXT DEFAULT '',\n \"native_amount\" INTEGER DEFAULT 0,\n \"native_currency\" TEXT DEFAULT '',\n \"usd_at_quote\" INTEGER DEFAULT 0,\n \"usd_at_confirmation\" INTEGER DEFAULT 0,\n \"connected_account_id\" TEXT DEFAULT '',\n \"application_fee_cents\" INTEGER DEFAULT 0,\n \"refund_of_payment_id\" TEXT DEFAULT '',\n \"connected_refund_state\" TEXT DEFAULT '',\n \"application_fee_refunded\" BOOLEAN DEFAULT FALSE\n);",
20344
20705
  "columns": {
20345
20706
  "id": {
20346
20707
  "type": "UUID",
@@ -20521,6 +20882,36 @@
20521
20882
  "notNull": false,
20522
20883
  "unique": false,
20523
20884
  "default": 0
20885
+ },
20886
+ "connected_account_id": {
20887
+ "type": "TEXT",
20888
+ "notNull": false,
20889
+ "unique": false,
20890
+ "default": ""
20891
+ },
20892
+ "application_fee_cents": {
20893
+ "type": "INTEGER",
20894
+ "notNull": false,
20895
+ "unique": false,
20896
+ "default": 0
20897
+ },
20898
+ "refund_of_payment_id": {
20899
+ "type": "TEXT",
20900
+ "notNull": false,
20901
+ "unique": false,
20902
+ "default": ""
20903
+ },
20904
+ "connected_refund_state": {
20905
+ "type": "TEXT",
20906
+ "notNull": false,
20907
+ "unique": false,
20908
+ "default": ""
20909
+ },
20910
+ "application_fee_refunded": {
20911
+ "type": "BOOLEAN",
20912
+ "notNull": false,
20913
+ "unique": false,
20914
+ "default": false
20524
20915
  }
20525
20916
  },
20526
20917
  "indexes": [
@@ -20560,7 +20951,7 @@
20560
20951
  ]
20561
20952
  }
20562
20953
  ],
20563
- "version": "f1f74425"
20954
+ "version": "00e17122"
20564
20955
  },
20565
20956
  "importPath": "@happyvertical/smrt-commerce"
20566
20957
  },
@@ -21239,6 +21630,31 @@
21239
21630
  "type": "text",
21240
21631
  "required": false,
21241
21632
  "default": ""
21633
+ },
21634
+ "connectedAccountId": {
21635
+ "type": "text",
21636
+ "required": false,
21637
+ "default": ""
21638
+ },
21639
+ "applicationFeeCents": {
21640
+ "type": "integer",
21641
+ "required": false,
21642
+ "default": 0
21643
+ },
21644
+ "connectedEnvironment": {
21645
+ "type": "text",
21646
+ "required": false,
21647
+ "default": ""
21648
+ },
21649
+ "connectedAmount": {
21650
+ "type": "integer",
21651
+ "required": false,
21652
+ "default": 0
21653
+ },
21654
+ "connectedCurrency": {
21655
+ "type": "text",
21656
+ "required": false,
21657
+ "default": ""
21242
21658
  }
21243
21659
  },
21244
21660
  "methods": {
@@ -21473,7 +21889,7 @@
21473
21889
  "collectionExportName": "PaymentIntentCollection",
21474
21890
  "schema": {
21475
21891
  "tableName": "payment_intents",
21476
- "ddl": "CREATE TABLE IF NOT EXISTS \"payment_intents\" (\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 \"sku_id\" TEXT DEFAULT '',\n \"offering_ref\" TEXT DEFAULT '',\n \"licensee_email\" TEXT DEFAULT '',\n \"customer_id\" TEXT DEFAULT '',\n \"payment_options\" JSON DEFAULT '[]',\n \"usd_price_locked\" INTEGER DEFAULT 0,\n \"price_lock_window_ms\" INTEGER,\n \"price_lock_expires_at\" TIMESTAMP,\n \"status\" TEXT,\n \"idempotency_key\" TEXT DEFAULT '',\n \"paid_option_backend_id\" TEXT DEFAULT '',\n \"payment_id\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"issued_at\" TIMESTAMP,\n \"expired_at\" TIMESTAMP,\n \"cancelled_at\" TIMESTAMP,\n \"retired_at\" TIMESTAMP,\n \"notes\" TEXT DEFAULT ''\n);",
21892
+ "ddl": "CREATE TABLE IF NOT EXISTS \"payment_intents\" (\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 \"sku_id\" TEXT DEFAULT '',\n \"offering_ref\" TEXT DEFAULT '',\n \"licensee_email\" TEXT DEFAULT '',\n \"customer_id\" TEXT DEFAULT '',\n \"payment_options\" JSON DEFAULT '[]',\n \"usd_price_locked\" INTEGER DEFAULT 0,\n \"price_lock_window_ms\" INTEGER,\n \"price_lock_expires_at\" TIMESTAMP,\n \"status\" TEXT,\n \"idempotency_key\" TEXT DEFAULT '',\n \"paid_option_backend_id\" TEXT DEFAULT '',\n \"payment_id\" TEXT DEFAULT '',\n \"paid_at\" TIMESTAMP,\n \"issued_at\" TIMESTAMP,\n \"expired_at\" TIMESTAMP,\n \"cancelled_at\" TIMESTAMP,\n \"retired_at\" TIMESTAMP,\n \"notes\" TEXT DEFAULT '',\n \"connected_account_id\" TEXT DEFAULT '',\n \"application_fee_cents\" INTEGER DEFAULT 0,\n \"connected_environment\" TEXT DEFAULT '',\n \"connected_amount\" INTEGER DEFAULT 0,\n \"connected_currency\" TEXT DEFAULT ''\n);",
21477
21893
  "columns": {
21478
21894
  "id": {
21479
21895
  "type": "UUID",
@@ -21605,6 +22021,36 @@
21605
22021
  "notNull": false,
21606
22022
  "unique": false,
21607
22023
  "default": ""
22024
+ },
22025
+ "connected_account_id": {
22026
+ "type": "TEXT",
22027
+ "notNull": false,
22028
+ "unique": false,
22029
+ "default": ""
22030
+ },
22031
+ "application_fee_cents": {
22032
+ "type": "INTEGER",
22033
+ "notNull": false,
22034
+ "unique": false,
22035
+ "default": 0
22036
+ },
22037
+ "connected_environment": {
22038
+ "type": "TEXT",
22039
+ "notNull": false,
22040
+ "unique": false,
22041
+ "default": ""
22042
+ },
22043
+ "connected_amount": {
22044
+ "type": "INTEGER",
22045
+ "notNull": false,
22046
+ "unique": false,
22047
+ "default": 0
22048
+ },
22049
+ "connected_currency": {
22050
+ "type": "TEXT",
22051
+ "notNull": false,
22052
+ "unique": false,
22053
+ "default": ""
21608
22054
  }
21609
22055
  },
21610
22056
  "indexes": [
@@ -21634,7 +22080,7 @@
21634
22080
  ]
21635
22081
  }
21636
22082
  ],
21637
- "version": "c565aaef"
22083
+ "version": "84a9cd3d"
21638
22084
  },
21639
22085
  "importPath": "@happyvertical/smrt-commerce"
21640
22086
  },
@@ -23496,95 +23942,909 @@
23496
23942
  },
23497
23943
  "importPath": "@happyvertical/smrt-commerce"
23498
23944
  },
23499
- "@happyvertical/smrt-commerce:Vendor": {
23500
- "name": "vendor",
23501
- "className": "Vendor",
23502
- "qualifiedName": "@happyvertical/smrt-commerce:Vendor",
23503
- "collection": "vendors",
23504
- "description": "Vendor represents the vendor/supplier role for a Profile.",
23505
- "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Vendor.ts",
23945
+ "@happyvertical/smrt-commerce:TenantPaymentAccount": {
23946
+ "name": "tenantpaymentaccount",
23947
+ "className": "TenantPaymentAccount",
23948
+ "qualifiedName": "@happyvertical/smrt-commerce:TenantPaymentAccount",
23949
+ "collection": "tenantpaymentaccounts",
23950
+ "description": "A tenant's connected payment account for one backend and environment.",
23951
+ "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/TenantPaymentAccount.ts",
23506
23952
  "packageName": "@happyvertical/smrt-commerce",
23507
23953
  "fields": {
23508
23954
  "tenantId": {
23509
23955
  "type": "text",
23510
- "required": false,
23956
+ "required": true,
23511
23957
  "_meta": {
23512
23958
  "sqlType": "UUID",
23513
- "nullable": true,
23514
23959
  "__tenancy": {
23515
23960
  "isTenantIdField": true,
23516
23961
  "autoFilter": true,
23517
- "required": false,
23962
+ "required": true,
23518
23963
  "autoPopulate": true,
23519
- "nullable": true,
23520
- "mode": "optional",
23964
+ "nullable": false,
23965
+ "mode": "required",
23521
23966
  "field": "tenantId",
23522
23967
  "allowSuperAdminBypass": false
23523
23968
  }
23524
23969
  }
23525
23970
  },
23526
- "profileId": {
23527
- "type": "crossPackageRef",
23528
- "required": false,
23529
- "related": "@happyvertical/smrt-profiles:Profile",
23530
- "_meta": {
23531
- "description": "Links this vendor to their profile record, where their name and contact details are kept."
23532
- }
23533
- },
23534
- "leadTimeDays": {
23535
- "type": "integer",
23536
- "required": false,
23537
- "default": 0,
23538
- "description": "How many days the vendor usually takes between your order and delivery.",
23971
+ "backendId": {
23972
+ "type": "text",
23973
+ "required": true,
23974
+ "default": "stripe",
23539
23975
  "_meta": {
23540
- "description": "How many days the vendor usually takes between your order and delivery."
23976
+ "required": true
23541
23977
  }
23542
23978
  },
23543
- "minimumOrderAmount": {
23544
- "type": "integer",
23545
- "required": false,
23546
- "default": 0,
23547
- "description": "The smallest order the vendor will accept.",
23979
+ "environment": {
23980
+ "type": "text",
23981
+ "required": true,
23982
+ "default": "test",
23548
23983
  "_meta": {
23549
- "description": "The smallest order the vendor will accept.",
23550
- "ui": {
23551
- "format": "money"
23552
- }
23553
- }
23984
+ "required": true
23985
+ },
23986
+ "enum": [
23987
+ "test",
23988
+ "live"
23989
+ ]
23554
23990
  },
23555
- "paymentTerms": {
23991
+ "providerAccountId": {
23556
23992
  "type": "text",
23557
- "required": false,
23993
+ "required": true,
23558
23994
  "default": "",
23559
- "description": "How long you have to pay this vendor, written the way you would say it, for example \"Net 30\".",
23560
23995
  "_meta": {
23561
- "description": "How long you have to pay this vendor, written the way you would say it, for example \"Net 30\"."
23996
+ "required": true
23562
23997
  }
23563
23998
  },
23564
- "currency": {
23999
+ "status": {
23565
24000
  "type": "text",
23566
24001
  "required": false,
23567
- "default": "USD",
23568
- "description": "The currency this vendor bills you in.",
23569
- "_meta": {
23570
- "description": "The currency this vendor bills you in.",
23571
- "ui": {
23572
- "widget": "currency"
23573
- }
23574
- }
24002
+ "default": "pending",
24003
+ "enum": [
24004
+ "pending",
24005
+ "restricted",
24006
+ "enabled",
24007
+ "disabled"
24008
+ ]
23575
24009
  },
23576
- "taxId": {
23577
- "type": "text",
24010
+ "chargesEnabled": {
24011
+ "type": "boolean",
23578
24012
  "required": false,
23579
- "default": "",
23580
- "description": "The vendor tax or VAT registration number kept on file.",
23581
- "_meta": {
23582
- "sensitive": true,
23583
- "description": "The vendor tax or VAT registration number kept on file."
23584
- },
23585
- "sensitive": true
24013
+ "default": false
23586
24014
  },
23587
- "defaultTaxCodeId": {
24015
+ "detailsSubmitted": {
24016
+ "type": "boolean",
24017
+ "required": false,
24018
+ "default": false
24019
+ },
24020
+ "payoutsEnabled": {
24021
+ "type": "boolean",
24022
+ "required": false,
24023
+ "default": false
24024
+ },
24025
+ "capabilitiesJson": {
24026
+ "type": "text",
24027
+ "required": false,
24028
+ "_meta": {}
24029
+ },
24030
+ "capabilitiesObservedAt": {
24031
+ "type": "datetime",
24032
+ "required": false,
24033
+ "_meta": {
24034
+ "nullable": true
24035
+ }
24036
+ },
24037
+ "feePolicyRef": {
24038
+ "type": "text",
24039
+ "required": false,
24040
+ "default": ""
24041
+ },
24042
+ "disabledAt": {
24043
+ "type": "datetime",
24044
+ "required": false,
24045
+ "_meta": {
24046
+ "nullable": true
24047
+ }
24048
+ },
24049
+ "disabledReason": {
24050
+ "type": "text",
24051
+ "required": false,
24052
+ "default": ""
24053
+ }
24054
+ },
24055
+ "methods": {
24056
+ "isEnabled": {
24057
+ "name": "isEnabled",
24058
+ "async": false,
24059
+ "parameters": [],
24060
+ "returnType": "boolean",
24061
+ "isStatic": false,
24062
+ "isPublic": true
24063
+ },
24064
+ "getCapabilities": {
24065
+ "name": "getCapabilities",
24066
+ "async": false,
24067
+ "parameters": [],
24068
+ "returnType": "TenantPaymentCapabilitySnapshot | null",
24069
+ "isStatic": false,
24070
+ "isPublic": true
24071
+ },
24072
+ "setCapabilities": {
24073
+ "name": "setCapabilities",
24074
+ "async": false,
24075
+ "parameters": [
24076
+ {
24077
+ "name": "snapshot",
24078
+ "type": "TenantPaymentCapabilitySnapshot",
24079
+ "optional": false
24080
+ },
24081
+ {
24082
+ "name": "observedAt",
24083
+ "type": "Date",
24084
+ "optional": false
24085
+ }
24086
+ ],
24087
+ "returnType": "void",
24088
+ "isStatic": false,
24089
+ "isPublic": true
24090
+ },
24091
+ "save": {
24092
+ "name": "save",
24093
+ "async": true,
24094
+ "parameters": [
24095
+ {
24096
+ "name": "options",
24097
+ "type": "SmrtSaveOptions",
24098
+ "optional": true
24099
+ }
24100
+ ],
24101
+ "returnType": "Promise<this>",
24102
+ "isStatic": false,
24103
+ "isPublic": true
24104
+ },
24105
+ "delete": {
24106
+ "name": "delete",
24107
+ "async": true,
24108
+ "parameters": [
24109
+ {
24110
+ "name": "_options",
24111
+ "type": "SmrtDeleteOptions",
24112
+ "optional": true
24113
+ }
24114
+ ],
24115
+ "returnType": "Promise<void>",
24116
+ "isStatic": false,
24117
+ "isPublic": true
24118
+ }
24119
+ },
24120
+ "decoratorConfig": {
24121
+ "tableName": "tenant_payment_accounts",
24122
+ "indexes": [
24123
+ {
24124
+ "name": "tenant_payment_accounts_tenant_backend_environment",
24125
+ "columns": [
24126
+ "tenantId",
24127
+ "backendId",
24128
+ "environment"
24129
+ ],
24130
+ "unique": true
24131
+ },
24132
+ {
24133
+ "name": "tenant_payment_accounts_provider_account",
24134
+ "columns": [
24135
+ "backendId",
24136
+ "environment",
24137
+ "providerAccountId"
24138
+ ],
24139
+ "unique": true
24140
+ }
24141
+ ],
24142
+ "api": {
24143
+ "include": [
24144
+ "list",
24145
+ "get"
24146
+ ]
24147
+ },
24148
+ "mcp": {
24149
+ "include": [
24150
+ "list",
24151
+ "get"
24152
+ ]
24153
+ },
24154
+ "cli": {
24155
+ "include": [
24156
+ "list",
24157
+ "get",
24158
+ "isEnabled",
24159
+ "getCapabilities"
24160
+ ],
24161
+ "skipApiCheck": true
24162
+ },
24163
+ "tenantScoped": {
24164
+ "mode": "required"
24165
+ },
24166
+ "conflictColumns": [
24167
+ "tenant_id",
24168
+ "slug",
24169
+ "context"
24170
+ ]
24171
+ },
24172
+ "extends": "SmrtObject",
24173
+ "exportName": "TenantPaymentAccount",
24174
+ "collectionExportName": "TenantPaymentAccountCollection",
24175
+ "validationRules": [
24176
+ {
24177
+ "field": "backendId",
24178
+ "rule": "required",
24179
+ "fieldType": "text"
24180
+ },
24181
+ {
24182
+ "field": "environment",
24183
+ "rule": "required",
24184
+ "fieldType": "text"
24185
+ },
24186
+ {
24187
+ "field": "providerAccountId",
24188
+ "rule": "required",
24189
+ "fieldType": "text"
24190
+ }
24191
+ ],
24192
+ "schema": {
24193
+ "tableName": "tenant_payment_accounts",
24194
+ "ddl": "CREATE TABLE IF NOT EXISTS \"tenant_payment_accounts\" (\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 \"backend_id\" TEXT NOT NULL DEFAULT 'stripe',\n \"environment\" TEXT NOT NULL DEFAULT 'test',\n \"provider_account_id\" TEXT NOT NULL DEFAULT '',\n \"status\" TEXT DEFAULT 'pending',\n \"charges_enabled\" BOOLEAN DEFAULT FALSE,\n \"details_submitted\" BOOLEAN DEFAULT FALSE,\n \"payouts_enabled\" BOOLEAN DEFAULT FALSE,\n \"capabilities_json\" TEXT,\n \"capabilities_observed_at\" TIMESTAMP,\n \"fee_policy_ref\" TEXT DEFAULT '',\n \"disabled_at\" TIMESTAMP,\n \"disabled_reason\" TEXT DEFAULT ''\n);",
24195
+ "columns": {
24196
+ "id": {
24197
+ "type": "UUID",
24198
+ "primaryKey": true,
24199
+ "referenceKind": "id",
24200
+ "notNull": true
24201
+ },
24202
+ "slug": {
24203
+ "type": "TEXT",
24204
+ "notNull": true
24205
+ },
24206
+ "context": {
24207
+ "type": "TEXT",
24208
+ "notNull": true,
24209
+ "default": ""
24210
+ },
24211
+ "created_at": {
24212
+ "type": "TIMESTAMP",
24213
+ "notNull": true,
24214
+ "default": "current_timestamp"
24215
+ },
24216
+ "updated_at": {
24217
+ "type": "TIMESTAMP",
24218
+ "notNull": true,
24219
+ "default": "current_timestamp"
24220
+ },
24221
+ "tenant_id": {
24222
+ "type": "UUID",
24223
+ "referenceKind": "tenantId",
24224
+ "notNull": true,
24225
+ "unique": false
24226
+ },
24227
+ "backend_id": {
24228
+ "type": "TEXT",
24229
+ "notNull": true,
24230
+ "unique": false,
24231
+ "default": "stripe"
24232
+ },
24233
+ "environment": {
24234
+ "type": "TEXT",
24235
+ "notNull": true,
24236
+ "unique": false,
24237
+ "default": "test"
24238
+ },
24239
+ "provider_account_id": {
24240
+ "type": "TEXT",
24241
+ "notNull": true,
24242
+ "unique": false,
24243
+ "default": ""
24244
+ },
24245
+ "status": {
24246
+ "type": "TEXT",
24247
+ "notNull": false,
24248
+ "unique": false,
24249
+ "default": "pending"
24250
+ },
24251
+ "charges_enabled": {
24252
+ "type": "BOOLEAN",
24253
+ "notNull": false,
24254
+ "unique": false,
24255
+ "default": false
24256
+ },
24257
+ "details_submitted": {
24258
+ "type": "BOOLEAN",
24259
+ "notNull": false,
24260
+ "unique": false,
24261
+ "default": false
24262
+ },
24263
+ "payouts_enabled": {
24264
+ "type": "BOOLEAN",
24265
+ "notNull": false,
24266
+ "unique": false,
24267
+ "default": false
24268
+ },
24269
+ "capabilities_json": {
24270
+ "type": "TEXT",
24271
+ "notNull": false,
24272
+ "unique": false
24273
+ },
24274
+ "capabilities_observed_at": {
24275
+ "type": "TIMESTAMP",
24276
+ "notNull": false,
24277
+ "unique": false
24278
+ },
24279
+ "fee_policy_ref": {
24280
+ "type": "TEXT",
24281
+ "notNull": false,
24282
+ "unique": false,
24283
+ "default": ""
24284
+ },
24285
+ "disabled_at": {
24286
+ "type": "TIMESTAMP",
24287
+ "notNull": false,
24288
+ "unique": false
24289
+ },
24290
+ "disabled_reason": {
24291
+ "type": "TEXT",
24292
+ "notNull": false,
24293
+ "unique": false,
24294
+ "default": ""
24295
+ }
24296
+ },
24297
+ "indexes": [
24298
+ {
24299
+ "name": "tenant_payment_accounts_slug_context_idx",
24300
+ "columns": [
24301
+ "tenant_id",
24302
+ "slug",
24303
+ "context"
24304
+ ],
24305
+ "unique": true
24306
+ },
24307
+ {
24308
+ "name": "tenant_payment_accounts_tenant_backend_environment",
24309
+ "columns": [
24310
+ "tenant_id",
24311
+ "backend_id",
24312
+ "environment"
24313
+ ],
24314
+ "unique": true
24315
+ },
24316
+ {
24317
+ "name": "tenant_payment_accounts_provider_account",
24318
+ "columns": [
24319
+ "backend_id",
24320
+ "environment",
24321
+ "provider_account_id"
24322
+ ],
24323
+ "unique": true
24324
+ },
24325
+ {
24326
+ "name": "tenant_payment_accounts_tenant_id_created_at_idx",
24327
+ "columns": [
24328
+ "tenant_id",
24329
+ "created_at"
24330
+ ]
24331
+ }
24332
+ ],
24333
+ "version": "7559c6fe"
24334
+ },
24335
+ "importPath": "@happyvertical/smrt-commerce"
24336
+ },
24337
+ "@happyvertical/smrt-commerce:TenantPaymentWebhookEvent": {
24338
+ "name": "tenantpaymentwebhookevent",
24339
+ "className": "TenantPaymentWebhookEvent",
24340
+ "qualifiedName": "@happyvertical/smrt-commerce:TenantPaymentWebhookEvent",
24341
+ "collection": "tenantpaymentwebhookevents",
24342
+ "description": "One processed provider webhook event.",
24343
+ "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/TenantPaymentWebhookEvent.ts",
24344
+ "packageName": "@happyvertical/smrt-commerce",
24345
+ "fields": {
24346
+ "backendId": {
24347
+ "type": "text",
24348
+ "required": true,
24349
+ "default": "",
24350
+ "_meta": {
24351
+ "required": true
24352
+ }
24353
+ },
24354
+ "environment": {
24355
+ "type": "text",
24356
+ "required": true,
24357
+ "default": "",
24358
+ "_meta": {
24359
+ "required": true
24360
+ }
24361
+ },
24362
+ "eventId": {
24363
+ "type": "text",
24364
+ "required": true,
24365
+ "default": "",
24366
+ "_meta": {
24367
+ "required": true
24368
+ }
24369
+ },
24370
+ "eventType": {
24371
+ "type": "text",
24372
+ "required": false,
24373
+ "default": ""
24374
+ },
24375
+ "endpoint": {
24376
+ "type": "text",
24377
+ "required": false,
24378
+ "default": ""
24379
+ },
24380
+ "tenantId": {
24381
+ "type": "crossPackageRef",
24382
+ "required": true,
24383
+ "related": "@happyvertical/smrt-users:Tenant",
24384
+ "_meta": {
24385
+ "required": true
24386
+ }
24387
+ },
24388
+ "providerAccountId": {
24389
+ "type": "text",
24390
+ "required": false,
24391
+ "default": ""
24392
+ },
24393
+ "outcome": {
24394
+ "type": "text",
24395
+ "required": false,
24396
+ "default": "ignored",
24397
+ "enum": [
24398
+ "settled",
24399
+ "already_settled",
24400
+ "pending",
24401
+ "account_updated",
24402
+ "stale_account_update",
24403
+ "application_fee",
24404
+ "refund_reported",
24405
+ "refund_updated",
24406
+ "late_payment",
24407
+ "ignored"
24408
+ ]
24409
+ },
24410
+ "paymentIntentId": {
24411
+ "type": "text",
24412
+ "required": false,
24413
+ "default": ""
24414
+ },
24415
+ "applicationFeeJson": {
24416
+ "type": "text",
24417
+ "required": false,
24418
+ "_meta": {}
24419
+ },
24420
+ "processedAt": {
24421
+ "type": "datetime",
24422
+ "required": false,
24423
+ "_meta": {
24424
+ "nullable": true
24425
+ }
24426
+ }
24427
+ },
24428
+ "methods": {},
24429
+ "decoratorConfig": {
24430
+ "tableName": "_smrt_tenant_payment_webhook_events",
24431
+ "indexes": [
24432
+ {
24433
+ "name": "_smrt_tenant_payment_webhook_events_event",
24434
+ "columns": [
24435
+ "backendId",
24436
+ "environment",
24437
+ "eventId"
24438
+ ],
24439
+ "unique": true
24440
+ }
24441
+ ],
24442
+ "api": false,
24443
+ "cli": false,
24444
+ "mcp": false,
24445
+ "conflictColumns": [
24446
+ "tenant_id",
24447
+ "slug",
24448
+ "context"
24449
+ ]
24450
+ },
24451
+ "extends": "SmrtObject",
24452
+ "exportName": "TenantPaymentWebhookEvent",
24453
+ "collectionExportName": "TenantPaymentWebhookEventCollection",
24454
+ "validationRules": [
24455
+ {
24456
+ "field": "backendId",
24457
+ "rule": "required",
24458
+ "fieldType": "text"
24459
+ },
24460
+ {
24461
+ "field": "environment",
24462
+ "rule": "required",
24463
+ "fieldType": "text"
24464
+ },
24465
+ {
24466
+ "field": "eventId",
24467
+ "rule": "required",
24468
+ "fieldType": "text"
24469
+ },
24470
+ {
24471
+ "field": "tenantId",
24472
+ "rule": "required",
24473
+ "fieldType": "crossPackageRef"
24474
+ }
24475
+ ],
24476
+ "schema": {
24477
+ "tableName": "_smrt_tenant_payment_webhook_events",
24478
+ "ddl": "CREATE TABLE IF NOT EXISTS \"_smrt_tenant_payment_webhook_events\" (\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 \"backend_id\" TEXT NOT NULL DEFAULT '',\n \"environment\" TEXT NOT NULL DEFAULT '',\n \"event_id\" TEXT NOT NULL DEFAULT '',\n \"event_type\" TEXT DEFAULT '',\n \"endpoint\" TEXT DEFAULT '',\n \"tenant_id\" UUID NOT NULL,\n \"provider_account_id\" TEXT DEFAULT '',\n \"outcome\" TEXT DEFAULT 'ignored',\n \"payment_intent_id\" TEXT DEFAULT '',\n \"application_fee_json\" TEXT,\n \"processed_at\" TIMESTAMP\n);",
24479
+ "columns": {
24480
+ "id": {
24481
+ "type": "UUID",
24482
+ "primaryKey": true,
24483
+ "referenceKind": "id",
24484
+ "notNull": true
24485
+ },
24486
+ "slug": {
24487
+ "type": "TEXT",
24488
+ "notNull": true
24489
+ },
24490
+ "context": {
24491
+ "type": "TEXT",
24492
+ "notNull": true,
24493
+ "default": ""
24494
+ },
24495
+ "created_at": {
24496
+ "type": "TIMESTAMP",
24497
+ "notNull": true,
24498
+ "default": "current_timestamp"
24499
+ },
24500
+ "updated_at": {
24501
+ "type": "TIMESTAMP",
24502
+ "notNull": true,
24503
+ "default": "current_timestamp"
24504
+ },
24505
+ "backend_id": {
24506
+ "type": "TEXT",
24507
+ "notNull": true,
24508
+ "unique": false,
24509
+ "default": ""
24510
+ },
24511
+ "environment": {
24512
+ "type": "TEXT",
24513
+ "notNull": true,
24514
+ "unique": false,
24515
+ "default": ""
24516
+ },
24517
+ "event_id": {
24518
+ "type": "TEXT",
24519
+ "notNull": true,
24520
+ "unique": false,
24521
+ "default": ""
24522
+ },
24523
+ "event_type": {
24524
+ "type": "TEXT",
24525
+ "notNull": false,
24526
+ "unique": false,
24527
+ "default": ""
24528
+ },
24529
+ "endpoint": {
24530
+ "type": "TEXT",
24531
+ "notNull": false,
24532
+ "unique": false,
24533
+ "default": ""
24534
+ },
24535
+ "tenant_id": {
24536
+ "type": "UUID",
24537
+ "referenceKind": "crossPackageRef",
24538
+ "notNull": true,
24539
+ "unique": false
24540
+ },
24541
+ "provider_account_id": {
24542
+ "type": "TEXT",
24543
+ "notNull": false,
24544
+ "unique": false,
24545
+ "default": ""
24546
+ },
24547
+ "outcome": {
24548
+ "type": "TEXT",
24549
+ "notNull": false,
24550
+ "unique": false,
24551
+ "default": "ignored"
24552
+ },
24553
+ "payment_intent_id": {
24554
+ "type": "TEXT",
24555
+ "notNull": false,
24556
+ "unique": false,
24557
+ "default": ""
24558
+ },
24559
+ "application_fee_json": {
24560
+ "type": "TEXT",
24561
+ "notNull": false,
24562
+ "unique": false
24563
+ },
24564
+ "processed_at": {
24565
+ "type": "TIMESTAMP",
24566
+ "notNull": false,
24567
+ "unique": false
24568
+ }
24569
+ },
24570
+ "indexes": [
24571
+ {
24572
+ "name": "_smrt_tenant_payment_webhook_events_tenant_id_slug_idx",
24573
+ "columns": [
24574
+ "tenant_id",
24575
+ "slug",
24576
+ "context"
24577
+ ],
24578
+ "unique": true
24579
+ },
24580
+ {
24581
+ "name": "_smrt_tenant_payment_webhook_events_event",
24582
+ "columns": [
24583
+ "backend_id",
24584
+ "environment",
24585
+ "event_id"
24586
+ ],
24587
+ "unique": true
24588
+ },
24589
+ {
24590
+ "name": "_smrt_tenant_payment_webhook_events_created_at_idx",
24591
+ "columns": [
24592
+ "created_at"
24593
+ ]
24594
+ }
24595
+ ],
24596
+ "version": "2625b602"
24597
+ },
24598
+ "importPath": "@happyvertical/smrt-commerce"
24599
+ },
24600
+ "@happyvertical/smrt-commerce:TenantPaymentWebhookEventCollection": {
24601
+ "name": "tenantpaymentwebhookeventcollection",
24602
+ "className": "TenantPaymentWebhookEventCollection",
24603
+ "qualifiedName": "@happyvertical/smrt-commerce:TenantPaymentWebhookEventCollection",
24604
+ "collection": "tenantpaymentwebhookevents",
24605
+ "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/TenantPaymentWebhookEvent.ts",
24606
+ "packageName": "@happyvertical/smrt-commerce",
24607
+ "fields": {},
24608
+ "methods": {
24609
+ "build": {
24610
+ "name": "build",
24611
+ "async": true,
24612
+ "parameters": [
24613
+ {
24614
+ "name": "options",
24615
+ "type": "any",
24616
+ "optional": false,
24617
+ "typeUnresolved": true
24618
+ }
24619
+ ],
24620
+ "returnType": "Promise<TenantPaymentWebhookEvent>",
24621
+ "isStatic": false,
24622
+ "isPublic": true
24623
+ }
24624
+ },
24625
+ "decoratorConfig": {
24626
+ "tableName": "_smrt_tenant_payment_webhook_events",
24627
+ "api": false,
24628
+ "mcp": false,
24629
+ "cli": false
24630
+ },
24631
+ "extends": "SmrtCollection",
24632
+ "extendsTypeArg": "TenantPaymentWebhookEvent",
24633
+ "exportName": "TenantPaymentWebhookEventCollection",
24634
+ "collectionExportName": "TenantPaymentWebhookEventCollectionCollection",
24635
+ "schema": {
24636
+ "tableName": "_smrt_tenant_payment_webhook_events",
24637
+ "ddl": "CREATE TABLE IF NOT EXISTS \"_smrt_tenant_payment_webhook_events\" (\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 \"backend_id\" TEXT NOT NULL DEFAULT '',\n \"environment\" TEXT NOT NULL DEFAULT '',\n \"event_id\" TEXT NOT NULL DEFAULT '',\n \"event_type\" TEXT DEFAULT '',\n \"endpoint\" TEXT DEFAULT '',\n \"tenant_id\" UUID NOT NULL,\n \"provider_account_id\" TEXT DEFAULT '',\n \"outcome\" TEXT DEFAULT 'ignored',\n \"payment_intent_id\" TEXT DEFAULT '',\n \"application_fee_json\" TEXT,\n \"processed_at\" TIMESTAMP\n);",
24638
+ "columns": {
24639
+ "id": {
24640
+ "type": "UUID",
24641
+ "primaryKey": true,
24642
+ "referenceKind": "id",
24643
+ "notNull": true
24644
+ },
24645
+ "slug": {
24646
+ "type": "TEXT",
24647
+ "notNull": true
24648
+ },
24649
+ "context": {
24650
+ "type": "TEXT",
24651
+ "notNull": true,
24652
+ "default": ""
24653
+ },
24654
+ "created_at": {
24655
+ "type": "TIMESTAMP",
24656
+ "notNull": true,
24657
+ "default": "current_timestamp"
24658
+ },
24659
+ "updated_at": {
24660
+ "type": "TIMESTAMP",
24661
+ "notNull": true,
24662
+ "default": "current_timestamp"
24663
+ },
24664
+ "backend_id": {
24665
+ "type": "TEXT",
24666
+ "notNull": true,
24667
+ "unique": false,
24668
+ "default": ""
24669
+ },
24670
+ "environment": {
24671
+ "type": "TEXT",
24672
+ "notNull": true,
24673
+ "unique": false,
24674
+ "default": ""
24675
+ },
24676
+ "event_id": {
24677
+ "type": "TEXT",
24678
+ "notNull": true,
24679
+ "unique": false,
24680
+ "default": ""
24681
+ },
24682
+ "event_type": {
24683
+ "type": "TEXT",
24684
+ "notNull": false,
24685
+ "unique": false,
24686
+ "default": ""
24687
+ },
24688
+ "endpoint": {
24689
+ "type": "TEXT",
24690
+ "notNull": false,
24691
+ "unique": false,
24692
+ "default": ""
24693
+ },
24694
+ "tenant_id": {
24695
+ "type": "UUID",
24696
+ "referenceKind": "crossPackageRef",
24697
+ "notNull": true,
24698
+ "unique": false
24699
+ },
24700
+ "provider_account_id": {
24701
+ "type": "TEXT",
24702
+ "notNull": false,
24703
+ "unique": false,
24704
+ "default": ""
24705
+ },
24706
+ "outcome": {
24707
+ "type": "TEXT",
24708
+ "notNull": false,
24709
+ "unique": false,
24710
+ "default": "ignored"
24711
+ },
24712
+ "payment_intent_id": {
24713
+ "type": "TEXT",
24714
+ "notNull": false,
24715
+ "unique": false,
24716
+ "default": ""
24717
+ },
24718
+ "application_fee_json": {
24719
+ "type": "TEXT",
24720
+ "notNull": false,
24721
+ "unique": false
24722
+ },
24723
+ "processed_at": {
24724
+ "type": "TIMESTAMP",
24725
+ "notNull": false,
24726
+ "unique": false
24727
+ }
24728
+ },
24729
+ "indexes": [
24730
+ {
24731
+ "name": "_smrt_tenant_payment_webhook_events_tenant_id_slug_idx",
24732
+ "columns": [
24733
+ "tenant_id",
24734
+ "slug",
24735
+ "context"
24736
+ ],
24737
+ "unique": true
24738
+ },
24739
+ {
24740
+ "name": "_smrt_tenant_payment_webhook_events_event",
24741
+ "columns": [
24742
+ "backend_id",
24743
+ "environment",
24744
+ "event_id"
24745
+ ],
24746
+ "unique": true
24747
+ },
24748
+ {
24749
+ "name": "_smrt_tenant_payment_webhook_events_created_at_idx",
24750
+ "columns": [
24751
+ "created_at"
24752
+ ]
24753
+ }
24754
+ ],
24755
+ "version": "2625b602"
24756
+ },
24757
+ "importPath": "@happyvertical/smrt-commerce"
24758
+ },
24759
+ "@happyvertical/smrt-commerce:Vendor": {
24760
+ "name": "vendor",
24761
+ "className": "Vendor",
24762
+ "qualifiedName": "@happyvertical/smrt-commerce:Vendor",
24763
+ "collection": "vendors",
24764
+ "description": "Vendor represents the vendor/supplier role for a Profile.",
24765
+ "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Vendor.ts",
24766
+ "packageName": "@happyvertical/smrt-commerce",
24767
+ "fields": {
24768
+ "tenantId": {
24769
+ "type": "text",
24770
+ "required": false,
24771
+ "_meta": {
24772
+ "sqlType": "UUID",
24773
+ "nullable": true,
24774
+ "__tenancy": {
24775
+ "isTenantIdField": true,
24776
+ "autoFilter": true,
24777
+ "required": false,
24778
+ "autoPopulate": true,
24779
+ "nullable": true,
24780
+ "mode": "optional",
24781
+ "field": "tenantId",
24782
+ "allowSuperAdminBypass": false
24783
+ }
24784
+ }
24785
+ },
24786
+ "profileId": {
24787
+ "type": "crossPackageRef",
24788
+ "required": false,
24789
+ "related": "@happyvertical/smrt-profiles:Profile",
24790
+ "_meta": {
24791
+ "description": "Links this vendor to their profile record, where their name and contact details are kept."
24792
+ }
24793
+ },
24794
+ "leadTimeDays": {
24795
+ "type": "integer",
24796
+ "required": false,
24797
+ "default": 0,
24798
+ "description": "How many days the vendor usually takes between your order and delivery.",
24799
+ "_meta": {
24800
+ "description": "How many days the vendor usually takes between your order and delivery."
24801
+ }
24802
+ },
24803
+ "minimumOrderAmount": {
24804
+ "type": "integer",
24805
+ "required": false,
24806
+ "default": 0,
24807
+ "description": "The smallest order the vendor will accept.",
24808
+ "_meta": {
24809
+ "description": "The smallest order the vendor will accept.",
24810
+ "ui": {
24811
+ "format": "money"
24812
+ }
24813
+ }
24814
+ },
24815
+ "paymentTerms": {
24816
+ "type": "text",
24817
+ "required": false,
24818
+ "default": "",
24819
+ "description": "How long you have to pay this vendor, written the way you would say it, for example \"Net 30\".",
24820
+ "_meta": {
24821
+ "description": "How long you have to pay this vendor, written the way you would say it, for example \"Net 30\"."
24822
+ }
24823
+ },
24824
+ "currency": {
24825
+ "type": "text",
24826
+ "required": false,
24827
+ "default": "USD",
24828
+ "description": "The currency this vendor bills you in.",
24829
+ "_meta": {
24830
+ "description": "The currency this vendor bills you in.",
24831
+ "ui": {
24832
+ "widget": "currency"
24833
+ }
24834
+ }
24835
+ },
24836
+ "taxId": {
24837
+ "type": "text",
24838
+ "required": false,
24839
+ "default": "",
24840
+ "description": "The vendor tax or VAT registration number kept on file.",
24841
+ "_meta": {
24842
+ "sensitive": true,
24843
+ "description": "The vendor tax or VAT registration number kept on file."
24844
+ },
24845
+ "sensitive": true
24846
+ },
24847
+ "defaultTaxCodeId": {
23588
24848
  "type": "foreignKey",
23589
24849
  "required": false,
23590
24850
  "related": "TaxCode",
@@ -26762,6 +28022,21 @@
26762
28022
  },
26763
28023
  "transactionId": {
26764
28024
  "visibility": "hidden"
28025
+ },
28026
+ "connectedAccountId": {
28027
+ "visibility": "hidden"
28028
+ },
28029
+ "applicationFeeCents": {
28030
+ "visibility": "hidden"
28031
+ },
28032
+ "refundOfPaymentId": {
28033
+ "visibility": "hidden"
28034
+ },
28035
+ "connectedRefundState": {
28036
+ "visibility": "hidden"
28037
+ },
28038
+ "applicationFeeRefunded": {
28039
+ "visibility": "hidden"
26765
28040
  }
26766
28041
  }
26767
28042
  },