@happyvertical/smrt-places 0.57.35 → 0.57.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,256 +2,136 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-places",
5
- "packageVersion": "0.57.35",
5
+ "packageVersion": "0.57.36",
6
6
  "objects": {
7
- "@happyvertical/smrt-places:Place": {
8
- "name": "place",
9
- "className": "Place",
10
- "qualifiedName": "@happyvertical/smrt-places:Place",
11
- "collection": "places",
12
- "filePath": "/home/runner/work/smrt/smrt/packages/places/src/models/Place.ts",
7
+ "@happyvertical/smrt-places:PlaceAssetCollection": {
8
+ "name": "placeassetcollection",
9
+ "className": "PlaceAssetCollection",
10
+ "qualifiedName": "@happyvertical/smrt-places:PlaceAssetCollection",
11
+ "collection": "placeassets",
12
+ "filePath": "/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceAssetCollection.ts",
13
13
  "packageName": "@happyvertical/smrt-places",
14
- "fields": {
15
- "created_at": {
16
- "type": "datetime",
17
- "required": false
18
- },
19
- "updated_at": {
20
- "type": "datetime",
21
- "required": false
22
- },
23
- "parentId": {
24
- "type": "foreignKey",
25
- "required": false,
26
- "related": "Place",
27
- "_meta": {
28
- "nullable": true
29
- }
30
- },
31
- "tenantId": {
32
- "type": "text",
33
- "required": false,
34
- "_meta": {
35
- "sqlType": "UUID",
36
- "nullable": true,
37
- "__tenancy": {
38
- "isTenantIdField": true,
39
- "autoFilter": true,
40
- "required": false,
41
- "autoPopulate": true,
42
- "nullable": true,
43
- "mode": "optional",
44
- "field": "tenantId",
45
- "allowSuperAdminBypass": false
46
- }
47
- }
48
- },
49
- "typeId": {
50
- "type": "foreignKey",
51
- "required": false,
52
- "related": "PlaceType"
53
- },
54
- "name": {
55
- "type": "text",
56
- "required": false
57
- },
58
- "description": {
59
- "type": "text",
60
- "required": false
61
- },
62
- "latitude": {
63
- "type": "decimal",
64
- "required": false,
65
- "_meta": {}
66
- },
67
- "longitude": {
68
- "type": "decimal",
69
- "required": false,
70
- "_meta": {}
71
- },
72
- "streetNumber": {
73
- "type": "text",
74
- "required": false
75
- },
76
- "streetName": {
77
- "type": "text",
78
- "required": false
79
- },
80
- "city": {
81
- "type": "text",
82
- "required": false
83
- },
84
- "region": {
85
- "type": "text",
86
- "required": false
87
- },
88
- "country": {
89
- "type": "text",
90
- "required": false
91
- },
92
- "postalCode": {
93
- "type": "text",
94
- "required": false
95
- },
96
- "countryCode": {
97
- "type": "text",
98
- "required": false
99
- },
100
- "timezone": {
101
- "type": "text",
102
- "required": false
103
- },
104
- "externalId": {
105
- "type": "text",
106
- "required": false
107
- },
108
- "source": {
109
- "type": "text",
110
- "required": false
111
- },
112
- "metadata": {
113
- "type": "text",
114
- "required": false
115
- },
116
- "createdAt": {
117
- "type": "text",
118
- "required": false
119
- },
120
- "updatedAt": {
121
- "type": "text",
122
- "required": false
123
- }
124
- },
14
+ "fields": {},
125
15
  "methods": {
126
- "getParent": {
127
- "name": "getParent",
128
- "async": true,
129
- "parameters": [],
130
- "returnType": "Promise<this | null>",
131
- "isStatic": false,
132
- "isPublic": true
133
- },
134
- "getChildren": {
135
- "name": "getChildren",
16
+ "byRight": {
17
+ "name": "byRight",
136
18
  "async": true,
137
- "parameters": [],
138
- "returnType": "Promise<this[]>",
19
+ "parameters": [
20
+ {
21
+ "name": "rightId",
22
+ "type": "string",
23
+ "optional": false
24
+ },
25
+ {
26
+ "name": "opts",
27
+ "type": "JunctionFilterOptions",
28
+ "optional": true
29
+ }
30
+ ],
31
+ "returnType": "Promise<TItem[]>",
139
32
  "isStatic": false,
140
33
  "isPublic": true
141
34
  },
142
- "getAncestors": {
143
- "name": "getAncestors",
35
+ "byLeft": {
36
+ "name": "byLeft",
144
37
  "async": true,
145
- "parameters": [],
146
- "returnType": "Promise<this[]>",
38
+ "parameters": [
39
+ {
40
+ "name": "leftId",
41
+ "type": "string",
42
+ "optional": false
43
+ },
44
+ {
45
+ "name": "opts",
46
+ "type": "JunctionFilterOptions",
47
+ "optional": true
48
+ }
49
+ ],
50
+ "returnType": "Promise<TItem[]>",
147
51
  "isStatic": false,
148
52
  "isPublic": true
149
53
  },
150
- "getDescendants": {
151
- "name": "getDescendants",
54
+ "attach": {
55
+ "name": "attach",
152
56
  "async": true,
153
- "parameters": [],
154
- "returnType": "Promise<this[]>",
57
+ "parameters": [
58
+ {
59
+ "name": "leftId",
60
+ "type": "string",
61
+ "optional": false
62
+ },
63
+ {
64
+ "name": "rightId",
65
+ "type": "string",
66
+ "optional": false
67
+ },
68
+ {
69
+ "name": "opts",
70
+ "type": "JunctionAttachOptions",
71
+ "optional": true
72
+ }
73
+ ],
74
+ "returnType": "Promise<TItem>",
155
75
  "isStatic": false,
156
76
  "isPublic": true
157
77
  },
158
- "getHierarchy": {
159
- "name": "getHierarchy",
78
+ "detach": {
79
+ "name": "detach",
160
80
  "async": true,
161
- "parameters": [],
162
- "returnType": "Promise<HierarchyView<this>>",
81
+ "parameters": [
82
+ {
83
+ "name": "leftId",
84
+ "type": "string",
85
+ "optional": false
86
+ },
87
+ {
88
+ "name": "rightId",
89
+ "type": "string",
90
+ "optional": false
91
+ },
92
+ {
93
+ "name": "opts",
94
+ "type": "JunctionFilterOptions",
95
+ "optional": true
96
+ }
97
+ ],
98
+ "returnType": "Promise<void>",
163
99
  "isStatic": false,
164
100
  "isPublic": true
165
101
  },
166
- "moveTo": {
167
- "name": "moveTo",
102
+ "setLinks": {
103
+ "name": "setLinks",
168
104
  "async": true,
169
105
  "parameters": [
170
106
  {
171
- "name": "newParent",
172
- "type": "this | string | null",
173
- "optional": false,
174
- "unionBranches": [
175
- {
176
- "type": "this"
177
- },
178
- {
179
- "type": "string"
180
- },
181
- {
182
- "type": "null"
183
- }
184
- ]
107
+ "name": "leftId",
108
+ "type": "string",
109
+ "optional": false
110
+ },
111
+ {
112
+ "name": "rightIds",
113
+ "type": "string[]",
114
+ "optional": false
115
+ },
116
+ {
117
+ "name": "opts",
118
+ "type": "JunctionAttachOptions",
119
+ "optional": true
185
120
  }
186
121
  ],
187
122
  "returnType": "Promise<void>",
188
123
  "isStatic": false,
189
124
  "isPublic": true
190
125
  },
191
- "getGeoData": {
192
- "name": "getGeoData",
193
- "async": false,
194
- "parameters": [],
195
- "returnType": "GeoData",
196
- "isStatic": false,
197
- "isPublic": true
198
- },
199
- "hasCoordinates": {
200
- "name": "hasCoordinates",
201
- "async": false,
202
- "parameters": [],
203
- "returnType": "boolean",
204
- "isStatic": false,
205
- "isPublic": true
206
- },
207
- "getMetadata": {
208
- "name": "getMetadata",
209
- "async": false,
210
- "parameters": [],
211
- "returnType": "Record<string, unknown>",
212
- "isStatic": false,
213
- "isPublic": true
214
- },
215
- "setMetadata": {
216
- "name": "setMetadata",
217
- "async": false,
218
- "parameters": [
219
- {
220
- "name": "data",
221
- "type": "Record<string, unknown>",
222
- "optional": false
223
- }
224
- ],
225
- "returnType": "void",
226
- "isStatic": false,
227
- "isPublic": true
228
- },
229
- "updateMetadata": {
230
- "name": "updateMetadata",
231
- "async": false,
232
- "parameters": [
233
- {
234
- "name": "updates",
235
- "type": "Record<string, unknown>",
236
- "optional": false
237
- }
238
- ],
239
- "returnType": "void",
240
- "isStatic": false,
241
- "isPublic": true
242
- },
243
- "getType": {
244
- "name": "getType",
245
- "async": true,
246
- "parameters": [],
247
- "returnType": "any",
248
- "isStatic": false,
249
- "isPublic": true
250
- },
251
126
  "getAssets": {
252
127
  "name": "getAssets",
253
128
  "async": true,
254
129
  "parameters": [
130
+ {
131
+ "name": "placeId",
132
+ "type": "string",
133
+ "optional": false
134
+ },
255
135
  {
256
136
  "name": "relationship",
257
137
  "type": "string",
@@ -266,6 +146,11 @@
266
146
  "name": "addAsset",
267
147
  "async": true,
268
148
  "parameters": [
149
+ {
150
+ "name": "placeId",
151
+ "type": "string",
152
+ "optional": false
153
+ },
269
154
  {
270
155
  "name": "asset",
271
156
  "type": "Asset",
@@ -287,40 +172,15 @@
287
172
  "isStatic": false,
288
173
  "isPublic": true
289
174
  },
290
- "getMainAsset": {
291
- "name": "getMainAsset",
292
- "async": true,
293
- "parameters": [],
294
- "returnType": "Promise<Asset | null>",
295
- "isStatic": false,
296
- "isPublic": true
297
- },
298
- "setMainAsset": {
299
- "name": "setMainAsset",
300
- "async": true,
301
- "parameters": [
302
- {
303
- "name": "asset",
304
- "type": "Asset | null",
305
- "optional": false,
306
- "unionBranches": [
307
- {
308
- "type": "Asset"
309
- },
310
- {
311
- "type": "null"
312
- }
313
- ]
314
- }
315
- ],
316
- "returnType": "Promise<void>",
317
- "isStatic": false,
318
- "isPublic": true
319
- },
320
175
  "removeAsset": {
321
176
  "name": "removeAsset",
322
177
  "async": true,
323
178
  "parameters": [
179
+ {
180
+ "name": "placeId",
181
+ "type": "string",
182
+ "optional": false
183
+ },
324
184
  {
325
185
  "name": "assetId",
326
186
  "type": "string",
@@ -338,44 +198,18 @@
338
198
  }
339
199
  },
340
200
  "decoratorConfig": {
341
- "tableStrategy": "sti",
342
- "api": {
343
- "include": [
344
- "list",
345
- "get",
346
- "create",
347
- "update",
348
- "delete"
349
- ]
350
- },
351
- "mcp": {
352
- "include": [
353
- "list",
354
- "get",
355
- "create",
356
- "update"
357
- ]
358
- },
359
- "cli": {
360
- "skipApiCheck": true
361
- },
362
- "tenantScoped": {
363
- "mode": "optional"
364
- },
365
- "conflictColumns": [
366
- "tenant_id",
367
- "slug",
368
- "context",
369
- "_meta_type"
370
- ]
201
+ "api": false,
202
+ "mcp": false,
203
+ "cli": false,
204
+ "tableName": "place_assets"
371
205
  },
372
- "extends": "SmrtHierarchical",
373
- "exportName": "Place",
374
- "collectionExportName": "PlaceCollection",
375
- "displayLabelField": "name",
206
+ "extends": "SmrtJunction",
207
+ "extendsTypeArg": "PlaceAsset",
208
+ "exportName": "PlaceAssetCollection",
209
+ "collectionExportName": "PlaceAssetCollectionCollection",
376
210
  "schema": {
377
- "tableName": "places",
378
- "ddl": "CREATE TABLE IF NOT EXISTS \"places\" (\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 \"parent_id\" UUID,\n \"tenant_id\" UUID,\n \"type_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"latitude\" REAL,\n \"longitude\" REAL,\n \"street_number\" TEXT,\n \"street_name\" TEXT,\n \"city\" TEXT,\n \"region\" TEXT,\n \"country\" TEXT,\n \"postal_code\" TEXT,\n \"country_code\" TEXT,\n \"timezone\" TEXT,\n \"external_id\" TEXT,\n \"source\" TEXT,\n \"metadata\" TEXT\n);",
211
+ "tableName": "place_assets",
212
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\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 \"place_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
379
213
  "columns": {
380
214
  "id": {
381
215
  "type": "UUID",
@@ -392,14 +226,6 @@
392
226
  "notNull": true,
393
227
  "default": ""
394
228
  },
395
- "_meta_type": {
396
- "type": "TEXT",
397
- "notNull": true
398
- },
399
- "_meta_data": {
400
- "type": "JSON",
401
- "notNull": false
402
- },
403
229
  "created_at": {
404
230
  "type": "TIMESTAMP",
405
231
  "notNull": true,
@@ -410,306 +236,51 @@
410
236
  "notNull": true,
411
237
  "default": "current_timestamp"
412
238
  },
413
- "parent_id": {
414
- "type": "UUID",
415
- "referenceKind": "foreignKey",
416
- "notNull": false,
417
- "foreignKey": {
418
- "table": "places",
419
- "column": "id",
420
- "onDelete": "NO ACTION",
421
- "onUpdate": "CASCADE"
422
- }
423
- },
424
239
  "tenant_id": {
425
240
  "type": "UUID",
426
241
  "referenceKind": "tenantId",
427
- "notNull": false
242
+ "notNull": false,
243
+ "unique": false
428
244
  },
429
- "type_id": {
245
+ "place_id": {
430
246
  "type": "UUID",
431
247
  "referenceKind": "foreignKey",
432
- "notNull": false,
248
+ "notNull": true,
249
+ "unique": false,
433
250
  "foreignKey": {
434
- "table": "place_types",
251
+ "table": "places",
435
252
  "column": "id",
436
- "onDelete": "NO ACTION",
253
+ "onDelete": "CASCADE",
437
254
  "onUpdate": "CASCADE"
438
255
  }
439
256
  },
440
- "name": {
441
- "type": "TEXT",
442
- "notNull": false
443
- },
444
- "description": {
445
- "type": "TEXT",
446
- "notNull": false
447
- },
448
- "latitude": {
449
- "type": "REAL",
450
- "notNull": false
451
- },
452
- "longitude": {
453
- "type": "REAL",
454
- "notNull": false
455
- },
456
- "street_number": {
457
- "type": "TEXT",
458
- "notNull": false
459
- },
460
- "street_name": {
461
- "type": "TEXT",
462
- "notNull": false
463
- },
464
- "city": {
465
- "type": "TEXT",
466
- "notNull": false
467
- },
468
- "region": {
469
- "type": "TEXT",
470
- "notNull": false
471
- },
472
- "country": {
473
- "type": "TEXT",
474
- "notNull": false
475
- },
476
- "postal_code": {
477
- "type": "TEXT",
478
- "notNull": false
479
- },
480
- "country_code": {
481
- "type": "TEXT",
482
- "notNull": false
483
- },
484
- "timezone": {
485
- "type": "TEXT",
486
- "notNull": false
487
- },
488
- "external_id": {
489
- "type": "TEXT",
490
- "notNull": false
257
+ "asset_id": {
258
+ "type": "UUID",
259
+ "referenceKind": "crossPackageRef",
260
+ "notNull": true,
261
+ "unique": false
491
262
  },
492
- "source": {
263
+ "relationship": {
493
264
  "type": "TEXT",
494
- "notNull": false
265
+ "notNull": true,
266
+ "unique": false
495
267
  },
496
- "metadata": {
497
- "type": "TEXT",
498
- "notNull": false
268
+ "sort_order": {
269
+ "type": "INTEGER",
270
+ "notNull": true,
271
+ "unique": false,
272
+ "default": 0
499
273
  }
500
274
  },
501
275
  "indexes": [
502
276
  {
503
- "name": "places_slug_context_meta_type_idx",
277
+ "name": "place_assets_place_id_asset_id_idx",
504
278
  "columns": [
505
- "tenant_id",
506
- "slug",
507
- "context",
508
- "_meta_type"
279
+ "place_id",
280
+ "asset_id",
281
+ "relationship"
509
282
  ],
510
- "unique": true,
511
- "nullsNotDistinct": true
512
- },
513
- {
514
- "name": "places_meta_type_idx",
515
- "columns": [
516
- "_meta_type"
517
- ]
518
- },
519
- {
520
- "name": "places_tenant_id_created_at_idx",
521
- "columns": [
522
- "tenant_id",
523
- "created_at"
524
- ]
525
- },
526
- {
527
- "name": "places_parent_id_idx",
528
- "columns": [
529
- "parent_id"
530
- ]
531
- },
532
- {
533
- "name": "places_type_id_idx",
534
- "columns": [
535
- "type_id"
536
- ]
537
- }
538
- ],
539
- "version": "f670088c"
540
- },
541
- "importPath": "@happyvertical/smrt-places"
542
- },
543
- "@happyvertical/smrt-places:PlaceAsset": {
544
- "name": "placeasset",
545
- "className": "PlaceAsset",
546
- "qualifiedName": "@happyvertical/smrt-places:PlaceAsset",
547
- "collection": "placeassets",
548
- "filePath": "/home/runner/work/smrt/smrt/packages/places/src/models/PlaceAsset.ts",
549
- "packageName": "@happyvertical/smrt-places",
550
- "fields": {
551
- "tenantId": {
552
- "type": "text",
553
- "required": false,
554
- "_meta": {
555
- "sqlType": "UUID",
556
- "nullable": true,
557
- "__tenancy": {
558
- "isTenantIdField": true,
559
- "autoFilter": true,
560
- "required": false,
561
- "autoPopulate": true,
562
- "nullable": true,
563
- "mode": "optional",
564
- "field": "tenantId",
565
- "allowSuperAdminBypass": false
566
- }
567
- }
568
- },
569
- "placeId": {
570
- "type": "foreignKey",
571
- "required": true,
572
- "related": "Place",
573
- "_meta": {
574
- "required": true,
575
- "onDelete": "CASCADE"
576
- }
577
- },
578
- "assetId": {
579
- "type": "crossPackageRef",
580
- "required": true,
581
- "related": "@happyvertical/smrt-assets:Asset",
582
- "_meta": {
583
- "onDelete": "CASCADE"
584
- }
585
- },
586
- "relationship": {
587
- "type": "text",
588
- "required": true,
589
- "_meta": {
590
- "required": true
591
- }
592
- },
593
- "sortOrder": {
594
- "type": "integer",
595
- "required": true,
596
- "default": 0
597
- }
598
- },
599
- "methods": {},
600
- "decoratorConfig": {
601
- "tableName": "place_assets",
602
- "conflictColumns": [
603
- "place_id",
604
- "asset_id",
605
- "relationship"
606
- ],
607
- "api": false,
608
- "mcp": false,
609
- "cli": false,
610
- "tenantScoped": {
611
- "mode": "optional"
612
- }
613
- },
614
- "extends": "SmrtObject",
615
- "exportName": "PlaceAsset",
616
- "collectionExportName": "PlaceAssetCollection",
617
- "validationRules": [
618
- {
619
- "field": "placeId",
620
- "rule": "required",
621
- "fieldType": "foreignKey"
622
- },
623
- {
624
- "field": "assetId",
625
- "rule": "required",
626
- "fieldType": "crossPackageRef"
627
- },
628
- {
629
- "field": "relationship",
630
- "rule": "required",
631
- "fieldType": "text"
632
- },
633
- {
634
- "field": "sortOrder",
635
- "rule": "required",
636
- "fieldType": "integer"
637
- }
638
- ],
639
- "schema": {
640
- "tableName": "place_assets",
641
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\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 \"place_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
642
- "columns": {
643
- "id": {
644
- "type": "UUID",
645
- "primaryKey": true,
646
- "referenceKind": "id",
647
- "notNull": true
648
- },
649
- "slug": {
650
- "type": "TEXT",
651
- "notNull": true
652
- },
653
- "context": {
654
- "type": "TEXT",
655
- "notNull": true,
656
- "default": ""
657
- },
658
- "created_at": {
659
- "type": "TIMESTAMP",
660
- "notNull": true,
661
- "default": "current_timestamp"
662
- },
663
- "updated_at": {
664
- "type": "TIMESTAMP",
665
- "notNull": true,
666
- "default": "current_timestamp"
667
- },
668
- "tenant_id": {
669
- "type": "UUID",
670
- "referenceKind": "tenantId",
671
- "notNull": false,
672
- "unique": false
673
- },
674
- "place_id": {
675
- "type": "UUID",
676
- "referenceKind": "foreignKey",
677
- "notNull": true,
678
- "unique": false,
679
- "foreignKey": {
680
- "table": "places",
681
- "column": "id",
682
- "onDelete": "CASCADE",
683
- "onUpdate": "CASCADE"
684
- }
685
- },
686
- "asset_id": {
687
- "type": "UUID",
688
- "referenceKind": "crossPackageRef",
689
- "notNull": true,
690
- "unique": false
691
- },
692
- "relationship": {
693
- "type": "TEXT",
694
- "notNull": true,
695
- "unique": false
696
- },
697
- "sort_order": {
698
- "type": "INTEGER",
699
- "notNull": true,
700
- "unique": false,
701
- "default": 0
702
- }
703
- },
704
- "indexes": [
705
- {
706
- "name": "place_assets_place_id_asset_id_idx",
707
- "columns": [
708
- "place_id",
709
- "asset_id",
710
- "relationship"
711
- ],
712
- "unique": true
283
+ "unique": true
713
284
  },
714
285
  {
715
286
  "name": "place_assets_slug_context_idx",
@@ -736,282 +307,129 @@
736
307
  },
737
308
  "importPath": "@happyvertical/smrt-places"
738
309
  },
739
- "@happyvertical/smrt-places:PlaceType": {
740
- "name": "placetype",
741
- "className": "PlaceType",
742
- "qualifiedName": "@happyvertical/smrt-places:PlaceType",
743
- "collection": "placetypes",
744
- "filePath": "/home/runner/work/smrt/smrt/packages/places/src/models/PlaceType.ts",
310
+ "@happyvertical/smrt-places:PlaceCollection": {
311
+ "name": "placecollection",
312
+ "className": "PlaceCollection",
313
+ "qualifiedName": "@happyvertical/smrt-places:PlaceCollection",
314
+ "collection": "places",
315
+ "filePath": "/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceCollection.ts",
745
316
  "packageName": "@happyvertical/smrt-places",
746
- "fields": {
747
- "created_at": {
748
- "type": "datetime",
749
- "required": false
750
- },
751
- "updated_at": {
752
- "type": "datetime",
753
- "required": false
754
- },
755
- "name": {
756
- "type": "text",
757
- "required": true,
758
- "default": "",
759
- "_meta": {
760
- "required": true
761
- }
762
- },
763
- "description": {
764
- "type": "text",
765
- "required": false
766
- },
767
- "createdAt": {
768
- "type": "text",
769
- "required": false
770
- },
771
- "updatedAt": {
772
- "type": "text",
773
- "required": false
774
- }
775
- },
317
+ "fields": {},
776
318
  "methods": {
777
- "getBySlug": {
778
- "name": "getBySlug",
319
+ "lookupOrCreate": {
320
+ "name": "lookupOrCreate",
779
321
  "async": true,
780
322
  "parameters": [
781
323
  {
782
- "name": "_slug",
324
+ "name": "query",
783
325
  "type": "string",
784
326
  "optional": false
327
+ },
328
+ {
329
+ "name": "options",
330
+ "type": "LookupOrCreateOptions",
331
+ "optional": true
785
332
  }
786
333
  ],
787
- "returnType": "Promise<PlaceType | null>",
788
- "isStatic": true,
334
+ "returnType": "Promise<Place | null>",
335
+ "isStatic": false,
789
336
  "isPublic": true
790
- }
791
- },
792
- "decoratorConfig": {
793
- "tableStrategy": "sti",
794
- "api": {
795
- "include": [
796
- "list",
797
- "get",
798
- "create",
799
- "update",
800
- "delete"
801
- ]
802
- },
803
- "mcp": {
804
- "include": [
805
- "list",
806
- "get",
807
- "create"
808
- ]
809
- },
810
- "cli": {
811
- "skipApiCheck": true
812
- }
813
- },
814
- "extends": "SmrtObject",
815
- "exportName": "PlaceType",
816
- "collectionExportName": "PlaceTypeCollection",
817
- "displayLabelField": "name",
818
- "validationRules": [
819
- {
820
- "field": "name",
821
- "rule": "required",
822
- "fieldType": "text"
823
- }
824
- ],
825
- "schema": {
826
- "tableName": "place_types",
827
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_types\" (\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 \"name\" TEXT DEFAULT '',\n \"description\" TEXT\n);",
828
- "columns": {
829
- "id": {
830
- "type": "UUID",
831
- "primaryKey": true,
832
- "referenceKind": "id",
833
- "notNull": true
834
- },
835
- "slug": {
836
- "type": "TEXT",
837
- "notNull": true
838
- },
839
- "context": {
840
- "type": "TEXT",
841
- "notNull": true,
842
- "default": ""
843
- },
844
- "_meta_type": {
845
- "type": "TEXT",
846
- "notNull": true
847
- },
848
- "_meta_data": {
849
- "type": "JSON",
850
- "notNull": false
851
- },
852
- "created_at": {
853
- "type": "TIMESTAMP",
854
- "notNull": true,
855
- "default": "current_timestamp"
856
- },
857
- "updated_at": {
858
- "type": "TIMESTAMP",
859
- "notNull": true,
860
- "default": "current_timestamp"
861
- },
862
- "name": {
863
- "type": "TEXT",
864
- "notNull": false,
865
- "default": ""
866
- },
867
- "description": {
868
- "type": "TEXT",
869
- "notNull": false
870
- }
871
337
  },
872
- "indexes": [
873
- {
874
- "name": "place_types_slug_context_meta_type_idx",
875
- "columns": [
876
- "slug",
877
- "context",
878
- "_meta_type"
879
- ],
880
- "unique": true
881
- },
882
- {
883
- "name": "place_types_meta_type_idx",
884
- "columns": [
885
- "_meta_type"
886
- ]
887
- },
888
- {
889
- "name": "place_types_created_at_idx",
890
- "columns": [
891
- "created_at"
892
- ]
893
- }
894
- ],
895
- "version": "8c3bb691"
896
- },
897
- "importPath": "@happyvertical/smrt-places"
898
- },
899
- "@happyvertical/smrt-places:PlaceAssetCollection": {
900
- "name": "placeassetcollection",
901
- "className": "PlaceAssetCollection",
902
- "qualifiedName": "@happyvertical/smrt-places:PlaceAssetCollection",
903
- "collection": "placeassets",
904
- "filePath": "/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceAssetCollection.ts",
905
- "packageName": "@happyvertical/smrt-places",
906
- "fields": {},
907
- "methods": {
908
- "byRight": {
909
- "name": "byRight",
338
+ "discoverNearby": {
339
+ "name": "discoverNearby",
910
340
  "async": true,
911
341
  "parameters": [
912
342
  {
913
- "name": "rightId",
914
- "type": "string",
343
+ "name": "latitude",
344
+ "type": "number",
915
345
  "optional": false
916
346
  },
917
347
  {
918
- "name": "opts",
919
- "type": "JunctionFilterOptions",
348
+ "name": "longitude",
349
+ "type": "number",
350
+ "optional": false
351
+ },
352
+ {
353
+ "name": "radiusMeters",
354
+ "type": "number",
355
+ "optional": false
356
+ },
357
+ {
358
+ "name": "options",
359
+ "type": "DiscoverNearbyOptions",
920
360
  "optional": true
921
361
  }
922
362
  ],
923
- "returnType": "Promise<TItem[]>",
363
+ "returnType": "Promise<Place[]>",
924
364
  "isStatic": false,
925
365
  "isPublic": true
926
366
  },
927
- "byLeft": {
928
- "name": "byLeft",
367
+ "resolveTrackPlaces": {
368
+ "name": "resolveTrackPlaces",
929
369
  "async": true,
930
370
  "parameters": [
931
371
  {
932
- "name": "leftId",
933
- "type": "string",
372
+ "name": "points",
373
+ "type": "ReadonlyArray<TrackPoint>",
934
374
  "optional": false
935
375
  },
936
376
  {
937
- "name": "opts",
938
- "type": "JunctionFilterOptions",
377
+ "name": "options",
378
+ "type": "ResolveTrackPlacesOptions",
939
379
  "optional": true
940
380
  }
941
381
  ],
942
- "returnType": "Promise<TItem[]>",
382
+ "returnType": "Promise<TrackPlacesResult>",
943
383
  "isStatic": false,
944
384
  "isPublic": true
945
385
  },
946
- "attach": {
947
- "name": "attach",
386
+ "getChildren": {
387
+ "name": "getChildren",
948
388
  "async": true,
949
389
  "parameters": [
950
390
  {
951
- "name": "leftId",
952
- "type": "string",
953
- "optional": false
954
- },
955
- {
956
- "name": "rightId",
391
+ "name": "parentId",
957
392
  "type": "string",
958
393
  "optional": false
959
- },
960
- {
961
- "name": "opts",
962
- "type": "JunctionAttachOptions",
963
- "optional": true
964
394
  }
965
395
  ],
966
- "returnType": "Promise<TItem>",
396
+ "returnType": "Promise<Place[]>",
967
397
  "isStatic": false,
968
398
  "isPublic": true
969
399
  },
970
- "detach": {
971
- "name": "detach",
400
+ "getRootPlaces": {
401
+ "name": "getRootPlaces",
402
+ "async": true,
403
+ "parameters": [],
404
+ "returnType": "Promise<Place[]>",
405
+ "isStatic": false,
406
+ "isPublic": true
407
+ },
408
+ "getByType": {
409
+ "name": "getByType",
972
410
  "async": true,
973
411
  "parameters": [
974
412
  {
975
- "name": "leftId",
976
- "type": "string",
977
- "optional": false
978
- },
979
- {
980
- "name": "rightId",
413
+ "name": "typeSlug",
981
414
  "type": "string",
982
415
  "optional": false
983
- },
984
- {
985
- "name": "opts",
986
- "type": "JunctionFilterOptions",
987
- "optional": true
988
416
  }
989
417
  ],
990
- "returnType": "Promise<void>",
418
+ "returnType": "Promise<Place[]>",
991
419
  "isStatic": false,
992
420
  "isPublic": true
993
421
  },
994
- "setLinks": {
995
- "name": "setLinks",
422
+ "getHierarchy": {
423
+ "name": "getHierarchy",
996
424
  "async": true,
997
425
  "parameters": [
998
426
  {
999
- "name": "leftId",
427
+ "name": "placeId",
1000
428
  "type": "string",
1001
429
  "optional": false
1002
- },
1003
- {
1004
- "name": "rightIds",
1005
- "type": "string[]",
1006
- "optional": false
1007
- },
1008
- {
1009
- "name": "opts",
1010
- "type": "JunctionAttachOptions",
1011
- "optional": true
1012
430
  }
1013
431
  ],
1014
- "returnType": "Promise<void>",
432
+ "returnType": "any",
1015
433
  "isStatic": false,
1016
434
  "isPublic": true
1017
435
  },
@@ -1087,148 +505,9 @@
1087
505
  "returnType": "Promise<void>",
1088
506
  "isStatic": false,
1089
507
  "isPublic": true
1090
- }
1091
- },
1092
- "decoratorConfig": {
1093
- "api": false,
1094
- "mcp": false,
1095
- "cli": false,
1096
- "tableName": "place_assets"
1097
- },
1098
- "extends": "SmrtJunction",
1099
- "extendsTypeArg": "PlaceAsset",
1100
- "exportName": "PlaceAssetCollection",
1101
- "collectionExportName": "PlaceAssetCollectionCollection",
1102
- "schema": {
1103
- "tableName": "place_assets",
1104
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\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 \"place_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
1105
- "columns": {
1106
- "id": {
1107
- "type": "UUID",
1108
- "primaryKey": true,
1109
- "referenceKind": "id",
1110
- "notNull": true
1111
- },
1112
- "slug": {
1113
- "type": "TEXT",
1114
- "notNull": true
1115
- },
1116
- "context": {
1117
- "type": "TEXT",
1118
- "notNull": true,
1119
- "default": ""
1120
- },
1121
- "created_at": {
1122
- "type": "TIMESTAMP",
1123
- "notNull": true,
1124
- "default": "current_timestamp"
1125
- },
1126
- "updated_at": {
1127
- "type": "TIMESTAMP",
1128
- "notNull": true,
1129
- "default": "current_timestamp"
1130
- },
1131
- "tenant_id": {
1132
- "type": "UUID",
1133
- "referenceKind": "tenantId",
1134
- "notNull": false,
1135
- "unique": false
1136
- },
1137
- "place_id": {
1138
- "type": "UUID",
1139
- "referenceKind": "foreignKey",
1140
- "notNull": true,
1141
- "unique": false,
1142
- "foreignKey": {
1143
- "table": "places",
1144
- "column": "id",
1145
- "onDelete": "CASCADE",
1146
- "onUpdate": "CASCADE"
1147
- }
1148
- },
1149
- "asset_id": {
1150
- "type": "UUID",
1151
- "referenceKind": "crossPackageRef",
1152
- "notNull": true,
1153
- "unique": false
1154
- },
1155
- "relationship": {
1156
- "type": "TEXT",
1157
- "notNull": true,
1158
- "unique": false
1159
- },
1160
- "sort_order": {
1161
- "type": "INTEGER",
1162
- "notNull": true,
1163
- "unique": false,
1164
- "default": 0
1165
- }
1166
- },
1167
- "indexes": [
1168
- {
1169
- "name": "place_assets_place_id_asset_id_idx",
1170
- "columns": [
1171
- "place_id",
1172
- "asset_id",
1173
- "relationship"
1174
- ],
1175
- "unique": true
1176
- },
1177
- {
1178
- "name": "place_assets_slug_context_idx",
1179
- "columns": [
1180
- "slug",
1181
- "context"
1182
- ]
1183
- },
1184
- {
1185
- "name": "place_assets_tenant_id_created_at_idx",
1186
- "columns": [
1187
- "tenant_id",
1188
- "created_at"
1189
- ]
1190
- },
1191
- {
1192
- "name": "place_assets_asset_id_idx",
1193
- "columns": [
1194
- "asset_id"
1195
- ]
1196
- }
1197
- ],
1198
- "version": "adf47666"
1199
- },
1200
- "importPath": "@happyvertical/smrt-places"
1201
- },
1202
- "@happyvertical/smrt-places:PlaceCollection": {
1203
- "name": "placecollection",
1204
- "className": "PlaceCollection",
1205
- "qualifiedName": "@happyvertical/smrt-places:PlaceCollection",
1206
- "collection": "places",
1207
- "filePath": "/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceCollection.ts",
1208
- "packageName": "@happyvertical/smrt-places",
1209
- "fields": {},
1210
- "methods": {
1211
- "lookupOrCreate": {
1212
- "name": "lookupOrCreate",
1213
- "async": true,
1214
- "parameters": [
1215
- {
1216
- "name": "query",
1217
- "type": "string",
1218
- "optional": false
1219
- },
1220
- {
1221
- "name": "options",
1222
- "type": "LookupOrCreateOptions",
1223
- "optional": true
1224
- }
1225
- ],
1226
- "returnType": "Promise<Place | null>",
1227
- "isStatic": false,
1228
- "isPublic": true
1229
508
  },
1230
- "discoverNearby": {
1231
- "name": "discoverNearby",
509
+ "searchByProximity": {
510
+ "name": "searchByProximity",
1232
511
  "async": true,
1233
512
  "parameters": [
1234
513
  {
@@ -1242,13 +521,8 @@
1242
521
  "optional": false
1243
522
  },
1244
523
  {
1245
- "name": "radiusMeters",
524
+ "name": "radiusKm",
1246
525
  "type": "number",
1247
- "optional": false
1248
- },
1249
- {
1250
- "name": "options",
1251
- "type": "DiscoverNearbyOptions",
1252
526
  "optional": true
1253
527
  }
1254
528
  ],
@@ -1256,31 +530,12 @@
1256
530
  "isStatic": false,
1257
531
  "isPublic": true
1258
532
  },
1259
- "resolveTrackPlaces": {
1260
- "name": "resolveTrackPlaces",
1261
- "async": true,
1262
- "parameters": [
1263
- {
1264
- "name": "points",
1265
- "type": "ReadonlyArray<TrackPoint>",
1266
- "optional": false
1267
- },
1268
- {
1269
- "name": "options",
1270
- "type": "ResolveTrackPlacesOptions",
1271
- "optional": true
1272
- }
1273
- ],
1274
- "returnType": "Promise<TrackPlacesResult>",
1275
- "isStatic": false,
1276
- "isPublic": true
1277
- },
1278
- "getChildren": {
1279
- "name": "getChildren",
533
+ "findByTenant": {
534
+ "name": "findByTenant",
1280
535
  "async": true,
1281
536
  "parameters": [
1282
537
  {
1283
- "name": "parentId",
538
+ "name": "tenantId",
1284
539
  "type": "string",
1285
540
  "optional": false
1286
541
  }
@@ -1289,20 +544,20 @@
1289
544
  "isStatic": false,
1290
545
  "isPublic": true
1291
546
  },
1292
- "getRootPlaces": {
1293
- "name": "getRootPlaces",
547
+ "findGlobal": {
548
+ "name": "findGlobal",
1294
549
  "async": true,
1295
550
  "parameters": [],
1296
551
  "returnType": "Promise<Place[]>",
1297
552
  "isStatic": false,
1298
553
  "isPublic": true
1299
554
  },
1300
- "getByType": {
1301
- "name": "getByType",
555
+ "findWithGlobals": {
556
+ "name": "findWithGlobals",
1302
557
  "async": true,
1303
558
  "parameters": [
1304
559
  {
1305
- "name": "typeSlug",
560
+ "name": "tenantId",
1306
561
  "type": "string",
1307
562
  "optional": false
1308
563
  }
@@ -1310,151 +565,245 @@
1310
565
  "returnType": "Promise<Place[]>",
1311
566
  "isStatic": false,
1312
567
  "isPublic": true
568
+ }
569
+ },
570
+ "decoratorConfig": {
571
+ "api": {
572
+ "include": [
573
+ "list",
574
+ "get",
575
+ "create",
576
+ "update",
577
+ "delete"
578
+ ]
1313
579
  },
1314
- "getHierarchy": {
1315
- "name": "getHierarchy",
1316
- "async": true,
1317
- "parameters": [
1318
- {
1319
- "name": "placeId",
1320
- "type": "string",
1321
- "optional": false
1322
- }
1323
- ],
1324
- "returnType": "any",
1325
- "isStatic": false,
1326
- "isPublic": true
1327
- },
1328
- "getAssets": {
1329
- "name": "getAssets",
1330
- "async": true,
1331
- "parameters": [
1332
- {
1333
- "name": "placeId",
1334
- "type": "string",
1335
- "optional": false
1336
- },
1337
- {
1338
- "name": "relationship",
1339
- "type": "string",
1340
- "optional": true
580
+ "mcp": {
581
+ "include": [
582
+ "list",
583
+ "get",
584
+ "create",
585
+ "update"
586
+ ]
587
+ }
588
+ },
589
+ "extends": "SmrtCollection",
590
+ "extendsTypeArg": "Place",
591
+ "exportName": "PlaceCollection",
592
+ "collectionExportName": "PlaceCollectionCollection",
593
+ "schema": {
594
+ "tableName": "places",
595
+ "ddl": "CREATE TABLE IF NOT EXISTS \"places\" (\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 \"parent_id\" UUID,\n \"tenant_id\" UUID,\n \"type_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"latitude\" REAL,\n \"longitude\" REAL,\n \"street_number\" TEXT,\n \"street_name\" TEXT,\n \"city\" TEXT,\n \"region\" TEXT,\n \"country\" TEXT,\n \"postal_code\" TEXT,\n \"country_code\" TEXT,\n \"timezone\" TEXT,\n \"external_id\" TEXT,\n \"source\" TEXT,\n \"metadata\" TEXT\n);",
596
+ "columns": {
597
+ "id": {
598
+ "type": "UUID",
599
+ "primaryKey": true,
600
+ "referenceKind": "id",
601
+ "notNull": true
602
+ },
603
+ "slug": {
604
+ "type": "TEXT",
605
+ "notNull": true
606
+ },
607
+ "context": {
608
+ "type": "TEXT",
609
+ "notNull": true,
610
+ "default": ""
611
+ },
612
+ "_meta_type": {
613
+ "type": "TEXT",
614
+ "notNull": true
615
+ },
616
+ "_meta_data": {
617
+ "type": "JSON",
618
+ "notNull": false
619
+ },
620
+ "created_at": {
621
+ "type": "TIMESTAMP",
622
+ "notNull": true,
623
+ "default": "current_timestamp"
624
+ },
625
+ "updated_at": {
626
+ "type": "TIMESTAMP",
627
+ "notNull": true,
628
+ "default": "current_timestamp"
629
+ },
630
+ "parent_id": {
631
+ "type": "UUID",
632
+ "referenceKind": "foreignKey",
633
+ "notNull": false,
634
+ "foreignKey": {
635
+ "table": "places",
636
+ "column": "id",
637
+ "onDelete": "NO ACTION",
638
+ "onUpdate": "CASCADE"
1341
639
  }
1342
- ],
1343
- "returnType": "Promise<Asset[]>",
1344
- "isStatic": false,
1345
- "isPublic": true
1346
- },
1347
- "addAsset": {
1348
- "name": "addAsset",
1349
- "async": true,
1350
- "parameters": [
1351
- {
1352
- "name": "placeId",
1353
- "type": "string",
1354
- "optional": false
1355
- },
1356
- {
1357
- "name": "asset",
1358
- "type": "Asset",
1359
- "optional": false
1360
- },
1361
- {
1362
- "name": "relationship",
1363
- "type": "any",
1364
- "optional": true,
1365
- "default": "attachment"
1366
- },
1367
- {
1368
- "name": "sortOrder",
1369
- "type": "any",
1370
- "optional": true
640
+ },
641
+ "tenant_id": {
642
+ "type": "UUID",
643
+ "referenceKind": "tenantId",
644
+ "notNull": false
645
+ },
646
+ "type_id": {
647
+ "type": "UUID",
648
+ "referenceKind": "foreignKey",
649
+ "notNull": false,
650
+ "foreignKey": {
651
+ "table": "place_types",
652
+ "column": "id",
653
+ "onDelete": "NO ACTION",
654
+ "onUpdate": "CASCADE"
1371
655
  }
1372
- ],
1373
- "returnType": "Promise<void>",
1374
- "isStatic": false,
1375
- "isPublic": true
656
+ },
657
+ "name": {
658
+ "type": "TEXT",
659
+ "notNull": false
660
+ },
661
+ "description": {
662
+ "type": "TEXT",
663
+ "notNull": false
664
+ },
665
+ "latitude": {
666
+ "type": "REAL",
667
+ "notNull": false
668
+ },
669
+ "longitude": {
670
+ "type": "REAL",
671
+ "notNull": false
672
+ },
673
+ "street_number": {
674
+ "type": "TEXT",
675
+ "notNull": false
676
+ },
677
+ "street_name": {
678
+ "type": "TEXT",
679
+ "notNull": false
680
+ },
681
+ "city": {
682
+ "type": "TEXT",
683
+ "notNull": false
684
+ },
685
+ "region": {
686
+ "type": "TEXT",
687
+ "notNull": false
688
+ },
689
+ "country": {
690
+ "type": "TEXT",
691
+ "notNull": false
692
+ },
693
+ "postal_code": {
694
+ "type": "TEXT",
695
+ "notNull": false
696
+ },
697
+ "country_code": {
698
+ "type": "TEXT",
699
+ "notNull": false
700
+ },
701
+ "timezone": {
702
+ "type": "TEXT",
703
+ "notNull": false
704
+ },
705
+ "external_id": {
706
+ "type": "TEXT",
707
+ "notNull": false
708
+ },
709
+ "source": {
710
+ "type": "TEXT",
711
+ "notNull": false
712
+ },
713
+ "metadata": {
714
+ "type": "TEXT",
715
+ "notNull": false
716
+ }
1376
717
  },
1377
- "removeAsset": {
1378
- "name": "removeAsset",
718
+ "indexes": [
719
+ {
720
+ "name": "places_slug_context_meta_type_idx",
721
+ "columns": [
722
+ "tenant_id",
723
+ "slug",
724
+ "context",
725
+ "_meta_type"
726
+ ],
727
+ "unique": true,
728
+ "nullsNotDistinct": true
729
+ },
730
+ {
731
+ "name": "places_meta_type_idx",
732
+ "columns": [
733
+ "_meta_type"
734
+ ]
735
+ },
736
+ {
737
+ "name": "places_tenant_id_created_at_idx",
738
+ "columns": [
739
+ "tenant_id",
740
+ "created_at"
741
+ ]
742
+ },
743
+ {
744
+ "name": "places_parent_id_idx",
745
+ "columns": [
746
+ "parent_id"
747
+ ]
748
+ },
749
+ {
750
+ "name": "places_type_id_idx",
751
+ "columns": [
752
+ "type_id"
753
+ ]
754
+ }
755
+ ],
756
+ "version": "f670088c"
757
+ },
758
+ "importPath": "@happyvertical/smrt-places"
759
+ },
760
+ "@happyvertical/smrt-places:PlaceTypeCollection": {
761
+ "name": "placetypecollection",
762
+ "className": "PlaceTypeCollection",
763
+ "qualifiedName": "@happyvertical/smrt-places:PlaceTypeCollection",
764
+ "collection": "placetypes",
765
+ "filePath": "/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceTypeCollection.ts",
766
+ "packageName": "@happyvertical/smrt-places",
767
+ "fields": {},
768
+ "methods": {
769
+ "getOrCreate": {
770
+ "name": "getOrCreate",
1379
771
  "async": true,
1380
772
  "parameters": [
1381
773
  {
1382
- "name": "placeId",
1383
- "type": "string",
1384
- "optional": false
1385
- },
1386
- {
1387
- "name": "assetId",
774
+ "name": "slug",
1388
775
  "type": "string",
1389
776
  "optional": false
1390
777
  },
1391
778
  {
1392
- "name": "relationship",
779
+ "name": "name",
1393
780
  "type": "string",
1394
781
  "optional": true
1395
782
  }
1396
783
  ],
1397
- "returnType": "Promise<void>",
1398
- "isStatic": false,
1399
- "isPublic": true
1400
- },
1401
- "searchByProximity": {
1402
- "name": "searchByProximity",
1403
- "async": true,
1404
- "parameters": [
1405
- {
1406
- "name": "latitude",
1407
- "type": "number",
1408
- "optional": false
1409
- },
1410
- {
1411
- "name": "longitude",
1412
- "type": "number",
1413
- "optional": false
1414
- },
1415
- {
1416
- "name": "radiusKm",
1417
- "type": "number",
1418
- "optional": true
1419
- }
1420
- ],
1421
- "returnType": "Promise<Place[]>",
784
+ "returnType": "Promise<PlaceType>",
1422
785
  "isStatic": false,
1423
786
  "isPublic": true
1424
787
  },
1425
- "findByTenant": {
1426
- "name": "findByTenant",
788
+ "getBySlug": {
789
+ "name": "getBySlug",
1427
790
  "async": true,
1428
791
  "parameters": [
1429
792
  {
1430
- "name": "tenantId",
793
+ "name": "slug",
1431
794
  "type": "string",
1432
795
  "optional": false
1433
796
  }
1434
797
  ],
1435
- "returnType": "Promise<Place[]>",
798
+ "returnType": "Promise<PlaceType | null>",
1436
799
  "isStatic": false,
1437
800
  "isPublic": true
1438
801
  },
1439
- "findGlobal": {
1440
- "name": "findGlobal",
802
+ "initializeDefaults": {
803
+ "name": "initializeDefaults",
1441
804
  "async": true,
1442
805
  "parameters": [],
1443
- "returnType": "Promise<Place[]>",
1444
- "isStatic": false,
1445
- "isPublic": true
1446
- },
1447
- "findWithGlobals": {
1448
- "name": "findWithGlobals",
1449
- "async": true,
1450
- "parameters": [
1451
- {
1452
- "name": "tenantId",
1453
- "type": "string",
1454
- "optional": false
1455
- }
1456
- ],
1457
- "returnType": "Promise<Place[]>",
806
+ "returnType": "Promise<PlaceType[]>",
1458
807
  "isStatic": false,
1459
808
  "isPublic": true
1460
809
  }
@@ -1473,18 +822,723 @@
1473
822
  "include": [
1474
823
  "list",
1475
824
  "get",
1476
- "create",
1477
- "update"
825
+ "create"
1478
826
  ]
1479
827
  }
1480
828
  },
1481
- "extends": "SmrtCollection",
1482
- "extendsTypeArg": "Place",
1483
- "exportName": "PlaceCollection",
1484
- "collectionExportName": "PlaceCollectionCollection",
829
+ "extends": "SmrtCollection",
830
+ "extendsTypeArg": "PlaceType",
831
+ "exportName": "PlaceTypeCollection",
832
+ "collectionExportName": "PlaceTypeCollectionCollection",
833
+ "schema": {
834
+ "tableName": "place_types",
835
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_types\" (\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 \"name\" TEXT DEFAULT '',\n \"description\" TEXT\n);",
836
+ "columns": {
837
+ "id": {
838
+ "type": "UUID",
839
+ "primaryKey": true,
840
+ "referenceKind": "id",
841
+ "notNull": true
842
+ },
843
+ "slug": {
844
+ "type": "TEXT",
845
+ "notNull": true
846
+ },
847
+ "context": {
848
+ "type": "TEXT",
849
+ "notNull": true,
850
+ "default": ""
851
+ },
852
+ "_meta_type": {
853
+ "type": "TEXT",
854
+ "notNull": true
855
+ },
856
+ "_meta_data": {
857
+ "type": "JSON",
858
+ "notNull": false
859
+ },
860
+ "created_at": {
861
+ "type": "TIMESTAMP",
862
+ "notNull": true,
863
+ "default": "current_timestamp"
864
+ },
865
+ "updated_at": {
866
+ "type": "TIMESTAMP",
867
+ "notNull": true,
868
+ "default": "current_timestamp"
869
+ },
870
+ "name": {
871
+ "type": "TEXT",
872
+ "notNull": false,
873
+ "default": ""
874
+ },
875
+ "description": {
876
+ "type": "TEXT",
877
+ "notNull": false
878
+ }
879
+ },
880
+ "indexes": [
881
+ {
882
+ "name": "place_types_slug_context_meta_type_idx",
883
+ "columns": [
884
+ "slug",
885
+ "context",
886
+ "_meta_type"
887
+ ],
888
+ "unique": true
889
+ },
890
+ {
891
+ "name": "place_types_meta_type_idx",
892
+ "columns": [
893
+ "_meta_type"
894
+ ]
895
+ },
896
+ {
897
+ "name": "place_types_created_at_idx",
898
+ "columns": [
899
+ "created_at"
900
+ ]
901
+ }
902
+ ],
903
+ "version": "8c3bb691"
904
+ },
905
+ "importPath": "@happyvertical/smrt-places"
906
+ },
907
+ "@happyvertical/smrt-places:Place": {
908
+ "name": "place",
909
+ "className": "Place",
910
+ "qualifiedName": "@happyvertical/smrt-places:Place",
911
+ "collection": "places",
912
+ "filePath": "/home/runner/work/smrt/smrt/packages/places/src/models/Place.ts",
913
+ "packageName": "@happyvertical/smrt-places",
914
+ "fields": {
915
+ "created_at": {
916
+ "type": "datetime",
917
+ "required": false
918
+ },
919
+ "updated_at": {
920
+ "type": "datetime",
921
+ "required": false
922
+ },
923
+ "parentId": {
924
+ "type": "foreignKey",
925
+ "required": false,
926
+ "related": "Place",
927
+ "_meta": {
928
+ "nullable": true
929
+ }
930
+ },
931
+ "tenantId": {
932
+ "type": "text",
933
+ "required": false,
934
+ "_meta": {
935
+ "sqlType": "UUID",
936
+ "nullable": true,
937
+ "__tenancy": {
938
+ "isTenantIdField": true,
939
+ "autoFilter": true,
940
+ "required": false,
941
+ "autoPopulate": true,
942
+ "nullable": true,
943
+ "mode": "optional",
944
+ "field": "tenantId",
945
+ "allowSuperAdminBypass": false
946
+ }
947
+ }
948
+ },
949
+ "typeId": {
950
+ "type": "foreignKey",
951
+ "required": false,
952
+ "related": "PlaceType"
953
+ },
954
+ "name": {
955
+ "type": "text",
956
+ "required": false
957
+ },
958
+ "description": {
959
+ "type": "text",
960
+ "required": false
961
+ },
962
+ "latitude": {
963
+ "type": "decimal",
964
+ "required": false,
965
+ "_meta": {}
966
+ },
967
+ "longitude": {
968
+ "type": "decimal",
969
+ "required": false,
970
+ "_meta": {}
971
+ },
972
+ "streetNumber": {
973
+ "type": "text",
974
+ "required": false
975
+ },
976
+ "streetName": {
977
+ "type": "text",
978
+ "required": false
979
+ },
980
+ "city": {
981
+ "type": "text",
982
+ "required": false
983
+ },
984
+ "region": {
985
+ "type": "text",
986
+ "required": false
987
+ },
988
+ "country": {
989
+ "type": "text",
990
+ "required": false
991
+ },
992
+ "postalCode": {
993
+ "type": "text",
994
+ "required": false
995
+ },
996
+ "countryCode": {
997
+ "type": "text",
998
+ "required": false
999
+ },
1000
+ "timezone": {
1001
+ "type": "text",
1002
+ "required": false
1003
+ },
1004
+ "externalId": {
1005
+ "type": "text",
1006
+ "required": false
1007
+ },
1008
+ "source": {
1009
+ "type": "text",
1010
+ "required": false
1011
+ },
1012
+ "metadata": {
1013
+ "type": "text",
1014
+ "required": false
1015
+ },
1016
+ "createdAt": {
1017
+ "type": "text",
1018
+ "required": false
1019
+ },
1020
+ "updatedAt": {
1021
+ "type": "text",
1022
+ "required": false
1023
+ }
1024
+ },
1025
+ "methods": {
1026
+ "getParent": {
1027
+ "name": "getParent",
1028
+ "async": true,
1029
+ "parameters": [],
1030
+ "returnType": "Promise<this | null>",
1031
+ "isStatic": false,
1032
+ "isPublic": true
1033
+ },
1034
+ "getChildren": {
1035
+ "name": "getChildren",
1036
+ "async": true,
1037
+ "parameters": [],
1038
+ "returnType": "Promise<this[]>",
1039
+ "isStatic": false,
1040
+ "isPublic": true
1041
+ },
1042
+ "getAncestors": {
1043
+ "name": "getAncestors",
1044
+ "async": true,
1045
+ "parameters": [],
1046
+ "returnType": "Promise<this[]>",
1047
+ "isStatic": false,
1048
+ "isPublic": true
1049
+ },
1050
+ "getDescendants": {
1051
+ "name": "getDescendants",
1052
+ "async": true,
1053
+ "parameters": [],
1054
+ "returnType": "Promise<this[]>",
1055
+ "isStatic": false,
1056
+ "isPublic": true
1057
+ },
1058
+ "getHierarchy": {
1059
+ "name": "getHierarchy",
1060
+ "async": true,
1061
+ "parameters": [],
1062
+ "returnType": "Promise<HierarchyView<this>>",
1063
+ "isStatic": false,
1064
+ "isPublic": true
1065
+ },
1066
+ "moveTo": {
1067
+ "name": "moveTo",
1068
+ "async": true,
1069
+ "parameters": [
1070
+ {
1071
+ "name": "newParent",
1072
+ "type": "this | string | null",
1073
+ "optional": false,
1074
+ "unionBranches": [
1075
+ {
1076
+ "type": "this"
1077
+ },
1078
+ {
1079
+ "type": "string"
1080
+ },
1081
+ {
1082
+ "type": "null"
1083
+ }
1084
+ ]
1085
+ }
1086
+ ],
1087
+ "returnType": "Promise<void>",
1088
+ "isStatic": false,
1089
+ "isPublic": true
1090
+ },
1091
+ "getGeoData": {
1092
+ "name": "getGeoData",
1093
+ "async": false,
1094
+ "parameters": [],
1095
+ "returnType": "GeoData",
1096
+ "isStatic": false,
1097
+ "isPublic": true
1098
+ },
1099
+ "hasCoordinates": {
1100
+ "name": "hasCoordinates",
1101
+ "async": false,
1102
+ "parameters": [],
1103
+ "returnType": "boolean",
1104
+ "isStatic": false,
1105
+ "isPublic": true
1106
+ },
1107
+ "getMetadata": {
1108
+ "name": "getMetadata",
1109
+ "async": false,
1110
+ "parameters": [],
1111
+ "returnType": "Record<string, unknown>",
1112
+ "isStatic": false,
1113
+ "isPublic": true
1114
+ },
1115
+ "setMetadata": {
1116
+ "name": "setMetadata",
1117
+ "async": false,
1118
+ "parameters": [
1119
+ {
1120
+ "name": "data",
1121
+ "type": "Record<string, unknown>",
1122
+ "optional": false
1123
+ }
1124
+ ],
1125
+ "returnType": "void",
1126
+ "isStatic": false,
1127
+ "isPublic": true
1128
+ },
1129
+ "updateMetadata": {
1130
+ "name": "updateMetadata",
1131
+ "async": false,
1132
+ "parameters": [
1133
+ {
1134
+ "name": "updates",
1135
+ "type": "Record<string, unknown>",
1136
+ "optional": false
1137
+ }
1138
+ ],
1139
+ "returnType": "void",
1140
+ "isStatic": false,
1141
+ "isPublic": true
1142
+ },
1143
+ "getType": {
1144
+ "name": "getType",
1145
+ "async": true,
1146
+ "parameters": [],
1147
+ "returnType": "any",
1148
+ "isStatic": false,
1149
+ "isPublic": true
1150
+ },
1151
+ "getAssets": {
1152
+ "name": "getAssets",
1153
+ "async": true,
1154
+ "parameters": [
1155
+ {
1156
+ "name": "relationship",
1157
+ "type": "string",
1158
+ "optional": true
1159
+ }
1160
+ ],
1161
+ "returnType": "Promise<Asset[]>",
1162
+ "isStatic": false,
1163
+ "isPublic": true
1164
+ },
1165
+ "addAsset": {
1166
+ "name": "addAsset",
1167
+ "async": true,
1168
+ "parameters": [
1169
+ {
1170
+ "name": "asset",
1171
+ "type": "Asset",
1172
+ "optional": false
1173
+ },
1174
+ {
1175
+ "name": "relationship",
1176
+ "type": "any",
1177
+ "optional": true,
1178
+ "default": "attachment"
1179
+ },
1180
+ {
1181
+ "name": "sortOrder",
1182
+ "type": "any",
1183
+ "optional": true
1184
+ }
1185
+ ],
1186
+ "returnType": "Promise<void>",
1187
+ "isStatic": false,
1188
+ "isPublic": true
1189
+ },
1190
+ "getMainAsset": {
1191
+ "name": "getMainAsset",
1192
+ "async": true,
1193
+ "parameters": [],
1194
+ "returnType": "Promise<Asset | null>",
1195
+ "isStatic": false,
1196
+ "isPublic": true
1197
+ },
1198
+ "setMainAsset": {
1199
+ "name": "setMainAsset",
1200
+ "async": true,
1201
+ "parameters": [
1202
+ {
1203
+ "name": "asset",
1204
+ "type": "Asset | null",
1205
+ "optional": false,
1206
+ "unionBranches": [
1207
+ {
1208
+ "type": "Asset"
1209
+ },
1210
+ {
1211
+ "type": "null"
1212
+ }
1213
+ ]
1214
+ }
1215
+ ],
1216
+ "returnType": "Promise<void>",
1217
+ "isStatic": false,
1218
+ "isPublic": true
1219
+ },
1220
+ "removeAsset": {
1221
+ "name": "removeAsset",
1222
+ "async": true,
1223
+ "parameters": [
1224
+ {
1225
+ "name": "assetId",
1226
+ "type": "string",
1227
+ "optional": false
1228
+ },
1229
+ {
1230
+ "name": "relationship",
1231
+ "type": "string",
1232
+ "optional": true
1233
+ }
1234
+ ],
1235
+ "returnType": "Promise<void>",
1236
+ "isStatic": false,
1237
+ "isPublic": true
1238
+ }
1239
+ },
1240
+ "decoratorConfig": {
1241
+ "tableStrategy": "sti",
1242
+ "api": {
1243
+ "include": [
1244
+ "list",
1245
+ "get",
1246
+ "create",
1247
+ "update",
1248
+ "delete"
1249
+ ]
1250
+ },
1251
+ "mcp": {
1252
+ "include": [
1253
+ "list",
1254
+ "get",
1255
+ "create",
1256
+ "update"
1257
+ ]
1258
+ },
1259
+ "cli": {
1260
+ "skipApiCheck": true
1261
+ },
1262
+ "tenantScoped": {
1263
+ "mode": "optional"
1264
+ },
1265
+ "conflictColumns": [
1266
+ "tenant_id",
1267
+ "slug",
1268
+ "context",
1269
+ "_meta_type"
1270
+ ]
1271
+ },
1272
+ "extends": "SmrtHierarchical",
1273
+ "exportName": "Place",
1274
+ "collectionExportName": "PlaceCollection",
1275
+ "displayLabelField": "name",
1276
+ "schema": {
1277
+ "tableName": "places",
1278
+ "ddl": "CREATE TABLE IF NOT EXISTS \"places\" (\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 \"parent_id\" UUID,\n \"tenant_id\" UUID,\n \"type_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"latitude\" REAL,\n \"longitude\" REAL,\n \"street_number\" TEXT,\n \"street_name\" TEXT,\n \"city\" TEXT,\n \"region\" TEXT,\n \"country\" TEXT,\n \"postal_code\" TEXT,\n \"country_code\" TEXT,\n \"timezone\" TEXT,\n \"external_id\" TEXT,\n \"source\" TEXT,\n \"metadata\" TEXT\n);",
1279
+ "columns": {
1280
+ "id": {
1281
+ "type": "UUID",
1282
+ "primaryKey": true,
1283
+ "referenceKind": "id",
1284
+ "notNull": true
1285
+ },
1286
+ "slug": {
1287
+ "type": "TEXT",
1288
+ "notNull": true
1289
+ },
1290
+ "context": {
1291
+ "type": "TEXT",
1292
+ "notNull": true,
1293
+ "default": ""
1294
+ },
1295
+ "_meta_type": {
1296
+ "type": "TEXT",
1297
+ "notNull": true
1298
+ },
1299
+ "_meta_data": {
1300
+ "type": "JSON",
1301
+ "notNull": false
1302
+ },
1303
+ "created_at": {
1304
+ "type": "TIMESTAMP",
1305
+ "notNull": true,
1306
+ "default": "current_timestamp"
1307
+ },
1308
+ "updated_at": {
1309
+ "type": "TIMESTAMP",
1310
+ "notNull": true,
1311
+ "default": "current_timestamp"
1312
+ },
1313
+ "parent_id": {
1314
+ "type": "UUID",
1315
+ "referenceKind": "foreignKey",
1316
+ "notNull": false,
1317
+ "foreignKey": {
1318
+ "table": "places",
1319
+ "column": "id",
1320
+ "onDelete": "NO ACTION",
1321
+ "onUpdate": "CASCADE"
1322
+ }
1323
+ },
1324
+ "tenant_id": {
1325
+ "type": "UUID",
1326
+ "referenceKind": "tenantId",
1327
+ "notNull": false
1328
+ },
1329
+ "type_id": {
1330
+ "type": "UUID",
1331
+ "referenceKind": "foreignKey",
1332
+ "notNull": false,
1333
+ "foreignKey": {
1334
+ "table": "place_types",
1335
+ "column": "id",
1336
+ "onDelete": "NO ACTION",
1337
+ "onUpdate": "CASCADE"
1338
+ }
1339
+ },
1340
+ "name": {
1341
+ "type": "TEXT",
1342
+ "notNull": false
1343
+ },
1344
+ "description": {
1345
+ "type": "TEXT",
1346
+ "notNull": false
1347
+ },
1348
+ "latitude": {
1349
+ "type": "REAL",
1350
+ "notNull": false
1351
+ },
1352
+ "longitude": {
1353
+ "type": "REAL",
1354
+ "notNull": false
1355
+ },
1356
+ "street_number": {
1357
+ "type": "TEXT",
1358
+ "notNull": false
1359
+ },
1360
+ "street_name": {
1361
+ "type": "TEXT",
1362
+ "notNull": false
1363
+ },
1364
+ "city": {
1365
+ "type": "TEXT",
1366
+ "notNull": false
1367
+ },
1368
+ "region": {
1369
+ "type": "TEXT",
1370
+ "notNull": false
1371
+ },
1372
+ "country": {
1373
+ "type": "TEXT",
1374
+ "notNull": false
1375
+ },
1376
+ "postal_code": {
1377
+ "type": "TEXT",
1378
+ "notNull": false
1379
+ },
1380
+ "country_code": {
1381
+ "type": "TEXT",
1382
+ "notNull": false
1383
+ },
1384
+ "timezone": {
1385
+ "type": "TEXT",
1386
+ "notNull": false
1387
+ },
1388
+ "external_id": {
1389
+ "type": "TEXT",
1390
+ "notNull": false
1391
+ },
1392
+ "source": {
1393
+ "type": "TEXT",
1394
+ "notNull": false
1395
+ },
1396
+ "metadata": {
1397
+ "type": "TEXT",
1398
+ "notNull": false
1399
+ }
1400
+ },
1401
+ "indexes": [
1402
+ {
1403
+ "name": "places_slug_context_meta_type_idx",
1404
+ "columns": [
1405
+ "tenant_id",
1406
+ "slug",
1407
+ "context",
1408
+ "_meta_type"
1409
+ ],
1410
+ "unique": true,
1411
+ "nullsNotDistinct": true
1412
+ },
1413
+ {
1414
+ "name": "places_meta_type_idx",
1415
+ "columns": [
1416
+ "_meta_type"
1417
+ ]
1418
+ },
1419
+ {
1420
+ "name": "places_tenant_id_created_at_idx",
1421
+ "columns": [
1422
+ "tenant_id",
1423
+ "created_at"
1424
+ ]
1425
+ },
1426
+ {
1427
+ "name": "places_parent_id_idx",
1428
+ "columns": [
1429
+ "parent_id"
1430
+ ]
1431
+ },
1432
+ {
1433
+ "name": "places_type_id_idx",
1434
+ "columns": [
1435
+ "type_id"
1436
+ ]
1437
+ }
1438
+ ],
1439
+ "version": "f670088c"
1440
+ },
1441
+ "importPath": "@happyvertical/smrt-places"
1442
+ },
1443
+ "@happyvertical/smrt-places:PlaceAsset": {
1444
+ "name": "placeasset",
1445
+ "className": "PlaceAsset",
1446
+ "qualifiedName": "@happyvertical/smrt-places:PlaceAsset",
1447
+ "collection": "placeassets",
1448
+ "filePath": "/home/runner/work/smrt/smrt/packages/places/src/models/PlaceAsset.ts",
1449
+ "packageName": "@happyvertical/smrt-places",
1450
+ "fields": {
1451
+ "tenantId": {
1452
+ "type": "text",
1453
+ "required": false,
1454
+ "_meta": {
1455
+ "sqlType": "UUID",
1456
+ "nullable": true,
1457
+ "__tenancy": {
1458
+ "isTenantIdField": true,
1459
+ "autoFilter": true,
1460
+ "required": false,
1461
+ "autoPopulate": true,
1462
+ "nullable": true,
1463
+ "mode": "optional",
1464
+ "field": "tenantId",
1465
+ "allowSuperAdminBypass": false
1466
+ }
1467
+ }
1468
+ },
1469
+ "placeId": {
1470
+ "type": "foreignKey",
1471
+ "required": true,
1472
+ "related": "Place",
1473
+ "_meta": {
1474
+ "required": true,
1475
+ "onDelete": "CASCADE"
1476
+ }
1477
+ },
1478
+ "assetId": {
1479
+ "type": "crossPackageRef",
1480
+ "required": true,
1481
+ "related": "@happyvertical/smrt-assets:Asset",
1482
+ "_meta": {
1483
+ "onDelete": "CASCADE"
1484
+ }
1485
+ },
1486
+ "relationship": {
1487
+ "type": "text",
1488
+ "required": true,
1489
+ "_meta": {
1490
+ "required": true
1491
+ }
1492
+ },
1493
+ "sortOrder": {
1494
+ "type": "integer",
1495
+ "required": true,
1496
+ "default": 0
1497
+ }
1498
+ },
1499
+ "methods": {},
1500
+ "decoratorConfig": {
1501
+ "tableName": "place_assets",
1502
+ "conflictColumns": [
1503
+ "place_id",
1504
+ "asset_id",
1505
+ "relationship"
1506
+ ],
1507
+ "api": false,
1508
+ "mcp": false,
1509
+ "cli": false,
1510
+ "tenantScoped": {
1511
+ "mode": "optional"
1512
+ }
1513
+ },
1514
+ "extends": "SmrtObject",
1515
+ "exportName": "PlaceAsset",
1516
+ "collectionExportName": "PlaceAssetCollection",
1517
+ "validationRules": [
1518
+ {
1519
+ "field": "placeId",
1520
+ "rule": "required",
1521
+ "fieldType": "foreignKey"
1522
+ },
1523
+ {
1524
+ "field": "assetId",
1525
+ "rule": "required",
1526
+ "fieldType": "crossPackageRef"
1527
+ },
1528
+ {
1529
+ "field": "relationship",
1530
+ "rule": "required",
1531
+ "fieldType": "text"
1532
+ },
1533
+ {
1534
+ "field": "sortOrder",
1535
+ "rule": "required",
1536
+ "fieldType": "integer"
1537
+ }
1538
+ ],
1485
1539
  "schema": {
1486
- "tableName": "places",
1487
- "ddl": "CREATE TABLE IF NOT EXISTS \"places\" (\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 \"parent_id\" UUID,\n \"tenant_id\" UUID,\n \"type_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"latitude\" REAL,\n \"longitude\" REAL,\n \"street_number\" TEXT,\n \"street_name\" TEXT,\n \"city\" TEXT,\n \"region\" TEXT,\n \"country\" TEXT,\n \"postal_code\" TEXT,\n \"country_code\" TEXT,\n \"timezone\" TEXT,\n \"external_id\" TEXT,\n \"source\" TEXT,\n \"metadata\" TEXT\n);",
1540
+ "tableName": "place_assets",
1541
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\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 \"place_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
1488
1542
  "columns": {
1489
1543
  "id": {
1490
1544
  "type": "UUID",
@@ -1501,14 +1555,6 @@
1501
1555
  "notNull": true,
1502
1556
  "default": ""
1503
1557
  },
1504
- "_meta_type": {
1505
- "type": "TEXT",
1506
- "notNull": true
1507
- },
1508
- "_meta_data": {
1509
- "type": "JSON",
1510
- "notNull": false
1511
- },
1512
1558
  "created_at": {
1513
1559
  "type": "TIMESTAMP",
1514
1560
  "notNull": true,
@@ -1519,188 +1565,132 @@
1519
1565
  "notNull": true,
1520
1566
  "default": "current_timestamp"
1521
1567
  },
1522
- "parent_id": {
1523
- "type": "UUID",
1524
- "referenceKind": "foreignKey",
1525
- "notNull": false,
1526
- "foreignKey": {
1527
- "table": "places",
1528
- "column": "id",
1529
- "onDelete": "NO ACTION",
1530
- "onUpdate": "CASCADE"
1531
- }
1532
- },
1533
1568
  "tenant_id": {
1534
1569
  "type": "UUID",
1535
1570
  "referenceKind": "tenantId",
1536
- "notNull": false
1571
+ "notNull": false,
1572
+ "unique": false
1537
1573
  },
1538
- "type_id": {
1574
+ "place_id": {
1539
1575
  "type": "UUID",
1540
1576
  "referenceKind": "foreignKey",
1541
- "notNull": false,
1577
+ "notNull": true,
1578
+ "unique": false,
1542
1579
  "foreignKey": {
1543
- "table": "place_types",
1580
+ "table": "places",
1544
1581
  "column": "id",
1545
- "onDelete": "NO ACTION",
1582
+ "onDelete": "CASCADE",
1546
1583
  "onUpdate": "CASCADE"
1547
1584
  }
1548
1585
  },
1549
- "name": {
1550
- "type": "TEXT",
1551
- "notNull": false
1552
- },
1553
- "description": {
1554
- "type": "TEXT",
1555
- "notNull": false
1556
- },
1557
- "latitude": {
1558
- "type": "REAL",
1559
- "notNull": false
1560
- },
1561
- "longitude": {
1562
- "type": "REAL",
1563
- "notNull": false
1564
- },
1565
- "street_number": {
1566
- "type": "TEXT",
1567
- "notNull": false
1568
- },
1569
- "street_name": {
1570
- "type": "TEXT",
1571
- "notNull": false
1572
- },
1573
- "city": {
1574
- "type": "TEXT",
1575
- "notNull": false
1576
- },
1577
- "region": {
1578
- "type": "TEXT",
1579
- "notNull": false
1580
- },
1581
- "country": {
1582
- "type": "TEXT",
1583
- "notNull": false
1584
- },
1585
- "postal_code": {
1586
- "type": "TEXT",
1587
- "notNull": false
1588
- },
1589
- "country_code": {
1590
- "type": "TEXT",
1591
- "notNull": false
1592
- },
1593
- "timezone": {
1594
- "type": "TEXT",
1595
- "notNull": false
1596
- },
1597
- "external_id": {
1598
- "type": "TEXT",
1599
- "notNull": false
1586
+ "asset_id": {
1587
+ "type": "UUID",
1588
+ "referenceKind": "crossPackageRef",
1589
+ "notNull": true,
1590
+ "unique": false
1600
1591
  },
1601
- "source": {
1592
+ "relationship": {
1602
1593
  "type": "TEXT",
1603
- "notNull": false
1594
+ "notNull": true,
1595
+ "unique": false
1604
1596
  },
1605
- "metadata": {
1606
- "type": "TEXT",
1607
- "notNull": false
1597
+ "sort_order": {
1598
+ "type": "INTEGER",
1599
+ "notNull": true,
1600
+ "unique": false,
1601
+ "default": 0
1608
1602
  }
1609
1603
  },
1610
1604
  "indexes": [
1611
1605
  {
1612
- "name": "places_slug_context_meta_type_idx",
1606
+ "name": "place_assets_place_id_asset_id_idx",
1613
1607
  "columns": [
1614
- "tenant_id",
1615
- "slug",
1616
- "context",
1617
- "_meta_type"
1608
+ "place_id",
1609
+ "asset_id",
1610
+ "relationship"
1618
1611
  ],
1619
- "unique": true,
1620
- "nullsNotDistinct": true
1612
+ "unique": true
1621
1613
  },
1622
1614
  {
1623
- "name": "places_meta_type_idx",
1615
+ "name": "place_assets_slug_context_idx",
1624
1616
  "columns": [
1625
- "_meta_type"
1617
+ "slug",
1618
+ "context"
1626
1619
  ]
1627
1620
  },
1628
1621
  {
1629
- "name": "places_tenant_id_created_at_idx",
1622
+ "name": "place_assets_tenant_id_created_at_idx",
1630
1623
  "columns": [
1631
1624
  "tenant_id",
1632
1625
  "created_at"
1633
1626
  ]
1634
1627
  },
1635
1628
  {
1636
- "name": "places_parent_id_idx",
1637
- "columns": [
1638
- "parent_id"
1639
- ]
1640
- },
1641
- {
1642
- "name": "places_type_id_idx",
1629
+ "name": "place_assets_asset_id_idx",
1643
1630
  "columns": [
1644
- "type_id"
1631
+ "asset_id"
1645
1632
  ]
1646
1633
  }
1647
1634
  ],
1648
- "version": "f670088c"
1635
+ "version": "adf47666"
1649
1636
  },
1650
1637
  "importPath": "@happyvertical/smrt-places"
1651
1638
  },
1652
- "@happyvertical/smrt-places:PlaceTypeCollection": {
1653
- "name": "placetypecollection",
1654
- "className": "PlaceTypeCollection",
1655
- "qualifiedName": "@happyvertical/smrt-places:PlaceTypeCollection",
1639
+ "@happyvertical/smrt-places:PlaceType": {
1640
+ "name": "placetype",
1641
+ "className": "PlaceType",
1642
+ "qualifiedName": "@happyvertical/smrt-places:PlaceType",
1656
1643
  "collection": "placetypes",
1657
- "filePath": "/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceTypeCollection.ts",
1644
+ "filePath": "/home/runner/work/smrt/smrt/packages/places/src/models/PlaceType.ts",
1658
1645
  "packageName": "@happyvertical/smrt-places",
1659
- "fields": {},
1660
- "methods": {
1661
- "getOrCreate": {
1662
- "name": "getOrCreate",
1663
- "async": true,
1664
- "parameters": [
1665
- {
1666
- "name": "slug",
1667
- "type": "string",
1668
- "optional": false
1669
- },
1670
- {
1671
- "name": "name",
1672
- "type": "string",
1673
- "optional": true
1674
- }
1675
- ],
1676
- "returnType": "Promise<PlaceType>",
1677
- "isStatic": false,
1678
- "isPublic": true
1646
+ "fields": {
1647
+ "created_at": {
1648
+ "type": "datetime",
1649
+ "required": false
1650
+ },
1651
+ "updated_at": {
1652
+ "type": "datetime",
1653
+ "required": false
1654
+ },
1655
+ "name": {
1656
+ "type": "text",
1657
+ "required": true,
1658
+ "default": "",
1659
+ "_meta": {
1660
+ "required": true
1661
+ }
1662
+ },
1663
+ "description": {
1664
+ "type": "text",
1665
+ "required": false
1666
+ },
1667
+ "createdAt": {
1668
+ "type": "text",
1669
+ "required": false
1679
1670
  },
1671
+ "updatedAt": {
1672
+ "type": "text",
1673
+ "required": false
1674
+ }
1675
+ },
1676
+ "methods": {
1680
1677
  "getBySlug": {
1681
1678
  "name": "getBySlug",
1682
1679
  "async": true,
1683
1680
  "parameters": [
1684
1681
  {
1685
- "name": "slug",
1682
+ "name": "_slug",
1686
1683
  "type": "string",
1687
1684
  "optional": false
1688
1685
  }
1689
1686
  ],
1690
1687
  "returnType": "Promise<PlaceType | null>",
1691
- "isStatic": false,
1692
- "isPublic": true
1693
- },
1694
- "initializeDefaults": {
1695
- "name": "initializeDefaults",
1696
- "async": true,
1697
- "parameters": [],
1698
- "returnType": "Promise<PlaceType[]>",
1699
- "isStatic": false,
1688
+ "isStatic": true,
1700
1689
  "isPublic": true
1701
1690
  }
1702
1691
  },
1703
1692
  "decoratorConfig": {
1693
+ "tableStrategy": "sti",
1704
1694
  "api": {
1705
1695
  "include": [
1706
1696
  "list",
@@ -1716,12 +1706,22 @@
1716
1706
  "get",
1717
1707
  "create"
1718
1708
  ]
1709
+ },
1710
+ "cli": {
1711
+ "skipApiCheck": true
1719
1712
  }
1720
1713
  },
1721
- "extends": "SmrtCollection",
1722
- "extendsTypeArg": "PlaceType",
1723
- "exportName": "PlaceTypeCollection",
1724
- "collectionExportName": "PlaceTypeCollectionCollection",
1714
+ "extends": "SmrtObject",
1715
+ "exportName": "PlaceType",
1716
+ "collectionExportName": "PlaceTypeCollection",
1717
+ "displayLabelField": "name",
1718
+ "validationRules": [
1719
+ {
1720
+ "field": "name",
1721
+ "rule": "required",
1722
+ "fieldType": "text"
1723
+ }
1724
+ ],
1725
1725
  "schema": {
1726
1726
  "tableName": "place_types",
1727
1727
  "ddl": "CREATE TABLE IF NOT EXISTS \"place_types\" (\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 \"name\" TEXT DEFAULT '',\n \"description\" TEXT\n);",