@happyvertical/smrt-commerce 0.55.24 → 0.56.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.
- package/AGENTS.md +2 -1
- package/README.md +38 -2
- package/agents/purchasing-ui.md +4 -3
- package/agents/quote-ui.md +3 -2
- package/dist/chunks/types-zVnIjSOk.js.map +1 -1
- package/dist/collections/ContractCollection.d.ts +2 -0
- package/dist/collections/ContractCollection.d.ts.map +1 -1
- package/dist/collections/PurchaseContractCollection.d.ts +8 -0
- package/dist/collections/PurchaseContractCollection.d.ts.map +1 -0
- package/dist/collections/SalesContractCollection.d.ts +8 -0
- package/dist/collections/SalesContractCollection.d.ts.map +1 -0
- package/dist/collections/index.d.ts +2 -0
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +228 -57
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +2004 -800
- package/dist/migrations/partyLinks.d.ts +39 -0
- package/dist/migrations/partyLinks.d.ts.map +1 -0
- package/dist/models/Contract.d.ts +37 -27
- package/dist/models/Contract.d.ts.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/recipes.d.ts +2 -32
- package/dist/recipes.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +938 -378
- package/dist/types/index.d.ts +8 -4
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-commerce",
|
|
5
|
-
"packageVersion": "0.
|
|
5
|
+
"packageVersion": "0.56.0",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-commerce:ContractCollection": {
|
|
8
8
|
"name": "contractcollection",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"collectionExportName": "ContractCollectionCollection",
|
|
165
165
|
"schema": {
|
|
166
166
|
"tableName": "contracts",
|
|
167
|
-
"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 \"
|
|
167
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
168
168
|
"columns": {
|
|
169
169
|
"id": {
|
|
170
170
|
"type": "UUID",
|
|
@@ -212,28 +212,6 @@
|
|
|
212
212
|
"type": "TEXT",
|
|
213
213
|
"notNull": false
|
|
214
214
|
},
|
|
215
|
-
"customer_id": {
|
|
216
|
-
"type": "UUID",
|
|
217
|
-
"referenceKind": "foreignKey",
|
|
218
|
-
"notNull": false,
|
|
219
|
-
"foreignKey": {
|
|
220
|
-
"table": "customers",
|
|
221
|
-
"column": "id",
|
|
222
|
-
"onDelete": "NO ACTION",
|
|
223
|
-
"onUpdate": "CASCADE"
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
"vendor_id": {
|
|
227
|
-
"type": "UUID",
|
|
228
|
-
"referenceKind": "foreignKey",
|
|
229
|
-
"notNull": false,
|
|
230
|
-
"foreignKey": {
|
|
231
|
-
"table": "vendors",
|
|
232
|
-
"column": "id",
|
|
233
|
-
"onDelete": "NO ACTION",
|
|
234
|
-
"onUpdate": "CASCADE"
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
215
|
"subtotal": {
|
|
238
216
|
"type": "INTEGER",
|
|
239
217
|
"notNull": false,
|
|
@@ -285,6 +263,28 @@
|
|
|
285
263
|
"type": "TEXT",
|
|
286
264
|
"notNull": false,
|
|
287
265
|
"default": ""
|
|
266
|
+
},
|
|
267
|
+
"customer_id": {
|
|
268
|
+
"type": "UUID",
|
|
269
|
+
"referenceKind": "foreignKey",
|
|
270
|
+
"notNull": false,
|
|
271
|
+
"foreignKey": {
|
|
272
|
+
"table": "customers",
|
|
273
|
+
"column": "id",
|
|
274
|
+
"onDelete": "NO ACTION",
|
|
275
|
+
"onUpdate": "CASCADE"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"vendor_id": {
|
|
279
|
+
"type": "UUID",
|
|
280
|
+
"referenceKind": "foreignKey",
|
|
281
|
+
"notNull": false,
|
|
282
|
+
"foreignKey": {
|
|
283
|
+
"table": "vendors",
|
|
284
|
+
"column": "id",
|
|
285
|
+
"onDelete": "NO ACTION",
|
|
286
|
+
"onUpdate": "CASCADE"
|
|
287
|
+
}
|
|
288
288
|
}
|
|
289
289
|
},
|
|
290
290
|
"indexes": [
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
]
|
|
326
326
|
}
|
|
327
327
|
],
|
|
328
|
-
"version": "
|
|
328
|
+
"version": "0eb8f0eb"
|
|
329
329
|
},
|
|
330
330
|
"importPath": "@happyvertical/smrt-commerce"
|
|
331
331
|
},
|
|
@@ -3656,119 +3656,65 @@
|
|
|
3656
3656
|
},
|
|
3657
3657
|
"importPath": "@happyvertical/smrt-commerce"
|
|
3658
3658
|
},
|
|
3659
|
-
"@happyvertical/smrt-commerce:
|
|
3660
|
-
"name": "
|
|
3661
|
-
"className": "
|
|
3662
|
-
"qualifiedName": "@happyvertical/smrt-commerce:
|
|
3663
|
-
"collection": "
|
|
3664
|
-
"
|
|
3659
|
+
"@happyvertical/smrt-commerce:PurchaseContractCollection": {
|
|
3660
|
+
"name": "purchasecontractcollection",
|
|
3661
|
+
"className": "PurchaseContractCollection",
|
|
3662
|
+
"qualifiedName": "@happyvertical/smrt-commerce:PurchaseContractCollection",
|
|
3663
|
+
"collection": "contracts",
|
|
3664
|
+
"description": "Read supplier-side contracts across every purchase STI subtype.",
|
|
3665
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/collections/PurchaseContractCollection.ts",
|
|
3665
3666
|
"packageName": "@happyvertical/smrt-commerce",
|
|
3666
3667
|
"fields": {},
|
|
3667
3668
|
"methods": {
|
|
3668
|
-
"
|
|
3669
|
-
"name": "
|
|
3670
|
-
"async": true,
|
|
3671
|
-
"parameters": [
|
|
3672
|
-
{
|
|
3673
|
-
"name": "profileId",
|
|
3674
|
-
"type": "string",
|
|
3675
|
-
"optional": false
|
|
3676
|
-
}
|
|
3677
|
-
],
|
|
3678
|
-
"returnType": "Promise<Vendor[]>",
|
|
3679
|
-
"isStatic": false,
|
|
3680
|
-
"isPublic": true
|
|
3681
|
-
},
|
|
3682
|
-
"findActive": {
|
|
3683
|
-
"name": "findActive",
|
|
3684
|
-
"async": true,
|
|
3685
|
-
"parameters": [],
|
|
3686
|
-
"returnType": "Promise<Vendor[]>",
|
|
3687
|
-
"isStatic": false,
|
|
3688
|
-
"isPublic": true
|
|
3689
|
-
},
|
|
3690
|
-
"findByStatus": {
|
|
3691
|
-
"name": "findByStatus",
|
|
3692
|
-
"async": true,
|
|
3693
|
-
"parameters": [
|
|
3694
|
-
{
|
|
3695
|
-
"name": "status",
|
|
3696
|
-
"type": "VendorStatus",
|
|
3697
|
-
"optional": false
|
|
3698
|
-
}
|
|
3699
|
-
],
|
|
3700
|
-
"returnType": "Promise<Vendor[]>",
|
|
3701
|
-
"isStatic": false,
|
|
3702
|
-
"isPublic": true
|
|
3703
|
-
},
|
|
3704
|
-
"getOrCreateForProfile": {
|
|
3705
|
-
"name": "getOrCreateForProfile",
|
|
3706
|
-
"async": true,
|
|
3707
|
-
"parameters": [
|
|
3708
|
-
{
|
|
3709
|
-
"name": "profileId",
|
|
3710
|
-
"type": "string",
|
|
3711
|
-
"optional": false
|
|
3712
|
-
},
|
|
3713
|
-
{
|
|
3714
|
-
"name": "defaults",
|
|
3715
|
-
"type": "Partial<object>",
|
|
3716
|
-
"optional": true,
|
|
3717
|
-
"memberTypes": [
|
|
3718
|
-
"number",
|
|
3719
|
-
"string"
|
|
3720
|
-
]
|
|
3721
|
-
}
|
|
3722
|
-
],
|
|
3723
|
-
"returnType": "Promise<Vendor>",
|
|
3724
|
-
"isStatic": false,
|
|
3725
|
-
"isPublic": true
|
|
3726
|
-
},
|
|
3727
|
-
"findByTenant": {
|
|
3728
|
-
"name": "findByTenant",
|
|
3669
|
+
"findByVendor": {
|
|
3670
|
+
"name": "findByVendor",
|
|
3729
3671
|
"async": true,
|
|
3730
3672
|
"parameters": [
|
|
3731
3673
|
{
|
|
3732
|
-
"name": "
|
|
3674
|
+
"name": "vendorId",
|
|
3733
3675
|
"type": "string",
|
|
3734
3676
|
"optional": false
|
|
3735
3677
|
}
|
|
3736
3678
|
],
|
|
3737
|
-
"returnType": "Promise<
|
|
3679
|
+
"returnType": "Promise<PurchaseContract[]>",
|
|
3738
3680
|
"isStatic": false,
|
|
3739
3681
|
"isPublic": true
|
|
3682
|
+
}
|
|
3683
|
+
},
|
|
3684
|
+
"decoratorConfig": {
|
|
3685
|
+
"tableName": "contracts",
|
|
3686
|
+
"api": {
|
|
3687
|
+
"exclude": [
|
|
3688
|
+
"create",
|
|
3689
|
+
"update",
|
|
3690
|
+
"delete",
|
|
3691
|
+
"findByVendor"
|
|
3692
|
+
]
|
|
3740
3693
|
},
|
|
3741
|
-
"
|
|
3742
|
-
"
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3694
|
+
"mcp": {
|
|
3695
|
+
"exclude": [
|
|
3696
|
+
"create",
|
|
3697
|
+
"update",
|
|
3698
|
+
"delete",
|
|
3699
|
+
"findByVendor"
|
|
3700
|
+
]
|
|
3748
3701
|
},
|
|
3749
|
-
"
|
|
3750
|
-
"
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
"optional": false
|
|
3757
|
-
}
|
|
3758
|
-
],
|
|
3759
|
-
"returnType": "Promise<Vendor[]>",
|
|
3760
|
-
"isStatic": false,
|
|
3761
|
-
"isPublic": true
|
|
3702
|
+
"cli": {
|
|
3703
|
+
"exclude": [
|
|
3704
|
+
"create",
|
|
3705
|
+
"update",
|
|
3706
|
+
"delete",
|
|
3707
|
+
"findByVendor"
|
|
3708
|
+
]
|
|
3762
3709
|
}
|
|
3763
3710
|
},
|
|
3764
|
-
"decoratorConfig": {},
|
|
3765
3711
|
"extends": "SmrtCollection",
|
|
3766
|
-
"extendsTypeArg": "
|
|
3767
|
-
"exportName": "
|
|
3768
|
-
"collectionExportName": "
|
|
3712
|
+
"extendsTypeArg": "PurchaseContract",
|
|
3713
|
+
"exportName": "PurchaseContractCollection",
|
|
3714
|
+
"collectionExportName": "PurchaseContractCollectionCollection",
|
|
3769
3715
|
"schema": {
|
|
3770
|
-
"tableName": "
|
|
3771
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
3716
|
+
"tableName": "contracts",
|
|
3717
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
3772
3718
|
"columns": {
|
|
3773
3719
|
"id": {
|
|
3774
3720
|
"type": "UUID",
|
|
@@ -3785,6 +3731,14 @@
|
|
|
3785
3731
|
"notNull": true,
|
|
3786
3732
|
"default": ""
|
|
3787
3733
|
},
|
|
3734
|
+
"_meta_type": {
|
|
3735
|
+
"type": "TEXT",
|
|
3736
|
+
"notNull": true
|
|
3737
|
+
},
|
|
3738
|
+
"_meta_data": {
|
|
3739
|
+
"type": "JSON",
|
|
3740
|
+
"notNull": false
|
|
3741
|
+
},
|
|
3788
3742
|
"created_at": {
|
|
3789
3743
|
"type": "TIMESTAMP",
|
|
3790
3744
|
"notNull": true,
|
|
@@ -3798,110 +3752,1535 @@
|
|
|
3798
3752
|
"tenant_id": {
|
|
3799
3753
|
"type": "UUID",
|
|
3800
3754
|
"referenceKind": "tenantId",
|
|
3801
|
-
"notNull": false
|
|
3802
|
-
"unique": false
|
|
3755
|
+
"notNull": false
|
|
3803
3756
|
},
|
|
3804
|
-
"
|
|
3805
|
-
"type": "
|
|
3806
|
-
"
|
|
3807
|
-
"notNull": false,
|
|
3808
|
-
"unique": false
|
|
3757
|
+
"contract_type": {
|
|
3758
|
+
"type": "TEXT",
|
|
3759
|
+
"notNull": false
|
|
3809
3760
|
},
|
|
3810
|
-
"
|
|
3761
|
+
"status": {
|
|
3762
|
+
"type": "TEXT",
|
|
3763
|
+
"notNull": false
|
|
3764
|
+
},
|
|
3765
|
+
"subtotal": {
|
|
3811
3766
|
"type": "INTEGER",
|
|
3812
3767
|
"notNull": false,
|
|
3813
|
-
"unique": false,
|
|
3814
3768
|
"default": 0
|
|
3815
3769
|
},
|
|
3816
|
-
"
|
|
3770
|
+
"tax_amount": {
|
|
3817
3771
|
"type": "INTEGER",
|
|
3818
3772
|
"notNull": false,
|
|
3819
|
-
"unique": false,
|
|
3820
3773
|
"default": 0
|
|
3821
3774
|
},
|
|
3822
|
-
"
|
|
3823
|
-
"type": "
|
|
3775
|
+
"total_amount": {
|
|
3776
|
+
"type": "INTEGER",
|
|
3824
3777
|
"notNull": false,
|
|
3825
|
-
"
|
|
3826
|
-
"default": ""
|
|
3778
|
+
"default": 0
|
|
3827
3779
|
},
|
|
3828
3780
|
"currency": {
|
|
3829
3781
|
"type": "TEXT",
|
|
3830
3782
|
"notNull": false,
|
|
3831
|
-
"unique": false,
|
|
3832
3783
|
"default": "USD"
|
|
3833
3784
|
},
|
|
3834
|
-
"
|
|
3785
|
+
"issue_date": {
|
|
3786
|
+
"type": "TIMESTAMP",
|
|
3787
|
+
"notNull": false
|
|
3788
|
+
},
|
|
3789
|
+
"due_date": {
|
|
3790
|
+
"type": "TIMESTAMP",
|
|
3791
|
+
"notNull": false
|
|
3792
|
+
},
|
|
3793
|
+
"expiry_date": {
|
|
3794
|
+
"type": "TIMESTAMP",
|
|
3795
|
+
"notNull": false
|
|
3796
|
+
},
|
|
3797
|
+
"reference": {
|
|
3835
3798
|
"type": "TEXT",
|
|
3836
3799
|
"notNull": false,
|
|
3837
|
-
"unique": false,
|
|
3838
3800
|
"default": ""
|
|
3839
3801
|
},
|
|
3840
|
-
"
|
|
3802
|
+
"notes": {
|
|
3841
3803
|
"type": "TEXT",
|
|
3842
3804
|
"notNull": false,
|
|
3843
|
-
"unique": false,
|
|
3844
3805
|
"default": ""
|
|
3845
3806
|
},
|
|
3846
|
-
"
|
|
3807
|
+
"terms": {
|
|
3847
3808
|
"type": "TEXT",
|
|
3848
3809
|
"notNull": false,
|
|
3849
|
-
"
|
|
3810
|
+
"default": ""
|
|
3850
3811
|
},
|
|
3851
|
-
"
|
|
3812
|
+
"channel_id": {
|
|
3852
3813
|
"type": "TEXT",
|
|
3853
3814
|
"notNull": false,
|
|
3854
|
-
"unique": false,
|
|
3855
3815
|
"default": ""
|
|
3856
3816
|
},
|
|
3857
|
-
"
|
|
3858
|
-
"type": "
|
|
3817
|
+
"customer_id": {
|
|
3818
|
+
"type": "UUID",
|
|
3819
|
+
"referenceKind": "foreignKey",
|
|
3859
3820
|
"notNull": false,
|
|
3860
|
-
"
|
|
3861
|
-
|
|
3821
|
+
"foreignKey": {
|
|
3822
|
+
"table": "customers",
|
|
3823
|
+
"column": "id",
|
|
3824
|
+
"onDelete": "NO ACTION",
|
|
3825
|
+
"onUpdate": "CASCADE"
|
|
3826
|
+
}
|
|
3862
3827
|
},
|
|
3863
|
-
"
|
|
3864
|
-
"type": "
|
|
3828
|
+
"vendor_id": {
|
|
3829
|
+
"type": "UUID",
|
|
3830
|
+
"referenceKind": "foreignKey",
|
|
3865
3831
|
"notNull": false,
|
|
3866
|
-
"
|
|
3867
|
-
|
|
3832
|
+
"foreignKey": {
|
|
3833
|
+
"table": "vendors",
|
|
3834
|
+
"column": "id",
|
|
3835
|
+
"onDelete": "NO ACTION",
|
|
3836
|
+
"onUpdate": "CASCADE"
|
|
3837
|
+
}
|
|
3868
3838
|
}
|
|
3869
3839
|
},
|
|
3870
3840
|
"indexes": [
|
|
3871
3841
|
{
|
|
3872
|
-
"name": "
|
|
3842
|
+
"name": "contracts_slug_context_meta_type_idx",
|
|
3873
3843
|
"columns": [
|
|
3874
3844
|
"tenant_id",
|
|
3875
3845
|
"slug",
|
|
3876
|
-
"context"
|
|
3846
|
+
"context",
|
|
3847
|
+
"_meta_type"
|
|
3877
3848
|
],
|
|
3878
3849
|
"unique": true,
|
|
3879
3850
|
"nullsNotDistinct": true
|
|
3880
3851
|
},
|
|
3881
3852
|
{
|
|
3882
|
-
"name": "
|
|
3853
|
+
"name": "contracts_meta_type_idx",
|
|
3883
3854
|
"columns": [
|
|
3884
|
-
"
|
|
3855
|
+
"_meta_type"
|
|
3856
|
+
]
|
|
3857
|
+
},
|
|
3858
|
+
{
|
|
3859
|
+
"name": "contracts_tenant_id_created_at_idx",
|
|
3860
|
+
"columns": [
|
|
3861
|
+
"tenant_id",
|
|
3862
|
+
"created_at"
|
|
3863
|
+
]
|
|
3864
|
+
},
|
|
3865
|
+
{
|
|
3866
|
+
"name": "contracts_customer_id_idx",
|
|
3867
|
+
"columns": [
|
|
3868
|
+
"customer_id"
|
|
3869
|
+
]
|
|
3870
|
+
},
|
|
3871
|
+
{
|
|
3872
|
+
"name": "contracts_vendor_id_idx",
|
|
3873
|
+
"columns": [
|
|
3874
|
+
"vendor_id"
|
|
3875
|
+
]
|
|
3876
|
+
}
|
|
3877
|
+
],
|
|
3878
|
+
"version": "456f7950"
|
|
3879
|
+
},
|
|
3880
|
+
"importPath": "@happyvertical/smrt-commerce"
|
|
3881
|
+
},
|
|
3882
|
+
"@happyvertical/smrt-commerce:SalesContractCollection": {
|
|
3883
|
+
"name": "salescontractcollection",
|
|
3884
|
+
"className": "SalesContractCollection",
|
|
3885
|
+
"qualifiedName": "@happyvertical/smrt-commerce:SalesContractCollection",
|
|
3886
|
+
"collection": "contracts",
|
|
3887
|
+
"description": "Read customer-side contracts across every sales STI subtype.",
|
|
3888
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/collections/SalesContractCollection.ts",
|
|
3889
|
+
"packageName": "@happyvertical/smrt-commerce",
|
|
3890
|
+
"fields": {},
|
|
3891
|
+
"methods": {
|
|
3892
|
+
"findByCustomer": {
|
|
3893
|
+
"name": "findByCustomer",
|
|
3894
|
+
"async": true,
|
|
3895
|
+
"parameters": [
|
|
3896
|
+
{
|
|
3897
|
+
"name": "customerId",
|
|
3898
|
+
"type": "string",
|
|
3899
|
+
"optional": false
|
|
3900
|
+
}
|
|
3901
|
+
],
|
|
3902
|
+
"returnType": "Promise<SalesContract[]>",
|
|
3903
|
+
"isStatic": false,
|
|
3904
|
+
"isPublic": true
|
|
3905
|
+
}
|
|
3906
|
+
},
|
|
3907
|
+
"decoratorConfig": {
|
|
3908
|
+
"tableName": "contracts",
|
|
3909
|
+
"api": {
|
|
3910
|
+
"exclude": [
|
|
3911
|
+
"create",
|
|
3912
|
+
"update",
|
|
3913
|
+
"delete",
|
|
3914
|
+
"findByCustomer"
|
|
3915
|
+
]
|
|
3916
|
+
},
|
|
3917
|
+
"mcp": {
|
|
3918
|
+
"exclude": [
|
|
3919
|
+
"create",
|
|
3920
|
+
"update",
|
|
3921
|
+
"delete",
|
|
3922
|
+
"findByCustomer"
|
|
3923
|
+
]
|
|
3924
|
+
},
|
|
3925
|
+
"cli": {
|
|
3926
|
+
"exclude": [
|
|
3927
|
+
"create",
|
|
3928
|
+
"update",
|
|
3929
|
+
"delete",
|
|
3930
|
+
"findByCustomer"
|
|
3931
|
+
]
|
|
3932
|
+
}
|
|
3933
|
+
},
|
|
3934
|
+
"extends": "SmrtCollection",
|
|
3935
|
+
"extendsTypeArg": "SalesContract",
|
|
3936
|
+
"exportName": "SalesContractCollection",
|
|
3937
|
+
"collectionExportName": "SalesContractCollectionCollection",
|
|
3938
|
+
"schema": {
|
|
3939
|
+
"tableName": "contracts",
|
|
3940
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
3941
|
+
"columns": {
|
|
3942
|
+
"id": {
|
|
3943
|
+
"type": "UUID",
|
|
3944
|
+
"primaryKey": true,
|
|
3945
|
+
"referenceKind": "id",
|
|
3946
|
+
"notNull": true
|
|
3947
|
+
},
|
|
3948
|
+
"slug": {
|
|
3949
|
+
"type": "TEXT",
|
|
3950
|
+
"notNull": true
|
|
3951
|
+
},
|
|
3952
|
+
"context": {
|
|
3953
|
+
"type": "TEXT",
|
|
3954
|
+
"notNull": true,
|
|
3955
|
+
"default": ""
|
|
3956
|
+
},
|
|
3957
|
+
"_meta_type": {
|
|
3958
|
+
"type": "TEXT",
|
|
3959
|
+
"notNull": true
|
|
3960
|
+
},
|
|
3961
|
+
"_meta_data": {
|
|
3962
|
+
"type": "JSON",
|
|
3963
|
+
"notNull": false
|
|
3964
|
+
},
|
|
3965
|
+
"created_at": {
|
|
3966
|
+
"type": "TIMESTAMP",
|
|
3967
|
+
"notNull": true,
|
|
3968
|
+
"default": "current_timestamp"
|
|
3969
|
+
},
|
|
3970
|
+
"updated_at": {
|
|
3971
|
+
"type": "TIMESTAMP",
|
|
3972
|
+
"notNull": true,
|
|
3973
|
+
"default": "current_timestamp"
|
|
3974
|
+
},
|
|
3975
|
+
"tenant_id": {
|
|
3976
|
+
"type": "UUID",
|
|
3977
|
+
"referenceKind": "tenantId",
|
|
3978
|
+
"notNull": false
|
|
3979
|
+
},
|
|
3980
|
+
"contract_type": {
|
|
3981
|
+
"type": "TEXT",
|
|
3982
|
+
"notNull": false
|
|
3983
|
+
},
|
|
3984
|
+
"status": {
|
|
3985
|
+
"type": "TEXT",
|
|
3986
|
+
"notNull": false
|
|
3987
|
+
},
|
|
3988
|
+
"subtotal": {
|
|
3989
|
+
"type": "INTEGER",
|
|
3990
|
+
"notNull": false,
|
|
3991
|
+
"default": 0
|
|
3992
|
+
},
|
|
3993
|
+
"tax_amount": {
|
|
3994
|
+
"type": "INTEGER",
|
|
3995
|
+
"notNull": false,
|
|
3996
|
+
"default": 0
|
|
3997
|
+
},
|
|
3998
|
+
"total_amount": {
|
|
3999
|
+
"type": "INTEGER",
|
|
4000
|
+
"notNull": false,
|
|
4001
|
+
"default": 0
|
|
4002
|
+
},
|
|
4003
|
+
"currency": {
|
|
4004
|
+
"type": "TEXT",
|
|
4005
|
+
"notNull": false,
|
|
4006
|
+
"default": "USD"
|
|
4007
|
+
},
|
|
4008
|
+
"issue_date": {
|
|
4009
|
+
"type": "TIMESTAMP",
|
|
4010
|
+
"notNull": false
|
|
4011
|
+
},
|
|
4012
|
+
"due_date": {
|
|
4013
|
+
"type": "TIMESTAMP",
|
|
4014
|
+
"notNull": false
|
|
4015
|
+
},
|
|
4016
|
+
"expiry_date": {
|
|
4017
|
+
"type": "TIMESTAMP",
|
|
4018
|
+
"notNull": false
|
|
4019
|
+
},
|
|
4020
|
+
"reference": {
|
|
4021
|
+
"type": "TEXT",
|
|
4022
|
+
"notNull": false,
|
|
4023
|
+
"default": ""
|
|
4024
|
+
},
|
|
4025
|
+
"notes": {
|
|
4026
|
+
"type": "TEXT",
|
|
4027
|
+
"notNull": false,
|
|
4028
|
+
"default": ""
|
|
4029
|
+
},
|
|
4030
|
+
"terms": {
|
|
4031
|
+
"type": "TEXT",
|
|
4032
|
+
"notNull": false,
|
|
4033
|
+
"default": ""
|
|
4034
|
+
},
|
|
4035
|
+
"channel_id": {
|
|
4036
|
+
"type": "TEXT",
|
|
4037
|
+
"notNull": false,
|
|
4038
|
+
"default": ""
|
|
4039
|
+
},
|
|
4040
|
+
"customer_id": {
|
|
4041
|
+
"type": "UUID",
|
|
4042
|
+
"referenceKind": "foreignKey",
|
|
4043
|
+
"notNull": false,
|
|
4044
|
+
"foreignKey": {
|
|
4045
|
+
"table": "customers",
|
|
4046
|
+
"column": "id",
|
|
4047
|
+
"onDelete": "NO ACTION",
|
|
4048
|
+
"onUpdate": "CASCADE"
|
|
4049
|
+
}
|
|
4050
|
+
},
|
|
4051
|
+
"vendor_id": {
|
|
4052
|
+
"type": "UUID",
|
|
4053
|
+
"referenceKind": "foreignKey",
|
|
4054
|
+
"notNull": false,
|
|
4055
|
+
"foreignKey": {
|
|
4056
|
+
"table": "vendors",
|
|
4057
|
+
"column": "id",
|
|
4058
|
+
"onDelete": "NO ACTION",
|
|
4059
|
+
"onUpdate": "CASCADE"
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
},
|
|
4063
|
+
"indexes": [
|
|
4064
|
+
{
|
|
4065
|
+
"name": "contracts_slug_context_meta_type_idx",
|
|
4066
|
+
"columns": [
|
|
4067
|
+
"tenant_id",
|
|
4068
|
+
"slug",
|
|
4069
|
+
"context",
|
|
4070
|
+
"_meta_type"
|
|
4071
|
+
],
|
|
4072
|
+
"unique": true,
|
|
4073
|
+
"nullsNotDistinct": true
|
|
4074
|
+
},
|
|
4075
|
+
{
|
|
4076
|
+
"name": "contracts_meta_type_idx",
|
|
4077
|
+
"columns": [
|
|
4078
|
+
"_meta_type"
|
|
4079
|
+
]
|
|
4080
|
+
},
|
|
4081
|
+
{
|
|
4082
|
+
"name": "contracts_tenant_id_created_at_idx",
|
|
4083
|
+
"columns": [
|
|
4084
|
+
"tenant_id",
|
|
4085
|
+
"created_at"
|
|
4086
|
+
]
|
|
4087
|
+
},
|
|
4088
|
+
{
|
|
4089
|
+
"name": "contracts_customer_id_idx",
|
|
4090
|
+
"columns": [
|
|
4091
|
+
"customer_id"
|
|
4092
|
+
]
|
|
4093
|
+
},
|
|
4094
|
+
{
|
|
4095
|
+
"name": "contracts_vendor_id_idx",
|
|
4096
|
+
"columns": [
|
|
4097
|
+
"vendor_id"
|
|
4098
|
+
]
|
|
4099
|
+
}
|
|
4100
|
+
],
|
|
4101
|
+
"version": "b3d6a501"
|
|
4102
|
+
},
|
|
4103
|
+
"importPath": "@happyvertical/smrt-commerce"
|
|
4104
|
+
},
|
|
4105
|
+
"@happyvertical/smrt-commerce:VendorCollection": {
|
|
4106
|
+
"name": "vendorcollection",
|
|
4107
|
+
"className": "VendorCollection",
|
|
4108
|
+
"qualifiedName": "@happyvertical/smrt-commerce:VendorCollection",
|
|
4109
|
+
"collection": "vendors",
|
|
4110
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/collections/VendorCollection.ts",
|
|
4111
|
+
"packageName": "@happyvertical/smrt-commerce",
|
|
4112
|
+
"fields": {},
|
|
4113
|
+
"methods": {
|
|
4114
|
+
"findByProfile": {
|
|
4115
|
+
"name": "findByProfile",
|
|
4116
|
+
"async": true,
|
|
4117
|
+
"parameters": [
|
|
4118
|
+
{
|
|
4119
|
+
"name": "profileId",
|
|
4120
|
+
"type": "string",
|
|
4121
|
+
"optional": false
|
|
4122
|
+
}
|
|
4123
|
+
],
|
|
4124
|
+
"returnType": "Promise<Vendor[]>",
|
|
4125
|
+
"isStatic": false,
|
|
4126
|
+
"isPublic": true
|
|
4127
|
+
},
|
|
4128
|
+
"findActive": {
|
|
4129
|
+
"name": "findActive",
|
|
4130
|
+
"async": true,
|
|
4131
|
+
"parameters": [],
|
|
4132
|
+
"returnType": "Promise<Vendor[]>",
|
|
4133
|
+
"isStatic": false,
|
|
4134
|
+
"isPublic": true
|
|
4135
|
+
},
|
|
4136
|
+
"findByStatus": {
|
|
4137
|
+
"name": "findByStatus",
|
|
4138
|
+
"async": true,
|
|
4139
|
+
"parameters": [
|
|
4140
|
+
{
|
|
4141
|
+
"name": "status",
|
|
4142
|
+
"type": "VendorStatus",
|
|
4143
|
+
"optional": false
|
|
4144
|
+
}
|
|
4145
|
+
],
|
|
4146
|
+
"returnType": "Promise<Vendor[]>",
|
|
4147
|
+
"isStatic": false,
|
|
4148
|
+
"isPublic": true
|
|
4149
|
+
},
|
|
4150
|
+
"getOrCreateForProfile": {
|
|
4151
|
+
"name": "getOrCreateForProfile",
|
|
4152
|
+
"async": true,
|
|
4153
|
+
"parameters": [
|
|
4154
|
+
{
|
|
4155
|
+
"name": "profileId",
|
|
4156
|
+
"type": "string",
|
|
4157
|
+
"optional": false
|
|
4158
|
+
},
|
|
4159
|
+
{
|
|
4160
|
+
"name": "defaults",
|
|
4161
|
+
"type": "Partial<object>",
|
|
4162
|
+
"optional": true,
|
|
4163
|
+
"memberTypes": [
|
|
4164
|
+
"number",
|
|
4165
|
+
"string"
|
|
4166
|
+
]
|
|
4167
|
+
}
|
|
4168
|
+
],
|
|
4169
|
+
"returnType": "Promise<Vendor>",
|
|
4170
|
+
"isStatic": false,
|
|
4171
|
+
"isPublic": true
|
|
4172
|
+
},
|
|
4173
|
+
"findByTenant": {
|
|
4174
|
+
"name": "findByTenant",
|
|
4175
|
+
"async": true,
|
|
4176
|
+
"parameters": [
|
|
4177
|
+
{
|
|
4178
|
+
"name": "tenantId",
|
|
4179
|
+
"type": "string",
|
|
4180
|
+
"optional": false
|
|
4181
|
+
}
|
|
4182
|
+
],
|
|
4183
|
+
"returnType": "Promise<Vendor[]>",
|
|
4184
|
+
"isStatic": false,
|
|
4185
|
+
"isPublic": true
|
|
4186
|
+
},
|
|
4187
|
+
"findGlobal": {
|
|
4188
|
+
"name": "findGlobal",
|
|
4189
|
+
"async": true,
|
|
4190
|
+
"parameters": [],
|
|
4191
|
+
"returnType": "Promise<Vendor[]>",
|
|
4192
|
+
"isStatic": false,
|
|
4193
|
+
"isPublic": true
|
|
4194
|
+
},
|
|
4195
|
+
"findWithGlobals": {
|
|
4196
|
+
"name": "findWithGlobals",
|
|
4197
|
+
"async": true,
|
|
4198
|
+
"parameters": [
|
|
4199
|
+
{
|
|
4200
|
+
"name": "tenantId",
|
|
4201
|
+
"type": "string",
|
|
4202
|
+
"optional": false
|
|
4203
|
+
}
|
|
4204
|
+
],
|
|
4205
|
+
"returnType": "Promise<Vendor[]>",
|
|
4206
|
+
"isStatic": false,
|
|
4207
|
+
"isPublic": true
|
|
4208
|
+
}
|
|
4209
|
+
},
|
|
4210
|
+
"decoratorConfig": {},
|
|
4211
|
+
"extends": "SmrtCollection",
|
|
4212
|
+
"extendsTypeArg": "Vendor",
|
|
4213
|
+
"exportName": "VendorCollection",
|
|
4214
|
+
"collectionExportName": "VendorCollectionCollection",
|
|
4215
|
+
"schema": {
|
|
4216
|
+
"tableName": "vendors",
|
|
4217
|
+
"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 \"contacts\" JSON DEFAULT '[]'\n);",
|
|
4218
|
+
"columns": {
|
|
4219
|
+
"id": {
|
|
4220
|
+
"type": "UUID",
|
|
4221
|
+
"primaryKey": true,
|
|
4222
|
+
"referenceKind": "id",
|
|
4223
|
+
"notNull": true
|
|
4224
|
+
},
|
|
4225
|
+
"slug": {
|
|
4226
|
+
"type": "TEXT",
|
|
4227
|
+
"notNull": true
|
|
4228
|
+
},
|
|
4229
|
+
"context": {
|
|
4230
|
+
"type": "TEXT",
|
|
4231
|
+
"notNull": true,
|
|
4232
|
+
"default": ""
|
|
4233
|
+
},
|
|
4234
|
+
"created_at": {
|
|
4235
|
+
"type": "TIMESTAMP",
|
|
4236
|
+
"notNull": true,
|
|
4237
|
+
"default": "current_timestamp"
|
|
4238
|
+
},
|
|
4239
|
+
"updated_at": {
|
|
4240
|
+
"type": "TIMESTAMP",
|
|
4241
|
+
"notNull": true,
|
|
4242
|
+
"default": "current_timestamp"
|
|
4243
|
+
},
|
|
4244
|
+
"tenant_id": {
|
|
4245
|
+
"type": "UUID",
|
|
4246
|
+
"referenceKind": "tenantId",
|
|
4247
|
+
"notNull": false,
|
|
4248
|
+
"unique": false
|
|
4249
|
+
},
|
|
4250
|
+
"profile_id": {
|
|
4251
|
+
"type": "UUID",
|
|
4252
|
+
"referenceKind": "crossPackageRef",
|
|
4253
|
+
"notNull": false,
|
|
4254
|
+
"unique": false
|
|
4255
|
+
},
|
|
4256
|
+
"lead_time_days": {
|
|
4257
|
+
"type": "INTEGER",
|
|
4258
|
+
"notNull": false,
|
|
4259
|
+
"unique": false,
|
|
4260
|
+
"default": 0
|
|
4261
|
+
},
|
|
4262
|
+
"minimum_order_amount": {
|
|
4263
|
+
"type": "INTEGER",
|
|
4264
|
+
"notNull": false,
|
|
4265
|
+
"unique": false,
|
|
4266
|
+
"default": 0
|
|
4267
|
+
},
|
|
4268
|
+
"payment_terms": {
|
|
4269
|
+
"type": "TEXT",
|
|
4270
|
+
"notNull": false,
|
|
4271
|
+
"unique": false,
|
|
4272
|
+
"default": ""
|
|
4273
|
+
},
|
|
4274
|
+
"currency": {
|
|
4275
|
+
"type": "TEXT",
|
|
4276
|
+
"notNull": false,
|
|
4277
|
+
"unique": false,
|
|
4278
|
+
"default": "USD"
|
|
4279
|
+
},
|
|
4280
|
+
"default_contact_email": {
|
|
4281
|
+
"type": "TEXT",
|
|
4282
|
+
"notNull": false,
|
|
4283
|
+
"unique": false,
|
|
4284
|
+
"default": ""
|
|
4285
|
+
},
|
|
4286
|
+
"default_contact_phone": {
|
|
4287
|
+
"type": "TEXT",
|
|
4288
|
+
"notNull": false,
|
|
4289
|
+
"unique": false,
|
|
4290
|
+
"default": ""
|
|
4291
|
+
},
|
|
4292
|
+
"status": {
|
|
4293
|
+
"type": "TEXT",
|
|
4294
|
+
"notNull": false,
|
|
4295
|
+
"unique": false
|
|
4296
|
+
},
|
|
4297
|
+
"notes": {
|
|
4298
|
+
"type": "TEXT",
|
|
4299
|
+
"notNull": false,
|
|
4300
|
+
"unique": false,
|
|
4301
|
+
"default": ""
|
|
4302
|
+
},
|
|
4303
|
+
"payout_addresses": {
|
|
4304
|
+
"type": "JSON",
|
|
4305
|
+
"notNull": false,
|
|
4306
|
+
"unique": false,
|
|
4307
|
+
"default": {}
|
|
4308
|
+
},
|
|
4309
|
+
"contacts": {
|
|
4310
|
+
"type": "JSON",
|
|
4311
|
+
"notNull": false,
|
|
4312
|
+
"unique": false,
|
|
4313
|
+
"default": []
|
|
4314
|
+
}
|
|
4315
|
+
},
|
|
4316
|
+
"indexes": [
|
|
4317
|
+
{
|
|
4318
|
+
"name": "vendors_slug_context_idx",
|
|
4319
|
+
"columns": [
|
|
4320
|
+
"tenant_id",
|
|
4321
|
+
"slug",
|
|
4322
|
+
"context"
|
|
4323
|
+
],
|
|
4324
|
+
"unique": true,
|
|
4325
|
+
"nullsNotDistinct": true
|
|
4326
|
+
},
|
|
4327
|
+
{
|
|
4328
|
+
"name": "vendors_tenant_id_created_at_idx",
|
|
4329
|
+
"columns": [
|
|
4330
|
+
"tenant_id",
|
|
4331
|
+
"created_at"
|
|
4332
|
+
]
|
|
4333
|
+
},
|
|
4334
|
+
{
|
|
4335
|
+
"name": "vendors_profile_id_idx",
|
|
4336
|
+
"columns": [
|
|
4337
|
+
"profile_id"
|
|
4338
|
+
]
|
|
4339
|
+
}
|
|
4340
|
+
],
|
|
4341
|
+
"version": "0963c71f"
|
|
4342
|
+
},
|
|
4343
|
+
"importPath": "@happyvertical/smrt-commerce"
|
|
4344
|
+
},
|
|
4345
|
+
"@happyvertical/smrt-commerce:Contract": {
|
|
4346
|
+
"name": "contract",
|
|
4347
|
+
"className": "Contract",
|
|
4348
|
+
"qualifiedName": "@happyvertical/smrt-commerce:Contract",
|
|
4349
|
+
"collection": "contracts",
|
|
4350
|
+
"description": "Contract is the base class for all commercial agreements.",
|
|
4351
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Contract.ts",
|
|
4352
|
+
"packageName": "@happyvertical/smrt-commerce",
|
|
4353
|
+
"fields": {
|
|
4354
|
+
"created_at": {
|
|
4355
|
+
"type": "datetime",
|
|
4356
|
+
"required": false
|
|
4357
|
+
},
|
|
4358
|
+
"updated_at": {
|
|
4359
|
+
"type": "datetime",
|
|
4360
|
+
"required": false
|
|
4361
|
+
},
|
|
4362
|
+
"tenantId": {
|
|
4363
|
+
"type": "text",
|
|
4364
|
+
"required": false,
|
|
4365
|
+
"_meta": {
|
|
4366
|
+
"sqlType": "UUID",
|
|
4367
|
+
"nullable": true,
|
|
4368
|
+
"__tenancy": {
|
|
4369
|
+
"isTenantIdField": true,
|
|
4370
|
+
"autoFilter": true,
|
|
4371
|
+
"required": false,
|
|
4372
|
+
"autoPopulate": true,
|
|
4373
|
+
"nullable": true,
|
|
4374
|
+
"mode": "optional",
|
|
4375
|
+
"field": "tenantId",
|
|
4376
|
+
"allowSuperAdminBypass": false
|
|
4377
|
+
}
|
|
4378
|
+
}
|
|
4379
|
+
},
|
|
4380
|
+
"contractType": {
|
|
4381
|
+
"type": "text",
|
|
4382
|
+
"required": false,
|
|
4383
|
+
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
4384
|
+
"_meta": {
|
|
4385
|
+
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
4386
|
+
},
|
|
4387
|
+
"enum": [
|
|
4388
|
+
"estimate",
|
|
4389
|
+
"order",
|
|
4390
|
+
"lease",
|
|
4391
|
+
"agreement",
|
|
4392
|
+
"purchase_order",
|
|
4393
|
+
"wholesale_order",
|
|
4394
|
+
"production_order",
|
|
4395
|
+
"cart",
|
|
4396
|
+
"license_sale"
|
|
4397
|
+
]
|
|
4398
|
+
},
|
|
4399
|
+
"status": {
|
|
4400
|
+
"type": "text",
|
|
4401
|
+
"required": false,
|
|
4402
|
+
"description": "Where the order or agreement stands, for example draft, sent, accepted or completed.",
|
|
4403
|
+
"_meta": {
|
|
4404
|
+
"description": "Where the order or agreement stands, for example draft, sent, accepted or completed."
|
|
4405
|
+
},
|
|
4406
|
+
"enum": [
|
|
4407
|
+
"draft",
|
|
4408
|
+
"sent",
|
|
4409
|
+
"accepted",
|
|
4410
|
+
"declined",
|
|
4411
|
+
"completed",
|
|
4412
|
+
"cancelled"
|
|
4413
|
+
]
|
|
4414
|
+
},
|
|
4415
|
+
"subtotal": {
|
|
4416
|
+
"type": "integer",
|
|
4417
|
+
"required": false,
|
|
4418
|
+
"default": 0,
|
|
4419
|
+
"description": "The amount before tax.",
|
|
4420
|
+
"_meta": {
|
|
4421
|
+
"description": "The amount before tax.",
|
|
4422
|
+
"ui": {
|
|
4423
|
+
"format": "money"
|
|
4424
|
+
}
|
|
4425
|
+
}
|
|
4426
|
+
},
|
|
4427
|
+
"taxAmount": {
|
|
4428
|
+
"type": "integer",
|
|
4429
|
+
"required": false,
|
|
4430
|
+
"default": 0,
|
|
4431
|
+
"description": "The tax charged.",
|
|
4432
|
+
"_meta": {
|
|
4433
|
+
"description": "The tax charged.",
|
|
4434
|
+
"ui": {
|
|
4435
|
+
"format": "money"
|
|
4436
|
+
}
|
|
4437
|
+
}
|
|
4438
|
+
},
|
|
4439
|
+
"totalAmount": {
|
|
4440
|
+
"type": "integer",
|
|
4441
|
+
"required": false,
|
|
4442
|
+
"default": 0,
|
|
4443
|
+
"description": "The full amount, tax included.",
|
|
4444
|
+
"_meta": {
|
|
4445
|
+
"description": "The full amount, tax included.",
|
|
4446
|
+
"ui": {
|
|
4447
|
+
"format": "money"
|
|
4448
|
+
}
|
|
4449
|
+
}
|
|
4450
|
+
},
|
|
4451
|
+
"currency": {
|
|
4452
|
+
"type": "text",
|
|
4453
|
+
"required": false,
|
|
4454
|
+
"default": "USD",
|
|
4455
|
+
"description": "The currency of the amounts.",
|
|
4456
|
+
"_meta": {
|
|
4457
|
+
"description": "The currency of the amounts.",
|
|
4458
|
+
"ui": {
|
|
4459
|
+
"widget": "currency"
|
|
4460
|
+
}
|
|
4461
|
+
}
|
|
4462
|
+
},
|
|
4463
|
+
"issueDate": {
|
|
4464
|
+
"type": "datetime",
|
|
4465
|
+
"required": false,
|
|
4466
|
+
"description": "The date it was issued or placed.",
|
|
4467
|
+
"_meta": {
|
|
4468
|
+
"description": "The date it was issued or placed."
|
|
4469
|
+
}
|
|
4470
|
+
},
|
|
4471
|
+
"dueDate": {
|
|
4472
|
+
"type": "datetime",
|
|
4473
|
+
"required": false,
|
|
4474
|
+
"description": "The date payment or delivery is due.",
|
|
4475
|
+
"_meta": {
|
|
4476
|
+
"description": "The date payment or delivery is due."
|
|
4477
|
+
}
|
|
4478
|
+
},
|
|
4479
|
+
"expiryDate": {
|
|
4480
|
+
"type": "datetime",
|
|
4481
|
+
"required": false,
|
|
4482
|
+
"description": "The last day the price or offer is good for.",
|
|
4483
|
+
"_meta": {
|
|
4484
|
+
"description": "The last day the price or offer is good for."
|
|
4485
|
+
}
|
|
4486
|
+
},
|
|
4487
|
+
"reference": {
|
|
4488
|
+
"type": "text",
|
|
4489
|
+
"required": false,
|
|
4490
|
+
"default": "",
|
|
4491
|
+
"description": "Your own number or note for finding this later, such as a purchase order or quote number.",
|
|
4492
|
+
"_meta": {
|
|
4493
|
+
"description": "Your own number or note for finding this later, such as a purchase order or quote number."
|
|
4494
|
+
}
|
|
4495
|
+
},
|
|
4496
|
+
"notes": {
|
|
4497
|
+
"type": "text",
|
|
4498
|
+
"required": false,
|
|
4499
|
+
"default": "",
|
|
4500
|
+
"description": "Anything worth remembering about this.",
|
|
4501
|
+
"_meta": {
|
|
4502
|
+
"description": "Anything worth remembering about this.",
|
|
4503
|
+
"ui": {
|
|
4504
|
+
"widget": "textarea"
|
|
4505
|
+
}
|
|
4506
|
+
}
|
|
4507
|
+
},
|
|
4508
|
+
"terms": {
|
|
4509
|
+
"type": "text",
|
|
4510
|
+
"required": false,
|
|
4511
|
+
"default": "",
|
|
4512
|
+
"description": "The conditions agreed, such as deposits, payment or delivery conditions.",
|
|
4513
|
+
"_meta": {
|
|
4514
|
+
"description": "The conditions agreed, such as deposits, payment or delivery conditions.",
|
|
4515
|
+
"ui": {
|
|
4516
|
+
"widget": "textarea"
|
|
4517
|
+
}
|
|
4518
|
+
}
|
|
4519
|
+
},
|
|
4520
|
+
"channelId": {
|
|
4521
|
+
"type": "text",
|
|
4522
|
+
"required": false,
|
|
4523
|
+
"default": "",
|
|
4524
|
+
"description": "Where it came from, for example your shop, a marketplace or a phone call.",
|
|
4525
|
+
"_meta": {
|
|
4526
|
+
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
4527
|
+
}
|
|
4528
|
+
}
|
|
4529
|
+
},
|
|
4530
|
+
"methods": {
|
|
4531
|
+
"isDraft": {
|
|
4532
|
+
"name": "isDraft",
|
|
4533
|
+
"async": false,
|
|
4534
|
+
"parameters": [],
|
|
4535
|
+
"returnType": "boolean",
|
|
4536
|
+
"isStatic": false,
|
|
4537
|
+
"isPublic": true
|
|
4538
|
+
},
|
|
4539
|
+
"isAccepted": {
|
|
4540
|
+
"name": "isAccepted",
|
|
4541
|
+
"async": false,
|
|
4542
|
+
"parameters": [],
|
|
4543
|
+
"returnType": "boolean",
|
|
4544
|
+
"isStatic": false,
|
|
4545
|
+
"isPublic": true
|
|
4546
|
+
},
|
|
4547
|
+
"isCompleted": {
|
|
4548
|
+
"name": "isCompleted",
|
|
4549
|
+
"async": false,
|
|
4550
|
+
"parameters": [],
|
|
4551
|
+
"returnType": "boolean",
|
|
4552
|
+
"isStatic": false,
|
|
4553
|
+
"isPublic": true
|
|
4554
|
+
},
|
|
4555
|
+
"isExpired": {
|
|
4556
|
+
"name": "isExpired",
|
|
4557
|
+
"async": false,
|
|
4558
|
+
"parameters": [],
|
|
4559
|
+
"returnType": "boolean",
|
|
4560
|
+
"isStatic": false,
|
|
4561
|
+
"isPublic": true
|
|
4562
|
+
},
|
|
4563
|
+
"isOverdue": {
|
|
4564
|
+
"name": "isOverdue",
|
|
4565
|
+
"async": false,
|
|
4566
|
+
"parameters": [],
|
|
4567
|
+
"returnType": "boolean",
|
|
4568
|
+
"isStatic": false,
|
|
4569
|
+
"isPublic": true
|
|
4570
|
+
},
|
|
4571
|
+
"recalculateTotals": {
|
|
4572
|
+
"name": "recalculateTotals",
|
|
4573
|
+
"async": true,
|
|
4574
|
+
"parameters": [],
|
|
4575
|
+
"returnType": "Promise<void>",
|
|
4576
|
+
"isStatic": false,
|
|
4577
|
+
"isPublic": true
|
|
4578
|
+
},
|
|
4579
|
+
"initialize": {
|
|
4580
|
+
"name": "initialize",
|
|
4581
|
+
"async": true,
|
|
4582
|
+
"parameters": [],
|
|
4583
|
+
"returnType": "Promise<this>",
|
|
4584
|
+
"isStatic": false,
|
|
4585
|
+
"isPublic": true
|
|
4586
|
+
},
|
|
4587
|
+
"save": {
|
|
4588
|
+
"name": "save",
|
|
4589
|
+
"async": true,
|
|
4590
|
+
"parameters": [],
|
|
4591
|
+
"returnType": "Promise<this>",
|
|
4592
|
+
"isStatic": false,
|
|
4593
|
+
"isPublic": true
|
|
4594
|
+
}
|
|
4595
|
+
},
|
|
4596
|
+
"decoratorConfig": {
|
|
4597
|
+
"tableStrategy": "sti",
|
|
4598
|
+
"api": {
|
|
4599
|
+
"include": [
|
|
4600
|
+
"list",
|
|
4601
|
+
"get",
|
|
4602
|
+
"create",
|
|
4603
|
+
"update"
|
|
4604
|
+
]
|
|
4605
|
+
},
|
|
4606
|
+
"mcp": {
|
|
4607
|
+
"include": [
|
|
4608
|
+
"list",
|
|
4609
|
+
"get"
|
|
4610
|
+
]
|
|
4611
|
+
},
|
|
4612
|
+
"cli": {
|
|
4613
|
+
"skipApiCheck": true
|
|
4614
|
+
},
|
|
4615
|
+
"tenantScoped": {
|
|
4616
|
+
"mode": "optional"
|
|
4617
|
+
},
|
|
4618
|
+
"conflictColumns": [
|
|
4619
|
+
"tenant_id",
|
|
4620
|
+
"slug",
|
|
4621
|
+
"context",
|
|
4622
|
+
"_meta_type"
|
|
4623
|
+
]
|
|
4624
|
+
},
|
|
4625
|
+
"extends": "SmrtObject",
|
|
4626
|
+
"exportName": "Contract",
|
|
4627
|
+
"collectionExportName": "ContractCollection",
|
|
4628
|
+
"schema": {
|
|
4629
|
+
"tableName": "contracts",
|
|
4630
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
4631
|
+
"columns": {
|
|
4632
|
+
"id": {
|
|
4633
|
+
"type": "UUID",
|
|
4634
|
+
"primaryKey": true,
|
|
4635
|
+
"referenceKind": "id",
|
|
4636
|
+
"notNull": true
|
|
4637
|
+
},
|
|
4638
|
+
"slug": {
|
|
4639
|
+
"type": "TEXT",
|
|
4640
|
+
"notNull": true
|
|
4641
|
+
},
|
|
4642
|
+
"context": {
|
|
4643
|
+
"type": "TEXT",
|
|
4644
|
+
"notNull": true,
|
|
4645
|
+
"default": ""
|
|
4646
|
+
},
|
|
4647
|
+
"_meta_type": {
|
|
4648
|
+
"type": "TEXT",
|
|
4649
|
+
"notNull": true
|
|
4650
|
+
},
|
|
4651
|
+
"_meta_data": {
|
|
4652
|
+
"type": "JSON",
|
|
4653
|
+
"notNull": false
|
|
4654
|
+
},
|
|
4655
|
+
"created_at": {
|
|
4656
|
+
"type": "TIMESTAMP",
|
|
4657
|
+
"notNull": true,
|
|
4658
|
+
"default": "current_timestamp"
|
|
4659
|
+
},
|
|
4660
|
+
"updated_at": {
|
|
4661
|
+
"type": "TIMESTAMP",
|
|
4662
|
+
"notNull": true,
|
|
4663
|
+
"default": "current_timestamp"
|
|
4664
|
+
},
|
|
4665
|
+
"tenant_id": {
|
|
4666
|
+
"type": "UUID",
|
|
4667
|
+
"referenceKind": "tenantId",
|
|
4668
|
+
"notNull": false
|
|
4669
|
+
},
|
|
4670
|
+
"contract_type": {
|
|
4671
|
+
"type": "TEXT",
|
|
4672
|
+
"notNull": false
|
|
4673
|
+
},
|
|
4674
|
+
"status": {
|
|
4675
|
+
"type": "TEXT",
|
|
4676
|
+
"notNull": false
|
|
4677
|
+
},
|
|
4678
|
+
"subtotal": {
|
|
4679
|
+
"type": "INTEGER",
|
|
4680
|
+
"notNull": false,
|
|
4681
|
+
"default": 0
|
|
4682
|
+
},
|
|
4683
|
+
"tax_amount": {
|
|
4684
|
+
"type": "INTEGER",
|
|
4685
|
+
"notNull": false,
|
|
4686
|
+
"default": 0
|
|
4687
|
+
},
|
|
4688
|
+
"total_amount": {
|
|
4689
|
+
"type": "INTEGER",
|
|
4690
|
+
"notNull": false,
|
|
4691
|
+
"default": 0
|
|
4692
|
+
},
|
|
4693
|
+
"currency": {
|
|
4694
|
+
"type": "TEXT",
|
|
4695
|
+
"notNull": false,
|
|
4696
|
+
"default": "USD"
|
|
4697
|
+
},
|
|
4698
|
+
"issue_date": {
|
|
4699
|
+
"type": "TIMESTAMP",
|
|
4700
|
+
"notNull": false
|
|
4701
|
+
},
|
|
4702
|
+
"due_date": {
|
|
4703
|
+
"type": "TIMESTAMP",
|
|
4704
|
+
"notNull": false
|
|
4705
|
+
},
|
|
4706
|
+
"expiry_date": {
|
|
4707
|
+
"type": "TIMESTAMP",
|
|
4708
|
+
"notNull": false
|
|
4709
|
+
},
|
|
4710
|
+
"reference": {
|
|
4711
|
+
"type": "TEXT",
|
|
4712
|
+
"notNull": false,
|
|
4713
|
+
"default": ""
|
|
4714
|
+
},
|
|
4715
|
+
"notes": {
|
|
4716
|
+
"type": "TEXT",
|
|
4717
|
+
"notNull": false,
|
|
4718
|
+
"default": ""
|
|
4719
|
+
},
|
|
4720
|
+
"terms": {
|
|
4721
|
+
"type": "TEXT",
|
|
4722
|
+
"notNull": false,
|
|
4723
|
+
"default": ""
|
|
4724
|
+
},
|
|
4725
|
+
"channel_id": {
|
|
4726
|
+
"type": "TEXT",
|
|
4727
|
+
"notNull": false,
|
|
4728
|
+
"default": ""
|
|
4729
|
+
},
|
|
4730
|
+
"customer_id": {
|
|
4731
|
+
"type": "UUID",
|
|
4732
|
+
"referenceKind": "foreignKey",
|
|
4733
|
+
"notNull": false,
|
|
4734
|
+
"foreignKey": {
|
|
4735
|
+
"table": "customers",
|
|
4736
|
+
"column": "id",
|
|
4737
|
+
"onDelete": "NO ACTION",
|
|
4738
|
+
"onUpdate": "CASCADE"
|
|
4739
|
+
}
|
|
4740
|
+
},
|
|
4741
|
+
"vendor_id": {
|
|
4742
|
+
"type": "UUID",
|
|
4743
|
+
"referenceKind": "foreignKey",
|
|
4744
|
+
"notNull": false,
|
|
4745
|
+
"foreignKey": {
|
|
4746
|
+
"table": "vendors",
|
|
4747
|
+
"column": "id",
|
|
4748
|
+
"onDelete": "NO ACTION",
|
|
4749
|
+
"onUpdate": "CASCADE"
|
|
4750
|
+
}
|
|
4751
|
+
}
|
|
4752
|
+
},
|
|
4753
|
+
"indexes": [
|
|
4754
|
+
{
|
|
4755
|
+
"name": "contracts_slug_context_meta_type_idx",
|
|
4756
|
+
"columns": [
|
|
4757
|
+
"tenant_id",
|
|
4758
|
+
"slug",
|
|
4759
|
+
"context",
|
|
4760
|
+
"_meta_type"
|
|
4761
|
+
],
|
|
4762
|
+
"unique": true,
|
|
4763
|
+
"nullsNotDistinct": true
|
|
4764
|
+
},
|
|
4765
|
+
{
|
|
4766
|
+
"name": "contracts_meta_type_idx",
|
|
4767
|
+
"columns": [
|
|
4768
|
+
"_meta_type"
|
|
4769
|
+
]
|
|
4770
|
+
},
|
|
4771
|
+
{
|
|
4772
|
+
"name": "contracts_tenant_id_created_at_idx",
|
|
4773
|
+
"columns": [
|
|
4774
|
+
"tenant_id",
|
|
4775
|
+
"created_at"
|
|
4776
|
+
]
|
|
4777
|
+
},
|
|
4778
|
+
{
|
|
4779
|
+
"name": "contracts_customer_id_idx",
|
|
4780
|
+
"columns": [
|
|
4781
|
+
"customer_id"
|
|
4782
|
+
]
|
|
4783
|
+
},
|
|
4784
|
+
{
|
|
4785
|
+
"name": "contracts_vendor_id_idx",
|
|
4786
|
+
"columns": [
|
|
4787
|
+
"vendor_id"
|
|
4788
|
+
]
|
|
4789
|
+
}
|
|
4790
|
+
],
|
|
4791
|
+
"version": "0eb8f0eb"
|
|
4792
|
+
},
|
|
4793
|
+
"importPath": "@happyvertical/smrt-commerce"
|
|
4794
|
+
},
|
|
4795
|
+
"@happyvertical/smrt-commerce:SalesContract": {
|
|
4796
|
+
"name": "salescontract",
|
|
4797
|
+
"className": "SalesContract",
|
|
4798
|
+
"qualifiedName": "@happyvertical/smrt-commerce:SalesContract",
|
|
4799
|
+
"collection": "contracts",
|
|
4800
|
+
"description": "Customer-side contracts, including orders, estimates, and licenses.",
|
|
4801
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Contract.ts",
|
|
4802
|
+
"packageName": "@happyvertical/smrt-commerce",
|
|
4803
|
+
"fields": {
|
|
4804
|
+
"created_at": {
|
|
4805
|
+
"type": "datetime",
|
|
4806
|
+
"required": false
|
|
4807
|
+
},
|
|
4808
|
+
"updated_at": {
|
|
4809
|
+
"type": "datetime",
|
|
4810
|
+
"required": false
|
|
4811
|
+
},
|
|
4812
|
+
"tenantId": {
|
|
4813
|
+
"type": "text",
|
|
4814
|
+
"required": false,
|
|
4815
|
+
"_meta": {
|
|
4816
|
+
"sqlType": "UUID",
|
|
4817
|
+
"nullable": true,
|
|
4818
|
+
"__tenancy": {
|
|
4819
|
+
"isTenantIdField": true,
|
|
4820
|
+
"autoFilter": true,
|
|
4821
|
+
"required": false,
|
|
4822
|
+
"autoPopulate": true,
|
|
4823
|
+
"nullable": true,
|
|
4824
|
+
"mode": "optional",
|
|
4825
|
+
"field": "tenantId",
|
|
4826
|
+
"allowSuperAdminBypass": false
|
|
4827
|
+
}
|
|
4828
|
+
}
|
|
4829
|
+
},
|
|
4830
|
+
"contractType": {
|
|
4831
|
+
"type": "text",
|
|
4832
|
+
"required": false,
|
|
4833
|
+
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
4834
|
+
"_meta": {
|
|
4835
|
+
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
4836
|
+
},
|
|
4837
|
+
"enum": [
|
|
4838
|
+
"estimate",
|
|
4839
|
+
"order",
|
|
4840
|
+
"lease",
|
|
4841
|
+
"agreement",
|
|
4842
|
+
"purchase_order",
|
|
4843
|
+
"wholesale_order",
|
|
4844
|
+
"production_order",
|
|
4845
|
+
"cart",
|
|
4846
|
+
"license_sale"
|
|
4847
|
+
]
|
|
4848
|
+
},
|
|
4849
|
+
"status": {
|
|
4850
|
+
"type": "text",
|
|
4851
|
+
"required": false,
|
|
4852
|
+
"description": "Where the order or agreement stands, for example draft, sent, accepted or completed.",
|
|
4853
|
+
"_meta": {
|
|
4854
|
+
"description": "Where the order or agreement stands, for example draft, sent, accepted or completed."
|
|
4855
|
+
},
|
|
4856
|
+
"enum": [
|
|
4857
|
+
"draft",
|
|
4858
|
+
"sent",
|
|
4859
|
+
"accepted",
|
|
4860
|
+
"declined",
|
|
4861
|
+
"completed",
|
|
4862
|
+
"cancelled"
|
|
4863
|
+
]
|
|
4864
|
+
},
|
|
4865
|
+
"subtotal": {
|
|
4866
|
+
"type": "integer",
|
|
4867
|
+
"required": false,
|
|
4868
|
+
"default": 0,
|
|
4869
|
+
"description": "The amount before tax.",
|
|
4870
|
+
"_meta": {
|
|
4871
|
+
"description": "The amount before tax.",
|
|
4872
|
+
"ui": {
|
|
4873
|
+
"format": "money"
|
|
4874
|
+
}
|
|
4875
|
+
}
|
|
4876
|
+
},
|
|
4877
|
+
"taxAmount": {
|
|
4878
|
+
"type": "integer",
|
|
4879
|
+
"required": false,
|
|
4880
|
+
"default": 0,
|
|
4881
|
+
"description": "The tax charged.",
|
|
4882
|
+
"_meta": {
|
|
4883
|
+
"description": "The tax charged.",
|
|
4884
|
+
"ui": {
|
|
4885
|
+
"format": "money"
|
|
4886
|
+
}
|
|
4887
|
+
}
|
|
4888
|
+
},
|
|
4889
|
+
"totalAmount": {
|
|
4890
|
+
"type": "integer",
|
|
4891
|
+
"required": false,
|
|
4892
|
+
"default": 0,
|
|
4893
|
+
"description": "The full amount, tax included.",
|
|
4894
|
+
"_meta": {
|
|
4895
|
+
"description": "The full amount, tax included.",
|
|
4896
|
+
"ui": {
|
|
4897
|
+
"format": "money"
|
|
4898
|
+
}
|
|
4899
|
+
}
|
|
4900
|
+
},
|
|
4901
|
+
"currency": {
|
|
4902
|
+
"type": "text",
|
|
4903
|
+
"required": false,
|
|
4904
|
+
"default": "USD",
|
|
4905
|
+
"description": "The currency of the amounts.",
|
|
4906
|
+
"_meta": {
|
|
4907
|
+
"description": "The currency of the amounts.",
|
|
4908
|
+
"ui": {
|
|
4909
|
+
"widget": "currency"
|
|
4910
|
+
}
|
|
4911
|
+
}
|
|
4912
|
+
},
|
|
4913
|
+
"issueDate": {
|
|
4914
|
+
"type": "datetime",
|
|
4915
|
+
"required": false,
|
|
4916
|
+
"description": "The date it was issued or placed.",
|
|
4917
|
+
"_meta": {
|
|
4918
|
+
"description": "The date it was issued or placed."
|
|
4919
|
+
}
|
|
4920
|
+
},
|
|
4921
|
+
"dueDate": {
|
|
4922
|
+
"type": "datetime",
|
|
4923
|
+
"required": false,
|
|
4924
|
+
"description": "The date payment or delivery is due.",
|
|
4925
|
+
"_meta": {
|
|
4926
|
+
"description": "The date payment or delivery is due."
|
|
4927
|
+
}
|
|
4928
|
+
},
|
|
4929
|
+
"expiryDate": {
|
|
4930
|
+
"type": "datetime",
|
|
4931
|
+
"required": false,
|
|
4932
|
+
"description": "The last day the price or offer is good for.",
|
|
4933
|
+
"_meta": {
|
|
4934
|
+
"description": "The last day the price or offer is good for."
|
|
4935
|
+
}
|
|
4936
|
+
},
|
|
4937
|
+
"reference": {
|
|
4938
|
+
"type": "text",
|
|
4939
|
+
"required": false,
|
|
4940
|
+
"default": "",
|
|
4941
|
+
"description": "Your own number or note for finding this later, such as a purchase order or quote number.",
|
|
4942
|
+
"_meta": {
|
|
4943
|
+
"description": "Your own number or note for finding this later, such as a purchase order or quote number."
|
|
4944
|
+
}
|
|
4945
|
+
},
|
|
4946
|
+
"notes": {
|
|
4947
|
+
"type": "text",
|
|
4948
|
+
"required": false,
|
|
4949
|
+
"default": "",
|
|
4950
|
+
"description": "Anything worth remembering about this.",
|
|
4951
|
+
"_meta": {
|
|
4952
|
+
"description": "Anything worth remembering about this.",
|
|
4953
|
+
"ui": {
|
|
4954
|
+
"widget": "textarea"
|
|
4955
|
+
}
|
|
4956
|
+
}
|
|
4957
|
+
},
|
|
4958
|
+
"terms": {
|
|
4959
|
+
"type": "text",
|
|
4960
|
+
"required": false,
|
|
4961
|
+
"default": "",
|
|
4962
|
+
"description": "The conditions agreed, such as deposits, payment or delivery conditions.",
|
|
4963
|
+
"_meta": {
|
|
4964
|
+
"description": "The conditions agreed, such as deposits, payment or delivery conditions.",
|
|
4965
|
+
"ui": {
|
|
4966
|
+
"widget": "textarea"
|
|
4967
|
+
}
|
|
4968
|
+
}
|
|
4969
|
+
},
|
|
4970
|
+
"channelId": {
|
|
4971
|
+
"type": "text",
|
|
4972
|
+
"required": false,
|
|
4973
|
+
"default": "",
|
|
4974
|
+
"description": "Where it came from, for example your shop, a marketplace or a phone call.",
|
|
4975
|
+
"_meta": {
|
|
4976
|
+
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
4977
|
+
}
|
|
4978
|
+
},
|
|
4979
|
+
"customerId": {
|
|
4980
|
+
"type": "foreignKey",
|
|
4981
|
+
"required": false,
|
|
4982
|
+
"related": "Customer",
|
|
4983
|
+
"_meta": {
|
|
4984
|
+
"description": "The customer a sales order or agreement is for."
|
|
4985
|
+
}
|
|
4986
|
+
}
|
|
4987
|
+
},
|
|
4988
|
+
"methods": {
|
|
4989
|
+
"isDraft": {
|
|
4990
|
+
"name": "isDraft",
|
|
4991
|
+
"async": false,
|
|
4992
|
+
"parameters": [],
|
|
4993
|
+
"returnType": "boolean",
|
|
4994
|
+
"isStatic": false,
|
|
4995
|
+
"isPublic": true
|
|
4996
|
+
},
|
|
4997
|
+
"isAccepted": {
|
|
4998
|
+
"name": "isAccepted",
|
|
4999
|
+
"async": false,
|
|
5000
|
+
"parameters": [],
|
|
5001
|
+
"returnType": "boolean",
|
|
5002
|
+
"isStatic": false,
|
|
5003
|
+
"isPublic": true
|
|
5004
|
+
},
|
|
5005
|
+
"isCompleted": {
|
|
5006
|
+
"name": "isCompleted",
|
|
5007
|
+
"async": false,
|
|
5008
|
+
"parameters": [],
|
|
5009
|
+
"returnType": "boolean",
|
|
5010
|
+
"isStatic": false,
|
|
5011
|
+
"isPublic": true
|
|
5012
|
+
},
|
|
5013
|
+
"isExpired": {
|
|
5014
|
+
"name": "isExpired",
|
|
5015
|
+
"async": false,
|
|
5016
|
+
"parameters": [],
|
|
5017
|
+
"returnType": "boolean",
|
|
5018
|
+
"isStatic": false,
|
|
5019
|
+
"isPublic": true
|
|
5020
|
+
},
|
|
5021
|
+
"isOverdue": {
|
|
5022
|
+
"name": "isOverdue",
|
|
5023
|
+
"async": false,
|
|
5024
|
+
"parameters": [],
|
|
5025
|
+
"returnType": "boolean",
|
|
5026
|
+
"isStatic": false,
|
|
5027
|
+
"isPublic": true
|
|
5028
|
+
},
|
|
5029
|
+
"recalculateTotals": {
|
|
5030
|
+
"name": "recalculateTotals",
|
|
5031
|
+
"async": true,
|
|
5032
|
+
"parameters": [],
|
|
5033
|
+
"returnType": "Promise<void>",
|
|
5034
|
+
"isStatic": false,
|
|
5035
|
+
"isPublic": true
|
|
5036
|
+
},
|
|
5037
|
+
"initialize": {
|
|
5038
|
+
"name": "initialize",
|
|
5039
|
+
"async": true,
|
|
5040
|
+
"parameters": [],
|
|
5041
|
+
"returnType": "Promise<this>",
|
|
5042
|
+
"isStatic": false,
|
|
5043
|
+
"isPublic": true
|
|
5044
|
+
},
|
|
5045
|
+
"save": {
|
|
5046
|
+
"name": "save",
|
|
5047
|
+
"async": true,
|
|
5048
|
+
"parameters": [],
|
|
5049
|
+
"returnType": "Promise<this>",
|
|
5050
|
+
"isStatic": false,
|
|
5051
|
+
"isPublic": true
|
|
5052
|
+
}
|
|
5053
|
+
},
|
|
5054
|
+
"decoratorConfig": {
|
|
5055
|
+
"abstract": true,
|
|
5056
|
+
"tenantScoped": {
|
|
5057
|
+
"mode": "optional"
|
|
5058
|
+
},
|
|
5059
|
+
"tableName": "contracts",
|
|
5060
|
+
"tableStrategy": "sti",
|
|
5061
|
+
"api": {
|
|
5062
|
+
"exclude": [
|
|
5063
|
+
"create",
|
|
5064
|
+
"update",
|
|
5065
|
+
"delete",
|
|
5066
|
+
"isDraft",
|
|
5067
|
+
"isAccepted",
|
|
5068
|
+
"isCompleted",
|
|
5069
|
+
"isExpired",
|
|
5070
|
+
"isOverdue",
|
|
5071
|
+
"recalculateTotals",
|
|
5072
|
+
"initialize",
|
|
5073
|
+
"save"
|
|
5074
|
+
]
|
|
5075
|
+
},
|
|
5076
|
+
"mcp": {
|
|
5077
|
+
"exclude": [
|
|
5078
|
+
"create",
|
|
5079
|
+
"update",
|
|
5080
|
+
"delete",
|
|
5081
|
+
"isDraft",
|
|
5082
|
+
"isAccepted",
|
|
5083
|
+
"isCompleted",
|
|
5084
|
+
"isExpired",
|
|
5085
|
+
"isOverdue",
|
|
5086
|
+
"recalculateTotals",
|
|
5087
|
+
"initialize",
|
|
5088
|
+
"save"
|
|
5089
|
+
]
|
|
5090
|
+
},
|
|
5091
|
+
"cli": {
|
|
5092
|
+
"exclude": [
|
|
5093
|
+
"create",
|
|
5094
|
+
"update",
|
|
5095
|
+
"delete",
|
|
5096
|
+
"isDraft",
|
|
5097
|
+
"isAccepted",
|
|
5098
|
+
"isCompleted",
|
|
5099
|
+
"isExpired",
|
|
5100
|
+
"isOverdue",
|
|
5101
|
+
"recalculateTotals",
|
|
5102
|
+
"initialize",
|
|
5103
|
+
"save"
|
|
5104
|
+
]
|
|
5105
|
+
}
|
|
5106
|
+
},
|
|
5107
|
+
"extends": "Contract",
|
|
5108
|
+
"exportName": "SalesContract",
|
|
5109
|
+
"collectionExportName": "SalesContractCollection",
|
|
5110
|
+
"abstractDeclaredApi": null,
|
|
5111
|
+
"schema": {
|
|
5112
|
+
"tableName": "contracts",
|
|
5113
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
5114
|
+
"columns": {
|
|
5115
|
+
"id": {
|
|
5116
|
+
"type": "UUID",
|
|
5117
|
+
"primaryKey": true,
|
|
5118
|
+
"referenceKind": "id",
|
|
5119
|
+
"notNull": true
|
|
5120
|
+
},
|
|
5121
|
+
"slug": {
|
|
5122
|
+
"type": "TEXT",
|
|
5123
|
+
"notNull": true
|
|
5124
|
+
},
|
|
5125
|
+
"context": {
|
|
5126
|
+
"type": "TEXT",
|
|
5127
|
+
"notNull": true,
|
|
5128
|
+
"default": ""
|
|
5129
|
+
},
|
|
5130
|
+
"_meta_type": {
|
|
5131
|
+
"type": "TEXT",
|
|
5132
|
+
"notNull": true
|
|
5133
|
+
},
|
|
5134
|
+
"_meta_data": {
|
|
5135
|
+
"type": "JSON",
|
|
5136
|
+
"notNull": false
|
|
5137
|
+
},
|
|
5138
|
+
"created_at": {
|
|
5139
|
+
"type": "TIMESTAMP",
|
|
5140
|
+
"notNull": true,
|
|
5141
|
+
"default": "current_timestamp"
|
|
5142
|
+
},
|
|
5143
|
+
"updated_at": {
|
|
5144
|
+
"type": "TIMESTAMP",
|
|
5145
|
+
"notNull": true,
|
|
5146
|
+
"default": "current_timestamp"
|
|
5147
|
+
},
|
|
5148
|
+
"tenant_id": {
|
|
5149
|
+
"type": "UUID",
|
|
5150
|
+
"referenceKind": "tenantId",
|
|
5151
|
+
"notNull": false
|
|
5152
|
+
},
|
|
5153
|
+
"contract_type": {
|
|
5154
|
+
"type": "TEXT",
|
|
5155
|
+
"notNull": false
|
|
5156
|
+
},
|
|
5157
|
+
"status": {
|
|
5158
|
+
"type": "TEXT",
|
|
5159
|
+
"notNull": false
|
|
5160
|
+
},
|
|
5161
|
+
"subtotal": {
|
|
5162
|
+
"type": "INTEGER",
|
|
5163
|
+
"notNull": false,
|
|
5164
|
+
"default": 0
|
|
5165
|
+
},
|
|
5166
|
+
"tax_amount": {
|
|
5167
|
+
"type": "INTEGER",
|
|
5168
|
+
"notNull": false,
|
|
5169
|
+
"default": 0
|
|
5170
|
+
},
|
|
5171
|
+
"total_amount": {
|
|
5172
|
+
"type": "INTEGER",
|
|
5173
|
+
"notNull": false,
|
|
5174
|
+
"default": 0
|
|
5175
|
+
},
|
|
5176
|
+
"currency": {
|
|
5177
|
+
"type": "TEXT",
|
|
5178
|
+
"notNull": false,
|
|
5179
|
+
"default": "USD"
|
|
5180
|
+
},
|
|
5181
|
+
"issue_date": {
|
|
5182
|
+
"type": "TIMESTAMP",
|
|
5183
|
+
"notNull": false
|
|
5184
|
+
},
|
|
5185
|
+
"due_date": {
|
|
5186
|
+
"type": "TIMESTAMP",
|
|
5187
|
+
"notNull": false
|
|
5188
|
+
},
|
|
5189
|
+
"expiry_date": {
|
|
5190
|
+
"type": "TIMESTAMP",
|
|
5191
|
+
"notNull": false
|
|
5192
|
+
},
|
|
5193
|
+
"reference": {
|
|
5194
|
+
"type": "TEXT",
|
|
5195
|
+
"notNull": false,
|
|
5196
|
+
"default": ""
|
|
5197
|
+
},
|
|
5198
|
+
"notes": {
|
|
5199
|
+
"type": "TEXT",
|
|
5200
|
+
"notNull": false,
|
|
5201
|
+
"default": ""
|
|
5202
|
+
},
|
|
5203
|
+
"terms": {
|
|
5204
|
+
"type": "TEXT",
|
|
5205
|
+
"notNull": false,
|
|
5206
|
+
"default": ""
|
|
5207
|
+
},
|
|
5208
|
+
"channel_id": {
|
|
5209
|
+
"type": "TEXT",
|
|
5210
|
+
"notNull": false,
|
|
5211
|
+
"default": ""
|
|
5212
|
+
},
|
|
5213
|
+
"customer_id": {
|
|
5214
|
+
"type": "UUID",
|
|
5215
|
+
"referenceKind": "foreignKey",
|
|
5216
|
+
"notNull": false,
|
|
5217
|
+
"foreignKey": {
|
|
5218
|
+
"table": "customers",
|
|
5219
|
+
"column": "id",
|
|
5220
|
+
"onDelete": "NO ACTION",
|
|
5221
|
+
"onUpdate": "CASCADE"
|
|
5222
|
+
}
|
|
5223
|
+
},
|
|
5224
|
+
"vendor_id": {
|
|
5225
|
+
"type": "UUID",
|
|
5226
|
+
"referenceKind": "foreignKey",
|
|
5227
|
+
"notNull": false,
|
|
5228
|
+
"foreignKey": {
|
|
5229
|
+
"table": "vendors",
|
|
5230
|
+
"column": "id",
|
|
5231
|
+
"onDelete": "NO ACTION",
|
|
5232
|
+
"onUpdate": "CASCADE"
|
|
5233
|
+
}
|
|
5234
|
+
}
|
|
5235
|
+
},
|
|
5236
|
+
"indexes": [
|
|
5237
|
+
{
|
|
5238
|
+
"name": "contracts_slug_context_meta_type_idx",
|
|
5239
|
+
"columns": [
|
|
5240
|
+
"tenant_id",
|
|
5241
|
+
"slug",
|
|
5242
|
+
"context",
|
|
5243
|
+
"_meta_type"
|
|
5244
|
+
],
|
|
5245
|
+
"unique": true,
|
|
5246
|
+
"nullsNotDistinct": true
|
|
5247
|
+
},
|
|
5248
|
+
{
|
|
5249
|
+
"name": "contracts_meta_type_idx",
|
|
5250
|
+
"columns": [
|
|
5251
|
+
"_meta_type"
|
|
5252
|
+
]
|
|
5253
|
+
},
|
|
5254
|
+
{
|
|
5255
|
+
"name": "contracts_tenant_id_created_at_idx",
|
|
5256
|
+
"columns": [
|
|
5257
|
+
"tenant_id",
|
|
3885
5258
|
"created_at"
|
|
3886
5259
|
]
|
|
3887
5260
|
},
|
|
3888
5261
|
{
|
|
3889
|
-
"name": "
|
|
5262
|
+
"name": "contracts_customer_id_idx",
|
|
3890
5263
|
"columns": [
|
|
3891
|
-
"
|
|
5264
|
+
"customer_id"
|
|
5265
|
+
]
|
|
5266
|
+
},
|
|
5267
|
+
{
|
|
5268
|
+
"name": "contracts_vendor_id_idx",
|
|
5269
|
+
"columns": [
|
|
5270
|
+
"vendor_id"
|
|
3892
5271
|
]
|
|
3893
5272
|
}
|
|
3894
5273
|
],
|
|
3895
|
-
"version": "
|
|
5274
|
+
"version": "b3d6a501"
|
|
3896
5275
|
},
|
|
3897
5276
|
"importPath": "@happyvertical/smrt-commerce"
|
|
3898
5277
|
},
|
|
3899
|
-
"@happyvertical/smrt-commerce:
|
|
3900
|
-
"name": "
|
|
3901
|
-
"className": "
|
|
3902
|
-
"qualifiedName": "@happyvertical/smrt-commerce:
|
|
5278
|
+
"@happyvertical/smrt-commerce:PurchaseContract": {
|
|
5279
|
+
"name": "purchasecontract",
|
|
5280
|
+
"className": "PurchaseContract",
|
|
5281
|
+
"qualifiedName": "@happyvertical/smrt-commerce:PurchaseContract",
|
|
3903
5282
|
"collection": "contracts",
|
|
3904
|
-
"description": "
|
|
5283
|
+
"description": "Supplier-side contracts, including purchase and production orders.",
|
|
3905
5284
|
"filePath": "/home/runner/work/smrt/smrt/packages/commerce/src/models/Contract.ts",
|
|
3906
5285
|
"packageName": "@happyvertical/smrt-commerce",
|
|
3907
5286
|
"fields": {
|
|
@@ -3966,22 +5345,6 @@
|
|
|
3966
5345
|
"cancelled"
|
|
3967
5346
|
]
|
|
3968
5347
|
},
|
|
3969
|
-
"customerId": {
|
|
3970
|
-
"type": "foreignKey",
|
|
3971
|
-
"required": false,
|
|
3972
|
-
"related": "Customer",
|
|
3973
|
-
"_meta": {
|
|
3974
|
-
"description": "The customer a sales order or agreement is for."
|
|
3975
|
-
}
|
|
3976
|
-
},
|
|
3977
|
-
"vendorId": {
|
|
3978
|
-
"type": "foreignKey",
|
|
3979
|
-
"required": false,
|
|
3980
|
-
"related": "Vendor",
|
|
3981
|
-
"_meta": {
|
|
3982
|
-
"description": "The vendor a purchase order is placed with."
|
|
3983
|
-
}
|
|
3984
|
-
},
|
|
3985
5348
|
"subtotal": {
|
|
3986
5349
|
"type": "integer",
|
|
3987
5350
|
"required": false,
|
|
@@ -4095,6 +5458,14 @@
|
|
|
4095
5458
|
"_meta": {
|
|
4096
5459
|
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
4097
5460
|
}
|
|
5461
|
+
},
|
|
5462
|
+
"vendorId": {
|
|
5463
|
+
"type": "foreignKey",
|
|
5464
|
+
"required": false,
|
|
5465
|
+
"related": "Vendor",
|
|
5466
|
+
"_meta": {
|
|
5467
|
+
"description": "The vendor a purchase order is placed with."
|
|
5468
|
+
}
|
|
4098
5469
|
}
|
|
4099
5470
|
},
|
|
4100
5471
|
"methods": {
|
|
@@ -4164,40 +5535,65 @@
|
|
|
4164
5535
|
}
|
|
4165
5536
|
},
|
|
4166
5537
|
"decoratorConfig": {
|
|
5538
|
+
"abstract": true,
|
|
5539
|
+
"tenantScoped": {
|
|
5540
|
+
"mode": "optional"
|
|
5541
|
+
},
|
|
5542
|
+
"tableName": "contracts",
|
|
4167
5543
|
"tableStrategy": "sti",
|
|
4168
5544
|
"api": {
|
|
4169
|
-
"
|
|
4170
|
-
"list",
|
|
4171
|
-
"get",
|
|
5545
|
+
"exclude": [
|
|
4172
5546
|
"create",
|
|
4173
|
-
"update"
|
|
5547
|
+
"update",
|
|
5548
|
+
"delete",
|
|
5549
|
+
"isDraft",
|
|
5550
|
+
"isAccepted",
|
|
5551
|
+
"isCompleted",
|
|
5552
|
+
"isExpired",
|
|
5553
|
+
"isOverdue",
|
|
5554
|
+
"recalculateTotals",
|
|
5555
|
+
"initialize",
|
|
5556
|
+
"save"
|
|
4174
5557
|
]
|
|
4175
5558
|
},
|
|
4176
5559
|
"mcp": {
|
|
4177
|
-
"
|
|
4178
|
-
"
|
|
4179
|
-
"
|
|
5560
|
+
"exclude": [
|
|
5561
|
+
"create",
|
|
5562
|
+
"update",
|
|
5563
|
+
"delete",
|
|
5564
|
+
"isDraft",
|
|
5565
|
+
"isAccepted",
|
|
5566
|
+
"isCompleted",
|
|
5567
|
+
"isExpired",
|
|
5568
|
+
"isOverdue",
|
|
5569
|
+
"recalculateTotals",
|
|
5570
|
+
"initialize",
|
|
5571
|
+
"save"
|
|
4180
5572
|
]
|
|
4181
5573
|
},
|
|
4182
5574
|
"cli": {
|
|
4183
|
-
"
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
5575
|
+
"exclude": [
|
|
5576
|
+
"create",
|
|
5577
|
+
"update",
|
|
5578
|
+
"delete",
|
|
5579
|
+
"isDraft",
|
|
5580
|
+
"isAccepted",
|
|
5581
|
+
"isCompleted",
|
|
5582
|
+
"isExpired",
|
|
5583
|
+
"isOverdue",
|
|
5584
|
+
"recalculateTotals",
|
|
5585
|
+
"initialize",
|
|
5586
|
+
"save"
|
|
5587
|
+
]
|
|
5588
|
+
}
|
|
4194
5589
|
},
|
|
4195
|
-
"extends": "
|
|
4196
|
-
"exportName": "
|
|
4197
|
-
"collectionExportName": "
|
|
5590
|
+
"extends": "Contract",
|
|
5591
|
+
"exportName": "PurchaseContract",
|
|
5592
|
+
"collectionExportName": "PurchaseContractCollection",
|
|
5593
|
+
"abstractDeclaredApi": null,
|
|
4198
5594
|
"schema": {
|
|
4199
5595
|
"tableName": "contracts",
|
|
4200
|
-
"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 \"
|
|
5596
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
4201
5597
|
"columns": {
|
|
4202
5598
|
"id": {
|
|
4203
5599
|
"type": "UUID",
|
|
@@ -4245,28 +5641,6 @@
|
|
|
4245
5641
|
"type": "TEXT",
|
|
4246
5642
|
"notNull": false
|
|
4247
5643
|
},
|
|
4248
|
-
"customer_id": {
|
|
4249
|
-
"type": "UUID",
|
|
4250
|
-
"referenceKind": "foreignKey",
|
|
4251
|
-
"notNull": false,
|
|
4252
|
-
"foreignKey": {
|
|
4253
|
-
"table": "customers",
|
|
4254
|
-
"column": "id",
|
|
4255
|
-
"onDelete": "NO ACTION",
|
|
4256
|
-
"onUpdate": "CASCADE"
|
|
4257
|
-
}
|
|
4258
|
-
},
|
|
4259
|
-
"vendor_id": {
|
|
4260
|
-
"type": "UUID",
|
|
4261
|
-
"referenceKind": "foreignKey",
|
|
4262
|
-
"notNull": false,
|
|
4263
|
-
"foreignKey": {
|
|
4264
|
-
"table": "vendors",
|
|
4265
|
-
"column": "id",
|
|
4266
|
-
"onDelete": "NO ACTION",
|
|
4267
|
-
"onUpdate": "CASCADE"
|
|
4268
|
-
}
|
|
4269
|
-
},
|
|
4270
5644
|
"subtotal": {
|
|
4271
5645
|
"type": "INTEGER",
|
|
4272
5646
|
"notNull": false,
|
|
@@ -4318,6 +5692,28 @@
|
|
|
4318
5692
|
"type": "TEXT",
|
|
4319
5693
|
"notNull": false,
|
|
4320
5694
|
"default": ""
|
|
5695
|
+
},
|
|
5696
|
+
"customer_id": {
|
|
5697
|
+
"type": "UUID",
|
|
5698
|
+
"referenceKind": "foreignKey",
|
|
5699
|
+
"notNull": false,
|
|
5700
|
+
"foreignKey": {
|
|
5701
|
+
"table": "customers",
|
|
5702
|
+
"column": "id",
|
|
5703
|
+
"onDelete": "NO ACTION",
|
|
5704
|
+
"onUpdate": "CASCADE"
|
|
5705
|
+
}
|
|
5706
|
+
},
|
|
5707
|
+
"vendor_id": {
|
|
5708
|
+
"type": "UUID",
|
|
5709
|
+
"referenceKind": "foreignKey",
|
|
5710
|
+
"notNull": false,
|
|
5711
|
+
"foreignKey": {
|
|
5712
|
+
"table": "vendors",
|
|
5713
|
+
"column": "id",
|
|
5714
|
+
"onDelete": "NO ACTION",
|
|
5715
|
+
"onUpdate": "CASCADE"
|
|
5716
|
+
}
|
|
4321
5717
|
}
|
|
4322
5718
|
},
|
|
4323
5719
|
"indexes": [
|
|
@@ -4358,7 +5754,7 @@
|
|
|
4358
5754
|
]
|
|
4359
5755
|
}
|
|
4360
5756
|
],
|
|
4361
|
-
"version": "
|
|
5757
|
+
"version": "456f7950"
|
|
4362
5758
|
},
|
|
4363
5759
|
"importPath": "@happyvertical/smrt-commerce"
|
|
4364
5760
|
},
|
|
@@ -4399,22 +5795,7 @@
|
|
|
4399
5795
|
},
|
|
4400
5796
|
"contractType": {
|
|
4401
5797
|
"type": "text",
|
|
4402
|
-
"required": false
|
|
4403
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
4404
|
-
"_meta": {
|
|
4405
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
4406
|
-
},
|
|
4407
|
-
"enum": [
|
|
4408
|
-
"estimate",
|
|
4409
|
-
"order",
|
|
4410
|
-
"lease",
|
|
4411
|
-
"agreement",
|
|
4412
|
-
"purchase_order",
|
|
4413
|
-
"wholesale_order",
|
|
4414
|
-
"production_order",
|
|
4415
|
-
"cart",
|
|
4416
|
-
"license_sale"
|
|
4417
|
-
]
|
|
5798
|
+
"required": false
|
|
4418
5799
|
},
|
|
4419
5800
|
"status": {
|
|
4420
5801
|
"type": "text",
|
|
@@ -4432,22 +5813,6 @@
|
|
|
4432
5813
|
"cancelled"
|
|
4433
5814
|
]
|
|
4434
5815
|
},
|
|
4435
|
-
"customerId": {
|
|
4436
|
-
"type": "foreignKey",
|
|
4437
|
-
"required": false,
|
|
4438
|
-
"related": "Customer",
|
|
4439
|
-
"_meta": {
|
|
4440
|
-
"description": "The customer a sales order or agreement is for."
|
|
4441
|
-
}
|
|
4442
|
-
},
|
|
4443
|
-
"vendorId": {
|
|
4444
|
-
"type": "foreignKey",
|
|
4445
|
-
"required": false,
|
|
4446
|
-
"related": "Vendor",
|
|
4447
|
-
"_meta": {
|
|
4448
|
-
"description": "The vendor a purchase order is placed with."
|
|
4449
|
-
}
|
|
4450
|
-
},
|
|
4451
5816
|
"subtotal": {
|
|
4452
5817
|
"type": "integer",
|
|
4453
5818
|
"required": false,
|
|
@@ -4561,6 +5926,14 @@
|
|
|
4561
5926
|
"_meta": {
|
|
4562
5927
|
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
4563
5928
|
}
|
|
5929
|
+
},
|
|
5930
|
+
"customerId": {
|
|
5931
|
+
"type": "foreignKey",
|
|
5932
|
+
"required": true,
|
|
5933
|
+
"related": "Customer",
|
|
5934
|
+
"_meta": {
|
|
5935
|
+
"required": true
|
|
5936
|
+
}
|
|
4564
5937
|
}
|
|
4565
5938
|
},
|
|
4566
5939
|
"methods": {
|
|
@@ -4636,12 +6009,19 @@
|
|
|
4636
6009
|
"tableName": "contracts",
|
|
4637
6010
|
"tableStrategy": "sti"
|
|
4638
6011
|
},
|
|
4639
|
-
"extends": "
|
|
6012
|
+
"extends": "SalesContract",
|
|
4640
6013
|
"exportName": "Estimate",
|
|
4641
6014
|
"collectionExportName": "EstimateCollection",
|
|
6015
|
+
"validationRules": [
|
|
6016
|
+
{
|
|
6017
|
+
"field": "customerId",
|
|
6018
|
+
"rule": "required",
|
|
6019
|
+
"fieldType": "foreignKey"
|
|
6020
|
+
}
|
|
6021
|
+
],
|
|
4642
6022
|
"schema": {
|
|
4643
6023
|
"tableName": "contracts",
|
|
4644
|
-
"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 \"
|
|
6024
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
4645
6025
|
"columns": {
|
|
4646
6026
|
"id": {
|
|
4647
6027
|
"type": "UUID",
|
|
@@ -4689,28 +6069,6 @@
|
|
|
4689
6069
|
"type": "TEXT",
|
|
4690
6070
|
"notNull": false
|
|
4691
6071
|
},
|
|
4692
|
-
"customer_id": {
|
|
4693
|
-
"type": "UUID",
|
|
4694
|
-
"referenceKind": "foreignKey",
|
|
4695
|
-
"notNull": false,
|
|
4696
|
-
"foreignKey": {
|
|
4697
|
-
"table": "customers",
|
|
4698
|
-
"column": "id",
|
|
4699
|
-
"onDelete": "NO ACTION",
|
|
4700
|
-
"onUpdate": "CASCADE"
|
|
4701
|
-
}
|
|
4702
|
-
},
|
|
4703
|
-
"vendor_id": {
|
|
4704
|
-
"type": "UUID",
|
|
4705
|
-
"referenceKind": "foreignKey",
|
|
4706
|
-
"notNull": false,
|
|
4707
|
-
"foreignKey": {
|
|
4708
|
-
"table": "vendors",
|
|
4709
|
-
"column": "id",
|
|
4710
|
-
"onDelete": "NO ACTION",
|
|
4711
|
-
"onUpdate": "CASCADE"
|
|
4712
|
-
}
|
|
4713
|
-
},
|
|
4714
6072
|
"subtotal": {
|
|
4715
6073
|
"type": "INTEGER",
|
|
4716
6074
|
"notNull": false,
|
|
@@ -4762,6 +6120,28 @@
|
|
|
4762
6120
|
"type": "TEXT",
|
|
4763
6121
|
"notNull": false,
|
|
4764
6122
|
"default": ""
|
|
6123
|
+
},
|
|
6124
|
+
"customer_id": {
|
|
6125
|
+
"type": "UUID",
|
|
6126
|
+
"referenceKind": "foreignKey",
|
|
6127
|
+
"notNull": false,
|
|
6128
|
+
"foreignKey": {
|
|
6129
|
+
"table": "customers",
|
|
6130
|
+
"column": "id",
|
|
6131
|
+
"onDelete": "NO ACTION",
|
|
6132
|
+
"onUpdate": "CASCADE"
|
|
6133
|
+
}
|
|
6134
|
+
},
|
|
6135
|
+
"vendor_id": {
|
|
6136
|
+
"type": "UUID",
|
|
6137
|
+
"referenceKind": "foreignKey",
|
|
6138
|
+
"notNull": false,
|
|
6139
|
+
"foreignKey": {
|
|
6140
|
+
"table": "vendors",
|
|
6141
|
+
"column": "id",
|
|
6142
|
+
"onDelete": "NO ACTION",
|
|
6143
|
+
"onUpdate": "CASCADE"
|
|
6144
|
+
}
|
|
4765
6145
|
}
|
|
4766
6146
|
},
|
|
4767
6147
|
"indexes": [
|
|
@@ -4802,7 +6182,7 @@
|
|
|
4802
6182
|
]
|
|
4803
6183
|
}
|
|
4804
6184
|
],
|
|
4805
|
-
"version": "
|
|
6185
|
+
"version": "97ec77c2"
|
|
4806
6186
|
},
|
|
4807
6187
|
"importPath": "@happyvertical/smrt-commerce"
|
|
4808
6188
|
},
|
|
@@ -4834,31 +6214,16 @@
|
|
|
4834
6214
|
"autoFilter": true,
|
|
4835
6215
|
"required": false,
|
|
4836
6216
|
"autoPopulate": true,
|
|
4837
|
-
"nullable": true,
|
|
4838
|
-
"mode": "optional",
|
|
4839
|
-
"field": "tenantId",
|
|
4840
|
-
"allowSuperAdminBypass": false
|
|
4841
|
-
}
|
|
4842
|
-
}
|
|
4843
|
-
},
|
|
4844
|
-
"contractType": {
|
|
4845
|
-
"type": "text",
|
|
4846
|
-
"required": false
|
|
4847
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
4848
|
-
"_meta": {
|
|
4849
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
4850
|
-
},
|
|
4851
|
-
"enum": [
|
|
4852
|
-
"estimate",
|
|
4853
|
-
"order",
|
|
4854
|
-
"lease",
|
|
4855
|
-
"agreement",
|
|
4856
|
-
"purchase_order",
|
|
4857
|
-
"wholesale_order",
|
|
4858
|
-
"production_order",
|
|
4859
|
-
"cart",
|
|
4860
|
-
"license_sale"
|
|
4861
|
-
]
|
|
6217
|
+
"nullable": true,
|
|
6218
|
+
"mode": "optional",
|
|
6219
|
+
"field": "tenantId",
|
|
6220
|
+
"allowSuperAdminBypass": false
|
|
6221
|
+
}
|
|
6222
|
+
}
|
|
6223
|
+
},
|
|
6224
|
+
"contractType": {
|
|
6225
|
+
"type": "text",
|
|
6226
|
+
"required": false
|
|
4862
6227
|
},
|
|
4863
6228
|
"status": {
|
|
4864
6229
|
"type": "text",
|
|
@@ -4876,22 +6241,6 @@
|
|
|
4876
6241
|
"cancelled"
|
|
4877
6242
|
]
|
|
4878
6243
|
},
|
|
4879
|
-
"customerId": {
|
|
4880
|
-
"type": "foreignKey",
|
|
4881
|
-
"required": false,
|
|
4882
|
-
"related": "Customer",
|
|
4883
|
-
"_meta": {
|
|
4884
|
-
"description": "The customer a sales order or agreement is for."
|
|
4885
|
-
}
|
|
4886
|
-
},
|
|
4887
|
-
"vendorId": {
|
|
4888
|
-
"type": "foreignKey",
|
|
4889
|
-
"required": false,
|
|
4890
|
-
"related": "Vendor",
|
|
4891
|
-
"_meta": {
|
|
4892
|
-
"description": "The vendor a purchase order is placed with."
|
|
4893
|
-
}
|
|
4894
|
-
},
|
|
4895
6244
|
"subtotal": {
|
|
4896
6245
|
"type": "integer",
|
|
4897
6246
|
"required": false,
|
|
@@ -5005,6 +6354,14 @@
|
|
|
5005
6354
|
"_meta": {
|
|
5006
6355
|
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
5007
6356
|
}
|
|
6357
|
+
},
|
|
6358
|
+
"customerId": {
|
|
6359
|
+
"type": "foreignKey",
|
|
6360
|
+
"required": true,
|
|
6361
|
+
"related": "Customer",
|
|
6362
|
+
"_meta": {
|
|
6363
|
+
"required": true
|
|
6364
|
+
}
|
|
5008
6365
|
}
|
|
5009
6366
|
},
|
|
5010
6367
|
"methods": {
|
|
@@ -5080,12 +6437,19 @@
|
|
|
5080
6437
|
"tableName": "contracts",
|
|
5081
6438
|
"tableStrategy": "sti"
|
|
5082
6439
|
},
|
|
5083
|
-
"extends": "
|
|
6440
|
+
"extends": "SalesContract",
|
|
5084
6441
|
"exportName": "Order",
|
|
5085
6442
|
"collectionExportName": "OrderCollection",
|
|
6443
|
+
"validationRules": [
|
|
6444
|
+
{
|
|
6445
|
+
"field": "customerId",
|
|
6446
|
+
"rule": "required",
|
|
6447
|
+
"fieldType": "foreignKey"
|
|
6448
|
+
}
|
|
6449
|
+
],
|
|
5086
6450
|
"schema": {
|
|
5087
6451
|
"tableName": "contracts",
|
|
5088
|
-
"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 \"
|
|
6452
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
5089
6453
|
"columns": {
|
|
5090
6454
|
"id": {
|
|
5091
6455
|
"type": "UUID",
|
|
@@ -5133,28 +6497,6 @@
|
|
|
5133
6497
|
"type": "TEXT",
|
|
5134
6498
|
"notNull": false
|
|
5135
6499
|
},
|
|
5136
|
-
"customer_id": {
|
|
5137
|
-
"type": "UUID",
|
|
5138
|
-
"referenceKind": "foreignKey",
|
|
5139
|
-
"notNull": false,
|
|
5140
|
-
"foreignKey": {
|
|
5141
|
-
"table": "customers",
|
|
5142
|
-
"column": "id",
|
|
5143
|
-
"onDelete": "NO ACTION",
|
|
5144
|
-
"onUpdate": "CASCADE"
|
|
5145
|
-
}
|
|
5146
|
-
},
|
|
5147
|
-
"vendor_id": {
|
|
5148
|
-
"type": "UUID",
|
|
5149
|
-
"referenceKind": "foreignKey",
|
|
5150
|
-
"notNull": false,
|
|
5151
|
-
"foreignKey": {
|
|
5152
|
-
"table": "vendors",
|
|
5153
|
-
"column": "id",
|
|
5154
|
-
"onDelete": "NO ACTION",
|
|
5155
|
-
"onUpdate": "CASCADE"
|
|
5156
|
-
}
|
|
5157
|
-
},
|
|
5158
6500
|
"subtotal": {
|
|
5159
6501
|
"type": "INTEGER",
|
|
5160
6502
|
"notNull": false,
|
|
@@ -5206,6 +6548,28 @@
|
|
|
5206
6548
|
"type": "TEXT",
|
|
5207
6549
|
"notNull": false,
|
|
5208
6550
|
"default": ""
|
|
6551
|
+
},
|
|
6552
|
+
"customer_id": {
|
|
6553
|
+
"type": "UUID",
|
|
6554
|
+
"referenceKind": "foreignKey",
|
|
6555
|
+
"notNull": false,
|
|
6556
|
+
"foreignKey": {
|
|
6557
|
+
"table": "customers",
|
|
6558
|
+
"column": "id",
|
|
6559
|
+
"onDelete": "NO ACTION",
|
|
6560
|
+
"onUpdate": "CASCADE"
|
|
6561
|
+
}
|
|
6562
|
+
},
|
|
6563
|
+
"vendor_id": {
|
|
6564
|
+
"type": "UUID",
|
|
6565
|
+
"referenceKind": "foreignKey",
|
|
6566
|
+
"notNull": false,
|
|
6567
|
+
"foreignKey": {
|
|
6568
|
+
"table": "vendors",
|
|
6569
|
+
"column": "id",
|
|
6570
|
+
"onDelete": "NO ACTION",
|
|
6571
|
+
"onUpdate": "CASCADE"
|
|
6572
|
+
}
|
|
5209
6573
|
}
|
|
5210
6574
|
},
|
|
5211
6575
|
"indexes": [
|
|
@@ -5246,7 +6610,7 @@
|
|
|
5246
6610
|
]
|
|
5247
6611
|
}
|
|
5248
6612
|
],
|
|
5249
|
-
"version": "
|
|
6613
|
+
"version": "de738a76"
|
|
5250
6614
|
},
|
|
5251
6615
|
"importPath": "@happyvertical/smrt-commerce"
|
|
5252
6616
|
},
|
|
@@ -5287,22 +6651,7 @@
|
|
|
5287
6651
|
},
|
|
5288
6652
|
"contractType": {
|
|
5289
6653
|
"type": "text",
|
|
5290
|
-
"required": false
|
|
5291
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
5292
|
-
"_meta": {
|
|
5293
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
5294
|
-
},
|
|
5295
|
-
"enum": [
|
|
5296
|
-
"estimate",
|
|
5297
|
-
"order",
|
|
5298
|
-
"lease",
|
|
5299
|
-
"agreement",
|
|
5300
|
-
"purchase_order",
|
|
5301
|
-
"wholesale_order",
|
|
5302
|
-
"production_order",
|
|
5303
|
-
"cart",
|
|
5304
|
-
"license_sale"
|
|
5305
|
-
]
|
|
6654
|
+
"required": false
|
|
5306
6655
|
},
|
|
5307
6656
|
"status": {
|
|
5308
6657
|
"type": "text",
|
|
@@ -5320,22 +6669,6 @@
|
|
|
5320
6669
|
"cancelled"
|
|
5321
6670
|
]
|
|
5322
6671
|
},
|
|
5323
|
-
"customerId": {
|
|
5324
|
-
"type": "foreignKey",
|
|
5325
|
-
"required": false,
|
|
5326
|
-
"related": "Customer",
|
|
5327
|
-
"_meta": {
|
|
5328
|
-
"description": "The customer a sales order or agreement is for."
|
|
5329
|
-
}
|
|
5330
|
-
},
|
|
5331
|
-
"vendorId": {
|
|
5332
|
-
"type": "foreignKey",
|
|
5333
|
-
"required": false,
|
|
5334
|
-
"related": "Vendor",
|
|
5335
|
-
"_meta": {
|
|
5336
|
-
"description": "The vendor a purchase order is placed with."
|
|
5337
|
-
}
|
|
5338
|
-
},
|
|
5339
6672
|
"subtotal": {
|
|
5340
6673
|
"type": "integer",
|
|
5341
6674
|
"required": false,
|
|
@@ -5449,6 +6782,14 @@
|
|
|
5449
6782
|
"_meta": {
|
|
5450
6783
|
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
5451
6784
|
}
|
|
6785
|
+
},
|
|
6786
|
+
"customerId": {
|
|
6787
|
+
"type": "foreignKey",
|
|
6788
|
+
"required": true,
|
|
6789
|
+
"related": "Customer",
|
|
6790
|
+
"_meta": {
|
|
6791
|
+
"required": true
|
|
6792
|
+
}
|
|
5452
6793
|
}
|
|
5453
6794
|
},
|
|
5454
6795
|
"methods": {
|
|
@@ -5524,12 +6865,19 @@
|
|
|
5524
6865
|
"tableName": "contracts",
|
|
5525
6866
|
"tableStrategy": "sti"
|
|
5526
6867
|
},
|
|
5527
|
-
"extends": "
|
|
6868
|
+
"extends": "SalesContract",
|
|
5528
6869
|
"exportName": "Lease",
|
|
5529
6870
|
"collectionExportName": "LeaseCollection",
|
|
6871
|
+
"validationRules": [
|
|
6872
|
+
{
|
|
6873
|
+
"field": "customerId",
|
|
6874
|
+
"rule": "required",
|
|
6875
|
+
"fieldType": "foreignKey"
|
|
6876
|
+
}
|
|
6877
|
+
],
|
|
5530
6878
|
"schema": {
|
|
5531
6879
|
"tableName": "contracts",
|
|
5532
|
-
"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 \"
|
|
6880
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
5533
6881
|
"columns": {
|
|
5534
6882
|
"id": {
|
|
5535
6883
|
"type": "UUID",
|
|
@@ -5577,28 +6925,6 @@
|
|
|
5577
6925
|
"type": "TEXT",
|
|
5578
6926
|
"notNull": false
|
|
5579
6927
|
},
|
|
5580
|
-
"customer_id": {
|
|
5581
|
-
"type": "UUID",
|
|
5582
|
-
"referenceKind": "foreignKey",
|
|
5583
|
-
"notNull": false,
|
|
5584
|
-
"foreignKey": {
|
|
5585
|
-
"table": "customers",
|
|
5586
|
-
"column": "id",
|
|
5587
|
-
"onDelete": "NO ACTION",
|
|
5588
|
-
"onUpdate": "CASCADE"
|
|
5589
|
-
}
|
|
5590
|
-
},
|
|
5591
|
-
"vendor_id": {
|
|
5592
|
-
"type": "UUID",
|
|
5593
|
-
"referenceKind": "foreignKey",
|
|
5594
|
-
"notNull": false,
|
|
5595
|
-
"foreignKey": {
|
|
5596
|
-
"table": "vendors",
|
|
5597
|
-
"column": "id",
|
|
5598
|
-
"onDelete": "NO ACTION",
|
|
5599
|
-
"onUpdate": "CASCADE"
|
|
5600
|
-
}
|
|
5601
|
-
},
|
|
5602
6928
|
"subtotal": {
|
|
5603
6929
|
"type": "INTEGER",
|
|
5604
6930
|
"notNull": false,
|
|
@@ -5650,6 +6976,28 @@
|
|
|
5650
6976
|
"type": "TEXT",
|
|
5651
6977
|
"notNull": false,
|
|
5652
6978
|
"default": ""
|
|
6979
|
+
},
|
|
6980
|
+
"customer_id": {
|
|
6981
|
+
"type": "UUID",
|
|
6982
|
+
"referenceKind": "foreignKey",
|
|
6983
|
+
"notNull": false,
|
|
6984
|
+
"foreignKey": {
|
|
6985
|
+
"table": "customers",
|
|
6986
|
+
"column": "id",
|
|
6987
|
+
"onDelete": "NO ACTION",
|
|
6988
|
+
"onUpdate": "CASCADE"
|
|
6989
|
+
}
|
|
6990
|
+
},
|
|
6991
|
+
"vendor_id": {
|
|
6992
|
+
"type": "UUID",
|
|
6993
|
+
"referenceKind": "foreignKey",
|
|
6994
|
+
"notNull": false,
|
|
6995
|
+
"foreignKey": {
|
|
6996
|
+
"table": "vendors",
|
|
6997
|
+
"column": "id",
|
|
6998
|
+
"onDelete": "NO ACTION",
|
|
6999
|
+
"onUpdate": "CASCADE"
|
|
7000
|
+
}
|
|
5653
7001
|
}
|
|
5654
7002
|
},
|
|
5655
7003
|
"indexes": [
|
|
@@ -5690,7 +7038,7 @@
|
|
|
5690
7038
|
]
|
|
5691
7039
|
}
|
|
5692
7040
|
],
|
|
5693
|
-
"version": "
|
|
7041
|
+
"version": "efe0fd5d"
|
|
5694
7042
|
},
|
|
5695
7043
|
"importPath": "@happyvertical/smrt-commerce"
|
|
5696
7044
|
},
|
|
@@ -5731,22 +7079,7 @@
|
|
|
5731
7079
|
},
|
|
5732
7080
|
"contractType": {
|
|
5733
7081
|
"type": "text",
|
|
5734
|
-
"required": false
|
|
5735
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
5736
|
-
"_meta": {
|
|
5737
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
5738
|
-
},
|
|
5739
|
-
"enum": [
|
|
5740
|
-
"estimate",
|
|
5741
|
-
"order",
|
|
5742
|
-
"lease",
|
|
5743
|
-
"agreement",
|
|
5744
|
-
"purchase_order",
|
|
5745
|
-
"wholesale_order",
|
|
5746
|
-
"production_order",
|
|
5747
|
-
"cart",
|
|
5748
|
-
"license_sale"
|
|
5749
|
-
]
|
|
7082
|
+
"required": false
|
|
5750
7083
|
},
|
|
5751
7084
|
"status": {
|
|
5752
7085
|
"type": "text",
|
|
@@ -5764,22 +7097,6 @@
|
|
|
5764
7097
|
"cancelled"
|
|
5765
7098
|
]
|
|
5766
7099
|
},
|
|
5767
|
-
"customerId": {
|
|
5768
|
-
"type": "foreignKey",
|
|
5769
|
-
"required": false,
|
|
5770
|
-
"related": "Customer",
|
|
5771
|
-
"_meta": {
|
|
5772
|
-
"description": "The customer a sales order or agreement is for."
|
|
5773
|
-
}
|
|
5774
|
-
},
|
|
5775
|
-
"vendorId": {
|
|
5776
|
-
"type": "foreignKey",
|
|
5777
|
-
"required": false,
|
|
5778
|
-
"related": "Vendor",
|
|
5779
|
-
"_meta": {
|
|
5780
|
-
"description": "The vendor a purchase order is placed with."
|
|
5781
|
-
}
|
|
5782
|
-
},
|
|
5783
7100
|
"subtotal": {
|
|
5784
7101
|
"type": "integer",
|
|
5785
7102
|
"required": false,
|
|
@@ -5893,6 +7210,14 @@
|
|
|
5893
7210
|
"_meta": {
|
|
5894
7211
|
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
5895
7212
|
}
|
|
7213
|
+
},
|
|
7214
|
+
"customerId": {
|
|
7215
|
+
"type": "foreignKey",
|
|
7216
|
+
"required": true,
|
|
7217
|
+
"related": "Customer",
|
|
7218
|
+
"_meta": {
|
|
7219
|
+
"required": true
|
|
7220
|
+
}
|
|
5896
7221
|
}
|
|
5897
7222
|
},
|
|
5898
7223
|
"methods": {
|
|
@@ -5968,12 +7293,19 @@
|
|
|
5968
7293
|
"tableName": "contracts",
|
|
5969
7294
|
"tableStrategy": "sti"
|
|
5970
7295
|
},
|
|
5971
|
-
"extends": "
|
|
7296
|
+
"extends": "SalesContract",
|
|
5972
7297
|
"exportName": "Agreement",
|
|
5973
7298
|
"collectionExportName": "AgreementCollection",
|
|
7299
|
+
"validationRules": [
|
|
7300
|
+
{
|
|
7301
|
+
"field": "customerId",
|
|
7302
|
+
"rule": "required",
|
|
7303
|
+
"fieldType": "foreignKey"
|
|
7304
|
+
}
|
|
7305
|
+
],
|
|
5974
7306
|
"schema": {
|
|
5975
7307
|
"tableName": "contracts",
|
|
5976
|
-
"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 \"
|
|
7308
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
5977
7309
|
"columns": {
|
|
5978
7310
|
"id": {
|
|
5979
7311
|
"type": "UUID",
|
|
@@ -6008,40 +7340,18 @@
|
|
|
6008
7340
|
"notNull": true,
|
|
6009
7341
|
"default": "current_timestamp"
|
|
6010
7342
|
},
|
|
6011
|
-
"tenant_id": {
|
|
6012
|
-
"type": "UUID",
|
|
6013
|
-
"referenceKind": "tenantId",
|
|
6014
|
-
"notNull": false
|
|
6015
|
-
},
|
|
6016
|
-
"contract_type": {
|
|
6017
|
-
"type": "TEXT",
|
|
6018
|
-
"notNull": false
|
|
6019
|
-
},
|
|
6020
|
-
"status": {
|
|
6021
|
-
"type": "TEXT",
|
|
6022
|
-
"notNull": false
|
|
6023
|
-
},
|
|
6024
|
-
"customer_id": {
|
|
6025
|
-
"type": "UUID",
|
|
6026
|
-
"referenceKind": "foreignKey",
|
|
6027
|
-
"notNull": false,
|
|
6028
|
-
"foreignKey": {
|
|
6029
|
-
"table": "customers",
|
|
6030
|
-
"column": "id",
|
|
6031
|
-
"onDelete": "NO ACTION",
|
|
6032
|
-
"onUpdate": "CASCADE"
|
|
6033
|
-
}
|
|
6034
|
-
},
|
|
6035
|
-
"vendor_id": {
|
|
6036
|
-
"type": "UUID",
|
|
6037
|
-
"referenceKind": "foreignKey",
|
|
6038
|
-
"notNull": false,
|
|
6039
|
-
"foreignKey": {
|
|
6040
|
-
"table": "vendors",
|
|
6041
|
-
"column": "id",
|
|
6042
|
-
"onDelete": "NO ACTION",
|
|
6043
|
-
"onUpdate": "CASCADE"
|
|
6044
|
-
}
|
|
7343
|
+
"tenant_id": {
|
|
7344
|
+
"type": "UUID",
|
|
7345
|
+
"referenceKind": "tenantId",
|
|
7346
|
+
"notNull": false
|
|
7347
|
+
},
|
|
7348
|
+
"contract_type": {
|
|
7349
|
+
"type": "TEXT",
|
|
7350
|
+
"notNull": false
|
|
7351
|
+
},
|
|
7352
|
+
"status": {
|
|
7353
|
+
"type": "TEXT",
|
|
7354
|
+
"notNull": false
|
|
6045
7355
|
},
|
|
6046
7356
|
"subtotal": {
|
|
6047
7357
|
"type": "INTEGER",
|
|
@@ -6094,6 +7404,28 @@
|
|
|
6094
7404
|
"type": "TEXT",
|
|
6095
7405
|
"notNull": false,
|
|
6096
7406
|
"default": ""
|
|
7407
|
+
},
|
|
7408
|
+
"customer_id": {
|
|
7409
|
+
"type": "UUID",
|
|
7410
|
+
"referenceKind": "foreignKey",
|
|
7411
|
+
"notNull": false,
|
|
7412
|
+
"foreignKey": {
|
|
7413
|
+
"table": "customers",
|
|
7414
|
+
"column": "id",
|
|
7415
|
+
"onDelete": "NO ACTION",
|
|
7416
|
+
"onUpdate": "CASCADE"
|
|
7417
|
+
}
|
|
7418
|
+
},
|
|
7419
|
+
"vendor_id": {
|
|
7420
|
+
"type": "UUID",
|
|
7421
|
+
"referenceKind": "foreignKey",
|
|
7422
|
+
"notNull": false,
|
|
7423
|
+
"foreignKey": {
|
|
7424
|
+
"table": "vendors",
|
|
7425
|
+
"column": "id",
|
|
7426
|
+
"onDelete": "NO ACTION",
|
|
7427
|
+
"onUpdate": "CASCADE"
|
|
7428
|
+
}
|
|
6097
7429
|
}
|
|
6098
7430
|
},
|
|
6099
7431
|
"indexes": [
|
|
@@ -6134,7 +7466,7 @@
|
|
|
6134
7466
|
]
|
|
6135
7467
|
}
|
|
6136
7468
|
],
|
|
6137
|
-
"version": "
|
|
7469
|
+
"version": "4fb506a2"
|
|
6138
7470
|
},
|
|
6139
7471
|
"importPath": "@happyvertical/smrt-commerce"
|
|
6140
7472
|
},
|
|
@@ -6175,22 +7507,7 @@
|
|
|
6175
7507
|
},
|
|
6176
7508
|
"contractType": {
|
|
6177
7509
|
"type": "text",
|
|
6178
|
-
"required": false
|
|
6179
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
6180
|
-
"_meta": {
|
|
6181
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
6182
|
-
},
|
|
6183
|
-
"enum": [
|
|
6184
|
-
"estimate",
|
|
6185
|
-
"order",
|
|
6186
|
-
"lease",
|
|
6187
|
-
"agreement",
|
|
6188
|
-
"purchase_order",
|
|
6189
|
-
"wholesale_order",
|
|
6190
|
-
"production_order",
|
|
6191
|
-
"cart",
|
|
6192
|
-
"license_sale"
|
|
6193
|
-
]
|
|
7510
|
+
"required": false
|
|
6194
7511
|
},
|
|
6195
7512
|
"status": {
|
|
6196
7513
|
"type": "text",
|
|
@@ -6208,22 +7525,6 @@
|
|
|
6208
7525
|
"cancelled"
|
|
6209
7526
|
]
|
|
6210
7527
|
},
|
|
6211
|
-
"customerId": {
|
|
6212
|
-
"type": "foreignKey",
|
|
6213
|
-
"required": false,
|
|
6214
|
-
"related": "Customer",
|
|
6215
|
-
"_meta": {
|
|
6216
|
-
"description": "The customer a sales order or agreement is for."
|
|
6217
|
-
}
|
|
6218
|
-
},
|
|
6219
|
-
"vendorId": {
|
|
6220
|
-
"type": "foreignKey",
|
|
6221
|
-
"required": false,
|
|
6222
|
-
"related": "Vendor",
|
|
6223
|
-
"_meta": {
|
|
6224
|
-
"description": "The vendor a purchase order is placed with."
|
|
6225
|
-
}
|
|
6226
|
-
},
|
|
6227
7528
|
"subtotal": {
|
|
6228
7529
|
"type": "integer",
|
|
6229
7530
|
"required": false,
|
|
@@ -6338,6 +7639,14 @@
|
|
|
6338
7639
|
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
6339
7640
|
}
|
|
6340
7641
|
},
|
|
7642
|
+
"vendorId": {
|
|
7643
|
+
"type": "foreignKey",
|
|
7644
|
+
"required": true,
|
|
7645
|
+
"related": "Vendor",
|
|
7646
|
+
"_meta": {
|
|
7647
|
+
"required": true
|
|
7648
|
+
}
|
|
7649
|
+
},
|
|
6341
7650
|
"expectedDate": {
|
|
6342
7651
|
"type": "meta",
|
|
6343
7652
|
"required": false,
|
|
@@ -6432,12 +7741,19 @@
|
|
|
6432
7741
|
"tableName": "contracts",
|
|
6433
7742
|
"tableStrategy": "sti"
|
|
6434
7743
|
},
|
|
6435
|
-
"extends": "
|
|
7744
|
+
"extends": "PurchaseContract",
|
|
6436
7745
|
"exportName": "PurchaseOrder",
|
|
6437
7746
|
"collectionExportName": "PurchaseOrderCollection",
|
|
7747
|
+
"validationRules": [
|
|
7748
|
+
{
|
|
7749
|
+
"field": "vendorId",
|
|
7750
|
+
"rule": "required",
|
|
7751
|
+
"fieldType": "foreignKey"
|
|
7752
|
+
}
|
|
7753
|
+
],
|
|
6438
7754
|
"schema": {
|
|
6439
7755
|
"tableName": "contracts",
|
|
6440
|
-
"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 \"
|
|
7756
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
6441
7757
|
"columns": {
|
|
6442
7758
|
"id": {
|
|
6443
7759
|
"type": "UUID",
|
|
@@ -6485,28 +7801,6 @@
|
|
|
6485
7801
|
"type": "TEXT",
|
|
6486
7802
|
"notNull": false
|
|
6487
7803
|
},
|
|
6488
|
-
"customer_id": {
|
|
6489
|
-
"type": "UUID",
|
|
6490
|
-
"referenceKind": "foreignKey",
|
|
6491
|
-
"notNull": false,
|
|
6492
|
-
"foreignKey": {
|
|
6493
|
-
"table": "customers",
|
|
6494
|
-
"column": "id",
|
|
6495
|
-
"onDelete": "NO ACTION",
|
|
6496
|
-
"onUpdate": "CASCADE"
|
|
6497
|
-
}
|
|
6498
|
-
},
|
|
6499
|
-
"vendor_id": {
|
|
6500
|
-
"type": "UUID",
|
|
6501
|
-
"referenceKind": "foreignKey",
|
|
6502
|
-
"notNull": false,
|
|
6503
|
-
"foreignKey": {
|
|
6504
|
-
"table": "vendors",
|
|
6505
|
-
"column": "id",
|
|
6506
|
-
"onDelete": "NO ACTION",
|
|
6507
|
-
"onUpdate": "CASCADE"
|
|
6508
|
-
}
|
|
6509
|
-
},
|
|
6510
7804
|
"subtotal": {
|
|
6511
7805
|
"type": "INTEGER",
|
|
6512
7806
|
"notNull": false,
|
|
@@ -6558,6 +7852,28 @@
|
|
|
6558
7852
|
"type": "TEXT",
|
|
6559
7853
|
"notNull": false,
|
|
6560
7854
|
"default": ""
|
|
7855
|
+
},
|
|
7856
|
+
"customer_id": {
|
|
7857
|
+
"type": "UUID",
|
|
7858
|
+
"referenceKind": "foreignKey",
|
|
7859
|
+
"notNull": false,
|
|
7860
|
+
"foreignKey": {
|
|
7861
|
+
"table": "customers",
|
|
7862
|
+
"column": "id",
|
|
7863
|
+
"onDelete": "NO ACTION",
|
|
7864
|
+
"onUpdate": "CASCADE"
|
|
7865
|
+
}
|
|
7866
|
+
},
|
|
7867
|
+
"vendor_id": {
|
|
7868
|
+
"type": "UUID",
|
|
7869
|
+
"referenceKind": "foreignKey",
|
|
7870
|
+
"notNull": false,
|
|
7871
|
+
"foreignKey": {
|
|
7872
|
+
"table": "vendors",
|
|
7873
|
+
"column": "id",
|
|
7874
|
+
"onDelete": "NO ACTION",
|
|
7875
|
+
"onUpdate": "CASCADE"
|
|
7876
|
+
}
|
|
6561
7877
|
}
|
|
6562
7878
|
},
|
|
6563
7879
|
"indexes": [
|
|
@@ -6598,7 +7914,7 @@
|
|
|
6598
7914
|
]
|
|
6599
7915
|
}
|
|
6600
7916
|
],
|
|
6601
|
-
"version": "
|
|
7917
|
+
"version": "6eabe226"
|
|
6602
7918
|
},
|
|
6603
7919
|
"importPath": "@happyvertical/smrt-commerce"
|
|
6604
7920
|
},
|
|
@@ -6639,22 +7955,7 @@
|
|
|
6639
7955
|
},
|
|
6640
7956
|
"contractType": {
|
|
6641
7957
|
"type": "text",
|
|
6642
|
-
"required": false
|
|
6643
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
6644
|
-
"_meta": {
|
|
6645
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
6646
|
-
},
|
|
6647
|
-
"enum": [
|
|
6648
|
-
"estimate",
|
|
6649
|
-
"order",
|
|
6650
|
-
"lease",
|
|
6651
|
-
"agreement",
|
|
6652
|
-
"purchase_order",
|
|
6653
|
-
"wholesale_order",
|
|
6654
|
-
"production_order",
|
|
6655
|
-
"cart",
|
|
6656
|
-
"license_sale"
|
|
6657
|
-
]
|
|
7958
|
+
"required": false
|
|
6658
7959
|
},
|
|
6659
7960
|
"status": {
|
|
6660
7961
|
"type": "text",
|
|
@@ -6672,22 +7973,6 @@
|
|
|
6672
7973
|
"cancelled"
|
|
6673
7974
|
]
|
|
6674
7975
|
},
|
|
6675
|
-
"customerId": {
|
|
6676
|
-
"type": "foreignKey",
|
|
6677
|
-
"required": false,
|
|
6678
|
-
"related": "Customer",
|
|
6679
|
-
"_meta": {
|
|
6680
|
-
"description": "The customer a sales order or agreement is for."
|
|
6681
|
-
}
|
|
6682
|
-
},
|
|
6683
|
-
"vendorId": {
|
|
6684
|
-
"type": "foreignKey",
|
|
6685
|
-
"required": false,
|
|
6686
|
-
"related": "Vendor",
|
|
6687
|
-
"_meta": {
|
|
6688
|
-
"description": "The vendor a purchase order is placed with."
|
|
6689
|
-
}
|
|
6690
|
-
},
|
|
6691
7976
|
"subtotal": {
|
|
6692
7977
|
"type": "integer",
|
|
6693
7978
|
"required": false,
|
|
@@ -6801,6 +8086,14 @@
|
|
|
6801
8086
|
"_meta": {
|
|
6802
8087
|
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
6803
8088
|
}
|
|
8089
|
+
},
|
|
8090
|
+
"customerId": {
|
|
8091
|
+
"type": "foreignKey",
|
|
8092
|
+
"required": true,
|
|
8093
|
+
"related": "Customer",
|
|
8094
|
+
"_meta": {
|
|
8095
|
+
"required": true
|
|
8096
|
+
}
|
|
6804
8097
|
}
|
|
6805
8098
|
},
|
|
6806
8099
|
"methods": {
|
|
@@ -6876,12 +8169,19 @@
|
|
|
6876
8169
|
"tableName": "contracts",
|
|
6877
8170
|
"tableStrategy": "sti"
|
|
6878
8171
|
},
|
|
6879
|
-
"extends": "
|
|
8172
|
+
"extends": "SalesContract",
|
|
6880
8173
|
"exportName": "WholesaleOrder",
|
|
6881
8174
|
"collectionExportName": "WholesaleOrderCollection",
|
|
8175
|
+
"validationRules": [
|
|
8176
|
+
{
|
|
8177
|
+
"field": "customerId",
|
|
8178
|
+
"rule": "required",
|
|
8179
|
+
"fieldType": "foreignKey"
|
|
8180
|
+
}
|
|
8181
|
+
],
|
|
6882
8182
|
"schema": {
|
|
6883
8183
|
"tableName": "contracts",
|
|
6884
|
-
"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 \"
|
|
8184
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
6885
8185
|
"columns": {
|
|
6886
8186
|
"id": {
|
|
6887
8187
|
"type": "UUID",
|
|
@@ -6929,28 +8229,6 @@
|
|
|
6929
8229
|
"type": "TEXT",
|
|
6930
8230
|
"notNull": false
|
|
6931
8231
|
},
|
|
6932
|
-
"customer_id": {
|
|
6933
|
-
"type": "UUID",
|
|
6934
|
-
"referenceKind": "foreignKey",
|
|
6935
|
-
"notNull": false,
|
|
6936
|
-
"foreignKey": {
|
|
6937
|
-
"table": "customers",
|
|
6938
|
-
"column": "id",
|
|
6939
|
-
"onDelete": "NO ACTION",
|
|
6940
|
-
"onUpdate": "CASCADE"
|
|
6941
|
-
}
|
|
6942
|
-
},
|
|
6943
|
-
"vendor_id": {
|
|
6944
|
-
"type": "UUID",
|
|
6945
|
-
"referenceKind": "foreignKey",
|
|
6946
|
-
"notNull": false,
|
|
6947
|
-
"foreignKey": {
|
|
6948
|
-
"table": "vendors",
|
|
6949
|
-
"column": "id",
|
|
6950
|
-
"onDelete": "NO ACTION",
|
|
6951
|
-
"onUpdate": "CASCADE"
|
|
6952
|
-
}
|
|
6953
|
-
},
|
|
6954
8232
|
"subtotal": {
|
|
6955
8233
|
"type": "INTEGER",
|
|
6956
8234
|
"notNull": false,
|
|
@@ -7002,6 +8280,28 @@
|
|
|
7002
8280
|
"type": "TEXT",
|
|
7003
8281
|
"notNull": false,
|
|
7004
8282
|
"default": ""
|
|
8283
|
+
},
|
|
8284
|
+
"customer_id": {
|
|
8285
|
+
"type": "UUID",
|
|
8286
|
+
"referenceKind": "foreignKey",
|
|
8287
|
+
"notNull": false,
|
|
8288
|
+
"foreignKey": {
|
|
8289
|
+
"table": "customers",
|
|
8290
|
+
"column": "id",
|
|
8291
|
+
"onDelete": "NO ACTION",
|
|
8292
|
+
"onUpdate": "CASCADE"
|
|
8293
|
+
}
|
|
8294
|
+
},
|
|
8295
|
+
"vendor_id": {
|
|
8296
|
+
"type": "UUID",
|
|
8297
|
+
"referenceKind": "foreignKey",
|
|
8298
|
+
"notNull": false,
|
|
8299
|
+
"foreignKey": {
|
|
8300
|
+
"table": "vendors",
|
|
8301
|
+
"column": "id",
|
|
8302
|
+
"onDelete": "NO ACTION",
|
|
8303
|
+
"onUpdate": "CASCADE"
|
|
8304
|
+
}
|
|
7005
8305
|
}
|
|
7006
8306
|
},
|
|
7007
8307
|
"indexes": [
|
|
@@ -7042,7 +8342,7 @@
|
|
|
7042
8342
|
]
|
|
7043
8343
|
}
|
|
7044
8344
|
],
|
|
7045
|
-
"version": "
|
|
8345
|
+
"version": "b7dcf847"
|
|
7046
8346
|
},
|
|
7047
8347
|
"importPath": "@happyvertical/smrt-commerce"
|
|
7048
8348
|
},
|
|
@@ -7083,22 +8383,7 @@
|
|
|
7083
8383
|
},
|
|
7084
8384
|
"contractType": {
|
|
7085
8385
|
"type": "text",
|
|
7086
|
-
"required": false
|
|
7087
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
7088
|
-
"_meta": {
|
|
7089
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
7090
|
-
},
|
|
7091
|
-
"enum": [
|
|
7092
|
-
"estimate",
|
|
7093
|
-
"order",
|
|
7094
|
-
"lease",
|
|
7095
|
-
"agreement",
|
|
7096
|
-
"purchase_order",
|
|
7097
|
-
"wholesale_order",
|
|
7098
|
-
"production_order",
|
|
7099
|
-
"cart",
|
|
7100
|
-
"license_sale"
|
|
7101
|
-
]
|
|
8386
|
+
"required": false
|
|
7102
8387
|
},
|
|
7103
8388
|
"status": {
|
|
7104
8389
|
"type": "text",
|
|
@@ -7116,22 +8401,6 @@
|
|
|
7116
8401
|
"cancelled"
|
|
7117
8402
|
]
|
|
7118
8403
|
},
|
|
7119
|
-
"customerId": {
|
|
7120
|
-
"type": "foreignKey",
|
|
7121
|
-
"required": false,
|
|
7122
|
-
"related": "Customer",
|
|
7123
|
-
"_meta": {
|
|
7124
|
-
"description": "The customer a sales order or agreement is for."
|
|
7125
|
-
}
|
|
7126
|
-
},
|
|
7127
|
-
"vendorId": {
|
|
7128
|
-
"type": "foreignKey",
|
|
7129
|
-
"required": false,
|
|
7130
|
-
"related": "Vendor",
|
|
7131
|
-
"_meta": {
|
|
7132
|
-
"description": "The vendor a purchase order is placed with."
|
|
7133
|
-
}
|
|
7134
|
-
},
|
|
7135
8404
|
"subtotal": {
|
|
7136
8405
|
"type": "integer",
|
|
7137
8406
|
"required": false,
|
|
@@ -7246,6 +8515,14 @@
|
|
|
7246
8515
|
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
7247
8516
|
}
|
|
7248
8517
|
},
|
|
8518
|
+
"vendorId": {
|
|
8519
|
+
"type": "foreignKey",
|
|
8520
|
+
"required": false,
|
|
8521
|
+
"related": "Vendor",
|
|
8522
|
+
"_meta": {
|
|
8523
|
+
"description": "The vendor a purchase order is placed with."
|
|
8524
|
+
}
|
|
8525
|
+
},
|
|
7249
8526
|
"productId": {
|
|
7250
8527
|
"type": "meta",
|
|
7251
8528
|
"required": false,
|
|
@@ -7336,12 +8613,12 @@
|
|
|
7336
8613
|
"tableName": "contracts",
|
|
7337
8614
|
"tableStrategy": "sti"
|
|
7338
8615
|
},
|
|
7339
|
-
"extends": "
|
|
8616
|
+
"extends": "PurchaseContract",
|
|
7340
8617
|
"exportName": "ProductionOrder",
|
|
7341
8618
|
"collectionExportName": "ProductionOrderCollection",
|
|
7342
8619
|
"schema": {
|
|
7343
8620
|
"tableName": "contracts",
|
|
7344
|
-
"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 \"
|
|
8621
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
7345
8622
|
"columns": {
|
|
7346
8623
|
"id": {
|
|
7347
8624
|
"type": "UUID",
|
|
@@ -7389,28 +8666,6 @@
|
|
|
7389
8666
|
"type": "TEXT",
|
|
7390
8667
|
"notNull": false
|
|
7391
8668
|
},
|
|
7392
|
-
"customer_id": {
|
|
7393
|
-
"type": "UUID",
|
|
7394
|
-
"referenceKind": "foreignKey",
|
|
7395
|
-
"notNull": false,
|
|
7396
|
-
"foreignKey": {
|
|
7397
|
-
"table": "customers",
|
|
7398
|
-
"column": "id",
|
|
7399
|
-
"onDelete": "NO ACTION",
|
|
7400
|
-
"onUpdate": "CASCADE"
|
|
7401
|
-
}
|
|
7402
|
-
},
|
|
7403
|
-
"vendor_id": {
|
|
7404
|
-
"type": "UUID",
|
|
7405
|
-
"referenceKind": "foreignKey",
|
|
7406
|
-
"notNull": false,
|
|
7407
|
-
"foreignKey": {
|
|
7408
|
-
"table": "vendors",
|
|
7409
|
-
"column": "id",
|
|
7410
|
-
"onDelete": "NO ACTION",
|
|
7411
|
-
"onUpdate": "CASCADE"
|
|
7412
|
-
}
|
|
7413
|
-
},
|
|
7414
8669
|
"subtotal": {
|
|
7415
8670
|
"type": "INTEGER",
|
|
7416
8671
|
"notNull": false,
|
|
@@ -7462,6 +8717,28 @@
|
|
|
7462
8717
|
"type": "TEXT",
|
|
7463
8718
|
"notNull": false,
|
|
7464
8719
|
"default": ""
|
|
8720
|
+
},
|
|
8721
|
+
"customer_id": {
|
|
8722
|
+
"type": "UUID",
|
|
8723
|
+
"referenceKind": "foreignKey",
|
|
8724
|
+
"notNull": false,
|
|
8725
|
+
"foreignKey": {
|
|
8726
|
+
"table": "customers",
|
|
8727
|
+
"column": "id",
|
|
8728
|
+
"onDelete": "NO ACTION",
|
|
8729
|
+
"onUpdate": "CASCADE"
|
|
8730
|
+
}
|
|
8731
|
+
},
|
|
8732
|
+
"vendor_id": {
|
|
8733
|
+
"type": "UUID",
|
|
8734
|
+
"referenceKind": "foreignKey",
|
|
8735
|
+
"notNull": false,
|
|
8736
|
+
"foreignKey": {
|
|
8737
|
+
"table": "vendors",
|
|
8738
|
+
"column": "id",
|
|
8739
|
+
"onDelete": "NO ACTION",
|
|
8740
|
+
"onUpdate": "CASCADE"
|
|
8741
|
+
}
|
|
7465
8742
|
}
|
|
7466
8743
|
},
|
|
7467
8744
|
"indexes": [
|
|
@@ -7502,7 +8779,7 @@
|
|
|
7502
8779
|
]
|
|
7503
8780
|
}
|
|
7504
8781
|
],
|
|
7505
|
-
"version": "
|
|
8782
|
+
"version": "d9bb954b"
|
|
7506
8783
|
},
|
|
7507
8784
|
"importPath": "@happyvertical/smrt-commerce"
|
|
7508
8785
|
},
|
|
@@ -7543,22 +8820,7 @@
|
|
|
7543
8820
|
},
|
|
7544
8821
|
"contractType": {
|
|
7545
8822
|
"type": "text",
|
|
7546
|
-
"required": false
|
|
7547
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
7548
|
-
"_meta": {
|
|
7549
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
7550
|
-
},
|
|
7551
|
-
"enum": [
|
|
7552
|
-
"estimate",
|
|
7553
|
-
"order",
|
|
7554
|
-
"lease",
|
|
7555
|
-
"agreement",
|
|
7556
|
-
"purchase_order",
|
|
7557
|
-
"wholesale_order",
|
|
7558
|
-
"production_order",
|
|
7559
|
-
"cart",
|
|
7560
|
-
"license_sale"
|
|
7561
|
-
]
|
|
8823
|
+
"required": false
|
|
7562
8824
|
},
|
|
7563
8825
|
"status": {
|
|
7564
8826
|
"type": "text",
|
|
@@ -7576,22 +8838,6 @@
|
|
|
7576
8838
|
"cancelled"
|
|
7577
8839
|
]
|
|
7578
8840
|
},
|
|
7579
|
-
"customerId": {
|
|
7580
|
-
"type": "foreignKey",
|
|
7581
|
-
"required": false,
|
|
7582
|
-
"related": "Customer",
|
|
7583
|
-
"_meta": {
|
|
7584
|
-
"description": "The customer a sales order or agreement is for."
|
|
7585
|
-
}
|
|
7586
|
-
},
|
|
7587
|
-
"vendorId": {
|
|
7588
|
-
"type": "foreignKey",
|
|
7589
|
-
"required": false,
|
|
7590
|
-
"related": "Vendor",
|
|
7591
|
-
"_meta": {
|
|
7592
|
-
"description": "The vendor a purchase order is placed with."
|
|
7593
|
-
}
|
|
7594
|
-
},
|
|
7595
8841
|
"subtotal": {
|
|
7596
8842
|
"type": "integer",
|
|
7597
8843
|
"required": false,
|
|
@@ -7705,6 +8951,14 @@
|
|
|
7705
8951
|
"_meta": {
|
|
7706
8952
|
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
7707
8953
|
}
|
|
8954
|
+
},
|
|
8955
|
+
"customerId": {
|
|
8956
|
+
"type": "foreignKey",
|
|
8957
|
+
"required": false,
|
|
8958
|
+
"related": "Customer",
|
|
8959
|
+
"_meta": {
|
|
8960
|
+
"description": "The customer a sales order or agreement is for."
|
|
8961
|
+
}
|
|
7708
8962
|
}
|
|
7709
8963
|
},
|
|
7710
8964
|
"methods": {
|
|
@@ -7780,12 +9034,12 @@
|
|
|
7780
9034
|
"tableName": "contracts",
|
|
7781
9035
|
"tableStrategy": "sti"
|
|
7782
9036
|
},
|
|
7783
|
-
"extends": "
|
|
9037
|
+
"extends": "SalesContract",
|
|
7784
9038
|
"exportName": "Cart",
|
|
7785
9039
|
"collectionExportName": "CartCollection",
|
|
7786
9040
|
"schema": {
|
|
7787
9041
|
"tableName": "contracts",
|
|
7788
|
-
"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 \"
|
|
9042
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
7789
9043
|
"columns": {
|
|
7790
9044
|
"id": {
|
|
7791
9045
|
"type": "UUID",
|
|
@@ -7833,28 +9087,6 @@
|
|
|
7833
9087
|
"type": "TEXT",
|
|
7834
9088
|
"notNull": false
|
|
7835
9089
|
},
|
|
7836
|
-
"customer_id": {
|
|
7837
|
-
"type": "UUID",
|
|
7838
|
-
"referenceKind": "foreignKey",
|
|
7839
|
-
"notNull": false,
|
|
7840
|
-
"foreignKey": {
|
|
7841
|
-
"table": "customers",
|
|
7842
|
-
"column": "id",
|
|
7843
|
-
"onDelete": "NO ACTION",
|
|
7844
|
-
"onUpdate": "CASCADE"
|
|
7845
|
-
}
|
|
7846
|
-
},
|
|
7847
|
-
"vendor_id": {
|
|
7848
|
-
"type": "UUID",
|
|
7849
|
-
"referenceKind": "foreignKey",
|
|
7850
|
-
"notNull": false,
|
|
7851
|
-
"foreignKey": {
|
|
7852
|
-
"table": "vendors",
|
|
7853
|
-
"column": "id",
|
|
7854
|
-
"onDelete": "NO ACTION",
|
|
7855
|
-
"onUpdate": "CASCADE"
|
|
7856
|
-
}
|
|
7857
|
-
},
|
|
7858
9090
|
"subtotal": {
|
|
7859
9091
|
"type": "INTEGER",
|
|
7860
9092
|
"notNull": false,
|
|
@@ -7906,6 +9138,28 @@
|
|
|
7906
9138
|
"type": "TEXT",
|
|
7907
9139
|
"notNull": false,
|
|
7908
9140
|
"default": ""
|
|
9141
|
+
},
|
|
9142
|
+
"customer_id": {
|
|
9143
|
+
"type": "UUID",
|
|
9144
|
+
"referenceKind": "foreignKey",
|
|
9145
|
+
"notNull": false,
|
|
9146
|
+
"foreignKey": {
|
|
9147
|
+
"table": "customers",
|
|
9148
|
+
"column": "id",
|
|
9149
|
+
"onDelete": "NO ACTION",
|
|
9150
|
+
"onUpdate": "CASCADE"
|
|
9151
|
+
}
|
|
9152
|
+
},
|
|
9153
|
+
"vendor_id": {
|
|
9154
|
+
"type": "UUID",
|
|
9155
|
+
"referenceKind": "foreignKey",
|
|
9156
|
+
"notNull": false,
|
|
9157
|
+
"foreignKey": {
|
|
9158
|
+
"table": "vendors",
|
|
9159
|
+
"column": "id",
|
|
9160
|
+
"onDelete": "NO ACTION",
|
|
9161
|
+
"onUpdate": "CASCADE"
|
|
9162
|
+
}
|
|
7909
9163
|
}
|
|
7910
9164
|
},
|
|
7911
9165
|
"indexes": [
|
|
@@ -7946,7 +9200,7 @@
|
|
|
7946
9200
|
]
|
|
7947
9201
|
}
|
|
7948
9202
|
],
|
|
7949
|
-
"version": "
|
|
9203
|
+
"version": "43023a03"
|
|
7950
9204
|
},
|
|
7951
9205
|
"importPath": "@happyvertical/smrt-commerce"
|
|
7952
9206
|
},
|
|
@@ -7987,22 +9241,7 @@
|
|
|
7987
9241
|
},
|
|
7988
9242
|
"contractType": {
|
|
7989
9243
|
"type": "text",
|
|
7990
|
-
"required": false
|
|
7991
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on.",
|
|
7992
|
-
"_meta": {
|
|
7993
|
-
"description": "The kind of contract: order, estimate, lease, agreement and so on."
|
|
7994
|
-
},
|
|
7995
|
-
"enum": [
|
|
7996
|
-
"estimate",
|
|
7997
|
-
"order",
|
|
7998
|
-
"lease",
|
|
7999
|
-
"agreement",
|
|
8000
|
-
"purchase_order",
|
|
8001
|
-
"wholesale_order",
|
|
8002
|
-
"production_order",
|
|
8003
|
-
"cart",
|
|
8004
|
-
"license_sale"
|
|
8005
|
-
]
|
|
9244
|
+
"required": false
|
|
8006
9245
|
},
|
|
8007
9246
|
"status": {
|
|
8008
9247
|
"type": "text",
|
|
@@ -8020,22 +9259,6 @@
|
|
|
8020
9259
|
"cancelled"
|
|
8021
9260
|
]
|
|
8022
9261
|
},
|
|
8023
|
-
"customerId": {
|
|
8024
|
-
"type": "foreignKey",
|
|
8025
|
-
"required": false,
|
|
8026
|
-
"related": "Customer",
|
|
8027
|
-
"_meta": {
|
|
8028
|
-
"description": "The customer a sales order or agreement is for."
|
|
8029
|
-
}
|
|
8030
|
-
},
|
|
8031
|
-
"vendorId": {
|
|
8032
|
-
"type": "foreignKey",
|
|
8033
|
-
"required": false,
|
|
8034
|
-
"related": "Vendor",
|
|
8035
|
-
"_meta": {
|
|
8036
|
-
"description": "The vendor a purchase order is placed with."
|
|
8037
|
-
}
|
|
8038
|
-
},
|
|
8039
9262
|
"subtotal": {
|
|
8040
9263
|
"type": "integer",
|
|
8041
9264
|
"required": false,
|
|
@@ -8150,6 +9373,14 @@
|
|
|
8150
9373
|
"description": "Where it came from, for example your shop, a marketplace or a phone call."
|
|
8151
9374
|
}
|
|
8152
9375
|
},
|
|
9376
|
+
"customerId": {
|
|
9377
|
+
"type": "foreignKey",
|
|
9378
|
+
"required": false,
|
|
9379
|
+
"related": "Customer",
|
|
9380
|
+
"_meta": {
|
|
9381
|
+
"description": "The customer a sales order or agreement is for."
|
|
9382
|
+
}
|
|
9383
|
+
},
|
|
8153
9384
|
"skuId": {
|
|
8154
9385
|
"type": "meta",
|
|
8155
9386
|
"required": false,
|
|
@@ -8360,12 +9591,12 @@
|
|
|
8360
9591
|
"tableName": "contracts",
|
|
8361
9592
|
"tableStrategy": "sti"
|
|
8362
9593
|
},
|
|
8363
|
-
"extends": "
|
|
9594
|
+
"extends": "SalesContract",
|
|
8364
9595
|
"exportName": "LicenseSale",
|
|
8365
9596
|
"collectionExportName": "LicenseSaleCollection",
|
|
8366
9597
|
"schema": {
|
|
8367
9598
|
"tableName": "contracts",
|
|
8368
|
-
"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 \"
|
|
9599
|
+
"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 \"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 \"customer_id\" UUID,\n \"vendor_id\" UUID\n);",
|
|
8369
9600
|
"columns": {
|
|
8370
9601
|
"id": {
|
|
8371
9602
|
"type": "UUID",
|
|
@@ -8413,28 +9644,6 @@
|
|
|
8413
9644
|
"type": "TEXT",
|
|
8414
9645
|
"notNull": false
|
|
8415
9646
|
},
|
|
8416
|
-
"customer_id": {
|
|
8417
|
-
"type": "UUID",
|
|
8418
|
-
"referenceKind": "foreignKey",
|
|
8419
|
-
"notNull": false,
|
|
8420
|
-
"foreignKey": {
|
|
8421
|
-
"table": "customers",
|
|
8422
|
-
"column": "id",
|
|
8423
|
-
"onDelete": "NO ACTION",
|
|
8424
|
-
"onUpdate": "CASCADE"
|
|
8425
|
-
}
|
|
8426
|
-
},
|
|
8427
|
-
"vendor_id": {
|
|
8428
|
-
"type": "UUID",
|
|
8429
|
-
"referenceKind": "foreignKey",
|
|
8430
|
-
"notNull": false,
|
|
8431
|
-
"foreignKey": {
|
|
8432
|
-
"table": "vendors",
|
|
8433
|
-
"column": "id",
|
|
8434
|
-
"onDelete": "NO ACTION",
|
|
8435
|
-
"onUpdate": "CASCADE"
|
|
8436
|
-
}
|
|
8437
|
-
},
|
|
8438
9647
|
"subtotal": {
|
|
8439
9648
|
"type": "INTEGER",
|
|
8440
9649
|
"notNull": false,
|
|
@@ -8486,6 +9695,28 @@
|
|
|
8486
9695
|
"type": "TEXT",
|
|
8487
9696
|
"notNull": false,
|
|
8488
9697
|
"default": ""
|
|
9698
|
+
},
|
|
9699
|
+
"customer_id": {
|
|
9700
|
+
"type": "UUID",
|
|
9701
|
+
"referenceKind": "foreignKey",
|
|
9702
|
+
"notNull": false,
|
|
9703
|
+
"foreignKey": {
|
|
9704
|
+
"table": "customers",
|
|
9705
|
+
"column": "id",
|
|
9706
|
+
"onDelete": "NO ACTION",
|
|
9707
|
+
"onUpdate": "CASCADE"
|
|
9708
|
+
}
|
|
9709
|
+
},
|
|
9710
|
+
"vendor_id": {
|
|
9711
|
+
"type": "UUID",
|
|
9712
|
+
"referenceKind": "foreignKey",
|
|
9713
|
+
"notNull": false,
|
|
9714
|
+
"foreignKey": {
|
|
9715
|
+
"table": "vendors",
|
|
9716
|
+
"column": "id",
|
|
9717
|
+
"onDelete": "NO ACTION",
|
|
9718
|
+
"onUpdate": "CASCADE"
|
|
9719
|
+
}
|
|
8489
9720
|
}
|
|
8490
9721
|
},
|
|
8491
9722
|
"indexes": [
|
|
@@ -8526,7 +9757,7 @@
|
|
|
8526
9757
|
]
|
|
8527
9758
|
}
|
|
8528
9759
|
],
|
|
8529
|
-
"version": "
|
|
9760
|
+
"version": "720a1437"
|
|
8530
9761
|
},
|
|
8531
9762
|
"importPath": "@happyvertical/smrt-commerce"
|
|
8532
9763
|
},
|
|
@@ -9265,10 +10496,11 @@
|
|
|
9265
10496
|
"contractId": {
|
|
9266
10497
|
"type": "foreignKey",
|
|
9267
10498
|
"required": false,
|
|
9268
|
-
"related": "
|
|
10499
|
+
"related": "SalesContract",
|
|
9269
10500
|
"description": "The order being fulfilled.",
|
|
9270
10501
|
"_meta": {
|
|
9271
|
-
"description": "The order being fulfilled."
|
|
10502
|
+
"description": "The order being fulfilled.",
|
|
10503
|
+
"validateSubtype": true
|
|
9272
10504
|
}
|
|
9273
10505
|
},
|
|
9274
10506
|
"fulfillmentType": {
|
|
@@ -9831,10 +11063,11 @@
|
|
|
9831
11063
|
"contractId": {
|
|
9832
11064
|
"type": "foreignKey",
|
|
9833
11065
|
"required": false,
|
|
9834
|
-
"related": "
|
|
11066
|
+
"related": "SalesContract",
|
|
9835
11067
|
"description": "The order or agreement this invoice bills for, if any.",
|
|
9836
11068
|
"_meta": {
|
|
9837
|
-
"description": "The order or agreement this invoice bills for, if any."
|
|
11069
|
+
"description": "The order or agreement this invoice bills for, if any.",
|
|
11070
|
+
"validateSubtype": true
|
|
9838
11071
|
}
|
|
9839
11072
|
},
|
|
9840
11073
|
"invoiceNumber": {
|
|
@@ -10958,10 +12191,11 @@
|
|
|
10958
12191
|
"contractId": {
|
|
10959
12192
|
"type": "foreignKey",
|
|
10960
12193
|
"required": false,
|
|
10961
|
-
"related": "
|
|
12194
|
+
"related": "SalesContract",
|
|
10962
12195
|
"description": "The order or agreement this payment is for, if any.",
|
|
10963
12196
|
"_meta": {
|
|
10964
|
-
"description": "The order or agreement this payment is for, if any."
|
|
12197
|
+
"description": "The order or agreement this payment is for, if any.",
|
|
12198
|
+
"validateSubtype": true
|
|
10965
12199
|
}
|
|
10966
12200
|
},
|
|
10967
12201
|
"customerId": {
|
|
@@ -15673,11 +16907,7 @@
|
|
|
15673
16907
|
},
|
|
15674
16908
|
"customerId": {
|
|
15675
16909
|
"label": "Customer",
|
|
15676
|
-
"order": 1
|
|
15677
|
-
"required": true
|
|
15678
|
-
},
|
|
15679
|
-
"vendorId": {
|
|
15680
|
-
"visibility": "hidden"
|
|
16910
|
+
"order": 1
|
|
15681
16911
|
},
|
|
15682
16912
|
"subtotal": {
|
|
15683
16913
|
"visibility": "hidden"
|
|
@@ -15838,14 +17068,9 @@
|
|
|
15838
17068
|
"visibility": "hidden",
|
|
15839
17069
|
"locked": true
|
|
15840
17070
|
},
|
|
15841
|
-
"vendorId": {
|
|
15842
|
-
"visibility": "hidden",
|
|
15843
|
-
"locked": true
|
|
15844
|
-
},
|
|
15845
17071
|
"customerId": {
|
|
15846
17072
|
"label": "Customer",
|
|
15847
|
-
"order": 1
|
|
15848
|
-
"required": true
|
|
17073
|
+
"order": 1
|
|
15849
17074
|
},
|
|
15850
17075
|
"channelId": {
|
|
15851
17076
|
"visibility": "hidden"
|
|
@@ -16210,11 +17435,7 @@
|
|
|
16210
17435
|
},
|
|
16211
17436
|
"customerId": {
|
|
16212
17437
|
"label": "Customer",
|
|
16213
|
-
"order": 1
|
|
16214
|
-
"required": true
|
|
16215
|
-
},
|
|
16216
|
-
"vendorId": {
|
|
16217
|
-
"visibility": "hidden"
|
|
17438
|
+
"order": 1
|
|
16218
17439
|
},
|
|
16219
17440
|
"subtotal": {
|
|
16220
17441
|
"visibility": "hidden"
|
|
@@ -16315,11 +17536,7 @@
|
|
|
16315
17536
|
},
|
|
16316
17537
|
"customerId": {
|
|
16317
17538
|
"label": "Customer",
|
|
16318
|
-
"order": 1
|
|
16319
|
-
"required": true
|
|
16320
|
-
},
|
|
16321
|
-
"vendorId": {
|
|
16322
|
-
"visibility": "hidden"
|
|
17539
|
+
"order": 1
|
|
16323
17540
|
},
|
|
16324
17541
|
"subtotal": {
|
|
16325
17542
|
"visibility": "hidden"
|
|
@@ -16413,10 +17630,6 @@
|
|
|
16413
17630
|
"visibility": "hidden",
|
|
16414
17631
|
"locked": true
|
|
16415
17632
|
},
|
|
16416
|
-
"customerId": {
|
|
16417
|
-
"visibility": "hidden",
|
|
16418
|
-
"locked": true
|
|
16419
|
-
},
|
|
16420
17633
|
"vendorId": {
|
|
16421
17634
|
"label": "Vendor",
|
|
16422
17635
|
"order": 1
|
|
@@ -16519,14 +17732,9 @@
|
|
|
16519
17732
|
"visibility": "hidden",
|
|
16520
17733
|
"locked": true
|
|
16521
17734
|
},
|
|
16522
|
-
"vendorId": {
|
|
16523
|
-
"visibility": "hidden",
|
|
16524
|
-
"locked": true
|
|
16525
|
-
},
|
|
16526
17735
|
"customerId": {
|
|
16527
17736
|
"label": "Customer",
|
|
16528
|
-
"order": 1
|
|
16529
|
-
"required": true
|
|
17737
|
+
"order": 1
|
|
16530
17738
|
},
|
|
16531
17739
|
"channelId": {
|
|
16532
17740
|
"visibility": "hidden"
|
|
@@ -16681,10 +17889,6 @@
|
|
|
16681
17889
|
"visibility": "hidden",
|
|
16682
17890
|
"locked": true
|
|
16683
17891
|
},
|
|
16684
|
-
"vendorId": {
|
|
16685
|
-
"visibility": "hidden",
|
|
16686
|
-
"locked": true
|
|
16687
|
-
},
|
|
16688
17892
|
"customerId": {
|
|
16689
17893
|
"label": "Customer",
|
|
16690
17894
|
"order": 1
|