@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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMnC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMnC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQvC,CAAA"}
@@ -0,0 +1,76 @@
1
+ import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
2
+ import { boolean, date, integer, pgTable, text, timestamp, } from "drizzle-orm/pg-core";
3
+ export const productsRef = pgTable("products", {
4
+ id: typeId("products").primaryKey(),
5
+ name: text("name").notNull(),
6
+ description: text("description"),
7
+ sellCurrency: text("sell_currency").notNull(),
8
+ sellAmountCents: integer("sell_amount_cents"),
9
+ costAmountCents: integer("cost_amount_cents"),
10
+ marginPercent: integer("margin_percent"),
11
+ startDate: date("start_date"),
12
+ endDate: date("end_date"),
13
+ pax: integer("pax"),
14
+ });
15
+ export const productOptionsRef = pgTable("product_options", {
16
+ id: typeId("product_options").primaryKey(),
17
+ productId: typeIdRef("product_id").notNull(),
18
+ name: text("name").notNull(),
19
+ status: text("status").notNull(),
20
+ isDefault: boolean("is_default").notNull().default(false),
21
+ sortOrder: integer("sort_order").notNull().default(0),
22
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
23
+ });
24
+ export const optionUnitsRef = pgTable("option_units", {
25
+ id: typeId("option_units").primaryKey(),
26
+ optionId: typeIdRef("option_id").notNull(),
27
+ name: text("name").notNull(),
28
+ description: text("description"),
29
+ unitType: text("unit_type"),
30
+ isRequired: boolean("is_required").notNull().default(false),
31
+ minQuantity: integer("min_quantity"),
32
+ sortOrder: integer("sort_order").notNull().default(0),
33
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
34
+ });
35
+ export const productDaysRef = pgTable("product_days", {
36
+ id: typeId("product_days").primaryKey(),
37
+ productId: typeIdRef("product_id").notNull(),
38
+ dayNumber: integer("day_number").notNull(),
39
+ });
40
+ export const productDayServicesRef = pgTable("product_day_services", {
41
+ id: typeId("product_day_services").primaryKey(),
42
+ dayId: typeIdRef("day_id").notNull(),
43
+ supplierServiceId: text("supplier_service_id"),
44
+ serviceType: text("service_type").notNull(),
45
+ name: text("name").notNull(),
46
+ description: text("description"),
47
+ costCurrency: text("cost_currency").notNull(),
48
+ costAmountCents: integer("cost_amount_cents").notNull(),
49
+ quantity: integer("quantity").notNull().default(1),
50
+ sortOrder: integer("sort_order"),
51
+ notes: text("notes"),
52
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
53
+ });
54
+ export const productTicketSettingsRef = pgTable("product_ticket_settings", {
55
+ id: typeId("product_ticket_settings").primaryKey(),
56
+ productId: typeIdRef("product_id").notNull(),
57
+ fulfillmentMode: text("fulfillment_mode").notNull(),
58
+ defaultDeliveryFormat: text("default_delivery_format").notNull(),
59
+ ticketPerUnit: boolean("ticket_per_unit").notNull().default(false),
60
+ });
61
+ export const bookingProductDetailsRef = pgTable("booking_product_details", {
62
+ bookingId: text("booking_id").primaryKey(),
63
+ productId: text("product_id"),
64
+ optionId: text("option_id"),
65
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
66
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
67
+ });
68
+ export const bookingItemProductDetailsRef = pgTable("booking_item_product_details", {
69
+ bookingItemId: text("booking_item_id").primaryKey(),
70
+ productId: text("product_id"),
71
+ optionId: text("option_id"),
72
+ unitId: text("unit_id"),
73
+ supplierServiceId: text("supplier_service_id"),
74
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
75
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
76
+ });