@voyantjs/hospitality 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Catalog plane field policy for `packages/hospitality`.
3
+ *
4
+ * The hospitality vertical's catalog entry is the **room type** — the
5
+ * sellable variant within a property. Properties themselves live in
6
+ * `packages/facilities` and are referenced via `propertyId`.
7
+ *
8
+ * Scope of this file:
9
+ * - The root `room_types` table (from `schema-inventory.ts`).
10
+ * - Provenance + identity fields the catalog plane needs to track.
11
+ *
12
+ * Out of scope (deferred to follow-up adoption passes — these are promoted
13
+ * child entities per architecture §6.2):
14
+ * - `room_units` — selectable physical-unit identity, own lifecycle.
15
+ * - `rate_plans` — variant pricing axis with its own lifecycle.
16
+ * - `meal_plans` — board-basis variants, structural choice axis.
17
+ * - `room_type_bed_configs` — composite list with managed structural
18
+ * fields under each row.
19
+ */
20
+ import { type FieldPolicyInput } from "@voyantjs/catalog/contract";
21
+ declare const HOSPITALITY_FIELD_POLICY: FieldPolicyInput[];
22
+ export declare const hospitalityCatalogPolicy: import("@voyantjs/catalog").FieldPolicy[];
23
+ export { HOSPITALITY_FIELD_POLICY };
24
+ //# sourceMappingURL=catalog-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-policy.d.ts","sourceRoot":"","sources":["../src/catalog-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAErF,QAAA,MAAM,wBAAwB,EAAE,gBAAgB,EA0X/C,CAAA;AAED,eAAO,MAAM,wBAAwB,2CAA8C,CAAA;AAEnF,OAAO,EAAE,wBAAwB,EAAE,CAAA"}
@@ -0,0 +1,395 @@
1
+ /**
2
+ * Catalog plane field policy for `packages/hospitality`.
3
+ *
4
+ * The hospitality vertical's catalog entry is the **room type** — the
5
+ * sellable variant within a property. Properties themselves live in
6
+ * `packages/facilities` and are referenced via `propertyId`.
7
+ *
8
+ * Scope of this file:
9
+ * - The root `room_types` table (from `schema-inventory.ts`).
10
+ * - Provenance + identity fields the catalog plane needs to track.
11
+ *
12
+ * Out of scope (deferred to follow-up adoption passes — these are promoted
13
+ * child entities per architecture §6.2):
14
+ * - `room_units` — selectable physical-unit identity, own lifecycle.
15
+ * - `rate_plans` — variant pricing axis with its own lifecycle.
16
+ * - `meal_plans` — board-basis variants, structural choice axis.
17
+ * - `room_type_bed_configs` — composite list with managed structural
18
+ * fields under each row.
19
+ */
20
+ import { defineFieldPolicy } from "@voyantjs/catalog/contract";
21
+ const HOSPITALITY_FIELD_POLICY = [
22
+ // ── Source pointer / provenance ─────────────────────────────────────────
23
+ {
24
+ path: "source.kind",
25
+ class: "managed",
26
+ merge: "source-only",
27
+ drift: "critical",
28
+ reindex: "entry",
29
+ snapshot: "on-book",
30
+ query: "indexed-column",
31
+ localized: false,
32
+ visibility: ["staff"],
33
+ editRole: "none",
34
+ overrideFriction: "none",
35
+ sourceFreshness: "sync",
36
+ },
37
+ {
38
+ path: "source.ref",
39
+ class: "managed",
40
+ merge: "source-only",
41
+ drift: "critical",
42
+ reindex: "none",
43
+ snapshot: "on-book",
44
+ query: "indexed-column",
45
+ localized: false,
46
+ visibility: ["staff"],
47
+ editRole: "none",
48
+ overrideFriction: "none",
49
+ sourceFreshness: "sync",
50
+ },
51
+ {
52
+ path: "seller.operator_id",
53
+ class: "managed",
54
+ merge: "source-only",
55
+ drift: "critical",
56
+ reindex: "none",
57
+ snapshot: "on-book",
58
+ query: "indexed-column",
59
+ localized: false,
60
+ visibility: ["staff"],
61
+ editRole: "none",
62
+ overrideFriction: "none",
63
+ sourceFreshness: "static",
64
+ },
65
+ // ── Identity / lifecycle ────────────────────────────────────────────────
66
+ {
67
+ path: "id",
68
+ class: "managed",
69
+ merge: "source-only",
70
+ drift: "critical",
71
+ reindex: "none",
72
+ snapshot: "on-book",
73
+ query: "first-class-table",
74
+ localized: false,
75
+ visibility: ["staff", "customer", "partner"],
76
+ editRole: "none",
77
+ overrideFriction: "none",
78
+ sourceFreshness: "static",
79
+ },
80
+ {
81
+ path: "code",
82
+ class: "managed",
83
+ merge: "source-only",
84
+ drift: "high",
85
+ reindex: "entry",
86
+ snapshot: "on-book",
87
+ query: "indexed-column",
88
+ localized: false,
89
+ visibility: ["staff"],
90
+ editRole: "none",
91
+ overrideFriction: "none",
92
+ sourceFreshness: "sync",
93
+ },
94
+ {
95
+ path: "createdAt",
96
+ class: "managed",
97
+ merge: "source-only",
98
+ drift: "none",
99
+ reindex: "none",
100
+ snapshot: "on-book",
101
+ query: "indexed-column",
102
+ localized: false,
103
+ visibility: ["staff"],
104
+ editRole: "none",
105
+ overrideFriction: "none",
106
+ sourceFreshness: "static",
107
+ },
108
+ {
109
+ path: "updatedAt",
110
+ class: "managed",
111
+ merge: "source-only",
112
+ drift: "none",
113
+ reindex: "none",
114
+ snapshot: "never",
115
+ query: "indexed-column",
116
+ localized: false,
117
+ visibility: ["staff"],
118
+ editRole: "none",
119
+ overrideFriction: "none",
120
+ sourceFreshness: "sync",
121
+ },
122
+ // ── Cross-module reference (the property the room belongs to) ──────────
123
+ {
124
+ path: "propertyId",
125
+ class: "structural",
126
+ merge: "source-only",
127
+ drift: "critical",
128
+ reindex: "facet-affecting",
129
+ snapshot: "on-book",
130
+ query: "indexed-column",
131
+ localized: false,
132
+ visibility: ["staff", "customer", "partner"],
133
+ editRole: "none",
134
+ overrideFriction: "none",
135
+ sourceFreshness: "sync",
136
+ },
137
+ // ── Merchandisable / marketing ──────────────────────────────────────────
138
+ {
139
+ path: "name",
140
+ class: "merchandisable",
141
+ merge: "replace",
142
+ drift: "medium",
143
+ reindex: "entry-locale",
144
+ snapshot: "on-book",
145
+ query: "indexed-column",
146
+ localized: true,
147
+ visibility: ["staff", "customer", "partner"],
148
+ editRole: "marketing",
149
+ overrideFriction: "none",
150
+ sourceFreshness: "sync",
151
+ },
152
+ {
153
+ path: "description",
154
+ class: "merchandisable",
155
+ merge: "replace",
156
+ drift: "low",
157
+ reindex: "entry-locale",
158
+ snapshot: "on-book",
159
+ query: "blob-only",
160
+ localized: true,
161
+ visibility: ["staff", "customer", "partner"],
162
+ editRole: "marketing",
163
+ overrideFriction: "none",
164
+ sourceFreshness: "sync",
165
+ },
166
+ {
167
+ path: "accessibilityNotes",
168
+ class: "merchandisable",
169
+ merge: "replace",
170
+ drift: "medium",
171
+ reindex: "entry-locale",
172
+ snapshot: "on-book",
173
+ query: "blob-only",
174
+ localized: true,
175
+ visibility: ["staff", "customer", "partner"],
176
+ editRole: "marketing",
177
+ overrideFriction: "confirm",
178
+ sourceFreshness: "sync",
179
+ },
180
+ // ── Structural / facet-affecting ───────────────────────────────────────
181
+ {
182
+ path: "inventoryMode",
183
+ class: "structural",
184
+ merge: "source-only",
185
+ drift: "high",
186
+ reindex: "entry",
187
+ snapshot: "on-book",
188
+ query: "indexed-column",
189
+ localized: false,
190
+ visibility: ["staff"],
191
+ editRole: "none",
192
+ overrideFriction: "none",
193
+ sourceFreshness: "sync",
194
+ },
195
+ {
196
+ path: "roomClass",
197
+ class: "structural",
198
+ merge: "source-only",
199
+ drift: "medium",
200
+ reindex: "facet-affecting",
201
+ snapshot: "on-book",
202
+ query: "indexed-column",
203
+ localized: false,
204
+ visibility: ["staff", "customer", "partner"],
205
+ editRole: "ops",
206
+ overrideFriction: "confirm",
207
+ sourceFreshness: "sync",
208
+ },
209
+ {
210
+ path: "active",
211
+ class: "structural",
212
+ merge: "source-only",
213
+ drift: "high",
214
+ reindex: "facet-affecting",
215
+ snapshot: "on-book",
216
+ query: "indexed-column",
217
+ localized: false,
218
+ visibility: ["staff"],
219
+ editRole: "none",
220
+ overrideFriction: "none",
221
+ sourceFreshness: "sync",
222
+ },
223
+ {
224
+ path: "smokingAllowed",
225
+ class: "structural",
226
+ merge: "source-only",
227
+ drift: "medium",
228
+ reindex: "facet-affecting",
229
+ snapshot: "on-book",
230
+ query: "indexed-column",
231
+ localized: false,
232
+ visibility: ["staff", "customer", "partner"],
233
+ editRole: "none",
234
+ overrideFriction: "none",
235
+ sourceFreshness: "sync",
236
+ },
237
+ {
238
+ path: "sortOrder",
239
+ class: "structural",
240
+ merge: "replace",
241
+ drift: "none",
242
+ reindex: "entry",
243
+ snapshot: "never",
244
+ query: "indexed-column",
245
+ localized: false,
246
+ visibility: ["staff"],
247
+ editRole: "ops",
248
+ overrideFriction: "none",
249
+ sourceFreshness: "sync",
250
+ },
251
+ // ── Occupancy / capacity (structural — drives search-side filtering) ──
252
+ {
253
+ path: "maxAdults",
254
+ class: "structural",
255
+ merge: "source-only",
256
+ drift: "medium",
257
+ reindex: "facet-affecting",
258
+ snapshot: "on-book",
259
+ query: "indexed-column",
260
+ localized: false,
261
+ visibility: ["staff", "customer", "partner"],
262
+ editRole: "none",
263
+ overrideFriction: "none",
264
+ sourceFreshness: "sync",
265
+ },
266
+ {
267
+ path: "maxChildren",
268
+ class: "structural",
269
+ merge: "source-only",
270
+ drift: "medium",
271
+ reindex: "facet-affecting",
272
+ snapshot: "on-book",
273
+ query: "indexed-column",
274
+ localized: false,
275
+ visibility: ["staff", "customer", "partner"],
276
+ editRole: "none",
277
+ overrideFriction: "none",
278
+ sourceFreshness: "sync",
279
+ },
280
+ {
281
+ path: "maxInfants",
282
+ class: "structural",
283
+ merge: "source-only",
284
+ drift: "medium",
285
+ reindex: "entry",
286
+ snapshot: "on-book",
287
+ query: "indexed-column",
288
+ localized: false,
289
+ visibility: ["staff", "customer", "partner"],
290
+ editRole: "none",
291
+ overrideFriction: "none",
292
+ sourceFreshness: "sync",
293
+ },
294
+ {
295
+ path: "standardOccupancy",
296
+ class: "structural",
297
+ merge: "source-only",
298
+ drift: "medium",
299
+ reindex: "facet-affecting",
300
+ snapshot: "on-book",
301
+ query: "indexed-column",
302
+ localized: false,
303
+ visibility: ["staff", "customer", "partner"],
304
+ editRole: "none",
305
+ overrideFriction: "none",
306
+ sourceFreshness: "sync",
307
+ },
308
+ {
309
+ path: "maxOccupancy",
310
+ class: "structural",
311
+ merge: "source-only",
312
+ drift: "medium",
313
+ reindex: "facet-affecting",
314
+ snapshot: "on-book",
315
+ query: "indexed-column",
316
+ localized: false,
317
+ visibility: ["staff", "customer", "partner"],
318
+ editRole: "none",
319
+ overrideFriction: "none",
320
+ sourceFreshness: "sync",
321
+ },
322
+ {
323
+ path: "minOccupancy",
324
+ class: "structural",
325
+ merge: "source-only",
326
+ drift: "medium",
327
+ reindex: "entry",
328
+ snapshot: "on-book",
329
+ query: "indexed-column",
330
+ localized: false,
331
+ visibility: ["staff", "customer", "partner"],
332
+ editRole: "none",
333
+ overrideFriction: "none",
334
+ sourceFreshness: "sync",
335
+ },
336
+ // ── Physical attributes ────────────────────────────────────────────────
337
+ {
338
+ path: "bedroomCount",
339
+ class: "structural",
340
+ merge: "source-only",
341
+ drift: "medium",
342
+ reindex: "facet-affecting",
343
+ snapshot: "on-book",
344
+ query: "indexed-column",
345
+ localized: false,
346
+ visibility: ["staff", "customer", "partner"],
347
+ editRole: "none",
348
+ overrideFriction: "none",
349
+ sourceFreshness: "sync",
350
+ },
351
+ {
352
+ path: "bathroomCount",
353
+ class: "structural",
354
+ merge: "source-only",
355
+ drift: "medium",
356
+ reindex: "facet-affecting",
357
+ snapshot: "on-book",
358
+ query: "indexed-column",
359
+ localized: false,
360
+ visibility: ["staff", "customer", "partner"],
361
+ editRole: "none",
362
+ overrideFriction: "none",
363
+ sourceFreshness: "sync",
364
+ },
365
+ {
366
+ path: "areaValue",
367
+ class: "structural",
368
+ merge: "source-only",
369
+ drift: "low",
370
+ reindex: "entry",
371
+ snapshot: "on-book",
372
+ query: "indexed-column",
373
+ localized: false,
374
+ visibility: ["staff", "customer", "partner"],
375
+ editRole: "none",
376
+ overrideFriction: "none",
377
+ sourceFreshness: "sync",
378
+ },
379
+ {
380
+ path: "areaUnit",
381
+ class: "managed",
382
+ merge: "source-only",
383
+ drift: "low",
384
+ reindex: "none",
385
+ snapshot: "on-book",
386
+ query: "blob-only",
387
+ localized: false,
388
+ visibility: ["staff", "customer", "partner"],
389
+ editRole: "none",
390
+ overrideFriction: "none",
391
+ sourceFreshness: "sync",
392
+ },
393
+ ];
394
+ export const hospitalityCatalogPolicy = defineFieldPolicy(HOSPITALITY_FIELD_POLICY);
395
+ export { HOSPITALITY_FIELD_POLICY };
@@ -46,20 +46,19 @@ export declare const hospitalityAccommodationRoutes: import("hono/hono-base").Ho
46
46
  input: {};
47
47
  output: {
48
48
  data: {
49
- metadata: {
50
- [x: string]: import("hono/utils/types").JSONValue;
51
- } | null;
52
49
  id: string;
53
- name: string;
50
+ code: string | null;
54
51
  createdAt: string;
55
52
  updatedAt: string;
56
- description: string | null;
57
- code: string | null;
58
- active: boolean;
59
- sortOrder: number;
60
53
  propertyId: string;
54
+ name: string;
55
+ description: string | null;
56
+ accessibilityNotes: string | null;
61
57
  inventoryMode: "virtual" | "pooled" | "serialized";
62
58
  roomClass: string | null;
59
+ active: boolean;
60
+ smokingAllowed: boolean;
61
+ sortOrder: number;
63
62
  maxAdults: number | null;
64
63
  maxChildren: number | null;
65
64
  maxInfants: number | null;
@@ -70,8 +69,9 @@ export declare const hospitalityAccommodationRoutes: import("hono/hono-base").Ho
70
69
  bathroomCount: number | null;
71
70
  areaValue: number | null;
72
71
  areaUnit: string | null;
73
- accessibilityNotes: string | null;
74
- smokingAllowed: boolean;
72
+ metadata: {
73
+ [x: string]: import("hono/utils/types").JSONValue;
74
+ } | null;
75
75
  } | null;
76
76
  };
77
77
  outputFormat: "json";
@@ -387,16 +387,16 @@ export declare const hospitalityAccommodationRoutes: import("hono/hono-base").Ho
387
387
  input: {};
388
388
  output: {
389
389
  data: {
390
- metadata: {
391
- [x: string]: import("hono/utils/types").JSONValue;
392
- } | null;
393
390
  id: string;
391
+ code: string | null;
394
392
  createdAt: string;
395
393
  updatedAt: string;
394
+ propertyId: string;
395
+ metadata: {
396
+ [x: string]: import("hono/utils/types").JSONValue;
397
+ } | null;
396
398
  status: "active" | "inactive" | "archived" | "out_of_order";
397
399
  notes: string | null;
398
- code: string | null;
399
- propertyId: string;
400
400
  roomTypeId: string;
401
401
  roomNumber: string | null;
402
402
  floor: string | null;
@@ -561,18 +561,18 @@ export declare const hospitalityAccommodationRoutes: import("hono/hono-base").Ho
561
561
  input: {};
562
562
  output: {
563
563
  data: {
564
- metadata: {
565
- [x: string]: import("hono/utils/types").JSONValue;
566
- } | null;
567
564
  id: string;
568
- name: string;
565
+ code: string;
569
566
  createdAt: string;
570
567
  updatedAt: string;
568
+ propertyId: string;
569
+ name: string;
571
570
  description: string | null;
572
- code: string;
573
571
  active: boolean;
574
572
  sortOrder: number;
575
- propertyId: string;
573
+ metadata: {
574
+ [x: string]: import("hono/utils/types").JSONValue;
575
+ } | null;
576
576
  includesBreakfast: boolean;
577
577
  includesLunch: boolean;
578
578
  includesDinner: boolean;
@@ -737,19 +737,19 @@ export declare const hospitalityAccommodationRoutes: import("hono/hono-base").Ho
737
737
  input: {};
738
738
  output: {
739
739
  data: {
740
- metadata: {
741
- [x: string]: import("hono/utils/types").JSONValue;
742
- } | null;
743
740
  id: string;
744
- name: string;
741
+ code: string;
745
742
  createdAt: string;
746
743
  updatedAt: string;
744
+ propertyId: string;
745
+ name: string;
747
746
  description: string | null;
748
- code: string;
749
747
  active: boolean;
750
- priceCatalogId: string | null;
751
748
  sortOrder: number;
752
- propertyId: string;
749
+ metadata: {
750
+ [x: string]: import("hono/utils/types").JSONValue;
751
+ } | null;
752
+ priceCatalogId: string | null;
753
753
  mealPlanId: string | null;
754
754
  cancellationPolicyId: string | null;
755
755
  marketId: string | null;
@@ -921,9 +921,9 @@ export declare const hospitalityAccommodationRoutes: import("hono/hono-base").Ho
921
921
  createdAt: string;
922
922
  updatedAt: string;
923
923
  active: boolean;
924
+ sortOrder: number;
924
925
  productId: string | null;
925
926
  optionId: string | null;
926
- sortOrder: number;
927
927
  roomTypeId: string;
928
928
  ratePlanId: string;
929
929
  unitId: string | null;
@@ -1070,8 +1070,8 @@ export declare const hospitalityAccommodationRoutes: import("hono/hono-base").Ho
1070
1070
  id: string;
1071
1071
  createdAt: string;
1072
1072
  updatedAt: string;
1073
- notes: string | null;
1074
1073
  active: boolean;
1074
+ notes: string | null;
1075
1075
  roomTypeId: string;
1076
1076
  currencyCode: string;
1077
1077
  ratePlanId: string;
@@ -34,12 +34,12 @@ export declare const hospitalityInventoryRoutes: import("hono/hono-base").HonoBa
34
34
  input: {};
35
35
  output: {
36
36
  data: {
37
- date: string;
38
37
  id: string;
39
38
  createdAt: string;
40
39
  updatedAt: string;
41
- notes: string | null;
42
40
  propertyId: string;
41
+ date: string;
42
+ notes: string | null;
43
43
  roomTypeId: string;
44
44
  totalUnits: number;
45
45
  availableUnits: number;
@@ -195,10 +195,10 @@ export declare const hospitalityInventoryRoutes: import("hono/hono-base").HonoBa
195
195
  input: {};
196
196
  output: {
197
197
  data: {
198
- date: string;
199
198
  id: string;
200
199
  createdAt: string;
201
200
  updatedAt: string;
201
+ date: string;
202
202
  notes: string | null;
203
203
  roomTypeId: string;
204
204
  ratePlanId: string;
@@ -354,16 +354,16 @@ export declare const hospitalityInventoryRoutes: import("hono/hono-base").HonoBa
354
354
  input: {};
355
355
  output: {
356
356
  data: {
357
- metadata: {
358
- [x: string]: import("hono/utils/types").JSONValue;
359
- } | null;
360
357
  id: string;
361
358
  createdAt: string;
362
359
  updatedAt: string;
360
+ propertyId: string;
361
+ metadata: {
362
+ [x: string]: import("hono/utils/types").JSONValue;
363
+ } | null;
363
364
  status: "draft" | "confirmed" | "cancelled" | "held" | "released";
364
365
  notes: string | null;
365
366
  quantity: number;
366
- propertyId: string;
367
367
  roomTypeId: string | null;
368
368
  roomUnitId: string | null;
369
369
  startsOn: string;
@@ -520,11 +520,11 @@ export declare const hospitalityInventoryRoutes: import("hono/hono-base").HonoBa
520
520
  input: {};
521
521
  output: {
522
522
  data: {
523
+ id: string;
524
+ createdAt: string;
523
525
  metadata: {
524
526
  [x: string]: import("hono/utils/types").JSONValue;
525
527
  } | null;
526
- id: string;
527
- createdAt: string;
528
528
  notes: string | null;
529
529
  roomUnitId: string;
530
530
  statusCode: string;
@@ -674,16 +674,16 @@ export declare const hospitalityInventoryRoutes: import("hono/hono-base").HonoBa
674
674
  input: {};
675
675
  output: {
676
676
  data: {
677
- metadata: {
678
- [x: string]: import("hono/utils/types").JSONValue;
679
- } | null;
680
677
  id: string;
681
678
  createdAt: string;
682
679
  updatedAt: string;
680
+ propertyId: string;
681
+ metadata: {
682
+ [x: string]: import("hono/utils/types").JSONValue;
683
+ } | null;
683
684
  status: "in_progress" | "cancelled" | "open" | "resolved";
684
685
  notes: string | null;
685
686
  reason: string | null;
686
- propertyId: string;
687
687
  roomTypeId: string | null;
688
688
  roomUnitId: string | null;
689
689
  startsOn: string;
@@ -840,17 +840,17 @@ export declare const hospitalityInventoryRoutes: import("hono/hono-base").HonoBa
840
840
  input: {};
841
841
  output: {
842
842
  data: {
843
- metadata: {
844
- [x: string]: import("hono/utils/types").JSONValue;
845
- } | null;
846
843
  id: string;
847
844
  createdAt: string;
848
845
  updatedAt: string;
846
+ propertyId: string;
847
+ metadata: {
848
+ [x: string]: import("hono/utils/types").JSONValue;
849
+ } | null;
849
850
  status: "in_progress" | "completed" | "cancelled" | "open";
850
851
  notes: string | null;
851
852
  priority: number;
852
853
  completedAt: string | null;
853
- propertyId: string;
854
854
  roomUnitId: string;
855
855
  stayBookingItemId: string | null;
856
856
  taskType: string;