@happyvertical/smrt-commerce 0.40.69 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-commerce",
5
- "packageVersion": "0.40.69",
5
+ "packageVersion": "0.41.0",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-commerce:ContractCollection": {
8
8
  "name": "contractcollection",
@@ -193,12 +193,6 @@
193
193
  }
194
194
  },
195
195
  "indexes": [
196
- {
197
- "name": "contract_collections_id_idx",
198
- "columns": [
199
- "id"
200
- ]
201
- },
202
196
  {
203
197
  "name": "contract_collections_slug_context_idx",
204
198
  "columns": [
@@ -206,6 +200,12 @@
206
200
  "context"
207
201
  ],
208
202
  "unique": true
203
+ },
204
+ {
205
+ "name": "contract_collections_created_at_idx",
206
+ "columns": [
207
+ "created_at"
208
+ ]
209
209
  }
210
210
  ],
211
211
  "version": "c2abc9f0"
@@ -307,12 +307,6 @@
307
307
  }
308
308
  },
309
309
  "indexes": [
310
- {
311
- "name": "contract_line_item_collections_id_idx",
312
- "columns": [
313
- "id"
314
- ]
315
- },
316
310
  {
317
311
  "name": "contract_line_item_collections_slug_context_idx",
318
312
  "columns": [
@@ -320,6 +314,12 @@
320
314
  "context"
321
315
  ],
322
316
  "unique": true
317
+ },
318
+ {
319
+ "name": "contract_line_item_collections_created_at_idx",
320
+ "columns": [
321
+ "created_at"
322
+ ]
323
323
  }
324
324
  ],
325
325
  "version": "410887d1"
@@ -462,12 +462,6 @@
462
462
  }
463
463
  },
464
464
  "indexes": [
465
- {
466
- "name": "customer_collections_id_idx",
467
- "columns": [
468
- "id"
469
- ]
470
- },
471
465
  {
472
466
  "name": "customer_collections_slug_context_idx",
473
467
  "columns": [
@@ -475,6 +469,12 @@
475
469
  "context"
476
470
  ],
477
471
  "unique": true
472
+ },
473
+ {
474
+ "name": "customer_collections_created_at_idx",
475
+ "columns": [
476
+ "created_at"
477
+ ]
478
478
  }
479
479
  ],
480
480
  "version": "63593259"
@@ -653,12 +653,6 @@
653
653
  }
654
654
  },
655
655
  "indexes": [
656
- {
657
- "name": "fulfillment_collections_id_idx",
658
- "columns": [
659
- "id"
660
- ]
661
- },
662
656
  {
663
657
  "name": "fulfillment_collections_slug_context_idx",
664
658
  "columns": [
@@ -666,6 +660,12 @@
666
660
  "context"
667
661
  ],
668
662
  "unique": true
663
+ },
664
+ {
665
+ "name": "fulfillment_collections_created_at_idx",
666
+ "columns": [
667
+ "created_at"
668
+ ]
669
669
  }
670
670
  ],
671
671
  "version": "0cb8f9e1"
@@ -795,12 +795,6 @@
795
795
  }
796
796
  },
797
797
  "indexes": [
798
- {
799
- "name": "fulfillment_line_item_collections_id_idx",
800
- "columns": [
801
- "id"
802
- ]
803
- },
804
798
  {
805
799
  "name": "fulfillment_line_item_collections_slug_context_idx",
806
800
  "columns": [
@@ -808,6 +802,12 @@
808
802
  "context"
809
803
  ],
810
804
  "unique": true
805
+ },
806
+ {
807
+ "name": "fulfillment_line_item_collections_created_at_idx",
808
+ "columns": [
809
+ "created_at"
810
+ ]
811
811
  }
812
812
  ],
813
813
  "version": "88e7502e"
@@ -1074,12 +1074,6 @@
1074
1074
  }
1075
1075
  },
1076
1076
  "indexes": [
1077
- {
1078
- "name": "invoice_collections_id_idx",
1079
- "columns": [
1080
- "id"
1081
- ]
1082
- },
1083
1077
  {
1084
1078
  "name": "invoice_collections_slug_context_idx",
1085
1079
  "columns": [
@@ -1087,6 +1081,12 @@
1087
1081
  "context"
1088
1082
  ],
1089
1083
  "unique": true
1084
+ },
1085
+ {
1086
+ "name": "invoice_collections_created_at_idx",
1087
+ "columns": [
1088
+ "created_at"
1089
+ ]
1090
1090
  }
1091
1091
  ],
1092
1092
  "version": "4877ccc3"
@@ -1305,12 +1305,6 @@
1305
1305
  }
1306
1306
  },
1307
1307
  "indexes": [
1308
- {
1309
- "name": "invoice_line_item_collections_id_idx",
1310
- "columns": [
1311
- "id"
1312
- ]
1313
- },
1314
1308
  {
1315
1309
  "name": "invoice_line_item_collections_slug_context_idx",
1316
1310
  "columns": [
@@ -1318,6 +1312,12 @@
1318
1312
  "context"
1319
1313
  ],
1320
1314
  "unique": true
1315
+ },
1316
+ {
1317
+ "name": "invoice_line_item_collections_created_at_idx",
1318
+ "columns": [
1319
+ "created_at"
1320
+ ]
1321
1321
  }
1322
1322
  ],
1323
1323
  "version": "27337dcf"
@@ -1532,12 +1532,6 @@
1532
1532
  }
1533
1533
  },
1534
1534
  "indexes": [
1535
- {
1536
- "name": "payment_allocation_collections_id_idx",
1537
- "columns": [
1538
- "id"
1539
- ]
1540
- },
1541
1535
  {
1542
1536
  "name": "payment_allocation_collections_slug_context_idx",
1543
1537
  "columns": [
@@ -1545,6 +1539,12 @@
1545
1539
  "context"
1546
1540
  ],
1547
1541
  "unique": true
1542
+ },
1543
+ {
1544
+ "name": "payment_allocation_collections_created_at_idx",
1545
+ "columns": [
1546
+ "created_at"
1547
+ ]
1548
1548
  }
1549
1549
  ],
1550
1550
  "version": "0d07c4d3"
@@ -1765,12 +1765,6 @@
1765
1765
  }
1766
1766
  },
1767
1767
  "indexes": [
1768
- {
1769
- "name": "payment_collections_id_idx",
1770
- "columns": [
1771
- "id"
1772
- ]
1773
- },
1774
1768
  {
1775
1769
  "name": "payment_collections_slug_context_idx",
1776
1770
  "columns": [
@@ -1778,6 +1772,12 @@
1778
1772
  "context"
1779
1773
  ],
1780
1774
  "unique": true
1775
+ },
1776
+ {
1777
+ "name": "payment_collections_created_at_idx",
1778
+ "columns": [
1779
+ "created_at"
1780
+ ]
1781
1781
  }
1782
1782
  ],
1783
1783
  "version": "bf759c9b"
@@ -1940,12 +1940,6 @@
1940
1940
  }
1941
1941
  },
1942
1942
  "indexes": [
1943
- {
1944
- "name": "payment_instrument_collections_id_idx",
1945
- "columns": [
1946
- "id"
1947
- ]
1948
- },
1949
1943
  {
1950
1944
  "name": "payment_instrument_collections_slug_context_idx",
1951
1945
  "columns": [
@@ -1953,6 +1947,12 @@
1953
1947
  "context"
1954
1948
  ],
1955
1949
  "unique": true
1950
+ },
1951
+ {
1952
+ "name": "payment_instrument_collections_created_at_idx",
1953
+ "columns": [
1954
+ "created_at"
1955
+ ]
1956
1956
  }
1957
1957
  ],
1958
1958
  "version": "dd2ca72c"
@@ -2126,12 +2126,6 @@
2126
2126
  }
2127
2127
  },
2128
2128
  "indexes": [
2129
- {
2130
- "name": "payment_intent_collections_id_idx",
2131
- "columns": [
2132
- "id"
2133
- ]
2134
- },
2135
2129
  {
2136
2130
  "name": "payment_intent_collections_slug_context_idx",
2137
2131
  "columns": [
@@ -2139,6 +2133,12 @@
2139
2133
  "context"
2140
2134
  ],
2141
2135
  "unique": true
2136
+ },
2137
+ {
2138
+ "name": "payment_intent_collections_created_at_idx",
2139
+ "columns": [
2140
+ "created_at"
2141
+ ]
2142
2142
  }
2143
2143
  ],
2144
2144
  "version": "f79d1a8f"
@@ -2326,12 +2326,6 @@
2326
2326
  }
2327
2327
  },
2328
2328
  "indexes": [
2329
- {
2330
- "name": "payout_collections_id_idx",
2331
- "columns": [
2332
- "id"
2333
- ]
2334
- },
2335
2329
  {
2336
2330
  "name": "payout_collections_slug_context_idx",
2337
2331
  "columns": [
@@ -2339,6 +2333,12 @@
2339
2333
  "context"
2340
2334
  ],
2341
2335
  "unique": true
2336
+ },
2337
+ {
2338
+ "name": "payout_collections_created_at_idx",
2339
+ "columns": [
2340
+ "created_at"
2341
+ ]
2342
2342
  }
2343
2343
  ],
2344
2344
  "version": "7dc3bcc1"
@@ -2481,12 +2481,6 @@
2481
2481
  }
2482
2482
  },
2483
2483
  "indexes": [
2484
- {
2485
- "name": "vendor_collections_id_idx",
2486
- "columns": [
2487
- "id"
2488
- ]
2489
- },
2490
2484
  {
2491
2485
  "name": "vendor_collections_slug_context_idx",
2492
2486
  "columns": [
@@ -2494,6 +2488,12 @@
2494
2488
  "context"
2495
2489
  ],
2496
2490
  "unique": true
2491
+ },
2492
+ {
2493
+ "name": "vendor_collections_created_at_idx",
2494
+ "columns": [
2495
+ "created_at"
2496
+ ]
2497
2497
  }
2498
2498
  ],
2499
2499
  "version": "ffdcddab"
@@ -2552,17 +2552,17 @@
2552
2552
  "related": "Vendor"
2553
2553
  },
2554
2554
  "subtotal": {
2555
- "type": "decimal",
2555
+ "type": "integer",
2556
2556
  "required": false,
2557
2557
  "default": 0
2558
2558
  },
2559
2559
  "taxAmount": {
2560
- "type": "decimal",
2560
+ "type": "integer",
2561
2561
  "required": false,
2562
2562
  "default": 0
2563
2563
  },
2564
2564
  "totalAmount": {
2565
- "type": "decimal",
2565
+ "type": "integer",
2566
2566
  "required": false,
2567
2567
  "default": 0
2568
2568
  },
@@ -3162,14 +3162,20 @@
3162
3162
  "cli": true,
3163
3163
  "tenantScoped": {
3164
3164
  "mode": "optional"
3165
- }
3165
+ },
3166
+ "conflictColumns": [
3167
+ "tenant_id",
3168
+ "slug",
3169
+ "context",
3170
+ "_meta_type"
3171
+ ]
3166
3172
  },
3167
3173
  "extends": "SmrtObject",
3168
3174
  "exportName": "Contract",
3169
3175
  "collectionExportName": "ContractCollection",
3170
3176
  "schema": {
3171
3177
  "tableName": "contracts",
3172
- "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" REAL DEFAULT 0,\n \"tax_amount\" REAL DEFAULT 0,\n \"total_amount\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
3178
+ "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
3173
3179
  "columns": {
3174
3180
  "id": {
3175
3181
  "type": "UUID",
@@ -3228,17 +3234,17 @@
3228
3234
  "notNull": false
3229
3235
  },
3230
3236
  "subtotal": {
3231
- "type": "REAL",
3237
+ "type": "INTEGER",
3232
3238
  "notNull": false,
3233
3239
  "default": 0
3234
3240
  },
3235
3241
  "tax_amount": {
3236
- "type": "REAL",
3242
+ "type": "INTEGER",
3237
3243
  "notNull": false,
3238
3244
  "default": 0
3239
3245
  },
3240
3246
  "total_amount": {
3241
- "type": "REAL",
3247
+ "type": "INTEGER",
3242
3248
  "notNull": false,
3243
3249
  "default": 0
3244
3250
  },
@@ -3281,15 +3287,10 @@
3281
3287
  }
3282
3288
  },
3283
3289
  "indexes": [
3284
- {
3285
- "name": "contracts_id_idx",
3286
- "columns": [
3287
- "id"
3288
- ]
3289
- },
3290
3290
  {
3291
3291
  "name": "contracts_slug_context_meta_type_idx",
3292
3292
  "columns": [
3293
+ "tenant_id",
3293
3294
  "slug",
3294
3295
  "context",
3295
3296
  "_meta_type"
@@ -3301,9 +3302,28 @@
3301
3302
  "columns": [
3302
3303
  "_meta_type"
3303
3304
  ]
3305
+ },
3306
+ {
3307
+ "name": "contracts_tenant_id_created_at_idx",
3308
+ "columns": [
3309
+ "tenant_id",
3310
+ "created_at"
3311
+ ]
3312
+ },
3313
+ {
3314
+ "name": "contracts_customer_id_idx",
3315
+ "columns": [
3316
+ "customer_id"
3317
+ ]
3318
+ },
3319
+ {
3320
+ "name": "contracts_vendor_id_idx",
3321
+ "columns": [
3322
+ "vendor_id"
3323
+ ]
3304
3324
  }
3305
3325
  ],
3306
- "version": "f73df1ce"
3326
+ "version": "db450616"
3307
3327
  }
3308
3328
  },
3309
3329
  "@happyvertical/smrt-commerce:Estimate": {
@@ -3359,17 +3379,17 @@
3359
3379
  "related": "Vendor"
3360
3380
  },
3361
3381
  "subtotal": {
3362
- "type": "decimal",
3382
+ "type": "integer",
3363
3383
  "required": false,
3364
3384
  "default": 0
3365
3385
  },
3366
3386
  "taxAmount": {
3367
- "type": "decimal",
3387
+ "type": "integer",
3368
3388
  "required": false,
3369
3389
  "default": 0
3370
3390
  },
3371
3391
  "totalAmount": {
3372
- "type": "decimal",
3392
+ "type": "integer",
3373
3393
  "required": false,
3374
3394
  "default": 0
3375
3395
  },
@@ -3962,7 +3982,7 @@
3962
3982
  "collectionExportName": "EstimateCollection",
3963
3983
  "schema": {
3964
3984
  "tableName": "contracts",
3965
- "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" REAL DEFAULT 0,\n \"tax_amount\" REAL DEFAULT 0,\n \"total_amount\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
3985
+ "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
3966
3986
  "columns": {
3967
3987
  "id": {
3968
3988
  "type": "UUID",
@@ -4021,17 +4041,17 @@
4021
4041
  "notNull": false
4022
4042
  },
4023
4043
  "subtotal": {
4024
- "type": "REAL",
4044
+ "type": "INTEGER",
4025
4045
  "notNull": false,
4026
4046
  "default": 0
4027
4047
  },
4028
4048
  "tax_amount": {
4029
- "type": "REAL",
4049
+ "type": "INTEGER",
4030
4050
  "notNull": false,
4031
4051
  "default": 0
4032
4052
  },
4033
4053
  "total_amount": {
4034
- "type": "REAL",
4054
+ "type": "INTEGER",
4035
4055
  "notNull": false,
4036
4056
  "default": 0
4037
4057
  },
@@ -4074,15 +4094,10 @@
4074
4094
  }
4075
4095
  },
4076
4096
  "indexes": [
4077
- {
4078
- "name": "contracts_id_idx",
4079
- "columns": [
4080
- "id"
4081
- ]
4082
- },
4083
4097
  {
4084
4098
  "name": "contracts_slug_context_meta_type_idx",
4085
4099
  "columns": [
4100
+ "tenant_id",
4086
4101
  "slug",
4087
4102
  "context",
4088
4103
  "_meta_type"
@@ -4094,9 +4109,28 @@
4094
4109
  "columns": [
4095
4110
  "_meta_type"
4096
4111
  ]
4112
+ },
4113
+ {
4114
+ "name": "contracts_tenant_id_created_at_idx",
4115
+ "columns": [
4116
+ "tenant_id",
4117
+ "created_at"
4118
+ ]
4119
+ },
4120
+ {
4121
+ "name": "contracts_customer_id_idx",
4122
+ "columns": [
4123
+ "customer_id"
4124
+ ]
4125
+ },
4126
+ {
4127
+ "name": "contracts_vendor_id_idx",
4128
+ "columns": [
4129
+ "vendor_id"
4130
+ ]
4097
4131
  }
4098
4132
  ],
4099
- "version": "6398f520"
4133
+ "version": "db450616"
4100
4134
  }
4101
4135
  },
4102
4136
  "@happyvertical/smrt-commerce:Order": {
@@ -4152,17 +4186,17 @@
4152
4186
  "related": "Vendor"
4153
4187
  },
4154
4188
  "subtotal": {
4155
- "type": "decimal",
4189
+ "type": "integer",
4156
4190
  "required": false,
4157
4191
  "default": 0
4158
4192
  },
4159
4193
  "taxAmount": {
4160
- "type": "decimal",
4194
+ "type": "integer",
4161
4195
  "required": false,
4162
4196
  "default": 0
4163
4197
  },
4164
4198
  "totalAmount": {
4165
- "type": "decimal",
4199
+ "type": "integer",
4166
4200
  "required": false,
4167
4201
  "default": 0
4168
4202
  },
@@ -4755,7 +4789,7 @@
4755
4789
  "collectionExportName": "OrderCollection",
4756
4790
  "schema": {
4757
4791
  "tableName": "contracts",
4758
- "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" REAL DEFAULT 0,\n \"tax_amount\" REAL DEFAULT 0,\n \"total_amount\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
4792
+ "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
4759
4793
  "columns": {
4760
4794
  "id": {
4761
4795
  "type": "UUID",
@@ -4814,17 +4848,17 @@
4814
4848
  "notNull": false
4815
4849
  },
4816
4850
  "subtotal": {
4817
- "type": "REAL",
4851
+ "type": "INTEGER",
4818
4852
  "notNull": false,
4819
4853
  "default": 0
4820
4854
  },
4821
4855
  "tax_amount": {
4822
- "type": "REAL",
4856
+ "type": "INTEGER",
4823
4857
  "notNull": false,
4824
4858
  "default": 0
4825
4859
  },
4826
4860
  "total_amount": {
4827
- "type": "REAL",
4861
+ "type": "INTEGER",
4828
4862
  "notNull": false,
4829
4863
  "default": 0
4830
4864
  },
@@ -4867,15 +4901,10 @@
4867
4901
  }
4868
4902
  },
4869
4903
  "indexes": [
4870
- {
4871
- "name": "contracts_id_idx",
4872
- "columns": [
4873
- "id"
4874
- ]
4875
- },
4876
4904
  {
4877
4905
  "name": "contracts_slug_context_meta_type_idx",
4878
4906
  "columns": [
4907
+ "tenant_id",
4879
4908
  "slug",
4880
4909
  "context",
4881
4910
  "_meta_type"
@@ -4887,9 +4916,28 @@
4887
4916
  "columns": [
4888
4917
  "_meta_type"
4889
4918
  ]
4919
+ },
4920
+ {
4921
+ "name": "contracts_tenant_id_created_at_idx",
4922
+ "columns": [
4923
+ "tenant_id",
4924
+ "created_at"
4925
+ ]
4926
+ },
4927
+ {
4928
+ "name": "contracts_customer_id_idx",
4929
+ "columns": [
4930
+ "customer_id"
4931
+ ]
4932
+ },
4933
+ {
4934
+ "name": "contracts_vendor_id_idx",
4935
+ "columns": [
4936
+ "vendor_id"
4937
+ ]
4890
4938
  }
4891
4939
  ],
4892
- "version": "6cab8a56"
4940
+ "version": "db450616"
4893
4941
  }
4894
4942
  },
4895
4943
  "@happyvertical/smrt-commerce:Lease": {
@@ -4945,17 +4993,17 @@
4945
4993
  "related": "Vendor"
4946
4994
  },
4947
4995
  "subtotal": {
4948
- "type": "decimal",
4996
+ "type": "integer",
4949
4997
  "required": false,
4950
4998
  "default": 0
4951
4999
  },
4952
5000
  "taxAmount": {
4953
- "type": "decimal",
5001
+ "type": "integer",
4954
5002
  "required": false,
4955
5003
  "default": 0
4956
5004
  },
4957
5005
  "totalAmount": {
4958
- "type": "decimal",
5006
+ "type": "integer",
4959
5007
  "required": false,
4960
5008
  "default": 0
4961
5009
  },
@@ -5548,7 +5596,7 @@
5548
5596
  "collectionExportName": "LeaseCollection",
5549
5597
  "schema": {
5550
5598
  "tableName": "contracts",
5551
- "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" REAL DEFAULT 0,\n \"tax_amount\" REAL DEFAULT 0,\n \"total_amount\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
5599
+ "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
5552
5600
  "columns": {
5553
5601
  "id": {
5554
5602
  "type": "UUID",
@@ -5607,17 +5655,17 @@
5607
5655
  "notNull": false
5608
5656
  },
5609
5657
  "subtotal": {
5610
- "type": "REAL",
5658
+ "type": "INTEGER",
5611
5659
  "notNull": false,
5612
5660
  "default": 0
5613
5661
  },
5614
5662
  "tax_amount": {
5615
- "type": "REAL",
5663
+ "type": "INTEGER",
5616
5664
  "notNull": false,
5617
5665
  "default": 0
5618
5666
  },
5619
5667
  "total_amount": {
5620
- "type": "REAL",
5668
+ "type": "INTEGER",
5621
5669
  "notNull": false,
5622
5670
  "default": 0
5623
5671
  },
@@ -5660,15 +5708,10 @@
5660
5708
  }
5661
5709
  },
5662
5710
  "indexes": [
5663
- {
5664
- "name": "contracts_id_idx",
5665
- "columns": [
5666
- "id"
5667
- ]
5668
- },
5669
5711
  {
5670
5712
  "name": "contracts_slug_context_meta_type_idx",
5671
5713
  "columns": [
5714
+ "tenant_id",
5672
5715
  "slug",
5673
5716
  "context",
5674
5717
  "_meta_type"
@@ -5680,9 +5723,28 @@
5680
5723
  "columns": [
5681
5724
  "_meta_type"
5682
5725
  ]
5726
+ },
5727
+ {
5728
+ "name": "contracts_tenant_id_created_at_idx",
5729
+ "columns": [
5730
+ "tenant_id",
5731
+ "created_at"
5732
+ ]
5733
+ },
5734
+ {
5735
+ "name": "contracts_customer_id_idx",
5736
+ "columns": [
5737
+ "customer_id"
5738
+ ]
5739
+ },
5740
+ {
5741
+ "name": "contracts_vendor_id_idx",
5742
+ "columns": [
5743
+ "vendor_id"
5744
+ ]
5683
5745
  }
5684
5746
  ],
5685
- "version": "d84bde8d"
5747
+ "version": "db450616"
5686
5748
  }
5687
5749
  },
5688
5750
  "@happyvertical/smrt-commerce:Agreement": {
@@ -5738,17 +5800,17 @@
5738
5800
  "related": "Vendor"
5739
5801
  },
5740
5802
  "subtotal": {
5741
- "type": "decimal",
5803
+ "type": "integer",
5742
5804
  "required": false,
5743
5805
  "default": 0
5744
5806
  },
5745
5807
  "taxAmount": {
5746
- "type": "decimal",
5808
+ "type": "integer",
5747
5809
  "required": false,
5748
5810
  "default": 0
5749
5811
  },
5750
5812
  "totalAmount": {
5751
- "type": "decimal",
5813
+ "type": "integer",
5752
5814
  "required": false,
5753
5815
  "default": 0
5754
5816
  },
@@ -6341,7 +6403,7 @@
6341
6403
  "collectionExportName": "AgreementCollection",
6342
6404
  "schema": {
6343
6405
  "tableName": "contracts",
6344
- "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" REAL DEFAULT 0,\n \"tax_amount\" REAL DEFAULT 0,\n \"total_amount\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
6406
+ "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
6345
6407
  "columns": {
6346
6408
  "id": {
6347
6409
  "type": "UUID",
@@ -6400,17 +6462,17 @@
6400
6462
  "notNull": false
6401
6463
  },
6402
6464
  "subtotal": {
6403
- "type": "REAL",
6465
+ "type": "INTEGER",
6404
6466
  "notNull": false,
6405
6467
  "default": 0
6406
6468
  },
6407
6469
  "tax_amount": {
6408
- "type": "REAL",
6470
+ "type": "INTEGER",
6409
6471
  "notNull": false,
6410
6472
  "default": 0
6411
6473
  },
6412
6474
  "total_amount": {
6413
- "type": "REAL",
6475
+ "type": "INTEGER",
6414
6476
  "notNull": false,
6415
6477
  "default": 0
6416
6478
  },
@@ -6453,15 +6515,10 @@
6453
6515
  }
6454
6516
  },
6455
6517
  "indexes": [
6456
- {
6457
- "name": "contracts_id_idx",
6458
- "columns": [
6459
- "id"
6460
- ]
6461
- },
6462
6518
  {
6463
6519
  "name": "contracts_slug_context_meta_type_idx",
6464
6520
  "columns": [
6521
+ "tenant_id",
6465
6522
  "slug",
6466
6523
  "context",
6467
6524
  "_meta_type"
@@ -6473,18 +6530,37 @@
6473
6530
  "columns": [
6474
6531
  "_meta_type"
6475
6532
  ]
6476
- }
6477
- ],
6478
- "version": "3d73bfb1"
6479
- }
6480
- },
6481
- "@happyvertical/smrt-commerce:PurchaseOrder": {
6482
- "name": "purchaseorder",
6483
- "className": "PurchaseOrder",
6484
- "qualifiedName": "@happyvertical/smrt-commerce:PurchaseOrder",
6485
- "collection": "contracts",
6486
- "filePath": "/home/runner/_work/smrt/smrt/packages/commerce/src/models/Contract.ts",
6487
- "packageName": "@happyvertical/smrt-commerce",
6533
+ },
6534
+ {
6535
+ "name": "contracts_tenant_id_created_at_idx",
6536
+ "columns": [
6537
+ "tenant_id",
6538
+ "created_at"
6539
+ ]
6540
+ },
6541
+ {
6542
+ "name": "contracts_customer_id_idx",
6543
+ "columns": [
6544
+ "customer_id"
6545
+ ]
6546
+ },
6547
+ {
6548
+ "name": "contracts_vendor_id_idx",
6549
+ "columns": [
6550
+ "vendor_id"
6551
+ ]
6552
+ }
6553
+ ],
6554
+ "version": "db450616"
6555
+ }
6556
+ },
6557
+ "@happyvertical/smrt-commerce:PurchaseOrder": {
6558
+ "name": "purchaseorder",
6559
+ "className": "PurchaseOrder",
6560
+ "qualifiedName": "@happyvertical/smrt-commerce:PurchaseOrder",
6561
+ "collection": "contracts",
6562
+ "filePath": "/home/runner/_work/smrt/smrt/packages/commerce/src/models/Contract.ts",
6563
+ "packageName": "@happyvertical/smrt-commerce",
6488
6564
  "fields": {
6489
6565
  "created_at": {
6490
6566
  "type": "datetime",
@@ -6531,17 +6607,17 @@
6531
6607
  "related": "Vendor"
6532
6608
  },
6533
6609
  "subtotal": {
6534
- "type": "decimal",
6610
+ "type": "integer",
6535
6611
  "required": false,
6536
6612
  "default": 0
6537
6613
  },
6538
6614
  "taxAmount": {
6539
- "type": "decimal",
6615
+ "type": "integer",
6540
6616
  "required": false,
6541
6617
  "default": 0
6542
6618
  },
6543
6619
  "totalAmount": {
6544
- "type": "decimal",
6620
+ "type": "integer",
6545
6621
  "required": false,
6546
6622
  "default": 0
6547
6623
  },
@@ -7134,7 +7210,7 @@
7134
7210
  "collectionExportName": "PurchaseOrderCollection",
7135
7211
  "schema": {
7136
7212
  "tableName": "contracts",
7137
- "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" REAL DEFAULT 0,\n \"tax_amount\" REAL DEFAULT 0,\n \"total_amount\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
7213
+ "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
7138
7214
  "columns": {
7139
7215
  "id": {
7140
7216
  "type": "UUID",
@@ -7193,17 +7269,17 @@
7193
7269
  "notNull": false
7194
7270
  },
7195
7271
  "subtotal": {
7196
- "type": "REAL",
7272
+ "type": "INTEGER",
7197
7273
  "notNull": false,
7198
7274
  "default": 0
7199
7275
  },
7200
7276
  "tax_amount": {
7201
- "type": "REAL",
7277
+ "type": "INTEGER",
7202
7278
  "notNull": false,
7203
7279
  "default": 0
7204
7280
  },
7205
7281
  "total_amount": {
7206
- "type": "REAL",
7282
+ "type": "INTEGER",
7207
7283
  "notNull": false,
7208
7284
  "default": 0
7209
7285
  },
@@ -7246,15 +7322,10 @@
7246
7322
  }
7247
7323
  },
7248
7324
  "indexes": [
7249
- {
7250
- "name": "contracts_id_idx",
7251
- "columns": [
7252
- "id"
7253
- ]
7254
- },
7255
7325
  {
7256
7326
  "name": "contracts_slug_context_meta_type_idx",
7257
7327
  "columns": [
7328
+ "tenant_id",
7258
7329
  "slug",
7259
7330
  "context",
7260
7331
  "_meta_type"
@@ -7266,9 +7337,28 @@
7266
7337
  "columns": [
7267
7338
  "_meta_type"
7268
7339
  ]
7340
+ },
7341
+ {
7342
+ "name": "contracts_tenant_id_created_at_idx",
7343
+ "columns": [
7344
+ "tenant_id",
7345
+ "created_at"
7346
+ ]
7347
+ },
7348
+ {
7349
+ "name": "contracts_customer_id_idx",
7350
+ "columns": [
7351
+ "customer_id"
7352
+ ]
7353
+ },
7354
+ {
7355
+ "name": "contracts_vendor_id_idx",
7356
+ "columns": [
7357
+ "vendor_id"
7358
+ ]
7269
7359
  }
7270
7360
  ],
7271
- "version": "cea633fa"
7361
+ "version": "db450616"
7272
7362
  }
7273
7363
  },
7274
7364
  "@happyvertical/smrt-commerce:WholesaleOrder": {
@@ -7324,17 +7414,17 @@
7324
7414
  "related": "Vendor"
7325
7415
  },
7326
7416
  "subtotal": {
7327
- "type": "decimal",
7417
+ "type": "integer",
7328
7418
  "required": false,
7329
7419
  "default": 0
7330
7420
  },
7331
7421
  "taxAmount": {
7332
- "type": "decimal",
7422
+ "type": "integer",
7333
7423
  "required": false,
7334
7424
  "default": 0
7335
7425
  },
7336
7426
  "totalAmount": {
7337
- "type": "decimal",
7427
+ "type": "integer",
7338
7428
  "required": false,
7339
7429
  "default": 0
7340
7430
  },
@@ -7927,7 +8017,7 @@
7927
8017
  "collectionExportName": "WholesaleOrderCollection",
7928
8018
  "schema": {
7929
8019
  "tableName": "contracts",
7930
- "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" REAL DEFAULT 0,\n \"tax_amount\" REAL DEFAULT 0,\n \"total_amount\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
8020
+ "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
7931
8021
  "columns": {
7932
8022
  "id": {
7933
8023
  "type": "UUID",
@@ -7986,17 +8076,17 @@
7986
8076
  "notNull": false
7987
8077
  },
7988
8078
  "subtotal": {
7989
- "type": "REAL",
8079
+ "type": "INTEGER",
7990
8080
  "notNull": false,
7991
8081
  "default": 0
7992
8082
  },
7993
8083
  "tax_amount": {
7994
- "type": "REAL",
8084
+ "type": "INTEGER",
7995
8085
  "notNull": false,
7996
8086
  "default": 0
7997
8087
  },
7998
8088
  "total_amount": {
7999
- "type": "REAL",
8089
+ "type": "INTEGER",
8000
8090
  "notNull": false,
8001
8091
  "default": 0
8002
8092
  },
@@ -8039,15 +8129,10 @@
8039
8129
  }
8040
8130
  },
8041
8131
  "indexes": [
8042
- {
8043
- "name": "contracts_id_idx",
8044
- "columns": [
8045
- "id"
8046
- ]
8047
- },
8048
8132
  {
8049
8133
  "name": "contracts_slug_context_meta_type_idx",
8050
8134
  "columns": [
8135
+ "tenant_id",
8051
8136
  "slug",
8052
8137
  "context",
8053
8138
  "_meta_type"
@@ -8059,9 +8144,28 @@
8059
8144
  "columns": [
8060
8145
  "_meta_type"
8061
8146
  ]
8147
+ },
8148
+ {
8149
+ "name": "contracts_tenant_id_created_at_idx",
8150
+ "columns": [
8151
+ "tenant_id",
8152
+ "created_at"
8153
+ ]
8154
+ },
8155
+ {
8156
+ "name": "contracts_customer_id_idx",
8157
+ "columns": [
8158
+ "customer_id"
8159
+ ]
8160
+ },
8161
+ {
8162
+ "name": "contracts_vendor_id_idx",
8163
+ "columns": [
8164
+ "vendor_id"
8165
+ ]
8062
8166
  }
8063
8167
  ],
8064
- "version": "4518389d"
8168
+ "version": "db450616"
8065
8169
  }
8066
8170
  },
8067
8171
  "@happyvertical/smrt-commerce:ProductionOrder": {
@@ -8117,17 +8221,17 @@
8117
8221
  "related": "Vendor"
8118
8222
  },
8119
8223
  "subtotal": {
8120
- "type": "decimal",
8224
+ "type": "integer",
8121
8225
  "required": false,
8122
8226
  "default": 0
8123
8227
  },
8124
8228
  "taxAmount": {
8125
- "type": "decimal",
8229
+ "type": "integer",
8126
8230
  "required": false,
8127
8231
  "default": 0
8128
8232
  },
8129
8233
  "totalAmount": {
8130
- "type": "decimal",
8234
+ "type": "integer",
8131
8235
  "required": false,
8132
8236
  "default": 0
8133
8237
  },
@@ -8736,7 +8840,7 @@
8736
8840
  "collectionExportName": "ProductionOrderCollection",
8737
8841
  "schema": {
8738
8842
  "tableName": "contracts",
8739
- "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" REAL DEFAULT 0,\n \"tax_amount\" REAL DEFAULT 0,\n \"total_amount\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
8843
+ "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
8740
8844
  "columns": {
8741
8845
  "id": {
8742
8846
  "type": "UUID",
@@ -8795,17 +8899,17 @@
8795
8899
  "notNull": false
8796
8900
  },
8797
8901
  "subtotal": {
8798
- "type": "REAL",
8902
+ "type": "INTEGER",
8799
8903
  "notNull": false,
8800
8904
  "default": 0
8801
8905
  },
8802
8906
  "tax_amount": {
8803
- "type": "REAL",
8907
+ "type": "INTEGER",
8804
8908
  "notNull": false,
8805
8909
  "default": 0
8806
8910
  },
8807
8911
  "total_amount": {
8808
- "type": "REAL",
8912
+ "type": "INTEGER",
8809
8913
  "notNull": false,
8810
8914
  "default": 0
8811
8915
  },
@@ -8848,15 +8952,10 @@
8848
8952
  }
8849
8953
  },
8850
8954
  "indexes": [
8851
- {
8852
- "name": "contracts_id_idx",
8853
- "columns": [
8854
- "id"
8855
- ]
8856
- },
8857
8955
  {
8858
8956
  "name": "contracts_slug_context_meta_type_idx",
8859
8957
  "columns": [
8958
+ "tenant_id",
8860
8959
  "slug",
8861
8960
  "context",
8862
8961
  "_meta_type"
@@ -8868,9 +8967,28 @@
8868
8967
  "columns": [
8869
8968
  "_meta_type"
8870
8969
  ]
8970
+ },
8971
+ {
8972
+ "name": "contracts_tenant_id_created_at_idx",
8973
+ "columns": [
8974
+ "tenant_id",
8975
+ "created_at"
8976
+ ]
8977
+ },
8978
+ {
8979
+ "name": "contracts_customer_id_idx",
8980
+ "columns": [
8981
+ "customer_id"
8982
+ ]
8983
+ },
8984
+ {
8985
+ "name": "contracts_vendor_id_idx",
8986
+ "columns": [
8987
+ "vendor_id"
8988
+ ]
8871
8989
  }
8872
8990
  ],
8873
- "version": "aea5177b"
8991
+ "version": "db450616"
8874
8992
  }
8875
8993
  },
8876
8994
  "@happyvertical/smrt-commerce:Cart": {
@@ -8926,17 +9044,17 @@
8926
9044
  "related": "Vendor"
8927
9045
  },
8928
9046
  "subtotal": {
8929
- "type": "decimal",
9047
+ "type": "integer",
8930
9048
  "required": false,
8931
9049
  "default": 0
8932
9050
  },
8933
9051
  "taxAmount": {
8934
- "type": "decimal",
9052
+ "type": "integer",
8935
9053
  "required": false,
8936
9054
  "default": 0
8937
9055
  },
8938
9056
  "totalAmount": {
8939
- "type": "decimal",
9057
+ "type": "integer",
8940
9058
  "required": false,
8941
9059
  "default": 0
8942
9060
  },
@@ -9529,7 +9647,7 @@
9529
9647
  "collectionExportName": "CartCollection",
9530
9648
  "schema": {
9531
9649
  "tableName": "contracts",
9532
- "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" REAL DEFAULT 0,\n \"tax_amount\" REAL DEFAULT 0,\n \"total_amount\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
9650
+ "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
9533
9651
  "columns": {
9534
9652
  "id": {
9535
9653
  "type": "UUID",
@@ -9588,17 +9706,17 @@
9588
9706
  "notNull": false
9589
9707
  },
9590
9708
  "subtotal": {
9591
- "type": "REAL",
9709
+ "type": "INTEGER",
9592
9710
  "notNull": false,
9593
9711
  "default": 0
9594
9712
  },
9595
9713
  "tax_amount": {
9596
- "type": "REAL",
9714
+ "type": "INTEGER",
9597
9715
  "notNull": false,
9598
9716
  "default": 0
9599
9717
  },
9600
9718
  "total_amount": {
9601
- "type": "REAL",
9719
+ "type": "INTEGER",
9602
9720
  "notNull": false,
9603
9721
  "default": 0
9604
9722
  },
@@ -9641,15 +9759,10 @@
9641
9759
  }
9642
9760
  },
9643
9761
  "indexes": [
9644
- {
9645
- "name": "contracts_id_idx",
9646
- "columns": [
9647
- "id"
9648
- ]
9649
- },
9650
9762
  {
9651
9763
  "name": "contracts_slug_context_meta_type_idx",
9652
9764
  "columns": [
9765
+ "tenant_id",
9653
9766
  "slug",
9654
9767
  "context",
9655
9768
  "_meta_type"
@@ -9661,9 +9774,28 @@
9661
9774
  "columns": [
9662
9775
  "_meta_type"
9663
9776
  ]
9777
+ },
9778
+ {
9779
+ "name": "contracts_tenant_id_created_at_idx",
9780
+ "columns": [
9781
+ "tenant_id",
9782
+ "created_at"
9783
+ ]
9784
+ },
9785
+ {
9786
+ "name": "contracts_customer_id_idx",
9787
+ "columns": [
9788
+ "customer_id"
9789
+ ]
9790
+ },
9791
+ {
9792
+ "name": "contracts_vendor_id_idx",
9793
+ "columns": [
9794
+ "vendor_id"
9795
+ ]
9664
9796
  }
9665
9797
  ],
9666
- "version": "879b2b74"
9798
+ "version": "db450616"
9667
9799
  }
9668
9800
  },
9669
9801
  "@happyvertical/smrt-commerce:LicenseSale": {
@@ -9719,17 +9851,17 @@
9719
9851
  "related": "Vendor"
9720
9852
  },
9721
9853
  "subtotal": {
9722
- "type": "decimal",
9854
+ "type": "integer",
9723
9855
  "required": false,
9724
9856
  "default": 0
9725
9857
  },
9726
9858
  "taxAmount": {
9727
- "type": "decimal",
9859
+ "type": "integer",
9728
9860
  "required": false,
9729
9861
  "default": 0
9730
9862
  },
9731
9863
  "totalAmount": {
9732
- "type": "decimal",
9864
+ "type": "integer",
9733
9865
  "required": false,
9734
9866
  "default": 0
9735
9867
  },
@@ -10458,7 +10590,7 @@
10458
10590
  "collectionExportName": "LicenseSaleCollection",
10459
10591
  "schema": {
10460
10592
  "tableName": "contracts",
10461
- "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" REAL DEFAULT 0,\n \"tax_amount\" REAL DEFAULT 0,\n \"total_amount\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
10593
+ "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 \"customer_id\" UUID,\n \"vendor_id\" UUID,\n \"subtotal\" INTEGER DEFAULT 0,\n \"tax_amount\" INTEGER DEFAULT 0,\n \"total_amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT 'USD',\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);",
10462
10594
  "columns": {
10463
10595
  "id": {
10464
10596
  "type": "UUID",
@@ -10517,17 +10649,17 @@
10517
10649
  "notNull": false
10518
10650
  },
10519
10651
  "subtotal": {
10520
- "type": "REAL",
10652
+ "type": "INTEGER",
10521
10653
  "notNull": false,
10522
10654
  "default": 0
10523
10655
  },
10524
10656
  "tax_amount": {
10525
- "type": "REAL",
10657
+ "type": "INTEGER",
10526
10658
  "notNull": false,
10527
10659
  "default": 0
10528
10660
  },
10529
10661
  "total_amount": {
10530
- "type": "REAL",
10662
+ "type": "INTEGER",
10531
10663
  "notNull": false,
10532
10664
  "default": 0
10533
10665
  },
@@ -10570,15 +10702,10 @@
10570
10702
  }
10571
10703
  },
10572
10704
  "indexes": [
10573
- {
10574
- "name": "contracts_id_idx",
10575
- "columns": [
10576
- "id"
10577
- ]
10578
- },
10579
10705
  {
10580
10706
  "name": "contracts_slug_context_meta_type_idx",
10581
10707
  "columns": [
10708
+ "tenant_id",
10582
10709
  "slug",
10583
10710
  "context",
10584
10711
  "_meta_type"
@@ -10590,9 +10717,28 @@
10590
10717
  "columns": [
10591
10718
  "_meta_type"
10592
10719
  ]
10720
+ },
10721
+ {
10722
+ "name": "contracts_tenant_id_created_at_idx",
10723
+ "columns": [
10724
+ "tenant_id",
10725
+ "created_at"
10726
+ ]
10727
+ },
10728
+ {
10729
+ "name": "contracts_customer_id_idx",
10730
+ "columns": [
10731
+ "customer_id"
10732
+ ]
10733
+ },
10734
+ {
10735
+ "name": "contracts_vendor_id_idx",
10736
+ "columns": [
10737
+ "vendor_id"
10738
+ ]
10593
10739
  }
10594
10740
  ],
10595
- "version": "266e30a8"
10741
+ "version": "db450616"
10596
10742
  }
10597
10743
  },
10598
10744
  "@happyvertical/smrt-commerce:ContractLineItem": {
@@ -10645,12 +10791,12 @@
10645
10791
  "default": 1
10646
10792
  },
10647
10793
  "unitPrice": {
10648
- "type": "decimal",
10794
+ "type": "integer",
10649
10795
  "required": false,
10650
10796
  "default": 0
10651
10797
  },
10652
10798
  "discount": {
10653
- "type": "decimal",
10799
+ "type": "integer",
10654
10800
  "required": false,
10655
10801
  "default": 0
10656
10802
  },
@@ -10660,7 +10806,7 @@
10660
10806
  "default": 0
10661
10807
  },
10662
10808
  "amount": {
10663
- "type": "decimal",
10809
+ "type": "integer",
10664
10810
  "required": false,
10665
10811
  "default": 0
10666
10812
  },
@@ -11228,14 +11374,20 @@
11228
11374
  "cli": true,
11229
11375
  "tenantScoped": {
11230
11376
  "mode": "optional"
11231
- }
11377
+ },
11378
+ "conflictColumns": [
11379
+ "tenant_id",
11380
+ "slug",
11381
+ "context",
11382
+ "_meta_type"
11383
+ ]
11232
11384
  },
11233
11385
  "extends": "SmrtObject",
11234
11386
  "exportName": "ContractLineItem",
11235
11387
  "collectionExportName": "ContractLineItemCollection",
11236
11388
  "schema": {
11237
11389
  "tableName": "contract_line_items",
11238
- "ddl": "CREATE TABLE IF NOT EXISTS \"contract_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"description\" TEXT DEFAULT '',\n \"quantity\" REAL DEFAULT 1,\n \"unit_price\" REAL DEFAULT 0,\n \"discount\" REAL DEFAULT 0,\n \"tax_rate\" REAL DEFAULT 0,\n \"amount\" REAL DEFAULT 0,\n \"product_id\" UUID,\n \"sku\" TEXT DEFAULT '',\n \"start_date\" TIMESTAMP,\n \"end_date\" TIMESTAMP,\n \"billing_period\" TEXT DEFAULT '',\n \"sort_order\" INTEGER DEFAULT 0\n);",
11390
+ "ddl": "CREATE TABLE IF NOT EXISTS \"contract_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"description\" TEXT DEFAULT '',\n \"quantity\" REAL DEFAULT 1,\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"tax_rate\" REAL DEFAULT 0,\n \"amount\" INTEGER DEFAULT 0,\n \"product_id\" UUID,\n \"sku\" TEXT DEFAULT '',\n \"start_date\" TIMESTAMP,\n \"end_date\" TIMESTAMP,\n \"billing_period\" TEXT DEFAULT '',\n \"sort_order\" INTEGER DEFAULT 0\n);",
11239
11391
  "columns": {
11240
11392
  "id": {
11241
11393
  "type": "UUID",
@@ -11291,12 +11443,12 @@
11291
11443
  "default": 1
11292
11444
  },
11293
11445
  "unit_price": {
11294
- "type": "REAL",
11446
+ "type": "INTEGER",
11295
11447
  "notNull": false,
11296
11448
  "default": 0
11297
11449
  },
11298
11450
  "discount": {
11299
- "type": "REAL",
11451
+ "type": "INTEGER",
11300
11452
  "notNull": false,
11301
11453
  "default": 0
11302
11454
  },
@@ -11306,7 +11458,7 @@
11306
11458
  "default": 0
11307
11459
  },
11308
11460
  "amount": {
11309
- "type": "REAL",
11461
+ "type": "INTEGER",
11310
11462
  "notNull": false,
11311
11463
  "default": 0
11312
11464
  },
@@ -11340,15 +11492,10 @@
11340
11492
  }
11341
11493
  },
11342
11494
  "indexes": [
11343
- {
11344
- "name": "contract_line_items_id_idx",
11345
- "columns": [
11346
- "id"
11347
- ]
11348
- },
11349
11495
  {
11350
11496
  "name": "contract_line_items_slug_context_meta_type_idx",
11351
11497
  "columns": [
11498
+ "tenant_id",
11352
11499
  "slug",
11353
11500
  "context",
11354
11501
  "_meta_type"
@@ -11360,9 +11507,28 @@
11360
11507
  "columns": [
11361
11508
  "_meta_type"
11362
11509
  ]
11510
+ },
11511
+ {
11512
+ "name": "contract_line_items_tenant_id_created_at_idx",
11513
+ "columns": [
11514
+ "tenant_id",
11515
+ "created_at"
11516
+ ]
11517
+ },
11518
+ {
11519
+ "name": "contract_line_items_contract_id_idx",
11520
+ "columns": [
11521
+ "contract_id"
11522
+ ]
11523
+ },
11524
+ {
11525
+ "name": "contract_line_items_product_id_idx",
11526
+ "columns": [
11527
+ "product_id"
11528
+ ]
11363
11529
  }
11364
11530
  ],
11365
- "version": "788c92c1"
11531
+ "version": "d0c5dd84"
11366
11532
  }
11367
11533
  },
11368
11534
  "@happyvertical/smrt-commerce:Customer": {
@@ -11397,7 +11563,7 @@
11397
11563
  "related": "@happyvertical/smrt-profiles:Profile"
11398
11564
  },
11399
11565
  "creditLimit": {
11400
- "type": "decimal",
11566
+ "type": "integer",
11401
11567
  "required": false,
11402
11568
  "default": 0
11403
11569
  },
@@ -11500,14 +11666,19 @@
11500
11666
  "cli": true,
11501
11667
  "tenantScoped": {
11502
11668
  "mode": "optional"
11503
- }
11669
+ },
11670
+ "conflictColumns": [
11671
+ "tenant_id",
11672
+ "slug",
11673
+ "context"
11674
+ ]
11504
11675
  },
11505
11676
  "extends": "SmrtObject",
11506
11677
  "exportName": "Customer",
11507
11678
  "collectionExportName": "CustomerCollection",
11508
11679
  "schema": {
11509
11680
  "tableName": "customers",
11510
- "ddl": "CREATE TABLE IF NOT EXISTS \"customers\" (\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 \"profile_id\" UUID,\n \"credit_limit\" REAL DEFAULT 0,\n \"payment_terms\" TEXT DEFAULT '',\n \"tax_exempt\" BOOLEAN DEFAULT FALSE,\n \"tax_id\" TEXT DEFAULT '',\n \"default_shipping_address\" JSON,\n \"default_billing_address\" JSON,\n \"status\" TEXT,\n \"customer_type\" TEXT,\n \"notes\" TEXT DEFAULT ''\n);",
11681
+ "ddl": "CREATE TABLE IF NOT EXISTS \"customers\" (\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 \"profile_id\" UUID,\n \"credit_limit\" INTEGER DEFAULT 0,\n \"payment_terms\" TEXT DEFAULT '',\n \"tax_exempt\" BOOLEAN DEFAULT FALSE,\n \"tax_id\" TEXT DEFAULT '',\n \"default_shipping_address\" JSON,\n \"default_billing_address\" JSON,\n \"status\" TEXT,\n \"customer_type\" TEXT,\n \"notes\" TEXT DEFAULT ''\n);",
11511
11682
  "columns": {
11512
11683
  "id": {
11513
11684
  "type": "UUID",
@@ -11547,7 +11718,7 @@
11547
11718
  "unique": false
11548
11719
  },
11549
11720
  "credit_limit": {
11550
- "type": "REAL",
11721
+ "type": "INTEGER",
11551
11722
  "notNull": false,
11552
11723
  "unique": false,
11553
11724
  "default": 0
@@ -11598,22 +11769,30 @@
11598
11769
  }
11599
11770
  },
11600
11771
  "indexes": [
11601
- {
11602
- "name": "customers_id_idx",
11603
- "columns": [
11604
- "id"
11605
- ]
11606
- },
11607
11772
  {
11608
11773
  "name": "customers_slug_context_idx",
11609
11774
  "columns": [
11775
+ "tenant_id",
11610
11776
  "slug",
11611
11777
  "context"
11612
11778
  ],
11613
11779
  "unique": true
11780
+ },
11781
+ {
11782
+ "name": "customers_tenant_id_created_at_idx",
11783
+ "columns": [
11784
+ "tenant_id",
11785
+ "created_at"
11786
+ ]
11787
+ },
11788
+ {
11789
+ "name": "customers_profile_id_idx",
11790
+ "columns": [
11791
+ "profile_id"
11792
+ ]
11614
11793
  }
11615
11794
  ],
11616
- "version": "205341ce"
11795
+ "version": "ad1b9967"
11617
11796
  }
11618
11797
  },
11619
11798
  "@happyvertical/smrt-commerce:Fulfillment": {
@@ -11782,7 +11961,12 @@
11782
11961
  "cli": true,
11783
11962
  "tenantScoped": {
11784
11963
  "mode": "optional"
11785
- }
11964
+ },
11965
+ "conflictColumns": [
11966
+ "tenant_id",
11967
+ "slug",
11968
+ "context"
11969
+ ]
11786
11970
  },
11787
11971
  "extends": "SmrtObject",
11788
11972
  "exportName": "Fulfillment",
@@ -11878,19 +12062,27 @@
11878
12062
  }
11879
12063
  },
11880
12064
  "indexes": [
11881
- {
11882
- "name": "fulfillments_id_idx",
11883
- "columns": [
11884
- "id"
11885
- ]
11886
- },
11887
12065
  {
11888
12066
  "name": "fulfillments_slug_context_idx",
11889
12067
  "columns": [
12068
+ "tenant_id",
11890
12069
  "slug",
11891
12070
  "context"
11892
12071
  ],
11893
12072
  "unique": true
12073
+ },
12074
+ {
12075
+ "name": "fulfillments_tenant_id_created_at_idx",
12076
+ "columns": [
12077
+ "tenant_id",
12078
+ "created_at"
12079
+ ]
12080
+ },
12081
+ {
12082
+ "name": "fulfillments_contract_id_idx",
12083
+ "columns": [
12084
+ "contract_id"
12085
+ ]
11894
12086
  }
11895
12087
  ],
11896
12088
  "version": "b8837680"
@@ -11972,7 +12164,12 @@
11972
12164
  "cli": true,
11973
12165
  "tenantScoped": {
11974
12166
  "mode": "optional"
11975
- }
12167
+ },
12168
+ "conflictColumns": [
12169
+ "tenant_id",
12170
+ "slug",
12171
+ "context"
12172
+ ]
11976
12173
  },
11977
12174
  "extends": "SmrtObject",
11978
12175
  "exportName": "FulfillmentLineItem",
@@ -12038,19 +12235,33 @@
12038
12235
  }
12039
12236
  },
12040
12237
  "indexes": [
12041
- {
12042
- "name": "fulfillment_line_items_id_idx",
12043
- "columns": [
12044
- "id"
12045
- ]
12046
- },
12047
12238
  {
12048
12239
  "name": "fulfillment_line_items_slug_context_idx",
12049
12240
  "columns": [
12241
+ "tenant_id",
12050
12242
  "slug",
12051
12243
  "context"
12052
12244
  ],
12053
12245
  "unique": true
12246
+ },
12247
+ {
12248
+ "name": "fulfillment_line_items_tenant_id_created_at_idx",
12249
+ "columns": [
12250
+ "tenant_id",
12251
+ "created_at"
12252
+ ]
12253
+ },
12254
+ {
12255
+ "name": "fulfillment_line_items_fulfillment_id_idx",
12256
+ "columns": [
12257
+ "fulfillment_id"
12258
+ ]
12259
+ },
12260
+ {
12261
+ "name": "fulfillment_line_items_contract_line_item_id_idx",
12262
+ "columns": [
12263
+ "contract_line_item_id"
12264
+ ]
12054
12265
  }
12055
12266
  ],
12056
12267
  "version": "664e52f2"
@@ -12380,7 +12591,12 @@
12380
12591
  "cli": true,
12381
12592
  "tenantScoped": {
12382
12593
  "mode": "optional"
12383
- }
12594
+ },
12595
+ "conflictColumns": [
12596
+ "tenant_id",
12597
+ "slug",
12598
+ "context"
12599
+ ]
12384
12600
  },
12385
12601
  "extends": "SmrtObject",
12386
12602
  "exportName": "Invoice",
@@ -12570,19 +12786,45 @@
12570
12786
  }
12571
12787
  },
12572
12788
  "indexes": [
12573
- {
12574
- "name": "invoices_id_idx",
12575
- "columns": [
12576
- "id"
12577
- ]
12578
- },
12579
12789
  {
12580
12790
  "name": "invoices_slug_context_idx",
12581
12791
  "columns": [
12792
+ "tenant_id",
12582
12793
  "slug",
12583
12794
  "context"
12584
12795
  ],
12585
12796
  "unique": true
12797
+ },
12798
+ {
12799
+ "name": "invoices_tenant_id_created_at_idx",
12800
+ "columns": [
12801
+ "tenant_id",
12802
+ "created_at"
12803
+ ]
12804
+ },
12805
+ {
12806
+ "name": "invoices_customer_id_idx",
12807
+ "columns": [
12808
+ "customer_id"
12809
+ ]
12810
+ },
12811
+ {
12812
+ "name": "invoices_contract_id_idx",
12813
+ "columns": [
12814
+ "contract_id"
12815
+ ]
12816
+ },
12817
+ {
12818
+ "name": "invoices_ar_journal_id_idx",
12819
+ "columns": [
12820
+ "ar_journal_id"
12821
+ ]
12822
+ },
12823
+ {
12824
+ "name": "invoices_revenue_journal_id_idx",
12825
+ "columns": [
12826
+ "revenue_journal_id"
12827
+ ]
12586
12828
  }
12587
12829
  ],
12588
12830
  "version": "c22cc7ef"
@@ -12645,7 +12887,7 @@
12645
12887
  "default": 0
12646
12888
  },
12647
12889
  "taxRate": {
12648
- "type": "integer",
12890
+ "type": "decimal",
12649
12891
  "required": false,
12650
12892
  "default": 0
12651
12893
  },
@@ -12752,14 +12994,19 @@
12752
12994
  "cli": true,
12753
12995
  "tenantScoped": {
12754
12996
  "mode": "optional"
12755
- }
12997
+ },
12998
+ "conflictColumns": [
12999
+ "tenant_id",
13000
+ "slug",
13001
+ "context"
13002
+ ]
12756
13003
  },
12757
13004
  "extends": "SmrtObject",
12758
13005
  "exportName": "InvoiceLineItem",
12759
13006
  "collectionExportName": "InvoiceLineItemCollection",
12760
13007
  "schema": {
12761
13008
  "tableName": "invoice_line_items",
12762
- "ddl": "CREATE TABLE IF NOT EXISTS \"invoice_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"invoice_id\" UUID,\n \"description\" TEXT DEFAULT '',\n \"sku\" TEXT DEFAULT '',\n \"quantity\" INTEGER DEFAULT 1,\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"tax_rate\" INTEGER DEFAULT 0,\n \"amount\" INTEGER DEFAULT 0,\n \"source_type\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"revenue_account_id\" UUID,\n \"sort_order\" INTEGER DEFAULT 0\n);",
13009
+ "ddl": "CREATE TABLE IF NOT EXISTS \"invoice_line_items\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"invoice_id\" UUID,\n \"description\" TEXT DEFAULT '',\n \"sku\" TEXT DEFAULT '',\n \"quantity\" INTEGER DEFAULT 1,\n \"unit_price\" INTEGER DEFAULT 0,\n \"discount\" INTEGER DEFAULT 0,\n \"tax_rate\" REAL DEFAULT 0,\n \"amount\" INTEGER DEFAULT 0,\n \"source_type\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"period_start\" TIMESTAMP,\n \"period_end\" TIMESTAMP,\n \"revenue_account_id\" UUID,\n \"sort_order\" INTEGER DEFAULT 0\n);",
12763
13010
  "columns": {
12764
13011
  "id": {
12765
13012
  "type": "UUID",
@@ -12829,7 +13076,7 @@
12829
13076
  "default": 0
12830
13077
  },
12831
13078
  "tax_rate": {
12832
- "type": "INTEGER",
13079
+ "type": "REAL",
12833
13080
  "notNull": false,
12834
13081
  "unique": false,
12835
13082
  "default": 0
@@ -12876,22 +13123,36 @@
12876
13123
  }
12877
13124
  },
12878
13125
  "indexes": [
12879
- {
12880
- "name": "invoice_line_items_id_idx",
12881
- "columns": [
12882
- "id"
12883
- ]
12884
- },
12885
13126
  {
12886
13127
  "name": "invoice_line_items_slug_context_idx",
12887
13128
  "columns": [
13129
+ "tenant_id",
12888
13130
  "slug",
12889
13131
  "context"
12890
13132
  ],
12891
13133
  "unique": true
13134
+ },
13135
+ {
13136
+ "name": "invoice_line_items_tenant_id_created_at_idx",
13137
+ "columns": [
13138
+ "tenant_id",
13139
+ "created_at"
13140
+ ]
13141
+ },
13142
+ {
13143
+ "name": "invoice_line_items_invoice_id_idx",
13144
+ "columns": [
13145
+ "invoice_id"
13146
+ ]
13147
+ },
13148
+ {
13149
+ "name": "invoice_line_items_revenue_account_id_idx",
13150
+ "columns": [
13151
+ "revenue_account_id"
13152
+ ]
12892
13153
  }
12893
13154
  ],
12894
- "version": "d8bd324d"
13155
+ "version": "62d20746"
12895
13156
  }
12896
13157
  },
12897
13158
  "@happyvertical/smrt-commerce:Payment": {
@@ -12931,7 +13192,7 @@
12931
13192
  "related": "Customer"
12932
13193
  },
12933
13194
  "amount": {
12934
- "type": "decimal",
13195
+ "type": "integer",
12935
13196
  "required": false,
12936
13197
  "default": 0
12937
13198
  },
@@ -12997,7 +13258,7 @@
12997
13258
  "default": ""
12998
13259
  },
12999
13260
  "nativeAmount": {
13000
- "type": "decimal",
13261
+ "type": "integer",
13001
13262
  "required": false,
13002
13263
  "default": 0
13003
13264
  },
@@ -13007,12 +13268,12 @@
13007
13268
  "default": ""
13008
13269
  },
13009
13270
  "usdAtQuote": {
13010
- "type": "decimal",
13271
+ "type": "integer",
13011
13272
  "required": false,
13012
13273
  "default": 0
13013
13274
  },
13014
13275
  "usdAtConfirmation": {
13015
- "type": "decimal",
13276
+ "type": "integer",
13016
13277
  "required": false,
13017
13278
  "default": 0
13018
13279
  }
@@ -13147,14 +13408,19 @@
13147
13408
  "cli": true,
13148
13409
  "tenantScoped": {
13149
13410
  "mode": "optional"
13150
- }
13411
+ },
13412
+ "conflictColumns": [
13413
+ "tenant_id",
13414
+ "slug",
13415
+ "context"
13416
+ ]
13151
13417
  },
13152
13418
  "extends": "SmrtObject",
13153
13419
  "exportName": "Payment",
13154
13420
  "collectionExportName": "PaymentCollection",
13155
13421
  "schema": {
13156
13422
  "tableName": "payments",
13157
- "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 \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"customer_id\" UUID,\n \"amount\" REAL 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\" REAL DEFAULT 0,\n \"native_currency\" TEXT DEFAULT '',\n \"usd_at_quote\" REAL DEFAULT 0,\n \"usd_at_confirmation\" REAL DEFAULT 0\n);",
13423
+ "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 \"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);",
13158
13424
  "columns": {
13159
13425
  "id": {
13160
13426
  "type": "UUID",
@@ -13200,7 +13466,7 @@
13200
13466
  "unique": false
13201
13467
  },
13202
13468
  "amount": {
13203
- "type": "REAL",
13469
+ "type": "INTEGER",
13204
13470
  "notNull": false,
13205
13471
  "unique": false,
13206
13472
  "default": 0
@@ -13280,7 +13546,7 @@
13280
13546
  "default": ""
13281
13547
  },
13282
13548
  "native_amount": {
13283
- "type": "REAL",
13549
+ "type": "INTEGER",
13284
13550
  "notNull": false,
13285
13551
  "unique": false,
13286
13552
  "default": 0
@@ -13292,35 +13558,55 @@
13292
13558
  "default": ""
13293
13559
  },
13294
13560
  "usd_at_quote": {
13295
- "type": "REAL",
13561
+ "type": "INTEGER",
13296
13562
  "notNull": false,
13297
13563
  "unique": false,
13298
13564
  "default": 0
13299
13565
  },
13300
13566
  "usd_at_confirmation": {
13301
- "type": "REAL",
13567
+ "type": "INTEGER",
13302
13568
  "notNull": false,
13303
13569
  "unique": false,
13304
13570
  "default": 0
13305
13571
  }
13306
13572
  },
13307
13573
  "indexes": [
13308
- {
13309
- "name": "payments_id_idx",
13310
- "columns": [
13311
- "id"
13312
- ]
13313
- },
13314
13574
  {
13315
13575
  "name": "payments_slug_context_idx",
13316
13576
  "columns": [
13577
+ "tenant_id",
13317
13578
  "slug",
13318
13579
  "context"
13319
13580
  ],
13320
13581
  "unique": true
13582
+ },
13583
+ {
13584
+ "name": "payments_tenant_id_created_at_idx",
13585
+ "columns": [
13586
+ "tenant_id",
13587
+ "created_at"
13588
+ ]
13589
+ },
13590
+ {
13591
+ "name": "payments_contract_id_idx",
13592
+ "columns": [
13593
+ "contract_id"
13594
+ ]
13595
+ },
13596
+ {
13597
+ "name": "payments_customer_id_idx",
13598
+ "columns": [
13599
+ "customer_id"
13600
+ ]
13601
+ },
13602
+ {
13603
+ "name": "payments_journal_id_idx",
13604
+ "columns": [
13605
+ "journal_id"
13606
+ ]
13321
13607
  }
13322
13608
  ],
13323
- "version": "65155923"
13609
+ "version": "fccf2aeb"
13324
13610
  }
13325
13611
  },
13326
13612
  "@happyvertical/smrt-commerce:PaymentAllocation": {
@@ -13410,7 +13696,12 @@
13410
13696
  },
13411
13697
  "tenantScoped": {
13412
13698
  "mode": "optional"
13413
- }
13699
+ },
13700
+ "conflictColumns": [
13701
+ "tenant_id",
13702
+ "slug",
13703
+ "context"
13704
+ ]
13414
13705
  },
13415
13706
  "extends": "SmrtObject",
13416
13707
  "exportName": "PaymentAllocation",
@@ -13487,19 +13778,33 @@
13487
13778
  }
13488
13779
  },
13489
13780
  "indexes": [
13490
- {
13491
- "name": "payment_allocations_id_idx",
13492
- "columns": [
13493
- "id"
13494
- ]
13495
- },
13496
13781
  {
13497
13782
  "name": "payment_allocations_slug_context_idx",
13498
13783
  "columns": [
13784
+ "tenant_id",
13499
13785
  "slug",
13500
13786
  "context"
13501
13787
  ],
13502
13788
  "unique": true
13789
+ },
13790
+ {
13791
+ "name": "payment_allocations_tenant_id_created_at_idx",
13792
+ "columns": [
13793
+ "tenant_id",
13794
+ "created_at"
13795
+ ]
13796
+ },
13797
+ {
13798
+ "name": "payment_allocations_payment_id_idx",
13799
+ "columns": [
13800
+ "payment_id"
13801
+ ]
13802
+ },
13803
+ {
13804
+ "name": "payment_allocations_invoice_id_idx",
13805
+ "columns": [
13806
+ "invoice_id"
13807
+ ]
13503
13808
  }
13504
13809
  ],
13505
13810
  "version": "6868b743"
@@ -13658,7 +13963,12 @@
13658
13963
  "cli": true,
13659
13964
  "tenantScoped": {
13660
13965
  "mode": "optional"
13661
- }
13966
+ },
13967
+ "conflictColumns": [
13968
+ "tenant_id",
13969
+ "slug",
13970
+ "context"
13971
+ ]
13662
13972
  },
13663
13973
  "extends": "SmrtObject",
13664
13974
  "exportName": "PaymentInstrument",
@@ -13765,19 +14075,27 @@
13765
14075
  }
13766
14076
  },
13767
14077
  "indexes": [
13768
- {
13769
- "name": "payment_instruments_id_idx",
13770
- "columns": [
13771
- "id"
13772
- ]
13773
- },
13774
14078
  {
13775
14079
  "name": "payment_instruments_slug_context_idx",
13776
14080
  "columns": [
14081
+ "tenant_id",
13777
14082
  "slug",
13778
14083
  "context"
13779
14084
  ],
13780
14085
  "unique": true
14086
+ },
14087
+ {
14088
+ "name": "payment_instruments_tenant_id_created_at_idx",
14089
+ "columns": [
14090
+ "tenant_id",
14091
+ "created_at"
14092
+ ]
14093
+ },
14094
+ {
14095
+ "name": "payment_instruments_customer_id_idx",
14096
+ "columns": [
14097
+ "customer_id"
14098
+ ]
13781
14099
  }
13782
14100
  ],
13783
14101
  "version": "0aace928"
@@ -13835,7 +14153,7 @@
13835
14153
  "default": []
13836
14154
  },
13837
14155
  "usdPriceLocked": {
13838
- "type": "decimal",
14156
+ "type": "integer",
13839
14157
  "required": false,
13840
14158
  "default": 0
13841
14159
  },
@@ -14116,7 +14434,7 @@
14116
14434
  "collectionExportName": "PaymentIntentCollection",
14117
14435
  "schema": {
14118
14436
  "tableName": "payment_intents",
14119
- "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\" REAL 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);",
14437
+ "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);",
14120
14438
  "columns": {
14121
14439
  "id": {
14122
14440
  "type": "UUID",
@@ -14180,7 +14498,7 @@
14180
14498
  "default": []
14181
14499
  },
14182
14500
  "usd_price_locked": {
14183
- "type": "REAL",
14501
+ "type": "INTEGER",
14184
14502
  "notNull": false,
14185
14503
  "unique": false,
14186
14504
  "default": 0
@@ -14251,12 +14569,6 @@
14251
14569
  }
14252
14570
  },
14253
14571
  "indexes": [
14254
- {
14255
- "name": "payment_intents_id_idx",
14256
- "columns": [
14257
- "id"
14258
- ]
14259
- },
14260
14572
  {
14261
14573
  "name": "payment_intents_tenant_id_offering_ref_idx",
14262
14574
  "columns": [
@@ -14266,9 +14578,23 @@
14266
14578
  "idempotency_key"
14267
14579
  ],
14268
14580
  "unique": true
14581
+ },
14582
+ {
14583
+ "name": "payment_intents_slug_context_idx",
14584
+ "columns": [
14585
+ "slug",
14586
+ "context"
14587
+ ]
14588
+ },
14589
+ {
14590
+ "name": "payment_intents_tenant_id_created_at_idx",
14591
+ "columns": [
14592
+ "tenant_id",
14593
+ "created_at"
14594
+ ]
14269
14595
  }
14270
14596
  ],
14271
- "version": "4597e297"
14597
+ "version": "c565aaef"
14272
14598
  }
14273
14599
  },
14274
14600
  "@happyvertical/smrt-commerce:Payout": {
@@ -14308,17 +14634,17 @@
14308
14634
  "related": "Vendor"
14309
14635
  },
14310
14636
  "grossAmount": {
14311
- "type": "decimal",
14637
+ "type": "integer",
14312
14638
  "required": false,
14313
14639
  "default": 0
14314
14640
  },
14315
14641
  "operatorFee": {
14316
- "type": "decimal",
14642
+ "type": "integer",
14317
14643
  "required": false,
14318
14644
  "default": 0
14319
14645
  },
14320
14646
  "supplierNet": {
14321
- "type": "decimal",
14647
+ "type": "integer",
14322
14648
  "required": false,
14323
14649
  "default": 0
14324
14650
  },
@@ -14487,14 +14813,19 @@
14487
14813
  },
14488
14814
  "tenantScoped": {
14489
14815
  "mode": "optional"
14490
- }
14816
+ },
14817
+ "conflictColumns": [
14818
+ "tenant_id",
14819
+ "slug",
14820
+ "context"
14821
+ ]
14491
14822
  },
14492
14823
  "extends": "SmrtObject",
14493
14824
  "exportName": "Payout",
14494
14825
  "collectionExportName": "PayoutCollection",
14495
14826
  "schema": {
14496
14827
  "tableName": "payouts",
14497
- "ddl": "CREATE TABLE IF NOT EXISTS \"payouts\" (\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 \"payment_id\" TEXT DEFAULT '',\n \"vendor_id\" UUID,\n \"gross_amount\" REAL DEFAULT 0,\n \"operator_fee\" REAL DEFAULT 0,\n \"supplier_net\" REAL DEFAULT 0,\n \"currency\" TEXT DEFAULT '',\n \"backend_id\" TEXT DEFAULT '',\n \"backend_tx_ref\" TEXT DEFAULT '',\n \"status\" TEXT,\n \"sent_at\" TIMESTAMP,\n \"confirmed_at\" TIMESTAMP,\n \"failed_at\" TIMESTAMP,\n \"failure_reason\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT ''\n);",
14828
+ "ddl": "CREATE TABLE IF NOT EXISTS \"payouts\" (\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 \"payment_id\" TEXT DEFAULT '',\n \"vendor_id\" UUID,\n \"gross_amount\" INTEGER DEFAULT 0,\n \"operator_fee\" INTEGER DEFAULT 0,\n \"supplier_net\" INTEGER DEFAULT 0,\n \"currency\" TEXT DEFAULT '',\n \"backend_id\" TEXT DEFAULT '',\n \"backend_tx_ref\" TEXT DEFAULT '',\n \"status\" TEXT,\n \"sent_at\" TIMESTAMP,\n \"confirmed_at\" TIMESTAMP,\n \"failed_at\" TIMESTAMP,\n \"failure_reason\" TEXT DEFAULT '',\n \"notes\" TEXT DEFAULT ''\n);",
14498
14829
  "columns": {
14499
14830
  "id": {
14500
14831
  "type": "UUID",
@@ -14540,19 +14871,19 @@
14540
14871
  "unique": false
14541
14872
  },
14542
14873
  "gross_amount": {
14543
- "type": "REAL",
14874
+ "type": "INTEGER",
14544
14875
  "notNull": false,
14545
14876
  "unique": false,
14546
14877
  "default": 0
14547
14878
  },
14548
14879
  "operator_fee": {
14549
- "type": "REAL",
14880
+ "type": "INTEGER",
14550
14881
  "notNull": false,
14551
14882
  "unique": false,
14552
14883
  "default": 0
14553
14884
  },
14554
14885
  "supplier_net": {
14555
- "type": "REAL",
14886
+ "type": "INTEGER",
14556
14887
  "notNull": false,
14557
14888
  "unique": false,
14558
14889
  "default": 0
@@ -14609,22 +14940,30 @@
14609
14940
  }
14610
14941
  },
14611
14942
  "indexes": [
14612
- {
14613
- "name": "payouts_id_idx",
14614
- "columns": [
14615
- "id"
14616
- ]
14617
- },
14618
14943
  {
14619
14944
  "name": "payouts_slug_context_idx",
14620
14945
  "columns": [
14946
+ "tenant_id",
14621
14947
  "slug",
14622
14948
  "context"
14623
14949
  ],
14624
14950
  "unique": true
14951
+ },
14952
+ {
14953
+ "name": "payouts_tenant_id_created_at_idx",
14954
+ "columns": [
14955
+ "tenant_id",
14956
+ "created_at"
14957
+ ]
14958
+ },
14959
+ {
14960
+ "name": "payouts_vendor_id_idx",
14961
+ "columns": [
14962
+ "vendor_id"
14963
+ ]
14625
14964
  }
14626
14965
  ],
14627
- "version": "f2382731"
14966
+ "version": "e73fa05b"
14628
14967
  }
14629
14968
  },
14630
14969
  "@happyvertical/smrt-commerce:Vendor": {
@@ -14664,7 +15003,7 @@
14664
15003
  "default": 0
14665
15004
  },
14666
15005
  "minimumOrderAmount": {
14667
- "type": "decimal",
15006
+ "type": "integer",
14668
15007
  "required": false,
14669
15008
  "default": 0
14670
15009
  },
@@ -14820,14 +15159,19 @@
14820
15159
  "cli": true,
14821
15160
  "tenantScoped": {
14822
15161
  "mode": "optional"
14823
- }
15162
+ },
15163
+ "conflictColumns": [
15164
+ "tenant_id",
15165
+ "slug",
15166
+ "context"
15167
+ ]
14824
15168
  },
14825
15169
  "extends": "SmrtObject",
14826
15170
  "exportName": "Vendor",
14827
15171
  "collectionExportName": "VendorCollection",
14828
15172
  "schema": {
14829
15173
  "tableName": "vendors",
14830
- "ddl": "CREATE TABLE IF NOT EXISTS \"vendors\" (\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 \"profile_id\" UUID,\n \"lead_time_days\" INTEGER DEFAULT 0,\n \"minimum_order_amount\" REAL DEFAULT 0,\n \"payment_terms\" TEXT DEFAULT '',\n \"currency\" TEXT DEFAULT 'USD',\n \"default_contact_email\" TEXT DEFAULT '',\n \"default_contact_phone\" TEXT DEFAULT '',\n \"status\" TEXT,\n \"notes\" TEXT DEFAULT '',\n \"payout_addresses\" JSON DEFAULT '{}'\n);",
15174
+ "ddl": "CREATE TABLE IF NOT EXISTS \"vendors\" (\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 \"profile_id\" UUID,\n \"lead_time_days\" INTEGER DEFAULT 0,\n \"minimum_order_amount\" INTEGER DEFAULT 0,\n \"payment_terms\" TEXT DEFAULT '',\n \"currency\" TEXT DEFAULT 'USD',\n \"default_contact_email\" TEXT DEFAULT '',\n \"default_contact_phone\" TEXT DEFAULT '',\n \"status\" TEXT,\n \"notes\" TEXT DEFAULT '',\n \"payout_addresses\" JSON DEFAULT '{}'\n);",
14831
15175
  "columns": {
14832
15176
  "id": {
14833
15177
  "type": "UUID",
@@ -14873,7 +15217,7 @@
14873
15217
  "default": 0
14874
15218
  },
14875
15219
  "minimum_order_amount": {
14876
- "type": "REAL",
15220
+ "type": "INTEGER",
14877
15221
  "notNull": false,
14878
15222
  "unique": false,
14879
15223
  "default": 0
@@ -14921,22 +15265,30 @@
14921
15265
  }
14922
15266
  },
14923
15267
  "indexes": [
14924
- {
14925
- "name": "vendors_id_idx",
14926
- "columns": [
14927
- "id"
14928
- ]
14929
- },
14930
15268
  {
14931
15269
  "name": "vendors_slug_context_idx",
14932
15270
  "columns": [
15271
+ "tenant_id",
14933
15272
  "slug",
14934
15273
  "context"
14935
15274
  ],
14936
15275
  "unique": true
15276
+ },
15277
+ {
15278
+ "name": "vendors_tenant_id_created_at_idx",
15279
+ "columns": [
15280
+ "tenant_id",
15281
+ "created_at"
15282
+ ]
15283
+ },
15284
+ {
15285
+ "name": "vendors_profile_id_idx",
15286
+ "columns": [
15287
+ "profile_id"
15288
+ ]
14937
15289
  }
14938
15290
  ],
14939
- "version": "43490a82"
15291
+ "version": "1dc2b65e"
14940
15292
  }
14941
15293
  }
14942
15294
  },