@voyantjs/hospitality 0.2.0 → 0.3.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 (53) hide show
  1. package/dist/routes-accommodation.d.ts +1196 -0
  2. package/dist/routes-accommodation.d.ts.map +1 -0
  3. package/dist/routes-accommodation.js +194 -0
  4. package/dist/routes-inventory.d.ts +981 -0
  5. package/dist/routes-inventory.d.ts.map +1 -0
  6. package/dist/routes-inventory.js +159 -0
  7. package/dist/routes-operations.d.ts +2349 -0
  8. package/dist/routes-operations.d.ts.map +1 -0
  9. package/dist/routes-operations.js +6 -0
  10. package/dist/routes-shared.d.ts +11 -0
  11. package/dist/routes-shared.d.ts.map +1 -0
  12. package/dist/routes-shared.js +3 -0
  13. package/dist/routes-stays.d.ts +1371 -0
  14. package/dist/routes-stays.d.ts.map +1 -0
  15. package/dist/routes-stays.js +211 -0
  16. package/dist/routes.d.ts +520 -527
  17. package/dist/routes.d.ts.map +1 -1
  18. package/dist/routes.js +4 -551
  19. package/dist/schema-bookings.d.ts +1476 -0
  20. package/dist/schema-bookings.d.ts.map +1 -0
  21. package/dist/schema-bookings.js +156 -0
  22. package/dist/schema-inventory.d.ts +1593 -0
  23. package/dist/schema-inventory.d.ts.map +1 -0
  24. package/dist/schema-inventory.js +154 -0
  25. package/dist/schema-operations.d.ts +1076 -0
  26. package/dist/schema-operations.d.ts.map +1 -0
  27. package/dist/schema-operations.js +114 -0
  28. package/dist/schema-pricing.d.ts +1065 -0
  29. package/dist/schema-pricing.d.ts.map +1 -0
  30. package/dist/schema-pricing.js +107 -0
  31. package/dist/schema-relations.d.ts +118 -0
  32. package/dist/schema-relations.d.ts.map +1 -0
  33. package/dist/schema-relations.js +199 -0
  34. package/dist/schema-shared.d.ts +13 -0
  35. package/dist/schema-shared.d.ts.map +1 -0
  36. package/dist/schema-shared.js +73 -0
  37. package/dist/schema.d.ts +6 -5335
  38. package/dist/schema.d.ts.map +1 -1
  39. package/dist/schema.js +6 -779
  40. package/dist/service.d.ts +37 -37
  41. package/dist/validation-accommodation.d.ts +438 -0
  42. package/dist/validation-accommodation.d.ts.map +1 -0
  43. package/dist/validation-accommodation.js +151 -0
  44. package/dist/validation-operations.d.ts +860 -0
  45. package/dist/validation-operations.d.ts.map +1 -0
  46. package/dist/validation-operations.js +293 -0
  47. package/dist/validation-shared.d.ts +94 -0
  48. package/dist/validation-shared.d.ts.map +1 -0
  49. package/dist/validation-shared.js +79 -0
  50. package/dist/validation.d.ts +3 -1377
  51. package/dist/validation.d.ts.map +1 -1
  52. package/dist/validation.js +3 -520
  53. package/package.json +6 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-inventory.d.ts","sourceRoot":"","sources":["../src/schema-inventory.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCrB,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB9B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B7B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,OAAO,SAAS,CAAC,YAAY,CAAA;AACpD,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,YAAY,CAAA;AACvD,MAAM,MAAM,iBAAiB,GAAG,OAAO,kBAAkB,CAAC,YAAY,CAAA;AACtE,MAAM,MAAM,oBAAoB,GAAG,OAAO,kBAAkB,CAAC,YAAY,CAAA;AACzE,MAAM,MAAM,QAAQ,GAAG,OAAO,SAAS,CAAC,YAAY,CAAA;AACpD,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,YAAY,CAAA;AACvD,MAAM,MAAM,QAAQ,GAAG,OAAO,SAAS,CAAC,YAAY,CAAA;AACpD,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,YAAY,CAAA;AACvD,MAAM,MAAM,QAAQ,GAAG,OAAO,SAAS,CAAC,YAAY,CAAA;AACpD,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,YAAY,CAAA;AACvD,MAAM,MAAM,gBAAgB,GAAG,OAAO,iBAAiB,CAAC,YAAY,CAAA;AACpE,MAAM,MAAM,mBAAmB,GAAG,OAAO,iBAAiB,CAAC,YAAY,CAAA"}
@@ -0,0 +1,154 @@
1
+ import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
2
+ import { properties } from "@voyantjs/facilities/schema";
3
+ import { boolean, index, integer, jsonb, pgTable, text, timestamp, uniqueIndex, } from "drizzle-orm/pg-core";
4
+ import { hospitalityGuaranteeModeEnum, hospitalityInventoryModeEnum, ratePlanChargeFrequencyEnum, roomUnitStatusEnum, } from "./schema-shared";
5
+ export const roomTypes = pgTable("room_types", {
6
+ id: typeId("room_types"),
7
+ propertyId: typeIdRef("property_id")
8
+ .notNull()
9
+ .references(() => properties.id, { onDelete: "cascade" }),
10
+ code: text("code"),
11
+ name: text("name").notNull(),
12
+ description: text("description"),
13
+ inventoryMode: hospitalityInventoryModeEnum("inventory_mode").notNull().default("pooled"),
14
+ roomClass: text("room_class"),
15
+ maxAdults: integer("max_adults"),
16
+ maxChildren: integer("max_children"),
17
+ maxInfants: integer("max_infants"),
18
+ standardOccupancy: integer("standard_occupancy"),
19
+ maxOccupancy: integer("max_occupancy"),
20
+ minOccupancy: integer("min_occupancy"),
21
+ bedroomCount: integer("bedroom_count"),
22
+ bathroomCount: integer("bathroom_count"),
23
+ areaValue: integer("area_value"),
24
+ areaUnit: text("area_unit"),
25
+ accessibilityNotes: text("accessibility_notes"),
26
+ smokingAllowed: boolean("smoking_allowed").notNull().default(false),
27
+ active: boolean("active").notNull().default(true),
28
+ sortOrder: integer("sort_order").notNull().default(0),
29
+ metadata: jsonb("metadata").$type(),
30
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
31
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
32
+ }, (table) => [
33
+ index("idx_room_types_property").on(table.propertyId),
34
+ index("idx_room_types_active").on(table.active),
35
+ index("idx_room_types_inventory_mode").on(table.inventoryMode),
36
+ uniqueIndex("uidx_room_types_property_code").on(table.propertyId, table.code),
37
+ ]);
38
+ export const roomTypeBedConfigs = pgTable("room_type_bed_configs", {
39
+ id: typeId("room_type_bed_configs"),
40
+ roomTypeId: typeIdRef("room_type_id")
41
+ .notNull()
42
+ .references(() => roomTypes.id, { onDelete: "cascade" }),
43
+ bedType: text("bed_type").notNull(),
44
+ quantity: integer("quantity").notNull().default(1),
45
+ isPrimary: boolean("is_primary").notNull().default(false),
46
+ notes: text("notes"),
47
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
48
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
49
+ }, (table) => [
50
+ index("idx_room_type_bed_configs_room_type").on(table.roomTypeId),
51
+ index("idx_room_type_bed_configs_primary").on(table.isPrimary),
52
+ ]);
53
+ export const roomUnits = pgTable("room_units", {
54
+ id: typeId("room_units"),
55
+ propertyId: typeIdRef("property_id")
56
+ .notNull()
57
+ .references(() => properties.id, { onDelete: "cascade" }),
58
+ roomTypeId: typeIdRef("room_type_id")
59
+ .notNull()
60
+ .references(() => roomTypes.id, { onDelete: "cascade" }),
61
+ code: text("code"),
62
+ roomNumber: text("room_number"),
63
+ floor: text("floor"),
64
+ wing: text("wing"),
65
+ status: roomUnitStatusEnum("status").notNull().default("active"),
66
+ viewCode: text("view_code"),
67
+ accessibilityCode: text("accessibility_code"),
68
+ genderRestriction: text("gender_restriction"),
69
+ notes: text("notes"),
70
+ metadata: jsonb("metadata").$type(),
71
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
72
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
73
+ }, (table) => [
74
+ index("idx_room_units_property").on(table.propertyId),
75
+ index("idx_room_units_room_type").on(table.roomTypeId),
76
+ index("idx_room_units_status").on(table.status),
77
+ uniqueIndex("uidx_room_units_property_code").on(table.propertyId, table.code),
78
+ ]);
79
+ export const mealPlans = pgTable("meal_plans", {
80
+ id: typeId("meal_plans"),
81
+ propertyId: typeIdRef("property_id")
82
+ .notNull()
83
+ .references(() => properties.id, { onDelete: "cascade" }),
84
+ code: text("code").notNull(),
85
+ name: text("name").notNull(),
86
+ description: text("description"),
87
+ includesBreakfast: boolean("includes_breakfast").notNull().default(false),
88
+ includesLunch: boolean("includes_lunch").notNull().default(false),
89
+ includesDinner: boolean("includes_dinner").notNull().default(false),
90
+ includesDrinks: boolean("includes_drinks").notNull().default(false),
91
+ active: boolean("active").notNull().default(true),
92
+ sortOrder: integer("sort_order").notNull().default(0),
93
+ metadata: jsonb("metadata").$type(),
94
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
95
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
96
+ }, (table) => [
97
+ index("idx_meal_plans_property").on(table.propertyId),
98
+ index("idx_meal_plans_active").on(table.active),
99
+ uniqueIndex("uidx_meal_plans_property_code").on(table.propertyId, table.code),
100
+ ]);
101
+ export const ratePlans = pgTable("rate_plans", {
102
+ id: typeId("rate_plans"),
103
+ propertyId: typeIdRef("property_id")
104
+ .notNull()
105
+ .references(() => properties.id, { onDelete: "cascade" }),
106
+ code: text("code").notNull(),
107
+ name: text("name").notNull(),
108
+ description: text("description"),
109
+ mealPlanId: typeIdRef("meal_plan_id").references(() => mealPlans.id, { onDelete: "set null" }),
110
+ priceCatalogId: text("price_catalog_id"),
111
+ cancellationPolicyId: text("cancellation_policy_id"),
112
+ marketId: text("market_id"),
113
+ currencyCode: text("currency_code").notNull(),
114
+ chargeFrequency: ratePlanChargeFrequencyEnum("charge_frequency").notNull().default("per_night"),
115
+ guaranteeMode: hospitalityGuaranteeModeEnum("guarantee_mode").notNull().default("none"),
116
+ commissionable: boolean("commissionable").notNull().default(true),
117
+ refundable: boolean("refundable").notNull().default(true),
118
+ active: boolean("active").notNull().default(true),
119
+ sortOrder: integer("sort_order").notNull().default(0),
120
+ metadata: jsonb("metadata").$type(),
121
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
122
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
123
+ }, (table) => [
124
+ index("idx_rate_plans_property").on(table.propertyId),
125
+ index("idx_rate_plans_meal_plan").on(table.mealPlanId),
126
+ index("idx_rate_plans_catalog").on(table.priceCatalogId),
127
+ index("idx_rate_plans_policy").on(table.cancellationPolicyId),
128
+ index("idx_rate_plans_market").on(table.marketId),
129
+ index("idx_rate_plans_active").on(table.active),
130
+ uniqueIndex("uidx_rate_plans_property_code").on(table.propertyId, table.code),
131
+ ]);
132
+ export const ratePlanRoomTypes = pgTable("rate_plan_room_types", {
133
+ id: typeId("rate_plan_room_types"),
134
+ ratePlanId: typeIdRef("rate_plan_id")
135
+ .notNull()
136
+ .references(() => ratePlans.id, { onDelete: "cascade" }),
137
+ roomTypeId: typeIdRef("room_type_id")
138
+ .notNull()
139
+ .references(() => roomTypes.id, { onDelete: "cascade" }),
140
+ productId: text("product_id"),
141
+ optionId: text("option_id"),
142
+ unitId: text("unit_id"),
143
+ active: boolean("active").notNull().default(true),
144
+ sortOrder: integer("sort_order").notNull().default(0),
145
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
146
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
147
+ }, (table) => [
148
+ index("idx_rate_plan_room_types_rate_plan").on(table.ratePlanId),
149
+ index("idx_rate_plan_room_types_room_type").on(table.roomTypeId),
150
+ index("idx_rate_plan_room_types_product").on(table.productId),
151
+ index("idx_rate_plan_room_types_option").on(table.optionId),
152
+ index("idx_rate_plan_room_types_unit").on(table.unitId),
153
+ uniqueIndex("uidx_rate_plan_room_types_pair").on(table.ratePlanId, table.roomTypeId),
154
+ ]);