@voyant-travel/accommodations 0.105.17

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 (51) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +11 -0
  3. package/dist/booking-engine/handler.d.ts +103 -0
  4. package/dist/booking-engine/handler.d.ts.map +1 -0
  5. package/dist/booking-engine/handler.js +254 -0
  6. package/dist/booking-engine/index.d.ts +8 -0
  7. package/dist/booking-engine/index.d.ts.map +1 -0
  8. package/dist/booking-engine/index.js +7 -0
  9. package/dist/catalog-policy.d.ts +23 -0
  10. package/dist/catalog-policy.d.ts.map +1 -0
  11. package/dist/catalog-policy.js +441 -0
  12. package/dist/content-shape.d.ts +5 -0
  13. package/dist/content-shape.d.ts.map +1 -0
  14. package/dist/content-shape.js +13 -0
  15. package/dist/draft-shape.d.ts +35 -0
  16. package/dist/draft-shape.d.ts.map +1 -0
  17. package/dist/draft-shape.js +84 -0
  18. package/dist/index.d.ts +8 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +7 -0
  21. package/dist/routes-content.d.ts +31 -0
  22. package/dist/routes-content.d.ts.map +1 -0
  23. package/dist/routes-content.js +87 -0
  24. package/dist/schema-bookings.d.ts +582 -0
  25. package/dist/schema-bookings.d.ts.map +1 -0
  26. package/dist/schema-bookings.js +62 -0
  27. package/dist/schema-inventory.d.ts +1361 -0
  28. package/dist/schema-inventory.d.ts.map +1 -0
  29. package/dist/schema-inventory.js +125 -0
  30. package/dist/schema-shared.d.ts +5 -0
  31. package/dist/schema-shared.d.ts.map +1 -0
  32. package/dist/schema-shared.js +24 -0
  33. package/dist/schema-sourced-content.d.ts +254 -0
  34. package/dist/schema-sourced-content.d.ts.map +1 -0
  35. package/dist/schema-sourced-content.js +48 -0
  36. package/dist/schema.d.ts +5 -0
  37. package/dist/schema.d.ts.map +1 -0
  38. package/dist/schema.js +4 -0
  39. package/dist/service-catalog-plane.d.ts +55 -0
  40. package/dist/service-catalog-plane.d.ts.map +1 -0
  41. package/dist/service-catalog-plane.js +202 -0
  42. package/dist/service-content-owned.d.ts +13 -0
  43. package/dist/service-content-owned.d.ts.map +1 -0
  44. package/dist/service-content-owned.js +205 -0
  45. package/dist/service-content-synthesizer.d.ts +43 -0
  46. package/dist/service-content-synthesizer.d.ts.map +1 -0
  47. package/dist/service-content-synthesizer.js +149 -0
  48. package/dist/service-content.d.ts +47 -0
  49. package/dist/service-content.d.ts.map +1 -0
  50. package/dist/service-content.js +304 -0
  51. package/package.json +101 -0
@@ -0,0 +1,62 @@
1
+ import { bookingItems } from "@voyant-travel/bookings/schema";
2
+ import { typeId, typeIdRef } from "@voyant-travel/db/lib/typeid-column";
3
+ import { date, index, integer, jsonb, pgTable, text, timestamp, uniqueIndex, } from "drizzle-orm/pg-core";
4
+ import { mealPlans, ratePlans, roomTypes } from "./schema-inventory.js";
5
+ import { stayBookingItemStatusEnum } from "./schema-shared.js";
6
+ export const stayBookingItems = pgTable("stay_booking_items", {
7
+ id: typeId("stay_booking_items"),
8
+ bookingItemId: typeIdRef("booking_item_id")
9
+ .notNull()
10
+ .references(() => bookingItems.id, { onDelete: "cascade" }),
11
+ propertyId: typeIdRef("property_id").notNull(),
12
+ roomTypeId: typeIdRef("room_type_id")
13
+ .notNull()
14
+ .references(() => roomTypes.id, { onDelete: "cascade" }),
15
+ supplierRoomRef: text("supplier_room_ref"),
16
+ ratePlanId: typeIdRef("rate_plan_id")
17
+ .notNull()
18
+ .references(() => ratePlans.id, { onDelete: "cascade" }),
19
+ checkInDate: date("check_in_date").notNull(),
20
+ checkOutDate: date("check_out_date").notNull(),
21
+ nightCount: integer("night_count").notNull().default(1),
22
+ roomCount: integer("room_count").notNull().default(1),
23
+ adults: integer("adults").notNull().default(1),
24
+ children: integer("children").notNull().default(0),
25
+ infants: integer("infants").notNull().default(0),
26
+ mealPlanId: typeIdRef("meal_plan_id").references(() => mealPlans.id, { onDelete: "set null" }),
27
+ confirmationCode: text("confirmation_code"),
28
+ voucherCode: text("voucher_code"),
29
+ status: stayBookingItemStatusEnum("status").notNull().default("reserved"),
30
+ notes: text("notes"),
31
+ metadata: jsonb("metadata").$type(),
32
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
33
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
34
+ }, (table) => [
35
+ index("idx_stay_booking_items_booking_item").on(table.bookingItemId),
36
+ index("idx_stay_booking_items_check_in").on(table.checkInDate),
37
+ index("idx_stay_booking_items_property_check_in").on(table.propertyId, table.checkInDate),
38
+ index("idx_stay_booking_items_room_type_check_in").on(table.roomTypeId, table.checkInDate),
39
+ index("idx_stay_booking_items_rate_plan_check_in").on(table.ratePlanId, table.checkInDate),
40
+ index("idx_stay_booking_items_status_check_in").on(table.status, table.checkInDate),
41
+ uniqueIndex("uidx_stay_booking_items_booking_item").on(table.bookingItemId),
42
+ ]);
43
+ export const stayDailyRates = pgTable("stay_daily_rates", {
44
+ id: typeId("stay_daily_rates"),
45
+ stayBookingItemId: typeIdRef("stay_booking_item_id")
46
+ .notNull()
47
+ .references(() => stayBookingItems.id, { onDelete: "cascade" }),
48
+ date: date("date").notNull(),
49
+ sellCurrency: text("sell_currency").notNull(),
50
+ sellAmountCents: integer("sell_amount_cents"),
51
+ costCurrency: text("cost_currency"),
52
+ costAmountCents: integer("cost_amount_cents"),
53
+ taxAmountCents: integer("tax_amount_cents"),
54
+ feeAmountCents: integer("fee_amount_cents"),
55
+ commissionAmountCents: integer("commission_amount_cents"),
56
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
57
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
58
+ }, (table) => [
59
+ index("idx_stay_daily_rates_stay_booking_item").on(table.stayBookingItemId),
60
+ index("idx_stay_daily_rates_date").on(table.date),
61
+ uniqueIndex("uidx_stay_daily_rates_item_date").on(table.stayBookingItemId, table.date),
62
+ ]);