@kernhq/module-inventory 0.1.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.
Files changed (43) hide show
  1. package/LICENSE +662 -0
  2. package/README.md +32 -0
  3. package/dist/contract.d.ts +387 -0
  4. package/dist/contract.d.ts.map +1 -0
  5. package/dist/contract.js +119 -0
  6. package/dist/contract.js.map +1 -0
  7. package/dist/server/_impl.d.ts +427 -0
  8. package/dist/server/_impl.d.ts.map +1 -0
  9. package/dist/server/_impl.js +204 -0
  10. package/dist/server/_impl.js.map +1 -0
  11. package/dist/server/index.d.ts +3 -0
  12. package/dist/server/index.d.ts.map +1 -0
  13. package/dist/server/index.js +32 -0
  14. package/dist/server/index.js.map +1 -0
  15. package/dist/server/schema.d.ts +1552 -0
  16. package/dist/server/schema.d.ts.map +1 -0
  17. package/dist/server/schema.js +175 -0
  18. package/dist/server/schema.js.map +1 -0
  19. package/drizzle.config.ts +8 -0
  20. package/migrations/0000_init.sql +129 -0
  21. package/migrations/0001_rls.sql +62 -0
  22. package/migrations/meta/0000_snapshot.json +994 -0
  23. package/migrations/meta/_journal.json +20 -0
  24. package/package.json +106 -0
  25. package/src/client/api-instance.ts +28 -0
  26. package/src/client/api.ts +10 -0
  27. package/src/client/components/AssetFormDialog.svelte +185 -0
  28. package/src/client/i18n.ts +169 -0
  29. package/src/client/index.ts +26 -0
  30. package/src/client/mock.ts +95 -0
  31. package/src/client/module.ts +96 -0
  32. package/src/client/pages/AssetsPage.svelte +266 -0
  33. package/src/client/permissions.ts +30 -0
  34. package/src/client/query.ts +12 -0
  35. package/src/client/widgets/OverviewWidget.svelte +92 -0
  36. package/src/contract.ts +143 -0
  37. package/src/module.test.ts +79 -0
  38. package/src/server/_impl.ts +275 -0
  39. package/src/server/index.ts +33 -0
  40. package/src/server/schema.ts +228 -0
  41. package/tsconfig.client.json +10 -0
  42. package/tsconfig.json +10 -0
  43. package/vitest.config.ts +5 -0
@@ -0,0 +1,994 @@
1
+ {
2
+ "id": "50998845-5c27-429f-ba8d-b7beda4579b4",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "mod_inventory.asset_history": {
8
+ "name": "asset_history",
9
+ "schema": "mod_inventory",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "uuidv7()"
17
+ },
18
+ "workspace_id": {
19
+ "name": "workspace_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "asset_id": {
25
+ "name": "asset_id",
26
+ "type": "uuid",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "actor_id": {
31
+ "name": "actor_id",
32
+ "type": "uuid",
33
+ "primaryKey": false,
34
+ "notNull": false
35
+ },
36
+ "action": {
37
+ "name": "action",
38
+ "type": "text",
39
+ "primaryKey": false,
40
+ "notNull": true
41
+ },
42
+ "changes": {
43
+ "name": "changes",
44
+ "type": "jsonb",
45
+ "primaryKey": false,
46
+ "notNull": false
47
+ },
48
+ "data": {
49
+ "name": "data",
50
+ "type": "jsonb",
51
+ "primaryKey": false,
52
+ "notNull": false
53
+ },
54
+ "created_at": {
55
+ "name": "created_at",
56
+ "type": "timestamp with time zone",
57
+ "primaryKey": false,
58
+ "notNull": true,
59
+ "default": "now()"
60
+ }
61
+ },
62
+ "indexes": {
63
+ "inventory_asset_history_asset_idx": {
64
+ "name": "inventory_asset_history_asset_idx",
65
+ "columns": [
66
+ {
67
+ "expression": "workspace_id",
68
+ "isExpression": false,
69
+ "asc": true,
70
+ "nulls": "last"
71
+ },
72
+ {
73
+ "expression": "asset_id",
74
+ "isExpression": false,
75
+ "asc": true,
76
+ "nulls": "last"
77
+ },
78
+ {
79
+ "expression": "created_at",
80
+ "isExpression": false,
81
+ "asc": true,
82
+ "nulls": "last"
83
+ }
84
+ ],
85
+ "isUnique": false,
86
+ "concurrently": false,
87
+ "method": "btree",
88
+ "with": {}
89
+ }
90
+ },
91
+ "foreignKeys": {},
92
+ "compositePrimaryKeys": {},
93
+ "uniqueConstraints": {},
94
+ "policies": {},
95
+ "checkConstraints": {},
96
+ "isRLSEnabled": false
97
+ },
98
+ "mod_inventory.assets": {
99
+ "name": "assets",
100
+ "schema": "mod_inventory",
101
+ "columns": {
102
+ "id": {
103
+ "name": "id",
104
+ "type": "uuid",
105
+ "primaryKey": true,
106
+ "notNull": true,
107
+ "default": "uuidv7()"
108
+ },
109
+ "workspace_id": {
110
+ "name": "workspace_id",
111
+ "type": "uuid",
112
+ "primaryKey": false,
113
+ "notNull": true
114
+ },
115
+ "code": {
116
+ "name": "code",
117
+ "type": "text",
118
+ "primaryKey": false,
119
+ "notNull": true
120
+ },
121
+ "name": {
122
+ "name": "name",
123
+ "type": "text",
124
+ "primaryKey": false,
125
+ "notNull": true
126
+ },
127
+ "description": {
128
+ "name": "description",
129
+ "type": "text",
130
+ "primaryKey": false,
131
+ "notNull": true,
132
+ "default": "''"
133
+ },
134
+ "category_id": {
135
+ "name": "category_id",
136
+ "type": "uuid",
137
+ "primaryKey": false,
138
+ "notNull": false
139
+ },
140
+ "status": {
141
+ "name": "status",
142
+ "type": "asset_status",
143
+ "typeSchema": "public",
144
+ "primaryKey": false,
145
+ "notNull": true,
146
+ "default": "'in_stock'"
147
+ },
148
+ "custodian_user_id": {
149
+ "name": "custodian_user_id",
150
+ "type": "uuid",
151
+ "primaryKey": false,
152
+ "notNull": false
153
+ },
154
+ "custody_since": {
155
+ "name": "custody_since",
156
+ "type": "timestamp with time zone",
157
+ "primaryKey": false,
158
+ "notNull": false
159
+ },
160
+ "serial_number": {
161
+ "name": "serial_number",
162
+ "type": "text",
163
+ "primaryKey": false,
164
+ "notNull": false
165
+ },
166
+ "location": {
167
+ "name": "location",
168
+ "type": "text",
169
+ "primaryKey": false,
170
+ "notNull": false
171
+ },
172
+ "purchased_on": {
173
+ "name": "purchased_on",
174
+ "type": "date",
175
+ "primaryKey": false,
176
+ "notNull": false
177
+ },
178
+ "purchased_from": {
179
+ "name": "purchased_from",
180
+ "type": "text",
181
+ "primaryKey": false,
182
+ "notNull": false
183
+ },
184
+ "price_minor": {
185
+ "name": "price_minor",
186
+ "type": "integer",
187
+ "primaryKey": false,
188
+ "notNull": false
189
+ },
190
+ "currency": {
191
+ "name": "currency",
192
+ "type": "char(3)",
193
+ "primaryKey": false,
194
+ "notNull": false
195
+ },
196
+ "warranty_until": {
197
+ "name": "warranty_until",
198
+ "type": "date",
199
+ "primaryKey": false,
200
+ "notNull": false
201
+ },
202
+ "photo_file_id": {
203
+ "name": "photo_file_id",
204
+ "type": "uuid",
205
+ "primaryKey": false,
206
+ "notNull": false
207
+ },
208
+ "created_at": {
209
+ "name": "created_at",
210
+ "type": "timestamp with time zone",
211
+ "primaryKey": false,
212
+ "notNull": true,
213
+ "default": "now()"
214
+ },
215
+ "updated_at": {
216
+ "name": "updated_at",
217
+ "type": "timestamp with time zone",
218
+ "primaryKey": false,
219
+ "notNull": true,
220
+ "default": "now()"
221
+ },
222
+ "archived_at": {
223
+ "name": "archived_at",
224
+ "type": "timestamp with time zone",
225
+ "primaryKey": false,
226
+ "notNull": false
227
+ }
228
+ },
229
+ "indexes": {
230
+ "inventory_assets_ws_code_uq": {
231
+ "name": "inventory_assets_ws_code_uq",
232
+ "columns": [
233
+ {
234
+ "expression": "workspace_id",
235
+ "isExpression": false,
236
+ "asc": true,
237
+ "nulls": "last"
238
+ },
239
+ {
240
+ "expression": "code",
241
+ "isExpression": false,
242
+ "asc": true,
243
+ "nulls": "last"
244
+ }
245
+ ],
246
+ "isUnique": true,
247
+ "concurrently": false,
248
+ "method": "btree",
249
+ "with": {}
250
+ },
251
+ "inventory_assets_ws_created_idx": {
252
+ "name": "inventory_assets_ws_created_idx",
253
+ "columns": [
254
+ {
255
+ "expression": "workspace_id",
256
+ "isExpression": false,
257
+ "asc": true,
258
+ "nulls": "last"
259
+ },
260
+ {
261
+ "expression": "created_at",
262
+ "isExpression": false,
263
+ "asc": true,
264
+ "nulls": "last"
265
+ }
266
+ ],
267
+ "isUnique": false,
268
+ "concurrently": false,
269
+ "method": "btree",
270
+ "with": {}
271
+ },
272
+ "inventory_assets_ws_status_idx": {
273
+ "name": "inventory_assets_ws_status_idx",
274
+ "columns": [
275
+ {
276
+ "expression": "workspace_id",
277
+ "isExpression": false,
278
+ "asc": true,
279
+ "nulls": "last"
280
+ },
281
+ {
282
+ "expression": "status",
283
+ "isExpression": false,
284
+ "asc": true,
285
+ "nulls": "last"
286
+ }
287
+ ],
288
+ "isUnique": false,
289
+ "concurrently": false,
290
+ "method": "btree",
291
+ "with": {}
292
+ },
293
+ "inventory_assets_ws_category_idx": {
294
+ "name": "inventory_assets_ws_category_idx",
295
+ "columns": [
296
+ {
297
+ "expression": "workspace_id",
298
+ "isExpression": false,
299
+ "asc": true,
300
+ "nulls": "last"
301
+ },
302
+ {
303
+ "expression": "category_id",
304
+ "isExpression": false,
305
+ "asc": true,
306
+ "nulls": "last"
307
+ }
308
+ ],
309
+ "isUnique": false,
310
+ "concurrently": false,
311
+ "method": "btree",
312
+ "with": {}
313
+ },
314
+ "inventory_assets_ws_warranty_idx": {
315
+ "name": "inventory_assets_ws_warranty_idx",
316
+ "columns": [
317
+ {
318
+ "expression": "workspace_id",
319
+ "isExpression": false,
320
+ "asc": true,
321
+ "nulls": "last"
322
+ },
323
+ {
324
+ "expression": "warranty_until",
325
+ "isExpression": false,
326
+ "asc": true,
327
+ "nulls": "last"
328
+ }
329
+ ],
330
+ "isUnique": false,
331
+ "where": "warranty_until is not null",
332
+ "concurrently": false,
333
+ "method": "btree",
334
+ "with": {}
335
+ }
336
+ },
337
+ "foreignKeys": {},
338
+ "compositePrimaryKeys": {},
339
+ "uniqueConstraints": {},
340
+ "policies": {},
341
+ "checkConstraints": {},
342
+ "isRLSEnabled": false
343
+ },
344
+ "mod_inventory.attachments": {
345
+ "name": "attachments",
346
+ "schema": "mod_inventory",
347
+ "columns": {
348
+ "id": {
349
+ "name": "id",
350
+ "type": "uuid",
351
+ "primaryKey": true,
352
+ "notNull": true,
353
+ "default": "uuidv7()"
354
+ },
355
+ "workspace_id": {
356
+ "name": "workspace_id",
357
+ "type": "uuid",
358
+ "primaryKey": false,
359
+ "notNull": true
360
+ },
361
+ "asset_id": {
362
+ "name": "asset_id",
363
+ "type": "uuid",
364
+ "primaryKey": false,
365
+ "notNull": true
366
+ },
367
+ "repair_id": {
368
+ "name": "repair_id",
369
+ "type": "uuid",
370
+ "primaryKey": false,
371
+ "notNull": false
372
+ },
373
+ "file_id": {
374
+ "name": "file_id",
375
+ "type": "uuid",
376
+ "primaryKey": false,
377
+ "notNull": true
378
+ },
379
+ "name": {
380
+ "name": "name",
381
+ "type": "text",
382
+ "primaryKey": false,
383
+ "notNull": true
384
+ },
385
+ "mime_type": {
386
+ "name": "mime_type",
387
+ "type": "text",
388
+ "primaryKey": false,
389
+ "notNull": false
390
+ },
391
+ "size": {
392
+ "name": "size",
393
+ "type": "integer",
394
+ "primaryKey": false,
395
+ "notNull": false
396
+ },
397
+ "uploaded_by": {
398
+ "name": "uploaded_by",
399
+ "type": "uuid",
400
+ "primaryKey": false,
401
+ "notNull": false
402
+ },
403
+ "created_at": {
404
+ "name": "created_at",
405
+ "type": "timestamp with time zone",
406
+ "primaryKey": false,
407
+ "notNull": true,
408
+ "default": "now()"
409
+ }
410
+ },
411
+ "indexes": {
412
+ "inventory_attachments_asset_file_uq": {
413
+ "name": "inventory_attachments_asset_file_uq",
414
+ "columns": [
415
+ {
416
+ "expression": "asset_id",
417
+ "isExpression": false,
418
+ "asc": true,
419
+ "nulls": "last"
420
+ },
421
+ {
422
+ "expression": "file_id",
423
+ "isExpression": false,
424
+ "asc": true,
425
+ "nulls": "last"
426
+ }
427
+ ],
428
+ "isUnique": true,
429
+ "concurrently": false,
430
+ "method": "btree",
431
+ "with": {}
432
+ },
433
+ "inventory_attachments_ws_asset_idx": {
434
+ "name": "inventory_attachments_ws_asset_idx",
435
+ "columns": [
436
+ {
437
+ "expression": "workspace_id",
438
+ "isExpression": false,
439
+ "asc": true,
440
+ "nulls": "last"
441
+ },
442
+ {
443
+ "expression": "asset_id",
444
+ "isExpression": false,
445
+ "asc": true,
446
+ "nulls": "last"
447
+ },
448
+ {
449
+ "expression": "created_at",
450
+ "isExpression": false,
451
+ "asc": true,
452
+ "nulls": "last"
453
+ }
454
+ ],
455
+ "isUnique": false,
456
+ "concurrently": false,
457
+ "method": "btree",
458
+ "with": {}
459
+ }
460
+ },
461
+ "foreignKeys": {},
462
+ "compositePrimaryKeys": {},
463
+ "uniqueConstraints": {},
464
+ "policies": {},
465
+ "checkConstraints": {},
466
+ "isRLSEnabled": false
467
+ },
468
+ "mod_inventory.categories": {
469
+ "name": "categories",
470
+ "schema": "mod_inventory",
471
+ "columns": {
472
+ "id": {
473
+ "name": "id",
474
+ "type": "uuid",
475
+ "primaryKey": true,
476
+ "notNull": true,
477
+ "default": "uuidv7()"
478
+ },
479
+ "workspace_id": {
480
+ "name": "workspace_id",
481
+ "type": "uuid",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "name": {
486
+ "name": "name",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "order": {
492
+ "name": "order",
493
+ "type": "integer",
494
+ "primaryKey": false,
495
+ "notNull": true,
496
+ "default": 0
497
+ },
498
+ "created_at": {
499
+ "name": "created_at",
500
+ "type": "timestamp with time zone",
501
+ "primaryKey": false,
502
+ "notNull": true,
503
+ "default": "now()"
504
+ },
505
+ "updated_at": {
506
+ "name": "updated_at",
507
+ "type": "timestamp with time zone",
508
+ "primaryKey": false,
509
+ "notNull": true,
510
+ "default": "now()"
511
+ }
512
+ },
513
+ "indexes": {
514
+ "inventory_categories_ws_name_uq": {
515
+ "name": "inventory_categories_ws_name_uq",
516
+ "columns": [
517
+ {
518
+ "expression": "workspace_id",
519
+ "isExpression": false,
520
+ "asc": true,
521
+ "nulls": "last"
522
+ },
523
+ {
524
+ "expression": "name",
525
+ "isExpression": false,
526
+ "asc": true,
527
+ "nulls": "last"
528
+ }
529
+ ],
530
+ "isUnique": true,
531
+ "concurrently": false,
532
+ "method": "btree",
533
+ "with": {}
534
+ },
535
+ "inventory_categories_ws_idx": {
536
+ "name": "inventory_categories_ws_idx",
537
+ "columns": [
538
+ {
539
+ "expression": "workspace_id",
540
+ "isExpression": false,
541
+ "asc": true,
542
+ "nulls": "last"
543
+ },
544
+ {
545
+ "expression": "order",
546
+ "isExpression": false,
547
+ "asc": true,
548
+ "nulls": "last"
549
+ }
550
+ ],
551
+ "isUnique": false,
552
+ "concurrently": false,
553
+ "method": "btree",
554
+ "with": {}
555
+ }
556
+ },
557
+ "foreignKeys": {},
558
+ "compositePrimaryKeys": {},
559
+ "uniqueConstraints": {},
560
+ "policies": {},
561
+ "checkConstraints": {},
562
+ "isRLSEnabled": false
563
+ },
564
+ "mod_inventory.counters": {
565
+ "name": "counters",
566
+ "schema": "mod_inventory",
567
+ "columns": {
568
+ "workspace_id": {
569
+ "name": "workspace_id",
570
+ "type": "uuid",
571
+ "primaryKey": true,
572
+ "notNull": true
573
+ },
574
+ "key": {
575
+ "name": "key",
576
+ "type": "text",
577
+ "primaryKey": true,
578
+ "notNull": true
579
+ },
580
+ "value": {
581
+ "name": "value",
582
+ "type": "integer",
583
+ "primaryKey": false,
584
+ "notNull": true
585
+ }
586
+ },
587
+ "indexes": {},
588
+ "foreignKeys": {},
589
+ "compositePrimaryKeys": {},
590
+ "uniqueConstraints": {},
591
+ "policies": {},
592
+ "checkConstraints": {},
593
+ "isRLSEnabled": false
594
+ },
595
+ "mod_inventory.custody_periods": {
596
+ "name": "custody_periods",
597
+ "schema": "mod_inventory",
598
+ "columns": {
599
+ "id": {
600
+ "name": "id",
601
+ "type": "uuid",
602
+ "primaryKey": true,
603
+ "notNull": true,
604
+ "default": "uuidv7()"
605
+ },
606
+ "workspace_id": {
607
+ "name": "workspace_id",
608
+ "type": "uuid",
609
+ "primaryKey": false,
610
+ "notNull": true
611
+ },
612
+ "asset_id": {
613
+ "name": "asset_id",
614
+ "type": "uuid",
615
+ "primaryKey": false,
616
+ "notNull": true
617
+ },
618
+ "user_id": {
619
+ "name": "user_id",
620
+ "type": "uuid",
621
+ "primaryKey": false,
622
+ "notNull": true
623
+ },
624
+ "note": {
625
+ "name": "note",
626
+ "type": "text",
627
+ "primaryKey": false,
628
+ "notNull": false
629
+ },
630
+ "effective_from": {
631
+ "name": "effective_from",
632
+ "type": "timestamp with time zone",
633
+ "primaryKey": false,
634
+ "notNull": true,
635
+ "default": "now()"
636
+ },
637
+ "effective_to": {
638
+ "name": "effective_to",
639
+ "type": "timestamp with time zone",
640
+ "primaryKey": false,
641
+ "notNull": false
642
+ },
643
+ "created_by": {
644
+ "name": "created_by",
645
+ "type": "uuid",
646
+ "primaryKey": false,
647
+ "notNull": false
648
+ },
649
+ "created_at": {
650
+ "name": "created_at",
651
+ "type": "timestamp with time zone",
652
+ "primaryKey": false,
653
+ "notNull": true,
654
+ "default": "now()"
655
+ }
656
+ },
657
+ "indexes": {
658
+ "inventory_custody_ws_asset_idx": {
659
+ "name": "inventory_custody_ws_asset_idx",
660
+ "columns": [
661
+ {
662
+ "expression": "workspace_id",
663
+ "isExpression": false,
664
+ "asc": true,
665
+ "nulls": "last"
666
+ },
667
+ {
668
+ "expression": "asset_id",
669
+ "isExpression": false,
670
+ "asc": true,
671
+ "nulls": "last"
672
+ },
673
+ {
674
+ "expression": "effective_from",
675
+ "isExpression": false,
676
+ "asc": true,
677
+ "nulls": "last"
678
+ }
679
+ ],
680
+ "isUnique": false,
681
+ "concurrently": false,
682
+ "method": "btree",
683
+ "with": {}
684
+ }
685
+ },
686
+ "foreignKeys": {},
687
+ "compositePrimaryKeys": {},
688
+ "uniqueConstraints": {},
689
+ "policies": {},
690
+ "checkConstraints": {},
691
+ "isRLSEnabled": false
692
+ },
693
+ "mod_inventory.field_defs": {
694
+ "name": "field_defs",
695
+ "schema": "mod_inventory",
696
+ "columns": {
697
+ "id": {
698
+ "name": "id",
699
+ "type": "uuid",
700
+ "primaryKey": true,
701
+ "notNull": true,
702
+ "default": "uuidv7()"
703
+ },
704
+ "workspace_id": {
705
+ "name": "workspace_id",
706
+ "type": "uuid",
707
+ "primaryKey": false,
708
+ "notNull": true
709
+ },
710
+ "category_id": {
711
+ "name": "category_id",
712
+ "type": "uuid",
713
+ "primaryKey": false,
714
+ "notNull": false
715
+ },
716
+ "key": {
717
+ "name": "key",
718
+ "type": "text",
719
+ "primaryKey": false,
720
+ "notNull": true
721
+ },
722
+ "name": {
723
+ "name": "name",
724
+ "type": "text",
725
+ "primaryKey": false,
726
+ "notNull": true
727
+ },
728
+ "description": {
729
+ "name": "description",
730
+ "type": "text",
731
+ "primaryKey": false,
732
+ "notNull": false
733
+ },
734
+ "type": {
735
+ "name": "type",
736
+ "type": "text",
737
+ "primaryKey": false,
738
+ "notNull": true
739
+ },
740
+ "options": {
741
+ "name": "options",
742
+ "type": "jsonb",
743
+ "primaryKey": false,
744
+ "notNull": false
745
+ },
746
+ "default_value": {
747
+ "name": "default_value",
748
+ "type": "jsonb",
749
+ "primaryKey": false,
750
+ "notNull": false
751
+ },
752
+ "required": {
753
+ "name": "required",
754
+ "type": "boolean",
755
+ "primaryKey": false,
756
+ "notNull": true,
757
+ "default": false
758
+ },
759
+ "searchable": {
760
+ "name": "searchable",
761
+ "type": "boolean",
762
+ "primaryKey": false,
763
+ "notNull": true,
764
+ "default": false
765
+ },
766
+ "show_in_list": {
767
+ "name": "show_in_list",
768
+ "type": "boolean",
769
+ "primaryKey": false,
770
+ "notNull": true,
771
+ "default": false
772
+ },
773
+ "order": {
774
+ "name": "order",
775
+ "type": "integer",
776
+ "primaryKey": false,
777
+ "notNull": true,
778
+ "default": 0
779
+ },
780
+ "archived_at": {
781
+ "name": "archived_at",
782
+ "type": "timestamp with time zone",
783
+ "primaryKey": false,
784
+ "notNull": false
785
+ },
786
+ "created_at": {
787
+ "name": "created_at",
788
+ "type": "timestamp with time zone",
789
+ "primaryKey": false,
790
+ "notNull": true,
791
+ "default": "now()"
792
+ },
793
+ "updated_at": {
794
+ "name": "updated_at",
795
+ "type": "timestamp with time zone",
796
+ "primaryKey": false,
797
+ "notNull": true,
798
+ "default": "now()"
799
+ }
800
+ },
801
+ "indexes": {
802
+ "inventory_field_defs_ws_key_uq": {
803
+ "name": "inventory_field_defs_ws_key_uq",
804
+ "columns": [
805
+ {
806
+ "expression": "workspace_id",
807
+ "isExpression": false,
808
+ "asc": true,
809
+ "nulls": "last"
810
+ },
811
+ {
812
+ "expression": "key",
813
+ "isExpression": false,
814
+ "asc": true,
815
+ "nulls": "last"
816
+ }
817
+ ],
818
+ "isUnique": true,
819
+ "concurrently": false,
820
+ "method": "btree",
821
+ "with": {}
822
+ },
823
+ "inventory_field_defs_ws_idx": {
824
+ "name": "inventory_field_defs_ws_idx",
825
+ "columns": [
826
+ {
827
+ "expression": "workspace_id",
828
+ "isExpression": false,
829
+ "asc": true,
830
+ "nulls": "last"
831
+ },
832
+ {
833
+ "expression": "order",
834
+ "isExpression": false,
835
+ "asc": true,
836
+ "nulls": "last"
837
+ }
838
+ ],
839
+ "isUnique": false,
840
+ "concurrently": false,
841
+ "method": "btree",
842
+ "with": {}
843
+ }
844
+ },
845
+ "foreignKeys": {},
846
+ "compositePrimaryKeys": {},
847
+ "uniqueConstraints": {},
848
+ "policies": {},
849
+ "checkConstraints": {},
850
+ "isRLSEnabled": false
851
+ },
852
+ "mod_inventory.repairs": {
853
+ "name": "repairs",
854
+ "schema": "mod_inventory",
855
+ "columns": {
856
+ "id": {
857
+ "name": "id",
858
+ "type": "uuid",
859
+ "primaryKey": true,
860
+ "notNull": true,
861
+ "default": "uuidv7()"
862
+ },
863
+ "workspace_id": {
864
+ "name": "workspace_id",
865
+ "type": "uuid",
866
+ "primaryKey": false,
867
+ "notNull": true
868
+ },
869
+ "asset_id": {
870
+ "name": "asset_id",
871
+ "type": "uuid",
872
+ "primaryKey": false,
873
+ "notNull": true
874
+ },
875
+ "summary": {
876
+ "name": "summary",
877
+ "type": "text",
878
+ "primaryKey": false,
879
+ "notNull": true
880
+ },
881
+ "detail": {
882
+ "name": "detail",
883
+ "type": "text",
884
+ "primaryKey": false,
885
+ "notNull": false
886
+ },
887
+ "vendor": {
888
+ "name": "vendor",
889
+ "type": "text",
890
+ "primaryKey": false,
891
+ "notNull": false
892
+ },
893
+ "cost_minor": {
894
+ "name": "cost_minor",
895
+ "type": "integer",
896
+ "primaryKey": false,
897
+ "notNull": false
898
+ },
899
+ "currency": {
900
+ "name": "currency",
901
+ "type": "char(3)",
902
+ "primaryKey": false,
903
+ "notNull": false
904
+ },
905
+ "sent_on": {
906
+ "name": "sent_on",
907
+ "type": "date",
908
+ "primaryKey": false,
909
+ "notNull": true
910
+ },
911
+ "returned_on": {
912
+ "name": "returned_on",
913
+ "type": "date",
914
+ "primaryKey": false,
915
+ "notNull": false
916
+ },
917
+ "created_by": {
918
+ "name": "created_by",
919
+ "type": "uuid",
920
+ "primaryKey": false,
921
+ "notNull": false
922
+ },
923
+ "created_at": {
924
+ "name": "created_at",
925
+ "type": "timestamp with time zone",
926
+ "primaryKey": false,
927
+ "notNull": true,
928
+ "default": "now()"
929
+ },
930
+ "updated_at": {
931
+ "name": "updated_at",
932
+ "type": "timestamp with time zone",
933
+ "primaryKey": false,
934
+ "notNull": true,
935
+ "default": "now()"
936
+ }
937
+ },
938
+ "indexes": {
939
+ "inventory_repairs_ws_asset_idx": {
940
+ "name": "inventory_repairs_ws_asset_idx",
941
+ "columns": [
942
+ {
943
+ "expression": "workspace_id",
944
+ "isExpression": false,
945
+ "asc": true,
946
+ "nulls": "last"
947
+ },
948
+ {
949
+ "expression": "asset_id",
950
+ "isExpression": false,
951
+ "asc": true,
952
+ "nulls": "last"
953
+ },
954
+ {
955
+ "expression": "sent_on",
956
+ "isExpression": false,
957
+ "asc": true,
958
+ "nulls": "last"
959
+ }
960
+ ],
961
+ "isUnique": false,
962
+ "concurrently": false,
963
+ "method": "btree",
964
+ "with": {}
965
+ }
966
+ },
967
+ "foreignKeys": {},
968
+ "compositePrimaryKeys": {},
969
+ "uniqueConstraints": {},
970
+ "policies": {},
971
+ "checkConstraints": {},
972
+ "isRLSEnabled": false
973
+ }
974
+ },
975
+ "enums": {
976
+ "public.asset_status": {
977
+ "name": "asset_status",
978
+ "schema": "public",
979
+ "values": ["in_stock", "assigned", "under_repair", "retired"]
980
+ }
981
+ },
982
+ "schemas": {
983
+ "mod_inventory": "mod_inventory"
984
+ },
985
+ "sequences": {},
986
+ "roles": {},
987
+ "policies": {},
988
+ "views": {},
989
+ "_meta": {
990
+ "columns": {},
991
+ "schemas": {},
992
+ "tables": {}
993
+ }
994
+ }