@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-operations.d.ts","sourceRoot":"","sources":["../src/schema-operations.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4B1B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB3B,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,GAAG,OAAO,cAAc,CAAC,YAAY,CAAA;AAC9D,MAAM,MAAM,gBAAgB,GAAG,OAAO,cAAc,CAAC,YAAY,CAAA"}
@@ -0,0 +1,114 @@
1
+ import { bookingItems } from "@voyantjs/bookings/schema";
2
+ import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
3
+ import { properties } from "@voyantjs/facilities/schema";
4
+ import { date, index, integer, jsonb, pgTable, text, timestamp, uniqueIndex, } from "drizzle-orm/pg-core";
5
+ import { stayBookingItems } from "./schema-bookings";
6
+ import { roomUnits } from "./schema-inventory";
7
+ import { stayCheckpointTypeEnum, stayFolioStatusEnum, stayOperationStatusEnum, stayServicePostKindEnum, } from "./schema-shared";
8
+ export const stayOperations = pgTable("stay_operations", {
9
+ id: typeId("stay_operations"),
10
+ stayBookingItemId: typeIdRef("stay_booking_item_id")
11
+ .notNull()
12
+ .references(() => stayBookingItems.id, { onDelete: "cascade" }),
13
+ propertyId: typeIdRef("property_id")
14
+ .notNull()
15
+ .references(() => properties.id, { onDelete: "cascade" }),
16
+ roomUnitId: typeIdRef("room_unit_id").references(() => roomUnits.id, { onDelete: "set null" }),
17
+ operationStatus: stayOperationStatusEnum("operation_status").notNull().default("reserved"),
18
+ expectedArrivalAt: timestamp("expected_arrival_at", { withTimezone: true }),
19
+ expectedDepartureAt: timestamp("expected_departure_at", { withTimezone: true }),
20
+ checkedInAt: timestamp("checked_in_at", { withTimezone: true }),
21
+ checkedOutAt: timestamp("checked_out_at", { withTimezone: true }),
22
+ noShowRecordedAt: timestamp("no_show_recorded_at", { withTimezone: true }),
23
+ notes: text("notes"),
24
+ metadata: jsonb("metadata").$type(),
25
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
26
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
27
+ }, (table) => [
28
+ uniqueIndex("uidx_stay_operations_stay_booking_item").on(table.stayBookingItemId),
29
+ index("idx_stay_operations_property").on(table.propertyId),
30
+ index("idx_stay_operations_room_unit").on(table.roomUnitId),
31
+ index("idx_stay_operations_status").on(table.operationStatus),
32
+ ]);
33
+ export const stayCheckpoints = pgTable("stay_checkpoints", {
34
+ id: typeId("stay_checkpoints"),
35
+ stayOperationId: typeIdRef("stay_operation_id")
36
+ .notNull()
37
+ .references(() => stayOperations.id, { onDelete: "cascade" }),
38
+ checkpointType: stayCheckpointTypeEnum("checkpoint_type").notNull().default("note"),
39
+ occurredAt: timestamp("occurred_at", { withTimezone: true }).notNull().defaultNow(),
40
+ roomUnitId: typeIdRef("room_unit_id").references(() => roomUnits.id, { onDelete: "set null" }),
41
+ notes: text("notes"),
42
+ metadata: jsonb("metadata").$type(),
43
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
44
+ }, (table) => [
45
+ index("idx_stay_checkpoints_operation").on(table.stayOperationId),
46
+ index("idx_stay_checkpoints_type").on(table.checkpointType),
47
+ index("idx_stay_checkpoints_occurred_at").on(table.occurredAt),
48
+ ]);
49
+ export const stayServicePosts = pgTable("stay_service_posts", {
50
+ id: typeId("stay_service_posts"),
51
+ stayOperationId: typeIdRef("stay_operation_id")
52
+ .notNull()
53
+ .references(() => stayOperations.id, { onDelete: "cascade" }),
54
+ bookingItemId: typeIdRef("booking_item_id").references(() => bookingItems.id, {
55
+ onDelete: "set null",
56
+ }),
57
+ serviceDate: date("service_date").notNull(),
58
+ kind: stayServicePostKindEnum("kind").notNull().default("other"),
59
+ description: text("description").notNull(),
60
+ quantity: integer("quantity").notNull().default(1),
61
+ currencyCode: text("currency_code").notNull(),
62
+ sellAmountCents: integer("sell_amount_cents").notNull().default(0),
63
+ costAmountCents: integer("cost_amount_cents"),
64
+ notes: text("notes"),
65
+ metadata: jsonb("metadata").$type(),
66
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
67
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
68
+ }, (table) => [
69
+ index("idx_stay_service_posts_operation").on(table.stayOperationId),
70
+ index("idx_stay_service_posts_booking_item").on(table.bookingItemId),
71
+ index("idx_stay_service_posts_service_date").on(table.serviceDate),
72
+ index("idx_stay_service_posts_kind").on(table.kind),
73
+ ]);
74
+ export const stayFolios = pgTable("stay_folios", {
75
+ id: typeId("stay_folios"),
76
+ stayOperationId: typeIdRef("stay_operation_id")
77
+ .notNull()
78
+ .references(() => stayOperations.id, { onDelete: "cascade" }),
79
+ currencyCode: text("currency_code").notNull(),
80
+ status: stayFolioStatusEnum("status").notNull().default("open"),
81
+ openedAt: timestamp("opened_at", { withTimezone: true }).notNull().defaultNow(),
82
+ closedAt: timestamp("closed_at", { withTimezone: true }),
83
+ notes: text("notes"),
84
+ metadata: jsonb("metadata").$type(),
85
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
86
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
87
+ }, (table) => [
88
+ index("idx_stay_folios_operation").on(table.stayOperationId),
89
+ index("idx_stay_folios_status").on(table.status),
90
+ ]);
91
+ export const stayFolioLines = pgTable("stay_folio_lines", {
92
+ id: typeId("stay_folio_lines"),
93
+ stayFolioId: typeIdRef("stay_folio_id")
94
+ .notNull()
95
+ .references(() => stayFolios.id, { onDelete: "cascade" }),
96
+ servicePostId: typeIdRef("service_post_id").references(() => stayServicePosts.id, {
97
+ onDelete: "set null",
98
+ }),
99
+ postedAt: timestamp("posted_at", { withTimezone: true }).notNull().defaultNow(),
100
+ lineType: text("line_type").notNull(),
101
+ description: text("description").notNull(),
102
+ quantity: integer("quantity").notNull().default(1),
103
+ amountCents: integer("amount_cents").notNull().default(0),
104
+ taxAmountCents: integer("tax_amount_cents"),
105
+ feeAmountCents: integer("fee_amount_cents"),
106
+ notes: text("notes"),
107
+ metadata: jsonb("metadata").$type(),
108
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
109
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
110
+ }, (table) => [
111
+ index("idx_stay_folio_lines_folio").on(table.stayFolioId),
112
+ index("idx_stay_folio_lines_service_post").on(table.servicePostId),
113
+ index("idx_stay_folio_lines_posted_at").on(table.postedAt),
114
+ ]);