@happyvertical/smrt-inventory 0.30.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.
@@ -0,0 +1,1023 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "timestamp": 1782177077457,
4
+ "packageName": "@happyvertical/smrt-inventory",
5
+ "packageVersion": "0.30.0",
6
+ "objects": {
7
+ "@happyvertical/smrt-inventory:InventoryLocationCollection": {
8
+ "name": "inventorylocationcollection",
9
+ "className": "InventoryLocationCollection",
10
+ "qualifiedName": "@happyvertical/smrt-inventory:InventoryLocationCollection",
11
+ "collection": "inventorylocations",
12
+ "filePath": "/home/runner/_work/smrt/smrt/packages/inventory/src/collections/InventoryLocationCollection.ts",
13
+ "packageName": "@happyvertical/smrt-inventory",
14
+ "fields": {},
15
+ "methods": {
16
+ "findByCode": {
17
+ "name": "findByCode",
18
+ "async": true,
19
+ "parameters": [
20
+ {
21
+ "name": "code",
22
+ "type": "string",
23
+ "optional": false
24
+ }
25
+ ],
26
+ "returnType": "Promise<InventoryLocation | null>",
27
+ "isStatic": false,
28
+ "isPublic": true
29
+ },
30
+ "findByKind": {
31
+ "name": "findByKind",
32
+ "async": true,
33
+ "parameters": [
34
+ {
35
+ "name": "kind",
36
+ "type": "InventoryLocationKind",
37
+ "optional": false
38
+ }
39
+ ],
40
+ "returnType": "Promise<InventoryLocation[]>",
41
+ "isStatic": false,
42
+ "isPublic": true
43
+ },
44
+ "findByPlace": {
45
+ "name": "findByPlace",
46
+ "async": true,
47
+ "parameters": [
48
+ {
49
+ "name": "placeId",
50
+ "type": "string",
51
+ "optional": false
52
+ }
53
+ ],
54
+ "returnType": "Promise<InventoryLocation[]>",
55
+ "isStatic": false,
56
+ "isPublic": true
57
+ },
58
+ "findActive": {
59
+ "name": "findActive",
60
+ "async": true,
61
+ "parameters": [
62
+ {
63
+ "name": "kind",
64
+ "type": "InventoryLocationKind",
65
+ "optional": true
66
+ }
67
+ ],
68
+ "returnType": "Promise<InventoryLocation[]>",
69
+ "isStatic": false,
70
+ "isPublic": true
71
+ }
72
+ },
73
+ "decoratorConfig": {
74
+ "tableName": "inventory_locations"
75
+ },
76
+ "extends": "SmrtCollection",
77
+ "extendsTypeArg": "InventoryLocation",
78
+ "exportName": "InventoryLocationCollection",
79
+ "collectionExportName": "InventoryLocationCollectionCollection",
80
+ "schema": {
81
+ "tableName": "inventory_locations",
82
+ "ddl": "CREATE TABLE IF NOT EXISTS \"inventory_locations\" (\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);",
83
+ "columns": {
84
+ "id": {
85
+ "type": "UUID",
86
+ "primaryKey": true,
87
+ "referenceKind": "id",
88
+ "notNull": true
89
+ },
90
+ "slug": {
91
+ "type": "TEXT",
92
+ "notNull": true
93
+ },
94
+ "context": {
95
+ "type": "TEXT",
96
+ "notNull": true,
97
+ "default": ""
98
+ },
99
+ "created_at": {
100
+ "type": "TIMESTAMP",
101
+ "notNull": true,
102
+ "default": "current_timestamp"
103
+ },
104
+ "updated_at": {
105
+ "type": "TIMESTAMP",
106
+ "notNull": true,
107
+ "default": "current_timestamp"
108
+ }
109
+ },
110
+ "indexes": [
111
+ {
112
+ "name": "inventory_locations_id_idx",
113
+ "columns": [
114
+ "id"
115
+ ]
116
+ },
117
+ {
118
+ "name": "inventory_locations_slug_context_idx",
119
+ "columns": [
120
+ "slug",
121
+ "context"
122
+ ],
123
+ "unique": true
124
+ }
125
+ ],
126
+ "version": "a8cccfa5"
127
+ }
128
+ },
129
+ "@happyvertical/smrt-inventory:StockLevelCollection": {
130
+ "name": "stocklevelcollection",
131
+ "className": "StockLevelCollection",
132
+ "qualifiedName": "@happyvertical/smrt-inventory:StockLevelCollection",
133
+ "collection": "stocklevels",
134
+ "filePath": "/home/runner/_work/smrt/smrt/packages/inventory/src/collections/StockLevelCollection.ts",
135
+ "packageName": "@happyvertical/smrt-inventory",
136
+ "fields": {},
137
+ "methods": {
138
+ "getLevel": {
139
+ "name": "getLevel",
140
+ "async": true,
141
+ "parameters": [
142
+ {
143
+ "name": "skuId",
144
+ "type": "string",
145
+ "optional": false
146
+ },
147
+ {
148
+ "name": "locationId",
149
+ "type": "string",
150
+ "optional": false
151
+ },
152
+ {
153
+ "name": "state",
154
+ "type": "StockState",
155
+ "optional": true,
156
+ "default": "available"
157
+ }
158
+ ],
159
+ "returnType": "Promise<StockLevel | null>",
160
+ "isStatic": false,
161
+ "isPublic": true
162
+ },
163
+ "findBySku": {
164
+ "name": "findBySku",
165
+ "async": true,
166
+ "parameters": [
167
+ {
168
+ "name": "skuId",
169
+ "type": "string",
170
+ "optional": false
171
+ }
172
+ ],
173
+ "returnType": "Promise<StockLevel[]>",
174
+ "isStatic": false,
175
+ "isPublic": true
176
+ },
177
+ "findByLocation": {
178
+ "name": "findByLocation",
179
+ "async": true,
180
+ "parameters": [
181
+ {
182
+ "name": "locationId",
183
+ "type": "string",
184
+ "optional": false
185
+ }
186
+ ],
187
+ "returnType": "Promise<StockLevel[]>",
188
+ "isStatic": false,
189
+ "isPublic": true
190
+ },
191
+ "totalForSku": {
192
+ "name": "totalForSku",
193
+ "async": true,
194
+ "parameters": [
195
+ {
196
+ "name": "skuId",
197
+ "type": "string",
198
+ "optional": false
199
+ },
200
+ {
201
+ "name": "state",
202
+ "type": "StockState",
203
+ "optional": true
204
+ }
205
+ ],
206
+ "returnType": "Promise<number>",
207
+ "isStatic": false,
208
+ "isPublic": true
209
+ },
210
+ "totalForLocation": {
211
+ "name": "totalForLocation",
212
+ "async": true,
213
+ "parameters": [
214
+ {
215
+ "name": "locationId",
216
+ "type": "string",
217
+ "optional": false
218
+ },
219
+ {
220
+ "name": "state",
221
+ "type": "StockState",
222
+ "optional": true
223
+ }
224
+ ],
225
+ "returnType": "Promise<number>",
226
+ "isStatic": false,
227
+ "isPublic": true
228
+ }
229
+ },
230
+ "decoratorConfig": {
231
+ "tableName": "inventory_stock_levels"
232
+ },
233
+ "extends": "SmrtCollection",
234
+ "extendsTypeArg": "StockLevel",
235
+ "exportName": "StockLevelCollection",
236
+ "collectionExportName": "StockLevelCollectionCollection",
237
+ "schema": {
238
+ "tableName": "inventory_stock_levels",
239
+ "ddl": "CREATE TABLE IF NOT EXISTS \"inventory_stock_levels\" (\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);",
240
+ "columns": {
241
+ "id": {
242
+ "type": "UUID",
243
+ "primaryKey": true,
244
+ "referenceKind": "id",
245
+ "notNull": true
246
+ },
247
+ "slug": {
248
+ "type": "TEXT",
249
+ "notNull": true
250
+ },
251
+ "context": {
252
+ "type": "TEXT",
253
+ "notNull": true,
254
+ "default": ""
255
+ },
256
+ "created_at": {
257
+ "type": "TIMESTAMP",
258
+ "notNull": true,
259
+ "default": "current_timestamp"
260
+ },
261
+ "updated_at": {
262
+ "type": "TIMESTAMP",
263
+ "notNull": true,
264
+ "default": "current_timestamp"
265
+ }
266
+ },
267
+ "indexes": [
268
+ {
269
+ "name": "inventory_stock_levels_id_idx",
270
+ "columns": [
271
+ "id"
272
+ ]
273
+ },
274
+ {
275
+ "name": "inventory_stock_levels_slug_context_idx",
276
+ "columns": [
277
+ "slug",
278
+ "context"
279
+ ],
280
+ "unique": true
281
+ }
282
+ ],
283
+ "version": "d858b8a5"
284
+ }
285
+ },
286
+ "@happyvertical/smrt-inventory:StockMovementCollection": {
287
+ "name": "stockmovementcollection",
288
+ "className": "StockMovementCollection",
289
+ "qualifiedName": "@happyvertical/smrt-inventory:StockMovementCollection",
290
+ "collection": "stockmovements",
291
+ "filePath": "/home/runner/_work/smrt/smrt/packages/inventory/src/collections/StockMovementCollection.ts",
292
+ "packageName": "@happyvertical/smrt-inventory",
293
+ "fields": {},
294
+ "methods": {
295
+ "findBySku": {
296
+ "name": "findBySku",
297
+ "async": true,
298
+ "parameters": [
299
+ {
300
+ "name": "skuId",
301
+ "type": "string",
302
+ "optional": false
303
+ }
304
+ ],
305
+ "returnType": "Promise<StockMovement[]>",
306
+ "isStatic": false,
307
+ "isPublic": true
308
+ },
309
+ "findByLocation": {
310
+ "name": "findByLocation",
311
+ "async": true,
312
+ "parameters": [
313
+ {
314
+ "name": "locationId",
315
+ "type": "string",
316
+ "optional": false
317
+ }
318
+ ],
319
+ "returnType": "Promise<StockMovement[]>",
320
+ "isStatic": false,
321
+ "isPublic": true
322
+ },
323
+ "findBySource": {
324
+ "name": "findBySource",
325
+ "async": true,
326
+ "parameters": [
327
+ {
328
+ "name": "sourceType",
329
+ "type": "string",
330
+ "optional": false
331
+ },
332
+ {
333
+ "name": "sourceId",
334
+ "type": "string",
335
+ "optional": false
336
+ }
337
+ ],
338
+ "returnType": "Promise<StockMovement[]>",
339
+ "isStatic": false,
340
+ "isPublic": true
341
+ },
342
+ "findByReason": {
343
+ "name": "findByReason",
344
+ "async": true,
345
+ "parameters": [
346
+ {
347
+ "name": "reasonCode",
348
+ "type": "StockMovementReason",
349
+ "optional": false
350
+ }
351
+ ],
352
+ "returnType": "Promise<StockMovement[]>",
353
+ "isStatic": false,
354
+ "isPublic": true
355
+ }
356
+ },
357
+ "decoratorConfig": {
358
+ "tableName": "inventory_stock_movements"
359
+ },
360
+ "extends": "SmrtCollection",
361
+ "extendsTypeArg": "StockMovement",
362
+ "exportName": "StockMovementCollection",
363
+ "collectionExportName": "StockMovementCollectionCollection",
364
+ "schema": {
365
+ "tableName": "inventory_stock_movements",
366
+ "ddl": "CREATE TABLE IF NOT EXISTS \"inventory_stock_movements\" (\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);",
367
+ "columns": {
368
+ "id": {
369
+ "type": "UUID",
370
+ "primaryKey": true,
371
+ "referenceKind": "id",
372
+ "notNull": true
373
+ },
374
+ "slug": {
375
+ "type": "TEXT",
376
+ "notNull": true
377
+ },
378
+ "context": {
379
+ "type": "TEXT",
380
+ "notNull": true,
381
+ "default": ""
382
+ },
383
+ "created_at": {
384
+ "type": "TIMESTAMP",
385
+ "notNull": true,
386
+ "default": "current_timestamp"
387
+ },
388
+ "updated_at": {
389
+ "type": "TIMESTAMP",
390
+ "notNull": true,
391
+ "default": "current_timestamp"
392
+ }
393
+ },
394
+ "indexes": [
395
+ {
396
+ "name": "inventory_stock_movements_id_idx",
397
+ "columns": [
398
+ "id"
399
+ ]
400
+ },
401
+ {
402
+ "name": "inventory_stock_movements_slug_context_idx",
403
+ "columns": [
404
+ "slug",
405
+ "context"
406
+ ],
407
+ "unique": true
408
+ }
409
+ ],
410
+ "version": "54d9d8f6"
411
+ }
412
+ },
413
+ "@happyvertical/smrt-inventory:InventoryLocation": {
414
+ "name": "inventorylocation",
415
+ "className": "InventoryLocation",
416
+ "qualifiedName": "@happyvertical/smrt-inventory:InventoryLocation",
417
+ "collection": "inventorylocations",
418
+ "filePath": "/home/runner/_work/smrt/smrt/packages/inventory/src/models/InventoryLocation.ts",
419
+ "packageName": "@happyvertical/smrt-inventory",
420
+ "fields": {
421
+ "tenantId": {
422
+ "type": "text",
423
+ "required": false,
424
+ "_meta": {
425
+ "sqlType": "UUID",
426
+ "nullable": true,
427
+ "__tenancy": {
428
+ "isTenantIdField": true,
429
+ "autoFilter": true,
430
+ "required": false,
431
+ "autoPopulate": true,
432
+ "nullable": true,
433
+ "mode": "optional",
434
+ "field": "tenantId",
435
+ "allowSuperAdminBypass": false
436
+ }
437
+ }
438
+ },
439
+ "code": {
440
+ "type": "text",
441
+ "required": true,
442
+ "default": "",
443
+ "_meta": {
444
+ "required": true
445
+ }
446
+ },
447
+ "name": {
448
+ "type": "text",
449
+ "required": false,
450
+ "default": ""
451
+ },
452
+ "kind": {
453
+ "type": "text",
454
+ "required": false,
455
+ "default": "warehouse"
456
+ },
457
+ "placeId": {
458
+ "type": "text",
459
+ "required": false,
460
+ "default": ""
461
+ },
462
+ "active": {
463
+ "type": "boolean",
464
+ "required": false,
465
+ "default": true
466
+ }
467
+ },
468
+ "methods": {},
469
+ "decoratorConfig": {
470
+ "tableName": "inventory_locations",
471
+ "conflictColumns": [
472
+ "code",
473
+ "tenant_id"
474
+ ],
475
+ "api": {
476
+ "include": [
477
+ "list",
478
+ "get",
479
+ "create",
480
+ "update"
481
+ ]
482
+ },
483
+ "mcp": {
484
+ "include": [
485
+ "list",
486
+ "get"
487
+ ]
488
+ },
489
+ "cli": true,
490
+ "tenantScoped": {
491
+ "mode": "optional"
492
+ }
493
+ },
494
+ "extends": "SmrtObject",
495
+ "exportName": "InventoryLocation",
496
+ "collectionExportName": "InventoryLocationCollection",
497
+ "validationRules": [
498
+ {
499
+ "field": "code",
500
+ "rule": "required",
501
+ "fieldType": "text"
502
+ }
503
+ ],
504
+ "schema": {
505
+ "tableName": "inventory_locations",
506
+ "ddl": "CREATE TABLE IF NOT EXISTS \"inventory_locations\" (\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 \"code\" TEXT NOT NULL DEFAULT '',\n \"name\" TEXT DEFAULT '',\n \"kind\" TEXT DEFAULT 'warehouse',\n \"place_id\" TEXT DEFAULT '',\n \"active\" BOOLEAN DEFAULT TRUE\n);",
507
+ "columns": {
508
+ "id": {
509
+ "type": "UUID",
510
+ "primaryKey": true,
511
+ "referenceKind": "id",
512
+ "notNull": true
513
+ },
514
+ "slug": {
515
+ "type": "TEXT",
516
+ "notNull": true
517
+ },
518
+ "context": {
519
+ "type": "TEXT",
520
+ "notNull": true,
521
+ "default": ""
522
+ },
523
+ "created_at": {
524
+ "type": "TIMESTAMP",
525
+ "notNull": true,
526
+ "default": "current_timestamp"
527
+ },
528
+ "updated_at": {
529
+ "type": "TIMESTAMP",
530
+ "notNull": true,
531
+ "default": "current_timestamp"
532
+ },
533
+ "tenant_id": {
534
+ "type": "UUID",
535
+ "referenceKind": "tenantId",
536
+ "notNull": false,
537
+ "unique": false
538
+ },
539
+ "code": {
540
+ "type": "TEXT",
541
+ "notNull": true,
542
+ "unique": false,
543
+ "default": ""
544
+ },
545
+ "name": {
546
+ "type": "TEXT",
547
+ "notNull": false,
548
+ "unique": false,
549
+ "default": ""
550
+ },
551
+ "kind": {
552
+ "type": "TEXT",
553
+ "notNull": false,
554
+ "unique": false,
555
+ "default": "warehouse"
556
+ },
557
+ "place_id": {
558
+ "type": "TEXT",
559
+ "notNull": false,
560
+ "unique": false,
561
+ "default": ""
562
+ },
563
+ "active": {
564
+ "type": "BOOLEAN",
565
+ "notNull": false,
566
+ "unique": false,
567
+ "default": true
568
+ }
569
+ },
570
+ "indexes": [
571
+ {
572
+ "name": "inventory_locations_id_idx",
573
+ "columns": [
574
+ "id"
575
+ ]
576
+ },
577
+ {
578
+ "name": "inventory_locations_code_tenant_id_idx",
579
+ "columns": [
580
+ "code",
581
+ "tenant_id"
582
+ ],
583
+ "unique": true
584
+ }
585
+ ],
586
+ "version": "401c28a1"
587
+ }
588
+ },
589
+ "@happyvertical/smrt-inventory:StockLevel": {
590
+ "name": "stocklevel",
591
+ "className": "StockLevel",
592
+ "qualifiedName": "@happyvertical/smrt-inventory:StockLevel",
593
+ "collection": "stocklevels",
594
+ "filePath": "/home/runner/_work/smrt/smrt/packages/inventory/src/models/StockLevel.ts",
595
+ "packageName": "@happyvertical/smrt-inventory",
596
+ "fields": {
597
+ "tenantId": {
598
+ "type": "text",
599
+ "required": false,
600
+ "_meta": {
601
+ "sqlType": "UUID",
602
+ "nullable": true,
603
+ "__tenancy": {
604
+ "isTenantIdField": true,
605
+ "autoFilter": true,
606
+ "required": false,
607
+ "autoPopulate": true,
608
+ "nullable": true,
609
+ "mode": "optional",
610
+ "field": "tenantId",
611
+ "allowSuperAdminBypass": false
612
+ }
613
+ }
614
+ },
615
+ "skuId": {
616
+ "type": "text",
617
+ "required": true,
618
+ "default": "",
619
+ "_meta": {
620
+ "required": true
621
+ }
622
+ },
623
+ "locationId": {
624
+ "type": "text",
625
+ "required": true,
626
+ "default": "",
627
+ "_meta": {
628
+ "required": true
629
+ }
630
+ },
631
+ "state": {
632
+ "type": "text",
633
+ "required": true,
634
+ "default": "available",
635
+ "_meta": {
636
+ "required": true
637
+ }
638
+ },
639
+ "qty": {
640
+ "type": "decimal",
641
+ "required": false,
642
+ "_meta": {}
643
+ }
644
+ },
645
+ "methods": {},
646
+ "decoratorConfig": {
647
+ "tableName": "inventory_stock_levels",
648
+ "conflictColumns": [
649
+ "sku_id",
650
+ "location_id",
651
+ "state",
652
+ "tenant_id"
653
+ ],
654
+ "api": {
655
+ "include": [
656
+ "list",
657
+ "get"
658
+ ]
659
+ },
660
+ "mcp": {
661
+ "include": [
662
+ "list",
663
+ "get"
664
+ ]
665
+ },
666
+ "cli": {
667
+ "include": [
668
+ "list",
669
+ "get"
670
+ ]
671
+ },
672
+ "tenantScoped": {
673
+ "mode": "optional"
674
+ }
675
+ },
676
+ "extends": "SmrtObject",
677
+ "exportName": "StockLevel",
678
+ "collectionExportName": "StockLevelCollection",
679
+ "validationRules": [
680
+ {
681
+ "field": "skuId",
682
+ "rule": "required",
683
+ "fieldType": "text"
684
+ },
685
+ {
686
+ "field": "locationId",
687
+ "rule": "required",
688
+ "fieldType": "text"
689
+ },
690
+ {
691
+ "field": "state",
692
+ "rule": "required",
693
+ "fieldType": "text"
694
+ }
695
+ ],
696
+ "schema": {
697
+ "tableName": "inventory_stock_levels",
698
+ "ddl": "CREATE TABLE IF NOT EXISTS \"inventory_stock_levels\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"sku_id\" TEXT NOT NULL DEFAULT '',\n \"location_id\" TEXT NOT NULL DEFAULT '',\n \"state\" TEXT NOT NULL DEFAULT 'available',\n \"qty\" REAL\n);",
699
+ "columns": {
700
+ "id": {
701
+ "type": "UUID",
702
+ "primaryKey": true,
703
+ "referenceKind": "id",
704
+ "notNull": true
705
+ },
706
+ "slug": {
707
+ "type": "TEXT",
708
+ "notNull": true
709
+ },
710
+ "context": {
711
+ "type": "TEXT",
712
+ "notNull": true,
713
+ "default": ""
714
+ },
715
+ "created_at": {
716
+ "type": "TIMESTAMP",
717
+ "notNull": true,
718
+ "default": "current_timestamp"
719
+ },
720
+ "updated_at": {
721
+ "type": "TIMESTAMP",
722
+ "notNull": true,
723
+ "default": "current_timestamp"
724
+ },
725
+ "tenant_id": {
726
+ "type": "UUID",
727
+ "referenceKind": "tenantId",
728
+ "notNull": false,
729
+ "unique": false
730
+ },
731
+ "sku_id": {
732
+ "type": "TEXT",
733
+ "notNull": true,
734
+ "unique": false,
735
+ "default": ""
736
+ },
737
+ "location_id": {
738
+ "type": "TEXT",
739
+ "notNull": true,
740
+ "unique": false,
741
+ "default": ""
742
+ },
743
+ "state": {
744
+ "type": "TEXT",
745
+ "notNull": true,
746
+ "unique": false,
747
+ "default": "available"
748
+ },
749
+ "qty": {
750
+ "type": "REAL",
751
+ "notNull": false,
752
+ "unique": false
753
+ }
754
+ },
755
+ "indexes": [
756
+ {
757
+ "name": "inventory_stock_levels_id_idx",
758
+ "columns": [
759
+ "id"
760
+ ]
761
+ },
762
+ {
763
+ "name": "inventory_stock_levels_sku_id_location_id_idx",
764
+ "columns": [
765
+ "sku_id",
766
+ "location_id",
767
+ "state",
768
+ "tenant_id"
769
+ ],
770
+ "unique": true
771
+ }
772
+ ],
773
+ "version": "7b08362b"
774
+ }
775
+ },
776
+ "@happyvertical/smrt-inventory:StockMovement": {
777
+ "name": "stockmovement",
778
+ "className": "StockMovement",
779
+ "qualifiedName": "@happyvertical/smrt-inventory:StockMovement",
780
+ "collection": "stockmovements",
781
+ "filePath": "/home/runner/_work/smrt/smrt/packages/inventory/src/models/StockMovement.ts",
782
+ "packageName": "@happyvertical/smrt-inventory",
783
+ "fields": {
784
+ "tenantId": {
785
+ "type": "text",
786
+ "required": false,
787
+ "_meta": {
788
+ "sqlType": "UUID",
789
+ "nullable": true,
790
+ "__tenancy": {
791
+ "isTenantIdField": true,
792
+ "autoFilter": true,
793
+ "required": false,
794
+ "autoPopulate": true,
795
+ "nullable": true,
796
+ "mode": "optional",
797
+ "field": "tenantId",
798
+ "allowSuperAdminBypass": false
799
+ }
800
+ }
801
+ },
802
+ "skuId": {
803
+ "type": "text",
804
+ "required": true,
805
+ "default": "",
806
+ "_meta": {
807
+ "required": true
808
+ }
809
+ },
810
+ "locationId": {
811
+ "type": "text",
812
+ "required": true,
813
+ "default": "",
814
+ "_meta": {
815
+ "required": true
816
+ }
817
+ },
818
+ "fromState": {
819
+ "type": "text",
820
+ "required": false
821
+ },
822
+ "toState": {
823
+ "type": "text",
824
+ "required": false
825
+ },
826
+ "qty": {
827
+ "type": "decimal",
828
+ "required": false,
829
+ "_meta": {}
830
+ },
831
+ "reasonCode": {
832
+ "type": "text",
833
+ "required": true,
834
+ "default": "adjustment",
835
+ "_meta": {
836
+ "required": true
837
+ }
838
+ },
839
+ "sourceType": {
840
+ "type": "text",
841
+ "required": false,
842
+ "default": ""
843
+ },
844
+ "sourceId": {
845
+ "type": "text",
846
+ "required": false,
847
+ "default": ""
848
+ },
849
+ "note": {
850
+ "type": "text",
851
+ "required": false,
852
+ "default": ""
853
+ },
854
+ "occurredAt": {
855
+ "type": "datetime",
856
+ "required": false
857
+ }
858
+ },
859
+ "methods": {},
860
+ "decoratorConfig": {
861
+ "tableName": "inventory_stock_movements",
862
+ "conflictColumns": [
863
+ "id"
864
+ ],
865
+ "api": {
866
+ "include": [
867
+ "list",
868
+ "get"
869
+ ]
870
+ },
871
+ "mcp": {
872
+ "include": [
873
+ "list",
874
+ "get"
875
+ ]
876
+ },
877
+ "cli": {
878
+ "include": [
879
+ "list",
880
+ "get"
881
+ ]
882
+ },
883
+ "tenantScoped": {
884
+ "mode": "optional"
885
+ }
886
+ },
887
+ "extends": "SmrtObject",
888
+ "exportName": "StockMovement",
889
+ "collectionExportName": "StockMovementCollection",
890
+ "validationRules": [
891
+ {
892
+ "field": "skuId",
893
+ "rule": "required",
894
+ "fieldType": "text"
895
+ },
896
+ {
897
+ "field": "locationId",
898
+ "rule": "required",
899
+ "fieldType": "text"
900
+ },
901
+ {
902
+ "field": "reasonCode",
903
+ "rule": "required",
904
+ "fieldType": "text"
905
+ }
906
+ ],
907
+ "schema": {
908
+ "tableName": "inventory_stock_movements",
909
+ "ddl": "CREATE TABLE IF NOT EXISTS \"inventory_stock_movements\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"sku_id\" TEXT NOT NULL DEFAULT '',\n \"location_id\" TEXT NOT NULL DEFAULT '',\n \"from_state\" TEXT,\n \"to_state\" TEXT,\n \"qty\" REAL,\n \"reason_code\" TEXT NOT NULL DEFAULT 'adjustment',\n \"source_type\" TEXT DEFAULT '',\n \"source_id\" TEXT DEFAULT '',\n \"note\" TEXT DEFAULT '',\n \"occurred_at\" TIMESTAMP\n);",
910
+ "columns": {
911
+ "id": {
912
+ "type": "UUID",
913
+ "primaryKey": true,
914
+ "referenceKind": "id",
915
+ "notNull": true
916
+ },
917
+ "slug": {
918
+ "type": "TEXT",
919
+ "notNull": true
920
+ },
921
+ "context": {
922
+ "type": "TEXT",
923
+ "notNull": true,
924
+ "default": ""
925
+ },
926
+ "created_at": {
927
+ "type": "TIMESTAMP",
928
+ "notNull": true,
929
+ "default": "current_timestamp"
930
+ },
931
+ "updated_at": {
932
+ "type": "TIMESTAMP",
933
+ "notNull": true,
934
+ "default": "current_timestamp"
935
+ },
936
+ "tenant_id": {
937
+ "type": "UUID",
938
+ "referenceKind": "tenantId",
939
+ "notNull": false,
940
+ "unique": false
941
+ },
942
+ "sku_id": {
943
+ "type": "TEXT",
944
+ "notNull": true,
945
+ "unique": false,
946
+ "default": ""
947
+ },
948
+ "location_id": {
949
+ "type": "TEXT",
950
+ "notNull": true,
951
+ "unique": false,
952
+ "default": ""
953
+ },
954
+ "from_state": {
955
+ "type": "TEXT",
956
+ "notNull": false,
957
+ "unique": false
958
+ },
959
+ "to_state": {
960
+ "type": "TEXT",
961
+ "notNull": false,
962
+ "unique": false
963
+ },
964
+ "qty": {
965
+ "type": "REAL",
966
+ "notNull": false,
967
+ "unique": false
968
+ },
969
+ "reason_code": {
970
+ "type": "TEXT",
971
+ "notNull": true,
972
+ "unique": false,
973
+ "default": "adjustment"
974
+ },
975
+ "source_type": {
976
+ "type": "TEXT",
977
+ "notNull": false,
978
+ "unique": false,
979
+ "default": ""
980
+ },
981
+ "source_id": {
982
+ "type": "TEXT",
983
+ "notNull": false,
984
+ "unique": false,
985
+ "default": ""
986
+ },
987
+ "note": {
988
+ "type": "TEXT",
989
+ "notNull": false,
990
+ "unique": false,
991
+ "default": ""
992
+ },
993
+ "occurred_at": {
994
+ "type": "TIMESTAMP",
995
+ "notNull": false,
996
+ "unique": false
997
+ }
998
+ },
999
+ "indexes": [
1000
+ {
1001
+ "name": "inventory_stock_movements_id_idx",
1002
+ "columns": [
1003
+ "id"
1004
+ ]
1005
+ },
1006
+ {
1007
+ "name": "inventory_stock_movements_id_idx",
1008
+ "columns": [
1009
+ "id"
1010
+ ],
1011
+ "unique": true
1012
+ }
1013
+ ],
1014
+ "version": "3c5a0445"
1015
+ }
1016
+ }
1017
+ },
1018
+ "moduleType": "smrt",
1019
+ "smrtDependencies": [
1020
+ "@happyvertical/smrt-core",
1021
+ "@happyvertical/smrt-tenancy"
1022
+ ]
1023
+ }