@happyvertical/smrt-commerce 0.56.1 → 0.56.2

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 (56) hide show
  1. package/README.md +22 -4
  2. package/agents/contract-money.md +6 -0
  3. package/agents/customer-vendor-ui.md +7 -1
  4. package/agents/document-money.md +4 -3
  5. package/agents/tax-summary.md +4 -2
  6. package/dist/chunks/{ContractLineItemCollection-DYjhj_pU.js → ContractLineItemCollection--BrGMtNz.js} +6 -6
  7. package/dist/chunks/ContractLineItemCollection--BrGMtNz.js.map +1 -0
  8. package/dist/chunks/{CustomerCollection-DQIujn4f.js → CustomerCollection-CjGaZSpf.js} +3 -3
  9. package/dist/chunks/{CustomerCollection-DQIujn4f.js.map → CustomerCollection-CjGaZSpf.js.map} +1 -1
  10. package/dist/chunks/{DocumentTaxCollection-BEpoqXAQ.js → DocumentTaxCollection-KOkaQT2M.js} +31 -11
  11. package/dist/chunks/DocumentTaxCollection-KOkaQT2M.js.map +1 -0
  12. package/dist/chunks/{InvoiceCollection-CKQflFjc.js → InvoiceCollection-BUe_8FT1.js} +14 -14
  13. package/dist/chunks/InvoiceCollection-BUe_8FT1.js.map +1 -0
  14. package/dist/chunks/{InvoiceLineItemCollection-CHm9zdqh.js → InvoiceLineItemCollection-CPQGghyd.js} +8 -7
  15. package/dist/chunks/InvoiceLineItemCollection-CPQGghyd.js.map +1 -0
  16. package/dist/chunks/{TaxCodeCollection-DOpzW4y8.js → TaxCodeCollection-DF2eaJed.js} +2 -2
  17. package/dist/chunks/{TaxCodeCollection-DOpzW4y8.js.map → TaxCodeCollection-DF2eaJed.js.map} +1 -1
  18. package/dist/chunks/{TaxComponentCollection-Cs2uXwEl.js → TaxComponentCollection-3x24xSNh.js} +3 -3
  19. package/dist/chunks/{TaxComponentCollection-Cs2uXwEl.js.map → TaxComponentCollection-3x24xSNh.js.map} +1 -1
  20. package/dist/chunks/{TaxSettingsCollection-BBTZDH1S.js → TaxSettingsCollection-DYYF-In-.js} +6 -6
  21. package/dist/chunks/{TaxSettingsCollection-BBTZDH1S.js.map → TaxSettingsCollection-DYYF-In-.js.map} +1 -1
  22. package/dist/chunks/{allocation-integrity-DI3G16BN.js → allocation-integrity-Cq0g6CfO.js} +3 -3
  23. package/dist/chunks/{allocation-integrity-DI3G16BN.js.map → allocation-integrity-Cq0g6CfO.js.map} +1 -1
  24. package/dist/chunks/{document-money-DNVhDJyC.js → document-money-oUDvdjOf.js} +10 -10
  25. package/dist/chunks/{document-money-DNVhDJyC.js.map → document-money-oUDvdjOf.js.map} +1 -1
  26. package/dist/chunks/{invoice-posting-BwV8g7z0.js → invoice-posting-CF3fE_Ec.js} +7 -7
  27. package/dist/chunks/{invoice-posting-BwV8g7z0.js.map → invoice-posting-CF3fE_Ec.js.map} +1 -1
  28. package/dist/chunks/{tenant-money-barrier-DjRXgMnX.js → tenant-money-barrier-y6EAa6vY.js} +2 -2
  29. package/dist/chunks/{tenant-money-barrier-DjRXgMnX.js.map → tenant-money-barrier-y6EAa6vY.js.map} +1 -1
  30. package/dist/chunks/{types-LDETvQ1C.js → types-Bbm0Xflc.js} +2 -1
  31. package/dist/chunks/types-Bbm0Xflc.js.map +1 -0
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +36 -23
  35. package/dist/index.js.map +1 -1
  36. package/dist/manifest.json +1057 -151
  37. package/dist/migrations/partyLinks.d.ts.map +1 -1
  38. package/dist/models/Contract.d.ts +10 -4
  39. package/dist/models/Contract.d.ts.map +1 -1
  40. package/dist/models/ContractLineItem.d.ts +13 -5
  41. package/dist/models/ContractLineItem.d.ts.map +1 -1
  42. package/dist/models/DocumentTax.d.ts.map +1 -1
  43. package/dist/models/Invoice.d.ts.map +1 -1
  44. package/dist/models/InvoiceLineItem.d.ts +12 -2
  45. package/dist/models/InvoiceLineItem.d.ts.map +1 -1
  46. package/dist/models/index.d.ts +1 -1
  47. package/dist/models/index.d.ts.map +1 -1
  48. package/dist/smrt-knowledge.json +2925 -5578
  49. package/dist/types/index.d.ts +1 -0
  50. package/dist/types/index.d.ts.map +1 -1
  51. package/package.json +13 -13
  52. package/dist/chunks/ContractLineItemCollection-DYjhj_pU.js.map +0 -1
  53. package/dist/chunks/DocumentTaxCollection-BEpoqXAQ.js.map +0 -1
  54. package/dist/chunks/InvoiceCollection-CKQflFjc.js.map +0 -1
  55. package/dist/chunks/InvoiceLineItemCollection-CHm9zdqh.js.map +0 -1
  56. package/dist/chunks/types-LDETvQ1C.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.56.1",
5
+ "packageVersion": "0.56.2",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-commerce:ContractCollection": {
8
8
  "name": "contractcollection",
@@ -217,7 +217,22 @@
217
217
  "isPublic": true
218
218
  }
219
219
  },
220
- "decoratorConfig": {},
220
+ "decoratorConfig": {
221
+ "api": {
222
+ "include": [
223
+ "list",
224
+ "get",
225
+ "create",
226
+ "update"
227
+ ]
228
+ },
229
+ "mcp": {
230
+ "include": [
231
+ "list",
232
+ "get"
233
+ ]
234
+ }
235
+ },
221
236
  "extends": "SmrtCollection",
222
237
  "extendsTypeArg": "Contract",
223
238
  "exportName": "ContractCollection",
@@ -412,7 +427,7 @@
412
427
  ]
413
428
  }
414
429
  ],
415
- "version": "1e559454"
430
+ "version": "8d7c3fd2"
416
431
  },
417
432
  "importPath": "@happyvertical/smrt-commerce"
418
433
  },
@@ -518,7 +533,23 @@
518
533
  "isPublic": true
519
534
  }
520
535
  },
521
- "decoratorConfig": {},
536
+ "decoratorConfig": {
537
+ "api": {
538
+ "include": [
539
+ "list",
540
+ "get",
541
+ "create",
542
+ "update",
543
+ "delete"
544
+ ]
545
+ },
546
+ "mcp": {
547
+ "include": [
548
+ "list",
549
+ "get"
550
+ ]
551
+ }
552
+ },
522
553
  "extends": "SmrtCollection",
523
554
  "extendsTypeArg": "ContractLineItem",
524
555
  "exportName": "ContractLineItemCollection",
@@ -838,7 +869,22 @@
838
869
  "isPublic": true
839
870
  }
840
871
  },
841
- "decoratorConfig": {},
872
+ "decoratorConfig": {
873
+ "api": {
874
+ "include": [
875
+ "list",
876
+ "get",
877
+ "create",
878
+ "update"
879
+ ]
880
+ },
881
+ "mcp": {
882
+ "include": [
883
+ "list",
884
+ "get"
885
+ ]
886
+ }
887
+ },
842
888
  "extends": "SmrtCollection",
843
889
  "extendsTypeArg": "Customer",
844
890
  "exportName": "CustomerCollection",
@@ -1061,7 +1107,25 @@
1061
1107
  }
1062
1108
  },
1063
1109
  "decoratorConfig": {
1064
- "tableName": "document_taxes"
1110
+ "tableName": "document_taxes",
1111
+ "api": {
1112
+ "include": [
1113
+ "list",
1114
+ "get"
1115
+ ]
1116
+ },
1117
+ "mcp": {
1118
+ "include": [
1119
+ "list",
1120
+ "get"
1121
+ ]
1122
+ },
1123
+ "cli": {
1124
+ "include": [
1125
+ "list",
1126
+ "get"
1127
+ ]
1128
+ }
1065
1129
  },
1066
1130
  "extends": "SmrtCollection",
1067
1131
  "extendsTypeArg": "DocumentTax",
@@ -1340,7 +1404,22 @@
1340
1404
  "isPublic": true
1341
1405
  }
1342
1406
  },
1343
- "decoratorConfig": {},
1407
+ "decoratorConfig": {
1408
+ "api": {
1409
+ "include": [
1410
+ "list",
1411
+ "get",
1412
+ "create",
1413
+ "update"
1414
+ ]
1415
+ },
1416
+ "mcp": {
1417
+ "include": [
1418
+ "list",
1419
+ "get"
1420
+ ]
1421
+ }
1422
+ },
1344
1423
  "extends": "SmrtCollection",
1345
1424
  "extendsTypeArg": "Fulfillment",
1346
1425
  "exportName": "FulfillmentCollection",
@@ -1558,7 +1637,23 @@
1558
1637
  "isPublic": true
1559
1638
  }
1560
1639
  },
1561
- "decoratorConfig": {},
1640
+ "decoratorConfig": {
1641
+ "api": {
1642
+ "include": [
1643
+ "list",
1644
+ "get",
1645
+ "create",
1646
+ "update",
1647
+ "delete"
1648
+ ]
1649
+ },
1650
+ "mcp": {
1651
+ "include": [
1652
+ "list",
1653
+ "get"
1654
+ ]
1655
+ }
1656
+ },
1562
1657
  "extends": "SmrtCollection",
1563
1658
  "extendsTypeArg": "FulfillmentLineItem",
1564
1659
  "exportName": "FulfillmentLineItemCollection",
@@ -1937,7 +2032,22 @@
1937
2032
  "isPublic": true
1938
2033
  }
1939
2034
  },
1940
- "decoratorConfig": {},
2035
+ "decoratorConfig": {
2036
+ "api": {
2037
+ "include": [
2038
+ "list",
2039
+ "get",
2040
+ "create",
2041
+ "update"
2042
+ ]
2043
+ },
2044
+ "mcp": {
2045
+ "include": [
2046
+ "list",
2047
+ "get"
2048
+ ]
2049
+ }
2050
+ },
1941
2051
  "extends": "SmrtCollection",
1942
2052
  "extendsTypeArg": "Invoice",
1943
2053
  "exportName": "InvoiceCollection",
@@ -2496,7 +2606,23 @@
2496
2606
  "isPublic": true
2497
2607
  }
2498
2608
  },
2499
- "decoratorConfig": {},
2609
+ "decoratorConfig": {
2610
+ "api": {
2611
+ "include": [
2612
+ "list",
2613
+ "get",
2614
+ "create",
2615
+ "update",
2616
+ "delete"
2617
+ ]
2618
+ },
2619
+ "mcp": {
2620
+ "include": [
2621
+ "list",
2622
+ "get"
2623
+ ]
2624
+ }
2625
+ },
2500
2626
  "extends": "SmrtCollection",
2501
2627
  "extendsTypeArg": "InvoiceLineItem",
2502
2628
  "exportName": "InvoiceLineItemCollection",
@@ -3138,7 +3264,26 @@
3138
3264
  "isPublic": true
3139
3265
  }
3140
3266
  },
3141
- "decoratorConfig": {},
3267
+ "decoratorConfig": {
3268
+ "api": {
3269
+ "include": [
3270
+ "list",
3271
+ "get"
3272
+ ]
3273
+ },
3274
+ "mcp": {
3275
+ "include": [
3276
+ "list",
3277
+ "get"
3278
+ ]
3279
+ },
3280
+ "cli": {
3281
+ "include": [
3282
+ "list",
3283
+ "get"
3284
+ ]
3285
+ }
3286
+ },
3142
3287
  "extends": "SmrtCollection",
3143
3288
  "extendsTypeArg": "PaymentAllocation",
3144
3289
  "exportName": "PaymentAllocationCollection",
@@ -3440,7 +3585,22 @@
3440
3585
  "isPublic": true
3441
3586
  }
3442
3587
  },
3443
- "decoratorConfig": {},
3588
+ "decoratorConfig": {
3589
+ "api": {
3590
+ "include": [
3591
+ "list",
3592
+ "get",
3593
+ "create",
3594
+ "update"
3595
+ ]
3596
+ },
3597
+ "mcp": {
3598
+ "include": [
3599
+ "list",
3600
+ "get"
3601
+ ]
3602
+ }
3603
+ },
3444
3604
  "extends": "SmrtCollection",
3445
3605
  "extendsTypeArg": "Payment",
3446
3606
  "exportName": "PaymentCollection",
@@ -3777,7 +3937,22 @@
3777
3937
  "isPublic": true
3778
3938
  }
3779
3939
  },
3780
- "decoratorConfig": {},
3940
+ "decoratorConfig": {
3941
+ "api": {
3942
+ "include": [
3943
+ "list",
3944
+ "get",
3945
+ "create",
3946
+ "update"
3947
+ ]
3948
+ },
3949
+ "mcp": {
3950
+ "include": [
3951
+ "list",
3952
+ "get"
3953
+ ]
3954
+ }
3955
+ },
3781
3956
  "extends": "SmrtCollection",
3782
3957
  "extendsTypeArg": "PaymentInstrument",
3783
3958
  "exportName": "PaymentInstrumentCollection",
@@ -4050,7 +4225,22 @@
4050
4225
  "isPublic": true
4051
4226
  }
4052
4227
  },
4053
- "decoratorConfig": {},
4228
+ "decoratorConfig": {
4229
+ "api": {
4230
+ "include": [
4231
+ "list",
4232
+ "get",
4233
+ "create",
4234
+ "update"
4235
+ ]
4236
+ },
4237
+ "mcp": {
4238
+ "include": [
4239
+ "list",
4240
+ "get"
4241
+ ]
4242
+ }
4243
+ },
4054
4244
  "extends": "SmrtCollection",
4055
4245
  "extendsTypeArg": "PaymentIntent",
4056
4246
  "exportName": "PaymentIntentCollection",
@@ -4368,7 +4558,26 @@
4368
4558
  "isPublic": true
4369
4559
  }
4370
4560
  },
4371
- "decoratorConfig": {},
4561
+ "decoratorConfig": {
4562
+ "api": {
4563
+ "include": [
4564
+ "list",
4565
+ "get"
4566
+ ]
4567
+ },
4568
+ "mcp": {
4569
+ "include": [
4570
+ "list",
4571
+ "get"
4572
+ ]
4573
+ },
4574
+ "cli": {
4575
+ "include": [
4576
+ "list",
4577
+ "get"
4578
+ ]
4579
+ }
4580
+ },
4372
4581
  "extends": "SmrtCollection",
4373
4582
  "extendsTypeArg": "Payout",
4374
4583
  "exportName": "PayoutCollection",
@@ -4770,7 +4979,7 @@
4770
4979
  ]
4771
4980
  }
4772
4981
  ],
4773
- "version": "f398d688"
4982
+ "version": "7f5f7bfd"
4774
4983
  },
4775
4984
  "importPath": "@happyvertical/smrt-commerce"
4776
4985
  },
@@ -5048,7 +5257,22 @@
5048
5257
  "isPublic": true
5049
5258
  }
5050
5259
  },
5051
- "decoratorConfig": {},
5260
+ "decoratorConfig": {
5261
+ "api": {
5262
+ "include": [
5263
+ "list",
5264
+ "get",
5265
+ "create",
5266
+ "update"
5267
+ ]
5268
+ },
5269
+ "mcp": {
5270
+ "include": [
5271
+ "list",
5272
+ "get"
5273
+ ]
5274
+ }
5275
+ },
5052
5276
  "extends": "SmrtCollection",
5053
5277
  "extendsTypeArg": "TaxCode",
5054
5278
  "exportName": "TaxCodeCollection",
@@ -5160,7 +5384,22 @@
5160
5384
  "packageName": "@happyvertical/smrt-commerce",
5161
5385
  "fields": {},
5162
5386
  "methods": {},
5163
- "decoratorConfig": {},
5387
+ "decoratorConfig": {
5388
+ "api": {
5389
+ "include": [
5390
+ "list",
5391
+ "get",
5392
+ "create",
5393
+ "update"
5394
+ ]
5395
+ },
5396
+ "mcp": {
5397
+ "include": [
5398
+ "list",
5399
+ "get"
5400
+ ]
5401
+ }
5402
+ },
5164
5403
  "extends": "SmrtCollection",
5165
5404
  "extendsTypeArg": "TaxComponent",
5166
5405
  "exportName": "TaxComponentCollection",
@@ -5390,9 +5629,22 @@
5390
5629
  "isPublic": true
5391
5630
  }
5392
5631
  },
5393
- "decoratorConfig": {},
5394
- "extends": "SmrtCollection",
5395
- "extendsTypeArg": "TaxSettings",
5632
+ "decoratorConfig": {
5633
+ "api": {
5634
+ "include": [
5635
+ "get",
5636
+ "create",
5637
+ "update"
5638
+ ]
5639
+ },
5640
+ "mcp": {
5641
+ "include": [
5642
+ "get"
5643
+ ]
5644
+ }
5645
+ },
5646
+ "extends": "SmrtCollection",
5647
+ "extendsTypeArg": "TaxSettings",
5396
5648
  "exportName": "TaxSettingsCollection",
5397
5649
  "collectionExportName": "TaxSettingsCollectionCollection",
5398
5650
  "schema": {
@@ -5639,7 +5891,25 @@
5639
5891
  }
5640
5892
  },
5641
5893
  "decoratorConfig": {
5642
- "tableName": "tax_summary_reports"
5894
+ "tableName": "tax_summary_reports",
5895
+ "api": {
5896
+ "include": [
5897
+ "list",
5898
+ "get"
5899
+ ]
5900
+ },
5901
+ "mcp": {
5902
+ "include": [
5903
+ "list",
5904
+ "get"
5905
+ ]
5906
+ },
5907
+ "cli": {
5908
+ "include": [
5909
+ "list",
5910
+ "get"
5911
+ ]
5912
+ }
5643
5913
  },
5644
5914
  "extends": "SmrtReportCollection",
5645
5915
  "extendsTypeArg": "TaxSummaryReport",
@@ -5939,7 +6209,22 @@
5939
6209
  "isPublic": true
5940
6210
  }
5941
6211
  },
5942
- "decoratorConfig": {},
6212
+ "decoratorConfig": {
6213
+ "api": {
6214
+ "include": [
6215
+ "list",
6216
+ "get",
6217
+ "create",
6218
+ "update"
6219
+ ]
6220
+ },
6221
+ "mcp": {
6222
+ "include": [
6223
+ "list",
6224
+ "get"
6225
+ ]
6226
+ }
6227
+ },
5943
6228
  "extends": "SmrtCollection",
5944
6229
  "extendsTypeArg": "Vendor",
5945
6230
  "exportName": "VendorCollection",
@@ -6145,6 +6430,7 @@
6145
6430
  "order",
6146
6431
  "lease",
6147
6432
  "agreement",
6433
+ "supplier_quote",
6148
6434
  "purchase_order",
6149
6435
  "wholesale_order",
6150
6436
  "production_order",
@@ -6183,7 +6469,12 @@
6183
6469
  "discountTotal": {
6184
6470
  "type": "integer",
6185
6471
  "required": false,
6186
- "default": 0
6472
+ "default": 0,
6473
+ "_meta": {
6474
+ "ui": {
6475
+ "format": "money"
6476
+ }
6477
+ }
6187
6478
  },
6188
6479
  "taxAmount": {
6189
6480
  "type": "integer",
@@ -6640,7 +6931,7 @@
6640
6931
  ]
6641
6932
  }
6642
6933
  ],
6643
- "version": "1e559454"
6934
+ "version": "8d7c3fd2"
6644
6935
  },
6645
6936
  "importPath": "@happyvertical/smrt-commerce"
6646
6937
  },
@@ -6691,6 +6982,7 @@
6691
6982
  "order",
6692
6983
  "lease",
6693
6984
  "agreement",
6985
+ "supplier_quote",
6694
6986
  "purchase_order",
6695
6987
  "wholesale_order",
6696
6988
  "production_order",
@@ -6729,7 +7021,12 @@
6729
7021
  "discountTotal": {
6730
7022
  "type": "integer",
6731
7023
  "required": false,
6732
- "default": 0
7024
+ "default": 0,
7025
+ "_meta": {
7026
+ "ui": {
7027
+ "format": "money"
7028
+ }
7029
+ }
6733
7030
  },
6734
7031
  "taxAmount": {
6735
7032
  "type": "integer",
@@ -7234,7 +7531,7 @@
7234
7531
  "className": "PurchaseContract",
7235
7532
  "qualifiedName": "@happyvertical/smrt-commerce:PurchaseContract",
7236
7533
  "collection": "contracts",
7237
- "description": "Supplier-side contracts, including purchase and production orders.",
7534
+ "description": "Supplier-side contracts, including supplier quotes, purchase and production orders.",
7238
7535
  "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Contract.ts",
7239
7536
  "packageName": "@happyvertical/smrt-commerce",
7240
7537
  "fields": {
@@ -7276,6 +7573,7 @@
7276
7573
  "order",
7277
7574
  "lease",
7278
7575
  "agreement",
7576
+ "supplier_quote",
7279
7577
  "purchase_order",
7280
7578
  "wholesale_order",
7281
7579
  "production_order",
@@ -7314,7 +7612,587 @@
7314
7612
  "discountTotal": {
7315
7613
  "type": "integer",
7316
7614
  "required": false,
7317
- "default": 0
7615
+ "default": 0,
7616
+ "_meta": {
7617
+ "ui": {
7618
+ "format": "money"
7619
+ }
7620
+ }
7621
+ },
7622
+ "taxAmount": {
7623
+ "type": "integer",
7624
+ "required": false,
7625
+ "default": 0,
7626
+ "description": "The tax charged.",
7627
+ "_meta": {
7628
+ "description": "The tax charged.",
7629
+ "ui": {
7630
+ "format": "money"
7631
+ }
7632
+ }
7633
+ },
7634
+ "totalAmount": {
7635
+ "type": "integer",
7636
+ "required": false,
7637
+ "default": 0,
7638
+ "description": "The full amount, tax included.",
7639
+ "_meta": {
7640
+ "description": "The full amount, tax included.",
7641
+ "ui": {
7642
+ "format": "money"
7643
+ }
7644
+ }
7645
+ },
7646
+ "currency": {
7647
+ "type": "text",
7648
+ "required": false,
7649
+ "default": "USD",
7650
+ "description": "The currency of the amounts.",
7651
+ "_meta": {
7652
+ "description": "The currency of the amounts.",
7653
+ "ui": {
7654
+ "widget": "currency"
7655
+ }
7656
+ }
7657
+ },
7658
+ "lineAmountType": {
7659
+ "type": "text",
7660
+ "required": false,
7661
+ "default": "exclusive",
7662
+ "enum": [
7663
+ "exclusive",
7664
+ "inclusive",
7665
+ "none"
7666
+ ]
7667
+ },
7668
+ "taxRoundingScope": {
7669
+ "type": "text",
7670
+ "required": false,
7671
+ "default": "line",
7672
+ "enum": [
7673
+ "line",
7674
+ "document"
7675
+ ]
7676
+ },
7677
+ "sellerTaxRegistrationsJson": {
7678
+ "type": "text",
7679
+ "required": false
7680
+ },
7681
+ "partyTaxId": {
7682
+ "type": "text",
7683
+ "required": false
7684
+ },
7685
+ "moneySnapshotId": {
7686
+ "type": "text",
7687
+ "required": false
7688
+ },
7689
+ "issueDate": {
7690
+ "type": "datetime",
7691
+ "required": false,
7692
+ "description": "The date it was issued or placed.",
7693
+ "_meta": {
7694
+ "description": "The date it was issued or placed."
7695
+ }
7696
+ },
7697
+ "dueDate": {
7698
+ "type": "datetime",
7699
+ "required": false,
7700
+ "description": "The date payment or delivery is due.",
7701
+ "_meta": {
7702
+ "description": "The date payment or delivery is due."
7703
+ }
7704
+ },
7705
+ "expiryDate": {
7706
+ "type": "datetime",
7707
+ "required": false,
7708
+ "description": "The last day the price or offer is good for.",
7709
+ "_meta": {
7710
+ "description": "The last day the price or offer is good for."
7711
+ }
7712
+ },
7713
+ "reference": {
7714
+ "type": "text",
7715
+ "required": false,
7716
+ "default": "",
7717
+ "description": "Your own number or note for finding this later, such as a purchase order or quote number.",
7718
+ "_meta": {
7719
+ "description": "Your own number or note for finding this later, such as a purchase order or quote number."
7720
+ }
7721
+ },
7722
+ "notes": {
7723
+ "type": "text",
7724
+ "required": false,
7725
+ "default": "",
7726
+ "description": "Anything worth remembering about this.",
7727
+ "_meta": {
7728
+ "description": "Anything worth remembering about this.",
7729
+ "ui": {
7730
+ "widget": "textarea"
7731
+ }
7732
+ }
7733
+ },
7734
+ "terms": {
7735
+ "type": "text",
7736
+ "required": false,
7737
+ "default": "",
7738
+ "description": "The conditions agreed, such as deposits, payment or delivery conditions.",
7739
+ "_meta": {
7740
+ "description": "The conditions agreed, such as deposits, payment or delivery conditions.",
7741
+ "ui": {
7742
+ "widget": "textarea"
7743
+ }
7744
+ }
7745
+ },
7746
+ "channelId": {
7747
+ "type": "text",
7748
+ "required": false,
7749
+ "default": "",
7750
+ "description": "Where it came from, for example your shop, a marketplace or a phone call.",
7751
+ "_meta": {
7752
+ "description": "Where it came from, for example your shop, a marketplace or a phone call."
7753
+ }
7754
+ },
7755
+ "vendorId": {
7756
+ "type": "foreignKey",
7757
+ "required": false,
7758
+ "related": "Vendor",
7759
+ "_meta": {
7760
+ "description": "The vendor supplying this quote or purchase contract."
7761
+ }
7762
+ }
7763
+ },
7764
+ "methods": {
7765
+ "rebindMoneyRead": {
7766
+ "name": "rebindMoneyRead",
7767
+ "async": false,
7768
+ "parameters": [
7769
+ {
7770
+ "name": "capability",
7771
+ "type": "DocumentMoneyReadRebindCapability",
7772
+ "optional": false
7773
+ },
7774
+ {
7775
+ "name": "db",
7776
+ "type": "DatabaseInterface",
7777
+ "optional": false
7778
+ }
7779
+ ],
7780
+ "returnType": "this",
7781
+ "isStatic": false,
7782
+ "isPublic": true
7783
+ },
7784
+ "isDraft": {
7785
+ "name": "isDraft",
7786
+ "async": false,
7787
+ "parameters": [],
7788
+ "returnType": "boolean",
7789
+ "isStatic": false,
7790
+ "isPublic": true
7791
+ },
7792
+ "isAccepted": {
7793
+ "name": "isAccepted",
7794
+ "async": false,
7795
+ "parameters": [],
7796
+ "returnType": "boolean",
7797
+ "isStatic": false,
7798
+ "isPublic": true
7799
+ },
7800
+ "isCompleted": {
7801
+ "name": "isCompleted",
7802
+ "async": false,
7803
+ "parameters": [],
7804
+ "returnType": "boolean",
7805
+ "isStatic": false,
7806
+ "isPublic": true
7807
+ },
7808
+ "isExpired": {
7809
+ "name": "isExpired",
7810
+ "async": false,
7811
+ "parameters": [],
7812
+ "returnType": "boolean",
7813
+ "isStatic": false,
7814
+ "isPublic": true
7815
+ },
7816
+ "isOverdue": {
7817
+ "name": "isOverdue",
7818
+ "async": false,
7819
+ "parameters": [],
7820
+ "returnType": "boolean",
7821
+ "isStatic": false,
7822
+ "isPublic": true
7823
+ },
7824
+ "recalculateTotals": {
7825
+ "name": "recalculateTotals",
7826
+ "async": true,
7827
+ "parameters": [],
7828
+ "returnType": "Promise<void>",
7829
+ "isStatic": false,
7830
+ "isPublic": true
7831
+ },
7832
+ "initialize": {
7833
+ "name": "initialize",
7834
+ "async": true,
7835
+ "parameters": [],
7836
+ "returnType": "Promise<this>",
7837
+ "isStatic": false,
7838
+ "isPublic": true
7839
+ },
7840
+ "save": {
7841
+ "name": "save",
7842
+ "async": true,
7843
+ "parameters": [],
7844
+ "returnType": "Promise<this>",
7845
+ "isStatic": false,
7846
+ "isPublic": true
7847
+ },
7848
+ "saveDerived": {
7849
+ "name": "saveDerived",
7850
+ "async": true,
7851
+ "parameters": [
7852
+ {
7853
+ "name": "capability",
7854
+ "type": "DocumentMoneyWriteCapability",
7855
+ "optional": false
7856
+ }
7857
+ ],
7858
+ "returnType": "Promise<this>",
7859
+ "isStatic": false,
7860
+ "isPublic": true
7861
+ }
7862
+ },
7863
+ "decoratorConfig": {
7864
+ "abstract": true,
7865
+ "tenantScoped": {
7866
+ "mode": "optional"
7867
+ },
7868
+ "tableName": "contracts",
7869
+ "tableStrategy": "sti",
7870
+ "api": {
7871
+ "exclude": [
7872
+ "create",
7873
+ "update",
7874
+ "delete",
7875
+ "rebindMoneyRead",
7876
+ "isDraft",
7877
+ "isAccepted",
7878
+ "isCompleted",
7879
+ "isExpired",
7880
+ "isOverdue",
7881
+ "recalculateTotals",
7882
+ "initialize",
7883
+ "save",
7884
+ "saveDerived"
7885
+ ]
7886
+ },
7887
+ "mcp": {
7888
+ "exclude": [
7889
+ "create",
7890
+ "update",
7891
+ "delete",
7892
+ "rebindMoneyRead",
7893
+ "isDraft",
7894
+ "isAccepted",
7895
+ "isCompleted",
7896
+ "isExpired",
7897
+ "isOverdue",
7898
+ "recalculateTotals",
7899
+ "initialize",
7900
+ "save",
7901
+ "saveDerived"
7902
+ ]
7903
+ },
7904
+ "cli": {
7905
+ "exclude": [
7906
+ "create",
7907
+ "update",
7908
+ "delete",
7909
+ "rebindMoneyRead",
7910
+ "isDraft",
7911
+ "isAccepted",
7912
+ "isCompleted",
7913
+ "isExpired",
7914
+ "isOverdue",
7915
+ "recalculateTotals",
7916
+ "initialize",
7917
+ "save",
7918
+ "saveDerived"
7919
+ ]
7920
+ }
7921
+ },
7922
+ "extends": "Contract",
7923
+ "exportName": "PurchaseContract",
7924
+ "collectionExportName": "PurchaseContractCollection",
7925
+ "abstractDeclaredApi": null,
7926
+ "schema": {
7927
+ "tableName": "contracts",
7928
+ "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 \"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);",
7929
+ "columns": {
7930
+ "id": {
7931
+ "type": "UUID",
7932
+ "primaryKey": true,
7933
+ "referenceKind": "id",
7934
+ "notNull": true
7935
+ },
7936
+ "slug": {
7937
+ "type": "TEXT",
7938
+ "notNull": true
7939
+ },
7940
+ "context": {
7941
+ "type": "TEXT",
7942
+ "notNull": true,
7943
+ "default": ""
7944
+ },
7945
+ "_meta_type": {
7946
+ "type": "TEXT",
7947
+ "notNull": true
7948
+ },
7949
+ "_meta_data": {
7950
+ "type": "JSON",
7951
+ "notNull": false
7952
+ },
7953
+ "created_at": {
7954
+ "type": "TIMESTAMP",
7955
+ "notNull": true,
7956
+ "default": "current_timestamp"
7957
+ },
7958
+ "updated_at": {
7959
+ "type": "TIMESTAMP",
7960
+ "notNull": true,
7961
+ "default": "current_timestamp"
7962
+ },
7963
+ "tenant_id": {
7964
+ "type": "UUID",
7965
+ "referenceKind": "tenantId",
7966
+ "notNull": false
7967
+ },
7968
+ "contract_type": {
7969
+ "type": "TEXT",
7970
+ "notNull": false
7971
+ },
7972
+ "status": {
7973
+ "type": "TEXT",
7974
+ "notNull": false
7975
+ },
7976
+ "subtotal": {
7977
+ "type": "INTEGER",
7978
+ "notNull": false,
7979
+ "default": 0
7980
+ },
7981
+ "discount_total": {
7982
+ "type": "INTEGER",
7983
+ "notNull": false,
7984
+ "default": 0
7985
+ },
7986
+ "tax_amount": {
7987
+ "type": "INTEGER",
7988
+ "notNull": false,
7989
+ "default": 0
7990
+ },
7991
+ "total_amount": {
7992
+ "type": "INTEGER",
7993
+ "notNull": false,
7994
+ "default": 0
7995
+ },
7996
+ "currency": {
7997
+ "type": "TEXT",
7998
+ "notNull": false,
7999
+ "default": "USD"
8000
+ },
8001
+ "line_amount_type": {
8002
+ "type": "TEXT",
8003
+ "notNull": false,
8004
+ "default": "exclusive"
8005
+ },
8006
+ "tax_rounding_scope": {
8007
+ "type": "TEXT",
8008
+ "notNull": false,
8009
+ "default": "line"
8010
+ },
8011
+ "seller_tax_registrations_json": {
8012
+ "type": "TEXT",
8013
+ "notNull": false
8014
+ },
8015
+ "party_tax_id": {
8016
+ "type": "TEXT",
8017
+ "notNull": false
8018
+ },
8019
+ "money_snapshot_id": {
8020
+ "type": "TEXT",
8021
+ "notNull": false
8022
+ },
8023
+ "issue_date": {
8024
+ "type": "TIMESTAMP",
8025
+ "notNull": false
8026
+ },
8027
+ "due_date": {
8028
+ "type": "TIMESTAMP",
8029
+ "notNull": false
8030
+ },
8031
+ "expiry_date": {
8032
+ "type": "TIMESTAMP",
8033
+ "notNull": false
8034
+ },
8035
+ "reference": {
8036
+ "type": "TEXT",
8037
+ "notNull": false,
8038
+ "default": ""
8039
+ },
8040
+ "notes": {
8041
+ "type": "TEXT",
8042
+ "notNull": false,
8043
+ "default": ""
8044
+ },
8045
+ "terms": {
8046
+ "type": "TEXT",
8047
+ "notNull": false,
8048
+ "default": ""
8049
+ },
8050
+ "channel_id": {
8051
+ "type": "TEXT",
8052
+ "notNull": false,
8053
+ "default": ""
8054
+ },
8055
+ "customer_id": {
8056
+ "type": "UUID",
8057
+ "referenceKind": "foreignKey",
8058
+ "notNull": false,
8059
+ "foreignKey": {
8060
+ "table": "customers",
8061
+ "column": "id",
8062
+ "onDelete": "NO ACTION",
8063
+ "onUpdate": "CASCADE"
8064
+ }
8065
+ },
8066
+ "vendor_id": {
8067
+ "type": "UUID",
8068
+ "referenceKind": "foreignKey",
8069
+ "notNull": false,
8070
+ "foreignKey": {
8071
+ "table": "vendors",
8072
+ "column": "id",
8073
+ "onDelete": "NO ACTION",
8074
+ "onUpdate": "CASCADE"
8075
+ }
8076
+ }
8077
+ },
8078
+ "indexes": [
8079
+ {
8080
+ "name": "contracts_slug_context_meta_type_idx",
8081
+ "columns": [
8082
+ "tenant_id",
8083
+ "slug",
8084
+ "context",
8085
+ "_meta_type"
8086
+ ],
8087
+ "unique": true,
8088
+ "nullsNotDistinct": true
8089
+ },
8090
+ {
8091
+ "name": "contracts_meta_type_idx",
8092
+ "columns": [
8093
+ "_meta_type"
8094
+ ]
8095
+ },
8096
+ {
8097
+ "name": "contracts_tenant_id_created_at_idx",
8098
+ "columns": [
8099
+ "tenant_id",
8100
+ "created_at"
8101
+ ]
8102
+ },
8103
+ {
8104
+ "name": "contracts_customer_id_idx",
8105
+ "columns": [
8106
+ "customer_id"
8107
+ ]
8108
+ },
8109
+ {
8110
+ "name": "contracts_vendor_id_idx",
8111
+ "columns": [
8112
+ "vendor_id"
8113
+ ]
8114
+ }
8115
+ ],
8116
+ "version": "7f5f7bfd"
8117
+ },
8118
+ "importPath": "@happyvertical/smrt-commerce"
8119
+ },
8120
+ "@happyvertical/smrt-commerce:Estimate": {
8121
+ "name": "estimate",
8122
+ "className": "Estimate",
8123
+ "qualifiedName": "@happyvertical/smrt-commerce:Estimate",
8124
+ "collection": "contracts",
8125
+ "description": "Quote or proposal for a customer",
8126
+ "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Contract.ts",
8127
+ "packageName": "@happyvertical/smrt-commerce",
8128
+ "fields": {
8129
+ "created_at": {
8130
+ "type": "datetime",
8131
+ "required": false
8132
+ },
8133
+ "updated_at": {
8134
+ "type": "datetime",
8135
+ "required": false
8136
+ },
8137
+ "tenantId": {
8138
+ "type": "text",
8139
+ "required": false,
8140
+ "_meta": {
8141
+ "sqlType": "UUID",
8142
+ "nullable": true,
8143
+ "__tenancy": {
8144
+ "isTenantIdField": true,
8145
+ "autoFilter": true,
8146
+ "required": false,
8147
+ "autoPopulate": true,
8148
+ "nullable": true,
8149
+ "mode": "optional",
8150
+ "field": "tenantId",
8151
+ "allowSuperAdminBypass": false
8152
+ }
8153
+ }
8154
+ },
8155
+ "contractType": {
8156
+ "type": "text",
8157
+ "required": false
8158
+ },
8159
+ "status": {
8160
+ "type": "text",
8161
+ "required": false,
8162
+ "description": "Where the order or agreement stands, for example draft, sent, accepted or completed.",
8163
+ "_meta": {
8164
+ "description": "Where the order or agreement stands, for example draft, sent, accepted or completed."
8165
+ },
8166
+ "enum": [
8167
+ "draft",
8168
+ "sent",
8169
+ "accepted",
8170
+ "declined",
8171
+ "completed",
8172
+ "cancelled"
8173
+ ]
8174
+ },
8175
+ "subtotal": {
8176
+ "type": "integer",
8177
+ "required": false,
8178
+ "default": 0,
8179
+ "description": "The amount before tax.",
8180
+ "_meta": {
8181
+ "description": "The amount before tax.",
8182
+ "ui": {
8183
+ "format": "money"
8184
+ }
8185
+ }
8186
+ },
8187
+ "discountTotal": {
8188
+ "type": "integer",
8189
+ "required": false,
8190
+ "default": 0,
8191
+ "_meta": {
8192
+ "ui": {
8193
+ "format": "money"
8194
+ }
8195
+ }
7318
8196
  },
7319
8197
  "taxAmount": {
7320
8198
  "type": "integer",
@@ -7449,12 +8327,12 @@
7449
8327
  "description": "Where it came from, for example your shop, a marketplace or a phone call."
7450
8328
  }
7451
8329
  },
7452
- "vendorId": {
8330
+ "customerId": {
7453
8331
  "type": "foreignKey",
7454
- "required": false,
7455
- "related": "Vendor",
8332
+ "required": true,
8333
+ "related": "Customer",
7456
8334
  "_meta": {
7457
- "description": "The vendor a purchase order is placed with."
8335
+ "required": true
7458
8336
  }
7459
8337
  }
7460
8338
  },
@@ -7558,68 +8436,22 @@
7558
8436
  }
7559
8437
  },
7560
8438
  "decoratorConfig": {
7561
- "abstract": true,
7562
8439
  "tenantScoped": {
7563
8440
  "mode": "optional"
7564
8441
  },
7565
8442
  "tableName": "contracts",
7566
- "tableStrategy": "sti",
7567
- "api": {
7568
- "exclude": [
7569
- "create",
7570
- "update",
7571
- "delete",
7572
- "rebindMoneyRead",
7573
- "isDraft",
7574
- "isAccepted",
7575
- "isCompleted",
7576
- "isExpired",
7577
- "isOverdue",
7578
- "recalculateTotals",
7579
- "initialize",
7580
- "save",
7581
- "saveDerived"
7582
- ]
7583
- },
7584
- "mcp": {
7585
- "exclude": [
7586
- "create",
7587
- "update",
7588
- "delete",
7589
- "rebindMoneyRead",
7590
- "isDraft",
7591
- "isAccepted",
7592
- "isCompleted",
7593
- "isExpired",
7594
- "isOverdue",
7595
- "recalculateTotals",
7596
- "initialize",
7597
- "save",
7598
- "saveDerived"
7599
- ]
7600
- },
7601
- "cli": {
7602
- "exclude": [
7603
- "create",
7604
- "update",
7605
- "delete",
7606
- "rebindMoneyRead",
7607
- "isDraft",
7608
- "isAccepted",
7609
- "isCompleted",
7610
- "isExpired",
7611
- "isOverdue",
7612
- "recalculateTotals",
7613
- "initialize",
7614
- "save",
7615
- "saveDerived"
7616
- ]
7617
- }
8443
+ "tableStrategy": "sti"
7618
8444
  },
7619
- "extends": "Contract",
7620
- "exportName": "PurchaseContract",
7621
- "collectionExportName": "PurchaseContractCollection",
7622
- "abstractDeclaredApi": null,
8445
+ "extends": "SalesContract",
8446
+ "exportName": "Estimate",
8447
+ "collectionExportName": "EstimateCollection",
8448
+ "validationRules": [
8449
+ {
8450
+ "field": "customerId",
8451
+ "rule": "required",
8452
+ "fieldType": "foreignKey"
8453
+ }
8454
+ ],
7623
8455
  "schema": {
7624
8456
  "tableName": "contracts",
7625
8457
  "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 \"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);",
@@ -7810,16 +8642,16 @@
7810
8642
  ]
7811
8643
  }
7812
8644
  ],
7813
- "version": "f398d688"
8645
+ "version": "5f2accf4"
7814
8646
  },
7815
8647
  "importPath": "@happyvertical/smrt-commerce"
7816
8648
  },
7817
- "@happyvertical/smrt-commerce:Estimate": {
7818
- "name": "estimate",
7819
- "className": "Estimate",
7820
- "qualifiedName": "@happyvertical/smrt-commerce:Estimate",
8649
+ "@happyvertical/smrt-commerce:Order": {
8650
+ "name": "order",
8651
+ "className": "Order",
8652
+ "qualifiedName": "@happyvertical/smrt-commerce:Order",
7821
8653
  "collection": "contracts",
7822
- "description": "Quote or proposal for a customer",
8654
+ "description": "Customer purchase order",
7823
8655
  "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Contract.ts",
7824
8656
  "packageName": "@happyvertical/smrt-commerce",
7825
8657
  "fields": {
@@ -7884,7 +8716,12 @@
7884
8716
  "discountTotal": {
7885
8717
  "type": "integer",
7886
8718
  "required": false,
7887
- "default": 0
8719
+ "default": 0,
8720
+ "_meta": {
8721
+ "ui": {
8722
+ "format": "money"
8723
+ }
8724
+ }
7888
8725
  },
7889
8726
  "taxAmount": {
7890
8727
  "type": "integer",
@@ -8135,8 +8972,8 @@
8135
8972
  "tableStrategy": "sti"
8136
8973
  },
8137
8974
  "extends": "SalesContract",
8138
- "exportName": "Estimate",
8139
- "collectionExportName": "EstimateCollection",
8975
+ "exportName": "Order",
8976
+ "collectionExportName": "OrderCollection",
8140
8977
  "validationRules": [
8141
8978
  {
8142
8979
  "field": "customerId",
@@ -8334,16 +9171,16 @@
8334
9171
  ]
8335
9172
  }
8336
9173
  ],
8337
- "version": "5f2accf4"
9174
+ "version": "b7d1f971"
8338
9175
  },
8339
9176
  "importPath": "@happyvertical/smrt-commerce"
8340
9177
  },
8341
- "@happyvertical/smrt-commerce:Order": {
8342
- "name": "order",
8343
- "className": "Order",
8344
- "qualifiedName": "@happyvertical/smrt-commerce:Order",
9178
+ "@happyvertical/smrt-commerce:Lease": {
9179
+ "name": "lease",
9180
+ "className": "Lease",
9181
+ "qualifiedName": "@happyvertical/smrt-commerce:Lease",
8345
9182
  "collection": "contracts",
8346
- "description": "Customer purchase order",
9183
+ "description": "Rental or lease agreement",
8347
9184
  "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Contract.ts",
8348
9185
  "packageName": "@happyvertical/smrt-commerce",
8349
9186
  "fields": {
@@ -8408,7 +9245,12 @@
8408
9245
  "discountTotal": {
8409
9246
  "type": "integer",
8410
9247
  "required": false,
8411
- "default": 0
9248
+ "default": 0,
9249
+ "_meta": {
9250
+ "ui": {
9251
+ "format": "money"
9252
+ }
9253
+ }
8412
9254
  },
8413
9255
  "taxAmount": {
8414
9256
  "type": "integer",
@@ -8659,8 +9501,8 @@
8659
9501
  "tableStrategy": "sti"
8660
9502
  },
8661
9503
  "extends": "SalesContract",
8662
- "exportName": "Order",
8663
- "collectionExportName": "OrderCollection",
9504
+ "exportName": "Lease",
9505
+ "collectionExportName": "LeaseCollection",
8664
9506
  "validationRules": [
8665
9507
  {
8666
9508
  "field": "customerId",
@@ -8858,16 +9700,16 @@
8858
9700
  ]
8859
9701
  }
8860
9702
  ],
8861
- "version": "b7d1f971"
9703
+ "version": "22b448c6"
8862
9704
  },
8863
9705
  "importPath": "@happyvertical/smrt-commerce"
8864
9706
  },
8865
- "@happyvertical/smrt-commerce:Lease": {
8866
- "name": "lease",
8867
- "className": "Lease",
8868
- "qualifiedName": "@happyvertical/smrt-commerce:Lease",
9707
+ "@happyvertical/smrt-commerce:Agreement": {
9708
+ "name": "agreement",
9709
+ "className": "Agreement",
9710
+ "qualifiedName": "@happyvertical/smrt-commerce:Agreement",
8869
9711
  "collection": "contracts",
8870
- "description": "Rental or lease agreement",
9712
+ "description": "Service or maintenance agreement",
8871
9713
  "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Contract.ts",
8872
9714
  "packageName": "@happyvertical/smrt-commerce",
8873
9715
  "fields": {
@@ -8932,7 +9774,12 @@
8932
9774
  "discountTotal": {
8933
9775
  "type": "integer",
8934
9776
  "required": false,
8935
- "default": 0
9777
+ "default": 0,
9778
+ "_meta": {
9779
+ "ui": {
9780
+ "format": "money"
9781
+ }
9782
+ }
8936
9783
  },
8937
9784
  "taxAmount": {
8938
9785
  "type": "integer",
@@ -9183,8 +10030,8 @@
9183
10030
  "tableStrategy": "sti"
9184
10031
  },
9185
10032
  "extends": "SalesContract",
9186
- "exportName": "Lease",
9187
- "collectionExportName": "LeaseCollection",
10033
+ "exportName": "Agreement",
10034
+ "collectionExportName": "AgreementCollection",
9188
10035
  "validationRules": [
9189
10036
  {
9190
10037
  "field": "customerId",
@@ -9382,16 +10229,16 @@
9382
10229
  ]
9383
10230
  }
9384
10231
  ],
9385
- "version": "22b448c6"
10232
+ "version": "39d75a3f"
9386
10233
  },
9387
10234
  "importPath": "@happyvertical/smrt-commerce"
9388
10235
  },
9389
- "@happyvertical/smrt-commerce:Agreement": {
9390
- "name": "agreement",
9391
- "className": "Agreement",
9392
- "qualifiedName": "@happyvertical/smrt-commerce:Agreement",
10236
+ "@happyvertical/smrt-commerce:SupplierQuote": {
10237
+ "name": "supplierquote",
10238
+ "className": "SupplierQuote",
10239
+ "qualifiedName": "@happyvertical/smrt-commerce:SupplierQuote",
9393
10240
  "collection": "contracts",
9394
- "description": "Service or maintenance agreement",
10241
+ "description": "Supplier quotation received from a vendor; acceptance does not create an order.",
9395
10242
  "filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Contract.ts",
9396
10243
  "packageName": "@happyvertical/smrt-commerce",
9397
10244
  "fields": {
@@ -9456,7 +10303,12 @@
9456
10303
  "discountTotal": {
9457
10304
  "type": "integer",
9458
10305
  "required": false,
9459
- "default": 0
10306
+ "default": 0,
10307
+ "_meta": {
10308
+ "ui": {
10309
+ "format": "money"
10310
+ }
10311
+ }
9460
10312
  },
9461
10313
  "taxAmount": {
9462
10314
  "type": "integer",
@@ -9591,10 +10443,10 @@
9591
10443
  "description": "Where it came from, for example your shop, a marketplace or a phone call."
9592
10444
  }
9593
10445
  },
9594
- "customerId": {
10446
+ "vendorId": {
9595
10447
  "type": "foreignKey",
9596
10448
  "required": true,
9597
- "related": "Customer",
10449
+ "related": "Vendor",
9598
10450
  "_meta": {
9599
10451
  "required": true
9600
10452
  }
@@ -9706,12 +10558,12 @@
9706
10558
  "tableName": "contracts",
9707
10559
  "tableStrategy": "sti"
9708
10560
  },
9709
- "extends": "SalesContract",
9710
- "exportName": "Agreement",
9711
- "collectionExportName": "AgreementCollection",
10561
+ "extends": "PurchaseContract",
10562
+ "exportName": "SupplierQuote",
10563
+ "collectionExportName": "SupplierQuoteCollection",
9712
10564
  "validationRules": [
9713
10565
  {
9714
- "field": "customerId",
10566
+ "field": "vendorId",
9715
10567
  "rule": "required",
9716
10568
  "fieldType": "foreignKey"
9717
10569
  }
@@ -9906,7 +10758,7 @@
9906
10758
  ]
9907
10759
  }
9908
10760
  ],
9909
- "version": "39d75a3f"
10761
+ "version": "8e2a6f1c"
9910
10762
  },
9911
10763
  "importPath": "@happyvertical/smrt-commerce"
9912
10764
  },
@@ -9980,7 +10832,12 @@
9980
10832
  "discountTotal": {
9981
10833
  "type": "integer",
9982
10834
  "required": false,
9983
- "default": 0
10835
+ "default": 0,
10836
+ "_meta": {
10837
+ "ui": {
10838
+ "format": "money"
10839
+ }
10840
+ }
9984
10841
  },
9985
10842
  "taxAmount": {
9986
10843
  "type": "integer",
@@ -10524,7 +11381,12 @@
10524
11381
  "discountTotal": {
10525
11382
  "type": "integer",
10526
11383
  "required": false,
10527
- "default": 0
11384
+ "default": 0,
11385
+ "_meta": {
11386
+ "ui": {
11387
+ "format": "money"
11388
+ }
11389
+ }
10528
11390
  },
10529
11391
  "taxAmount": {
10530
11392
  "type": "integer",
@@ -11048,7 +11910,12 @@
11048
11910
  "discountTotal": {
11049
11911
  "type": "integer",
11050
11912
  "required": false,
11051
- "default": 0
11913
+ "default": 0,
11914
+ "_meta": {
11915
+ "ui": {
11916
+ "format": "money"
11917
+ }
11918
+ }
11052
11919
  },
11053
11920
  "taxAmount": {
11054
11921
  "type": "integer",
@@ -11188,7 +12055,7 @@
11188
12055
  "required": false,
11189
12056
  "related": "Vendor",
11190
12057
  "_meta": {
11191
- "description": "The vendor a purchase order is placed with."
12058
+ "description": "The vendor supplying this quote or purchase contract."
11192
12059
  }
11193
12060
  },
11194
12061
  "productId": {
@@ -11581,7 +12448,12 @@
11581
12448
  "discountTotal": {
11582
12449
  "type": "integer",
11583
12450
  "required": false,
11584
- "default": 0
12451
+ "default": 0,
12452
+ "_meta": {
12453
+ "ui": {
12454
+ "format": "money"
12455
+ }
12456
+ }
11585
12457
  },
11586
12458
  "taxAmount": {
11587
12459
  "type": "integer",
@@ -12098,7 +12970,12 @@
12098
12970
  "discountTotal": {
12099
12971
  "type": "integer",
12100
12972
  "required": false,
12101
- "default": 0
12973
+ "default": 0,
12974
+ "_meta": {
12975
+ "ui": {
12976
+ "format": "money"
12977
+ }
12978
+ }
12102
12979
  },
12103
12980
  "taxAmount": {
12104
12981
  "type": "integer",
@@ -12748,9 +13625,9 @@
12748
13625
  "type": "integer",
12749
13626
  "required": false,
12750
13627
  "default": 0,
12751
- "description": "The price of one, before tax.",
13628
+ "description": "The price of one, before discount; includes tax when the document's prices include tax.",
12752
13629
  "_meta": {
12753
- "description": "The price of one, before tax.",
13630
+ "description": "The price of one, before discount; includes tax when the document's prices include tax.",
12754
13631
  "ui": {
12755
13632
  "format": "money"
12756
13633
  }
@@ -12822,7 +13699,12 @@
12822
13699
  "taxAmount": {
12823
13700
  "type": "integer",
12824
13701
  "required": true,
12825
- "default": 0
13702
+ "default": 0,
13703
+ "_meta": {
13704
+ "ui": {
13705
+ "format": "money"
13706
+ }
13707
+ }
12826
13708
  },
12827
13709
  "legacyAmount": {
12828
13710
  "type": "integer",
@@ -12839,9 +13721,9 @@
12839
13721
  "type": "integer",
12840
13722
  "required": false,
12841
13723
  "default": 0,
12842
- "description": "The line total.",
13724
+ "description": "The line amount: net of discount, and including tax only when the document's prices include tax.",
12843
13725
  "_meta": {
12844
- "description": "The line total.",
13726
+ "description": "The line amount: net of discount, and including tax only when the document's prices include tax.",
12845
13727
  "ui": {
12846
13728
  "format": "money"
12847
13729
  }
@@ -13733,7 +14615,10 @@
13733
14615
  "default": 0,
13734
14616
  "description": "Tax-exclusive base in integer minor units.",
13735
14617
  "_meta": {
13736
- "description": "Tax-exclusive base in integer minor units."
14618
+ "description": "Tax-exclusive base in integer minor units.",
14619
+ "ui": {
14620
+ "format": "money"
14621
+ }
13737
14622
  }
13738
14623
  },
13739
14624
  "taxMinor": {
@@ -13742,7 +14627,10 @@
13742
14627
  "default": 0,
13743
14628
  "description": "Tax total in integer minor units.",
13744
14629
  "_meta": {
13745
- "description": "Tax total in integer minor units."
14630
+ "description": "Tax total in integer minor units.",
14631
+ "ui": {
14632
+ "format": "money"
14633
+ }
13746
14634
  }
13747
14635
  },
13748
14636
  "recoverableMinor": {
@@ -13751,7 +14639,10 @@
13751
14639
  "default": 0,
13752
14640
  "description": "Recoverable purchase tax in integer minor units.",
13753
14641
  "_meta": {
13754
- "description": "Recoverable purchase tax in integer minor units."
14642
+ "description": "Recoverable purchase tax in integer minor units.",
14643
+ "ui": {
14644
+ "format": "money"
14645
+ }
13755
14646
  }
13756
14647
  }
13757
14648
  },
@@ -14610,7 +15501,12 @@
14610
15501
  "creditedAmount": {
14611
15502
  "type": "integer",
14612
15503
  "required": true,
14613
- "default": 0
15504
+ "default": 0,
15505
+ "_meta": {
15506
+ "ui": {
15507
+ "format": "money"
15508
+ }
15509
+ }
14614
15510
  },
14615
15511
  "tenantId": {
14616
15512
  "type": "text",
@@ -14779,7 +15675,12 @@
14779
15675
  "discountTotal": {
14780
15676
  "type": "integer",
14781
15677
  "required": true,
14782
- "default": 0
15678
+ "default": 0,
15679
+ "_meta": {
15680
+ "ui": {
15681
+ "format": "money"
15682
+ }
15683
+ }
14783
15684
  },
14784
15685
  "sellerTaxRegistrationsJson": {
14785
15686
  "type": "text",
@@ -15663,9 +16564,9 @@
15663
16564
  "type": "integer",
15664
16565
  "required": false,
15665
16566
  "default": 0,
15666
- "description": "The price of one, before tax.",
16567
+ "description": "The price of one, before discount; includes tax when the document's prices include tax.",
15667
16568
  "_meta": {
15668
- "description": "The price of one, before tax.",
16569
+ "description": "The price of one, before discount; includes tax when the document's prices include tax.",
15669
16570
  "ui": {
15670
16571
  "format": "money"
15671
16572
  }
@@ -15737,7 +16638,12 @@
15737
16638
  "taxAmount": {
15738
16639
  "type": "integer",
15739
16640
  "required": true,
15740
- "default": 0
16641
+ "default": 0,
16642
+ "_meta": {
16643
+ "ui": {
16644
+ "format": "money"
16645
+ }
16646
+ }
15741
16647
  },
15742
16648
  "legacyAmount": {
15743
16649
  "type": "integer",
@@ -15754,9 +16660,9 @@
15754
16660
  "type": "integer",
15755
16661
  "required": false,
15756
16662
  "default": 0,
15757
- "description": "The line total.",
16663
+ "description": "The line amount: net of discount, and including tax only when the document's prices include tax.",
15758
16664
  "_meta": {
15759
- "description": "The line total.",
16665
+ "description": "The line amount: net of discount, and including tax only when the document's prices include tax.",
15760
16666
  "ui": {
15761
16667
  "format": "money"
15762
16668
  }