@voyantjs/bookings 0.1.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 (42) hide show
  1. package/LICENSE +109 -0
  2. package/README.md +42 -0
  3. package/dist/availability-ref.d.ts +418 -0
  4. package/dist/availability-ref.d.ts.map +1 -0
  5. package/dist/availability-ref.js +28 -0
  6. package/dist/extensions/suppliers.d.ts +3 -0
  7. package/dist/extensions/suppliers.d.ts.map +1 -0
  8. package/dist/extensions/suppliers.js +103 -0
  9. package/dist/index.d.ts +20 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +25 -0
  12. package/dist/pii.d.ts +29 -0
  13. package/dist/pii.d.ts.map +1 -0
  14. package/dist/pii.js +131 -0
  15. package/dist/products-ref.d.ts +1043 -0
  16. package/dist/products-ref.d.ts.map +1 -0
  17. package/dist/products-ref.js +76 -0
  18. package/dist/routes.d.ts +2171 -0
  19. package/dist/routes.d.ts.map +1 -0
  20. package/dist/routes.js +659 -0
  21. package/dist/schema/travel-details.d.ts +179 -0
  22. package/dist/schema/travel-details.d.ts.map +1 -0
  23. package/dist/schema/travel-details.js +46 -0
  24. package/dist/schema.d.ts +3180 -0
  25. package/dist/schema.d.ts.map +1 -0
  26. package/dist/schema.js +509 -0
  27. package/dist/service.d.ts +5000 -0
  28. package/dist/service.d.ts.map +1 -0
  29. package/dist/service.js +2016 -0
  30. package/dist/tasks/expire-stale-holds.d.ts +12 -0
  31. package/dist/tasks/expire-stale-holds.d.ts.map +1 -0
  32. package/dist/tasks/expire-stale-holds.js +7 -0
  33. package/dist/tasks/index.d.ts +2 -0
  34. package/dist/tasks/index.d.ts.map +1 -0
  35. package/dist/tasks/index.js +1 -0
  36. package/dist/transactions-ref.d.ts +2223 -0
  37. package/dist/transactions-ref.d.ts.map +1 -0
  38. package/dist/transactions-ref.js +147 -0
  39. package/dist/validation.d.ts +643 -0
  40. package/dist/validation.d.ts.map +1 -0
  41. package/dist/validation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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BxB,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOnC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMvC,CAAA"}
@@ -0,0 +1,147 @@
1
+ import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
2
+ import { boolean, date, integer, jsonb, pgTable, text, timestamp, } from "drizzle-orm/pg-core";
3
+ export const offersRef = pgTable("offers", {
4
+ id: typeId("offers").primaryKey(),
5
+ offerNumber: text("offer_number").notNull(),
6
+ title: text("title").notNull(),
7
+ status: text("status").notNull(),
8
+ personId: text("person_id"),
9
+ organizationId: text("organization_id"),
10
+ currency: text("currency").notNull(),
11
+ baseCurrency: text("base_currency"),
12
+ totalAmountCents: integer("total_amount_cents").notNull(),
13
+ costAmountCents: integer("cost_amount_cents").notNull(),
14
+ acceptedAt: timestamp("accepted_at", { withTimezone: true }),
15
+ convertedAt: timestamp("converted_at", { withTimezone: true }),
16
+ notes: text("notes"),
17
+ metadata: jsonb("metadata"),
18
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
19
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
20
+ });
21
+ export const offerParticipantsRef = pgTable("offer_participants", {
22
+ id: typeId("offer_participants").primaryKey(),
23
+ offerId: typeIdRef("offer_id").notNull(),
24
+ personId: text("person_id"),
25
+ participantType: text("participant_type").notNull(),
26
+ travelerCategory: text("traveler_category"),
27
+ firstName: text("first_name").notNull(),
28
+ lastName: text("last_name").notNull(),
29
+ email: text("email"),
30
+ phone: text("phone"),
31
+ preferredLanguage: text("preferred_language"),
32
+ isPrimary: boolean("is_primary").notNull().default(false),
33
+ notes: text("notes"),
34
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
35
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
36
+ });
37
+ export const offerItemsRef = pgTable("offer_items", {
38
+ id: typeId("offer_items").primaryKey(),
39
+ offerId: typeIdRef("offer_id").notNull(),
40
+ productId: text("product_id"),
41
+ optionId: text("option_id"),
42
+ unitId: text("unit_id"),
43
+ slotId: text("slot_id"),
44
+ title: text("title").notNull(),
45
+ description: text("description"),
46
+ itemType: text("item_type").notNull(),
47
+ status: text("status").notNull(),
48
+ serviceDate: date("service_date"),
49
+ startsAt: timestamp("starts_at", { withTimezone: true }),
50
+ endsAt: timestamp("ends_at", { withTimezone: true }),
51
+ quantity: integer("quantity").notNull().default(1),
52
+ sellCurrency: text("sell_currency").notNull(),
53
+ unitSellAmountCents: integer("unit_sell_amount_cents"),
54
+ totalSellAmountCents: integer("total_sell_amount_cents"),
55
+ costCurrency: text("cost_currency"),
56
+ unitCostAmountCents: integer("unit_cost_amount_cents"),
57
+ totalCostAmountCents: integer("total_cost_amount_cents"),
58
+ notes: text("notes"),
59
+ metadata: jsonb("metadata"),
60
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
61
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
62
+ });
63
+ export const offerItemParticipantsRef = pgTable("offer_item_participants", {
64
+ id: typeId("offer_item_participants").primaryKey(),
65
+ offerItemId: typeIdRef("offer_item_id").notNull(),
66
+ participantId: typeIdRef("participant_id").notNull(),
67
+ role: text("role").notNull(),
68
+ isPrimary: boolean("is_primary").notNull().default(false),
69
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
70
+ });
71
+ export const ordersRef = pgTable("orders", {
72
+ id: typeId("orders").primaryKey(),
73
+ orderNumber: text("order_number").notNull(),
74
+ offerId: typeIdRef("offer_id"),
75
+ title: text("title").notNull(),
76
+ status: text("status").notNull(),
77
+ personId: text("person_id"),
78
+ organizationId: text("organization_id"),
79
+ currency: text("currency").notNull(),
80
+ baseCurrency: text("base_currency"),
81
+ totalAmountCents: integer("total_amount_cents").notNull(),
82
+ costAmountCents: integer("cost_amount_cents").notNull(),
83
+ confirmedAt: timestamp("confirmed_at", { withTimezone: true }),
84
+ cancelledAt: timestamp("cancelled_at", { withTimezone: true }),
85
+ expiresAt: timestamp("expires_at", { withTimezone: true }),
86
+ notes: text("notes"),
87
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
88
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
89
+ });
90
+ export const orderParticipantsRef = pgTable("order_participants", {
91
+ id: typeId("order_participants").primaryKey(),
92
+ orderId: typeIdRef("order_id").notNull(),
93
+ personId: text("person_id"),
94
+ participantType: text("participant_type").notNull(),
95
+ travelerCategory: text("traveler_category"),
96
+ firstName: text("first_name").notNull(),
97
+ lastName: text("last_name").notNull(),
98
+ email: text("email"),
99
+ phone: text("phone"),
100
+ preferredLanguage: text("preferred_language"),
101
+ isPrimary: boolean("is_primary").notNull().default(false),
102
+ notes: text("notes"),
103
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
104
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
105
+ });
106
+ export const orderItemsRef = pgTable("order_items", {
107
+ id: typeId("order_items").primaryKey(),
108
+ orderId: typeIdRef("order_id").notNull(),
109
+ offerItemId: typeIdRef("offer_item_id"),
110
+ productId: text("product_id"),
111
+ optionId: text("option_id"),
112
+ unitId: text("unit_id"),
113
+ slotId: text("slot_id"),
114
+ title: text("title").notNull(),
115
+ description: text("description"),
116
+ itemType: text("item_type").notNull(),
117
+ status: text("status").notNull(),
118
+ serviceDate: date("service_date"),
119
+ startsAt: timestamp("starts_at", { withTimezone: true }),
120
+ endsAt: timestamp("ends_at", { withTimezone: true }),
121
+ quantity: integer("quantity").notNull().default(1),
122
+ sellCurrency: text("sell_currency").notNull(),
123
+ unitSellAmountCents: integer("unit_sell_amount_cents"),
124
+ totalSellAmountCents: integer("total_sell_amount_cents"),
125
+ costCurrency: text("cost_currency"),
126
+ unitCostAmountCents: integer("unit_cost_amount_cents"),
127
+ totalCostAmountCents: integer("total_cost_amount_cents"),
128
+ notes: text("notes"),
129
+ metadata: jsonb("metadata"),
130
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
131
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
132
+ });
133
+ export const orderItemParticipantsRef = pgTable("order_item_participants", {
134
+ id: typeId("order_item_participants").primaryKey(),
135
+ orderItemId: typeIdRef("order_item_id").notNull(),
136
+ participantId: typeIdRef("participant_id").notNull(),
137
+ role: text("role").notNull(),
138
+ isPrimary: boolean("is_primary").notNull().default(false),
139
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
140
+ });
141
+ export const bookingTransactionDetailsRef = pgTable("booking_transaction_details", {
142
+ bookingId: text("booking_id").primaryKey(),
143
+ offerId: text("offer_id"),
144
+ orderId: text("order_id"),
145
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
146
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
147
+ });