@voyantjs/bookings 0.6.7 → 0.6.9
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.
- package/README.md +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/pii.d.ts +10 -9
- package/dist/pii.d.ts.map +1 -1
- package/dist/pii.js +33 -33
- package/dist/routes-groups.d.ts +25 -5
- package/dist/routes-groups.d.ts.map +1 -1
- package/dist/routes-groups.js +3 -3
- package/dist/routes-public.d.ts +19 -21
- package/dist/routes-public.d.ts.map +1 -1
- package/dist/routes-public.js +1 -1
- package/dist/routes-shared.d.ts +1 -1
- package/dist/routes-shared.d.ts.map +1 -1
- package/dist/routes.d.ts +200 -187
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +65 -95
- package/dist/schema/travel-details.d.ts +27 -27
- package/dist/schema/travel-details.d.ts.map +1 -1
- package/dist/schema/travel-details.js +19 -14
- package/dist/schema-core.d.ts +194 -305
- package/dist/schema-core.d.ts.map +1 -1
- package/dist/schema-core.js +20 -8
- package/dist/schema-items.d.ts +15 -15
- package/dist/schema-items.d.ts.map +1 -1
- package/dist/schema-items.js +16 -11
- package/dist/schema-operations.d.ts +1 -1
- package/dist/schema-operations.d.ts.map +1 -1
- package/dist/schema-operations.js +13 -5
- package/dist/schema-relations.d.ts +26 -9
- package/dist/schema-relations.d.ts.map +1 -1
- package/dist/schema-relations.js +36 -21
- package/dist/schema-shared.d.ts +3 -2
- package/dist/schema-shared.d.ts.map +1 -1
- package/dist/schema-shared.js +4 -5
- package/dist/schema-staff.d.ts +267 -0
- package/dist/schema-staff.d.ts.map +1 -0
- package/dist/schema-staff.js +31 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +1 -0
- package/dist/service-groups.d.ts +3 -7
- package/dist/service-groups.d.ts.map +1 -1
- package/dist/service-groups.js +6 -10
- package/dist/service-public.d.ts +49 -55
- package/dist/service-public.d.ts.map +1 -1
- package/dist/service-public.js +106 -53
- package/dist/service.d.ts +227 -99
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +321 -108
- package/dist/transactions-ref.d.ts +930 -66
- package/dist/transactions-ref.d.ts.map +1 -1
- package/dist/transactions-ref.js +56 -2
- package/dist/validation-public.d.ts +29 -69
- package/dist/validation-public.d.ts.map +1 -1
- package/dist/validation-public.js +21 -20
- package/dist/validation-shared.d.ts +4 -5
- package/dist/validation-shared.d.ts.map +1 -1
- package/dist/validation-shared.js +2 -10
- package/dist/validation.d.ts +229 -44
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +84 -28
- package/package.json +6 -6
package/dist/schema-core.js
CHANGED
|
@@ -10,6 +10,16 @@ export const bookings = pgTable("bookings", {
|
|
|
10
10
|
sourceType: bookingSourceTypeEnum("source_type").notNull().default("manual"),
|
|
11
11
|
externalBookingRef: text("external_booking_ref"),
|
|
12
12
|
communicationLanguage: text("communication_language"),
|
|
13
|
+
contactFirstName: text("contact_first_name"),
|
|
14
|
+
contactLastName: text("contact_last_name"),
|
|
15
|
+
contactEmail: text("contact_email"),
|
|
16
|
+
contactPhone: text("contact_phone"),
|
|
17
|
+
contactPreferredLanguage: text("contact_preferred_language"),
|
|
18
|
+
contactCountry: text("contact_country"),
|
|
19
|
+
contactRegion: text("contact_region"),
|
|
20
|
+
contactCity: text("contact_city"),
|
|
21
|
+
contactAddressLine1: text("contact_address_line1"),
|
|
22
|
+
contactPostalCode: text("contact_postal_code"),
|
|
13
23
|
sellCurrency: text("sell_currency").notNull(),
|
|
14
24
|
baseCurrency: text("base_currency"),
|
|
15
25
|
sellAmountCents: integer("sell_amount_cents"),
|
|
@@ -31,13 +41,14 @@ export const bookings = pgTable("bookings", {
|
|
|
31
41
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
32
42
|
}, (table) => [
|
|
33
43
|
index("idx_bookings_status").on(table.status),
|
|
44
|
+
index("idx_bookings_status_created").on(table.status, table.createdAt),
|
|
34
45
|
index("idx_bookings_person").on(table.personId),
|
|
35
46
|
index("idx_bookings_organization").on(table.organizationId),
|
|
36
47
|
index("idx_bookings_source_type").on(table.sourceType),
|
|
37
48
|
index("idx_bookings_number").on(table.bookingNumber),
|
|
38
49
|
]);
|
|
39
|
-
export const
|
|
40
|
-
id: typeId("
|
|
50
|
+
export const bookingTravelers = pgTable("booking_travelers", {
|
|
51
|
+
id: typeId("booking_travelers"),
|
|
41
52
|
bookingId: typeIdRef("booking_id")
|
|
42
53
|
.notNull()
|
|
43
54
|
.references(() => bookings.id, { onDelete: "cascade" }),
|
|
@@ -56,14 +67,16 @@ export const bookingParticipants = pgTable("booking_participants", {
|
|
|
56
67
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
57
68
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
58
69
|
}, (table) => [
|
|
59
|
-
index("
|
|
60
|
-
index("
|
|
61
|
-
index("
|
|
70
|
+
index("idx_booking_travelers_booking").on(table.bookingId),
|
|
71
|
+
index("idx_booking_travelers_booking_primary_created").on(table.bookingId, table.isPrimary, table.createdAt),
|
|
72
|
+
index("idx_booking_travelers_booking_type_created").on(table.bookingId, table.participantType, table.createdAt),
|
|
73
|
+
index("idx_booking_travelers_type").on(table.participantType),
|
|
74
|
+
index("idx_booking_travelers_person").on(table.personId),
|
|
62
75
|
]);
|
|
63
76
|
export const bookingPiiAccessLog = pgTable("booking_pii_access_log", {
|
|
64
77
|
id: typeId("booking_pii_access_log"),
|
|
65
78
|
bookingId: text("booking_id"),
|
|
66
|
-
|
|
79
|
+
travelerId: text("traveler_id"),
|
|
67
80
|
actorId: text("actor_id"),
|
|
68
81
|
actorType: text("actor_type"),
|
|
69
82
|
callerType: text("caller_type"),
|
|
@@ -74,8 +87,7 @@ export const bookingPiiAccessLog = pgTable("booking_pii_access_log", {
|
|
|
74
87
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
75
88
|
}, (table) => [
|
|
76
89
|
index("idx_booking_pii_access_log_booking").on(table.bookingId),
|
|
77
|
-
index("
|
|
90
|
+
index("idx_booking_pii_access_log_traveler").on(table.travelerId),
|
|
78
91
|
index("idx_booking_pii_access_log_actor").on(table.actorId),
|
|
79
92
|
index("idx_booking_pii_access_log_created_at").on(table.createdAt),
|
|
80
93
|
]);
|
|
81
|
-
export const bookingPassengers = bookingParticipants;
|
package/dist/schema-items.d.ts
CHANGED
|
@@ -802,7 +802,7 @@ export declare const bookingFulfillments: import("drizzle-orm/pg-core").PgTableW
|
|
|
802
802
|
identity: undefined;
|
|
803
803
|
generated: undefined;
|
|
804
804
|
}, {}, {}>;
|
|
805
|
-
|
|
805
|
+
travelerId: import("drizzle-orm/pg-core").PgColumn<{
|
|
806
806
|
name: string;
|
|
807
807
|
tableName: "booking_fulfillments";
|
|
808
808
|
dataType: "string";
|
|
@@ -1032,7 +1032,7 @@ export declare const bookingRedemptionEvents: import("drizzle-orm/pg-core").PgTa
|
|
|
1032
1032
|
identity: undefined;
|
|
1033
1033
|
generated: undefined;
|
|
1034
1034
|
}, {}, {}>;
|
|
1035
|
-
|
|
1035
|
+
travelerId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1036
1036
|
name: string;
|
|
1037
1037
|
tableName: "booking_redemption_events";
|
|
1038
1038
|
dataType: "string";
|
|
@@ -1156,13 +1156,13 @@ export declare const bookingRedemptionEvents: import("drizzle-orm/pg-core").PgTa
|
|
|
1156
1156
|
};
|
|
1157
1157
|
dialect: "pg";
|
|
1158
1158
|
}>;
|
|
1159
|
-
export declare const
|
|
1160
|
-
name: "
|
|
1159
|
+
export declare const bookingItemTravelers: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1160
|
+
name: "booking_item_travelers";
|
|
1161
1161
|
schema: undefined;
|
|
1162
1162
|
columns: {
|
|
1163
1163
|
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
1164
1164
|
name: string;
|
|
1165
|
-
tableName: "
|
|
1165
|
+
tableName: "booking_item_travelers";
|
|
1166
1166
|
dataType: "string";
|
|
1167
1167
|
columnType: "PgText";
|
|
1168
1168
|
data: string;
|
|
@@ -1179,7 +1179,7 @@ export declare const bookingItemParticipants: import("drizzle-orm/pg-core").PgTa
|
|
|
1179
1179
|
}, {}, {}>;
|
|
1180
1180
|
bookingItemId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1181
1181
|
name: string;
|
|
1182
|
-
tableName: "
|
|
1182
|
+
tableName: "booking_item_travelers";
|
|
1183
1183
|
dataType: "string";
|
|
1184
1184
|
columnType: "PgText";
|
|
1185
1185
|
data: string;
|
|
@@ -1194,9 +1194,9 @@ export declare const bookingItemParticipants: import("drizzle-orm/pg-core").PgTa
|
|
|
1194
1194
|
identity: undefined;
|
|
1195
1195
|
generated: undefined;
|
|
1196
1196
|
}, {}, {}>;
|
|
1197
|
-
|
|
1197
|
+
travelerId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1198
1198
|
name: string;
|
|
1199
|
-
tableName: "
|
|
1199
|
+
tableName: "booking_item_travelers";
|
|
1200
1200
|
dataType: "string";
|
|
1201
1201
|
columnType: "PgText";
|
|
1202
1202
|
data: string;
|
|
@@ -1213,24 +1213,24 @@ export declare const bookingItemParticipants: import("drizzle-orm/pg-core").PgTa
|
|
|
1213
1213
|
}, {}, {}>;
|
|
1214
1214
|
role: import("drizzle-orm/pg-core").PgColumn<{
|
|
1215
1215
|
name: "role";
|
|
1216
|
-
tableName: "
|
|
1216
|
+
tableName: "booking_item_travelers";
|
|
1217
1217
|
dataType: "string";
|
|
1218
1218
|
columnType: "PgEnumColumn";
|
|
1219
|
-
data: "other" | "traveler" | "occupant" | "
|
|
1219
|
+
data: "other" | "traveler" | "occupant" | "beneficiary";
|
|
1220
1220
|
driverParam: string;
|
|
1221
1221
|
notNull: true;
|
|
1222
1222
|
hasDefault: true;
|
|
1223
1223
|
isPrimaryKey: false;
|
|
1224
1224
|
isAutoincrement: false;
|
|
1225
1225
|
hasRuntimeDefault: false;
|
|
1226
|
-
enumValues: ["traveler", "occupant", "
|
|
1226
|
+
enumValues: ["traveler", "occupant", "beneficiary", "other"];
|
|
1227
1227
|
baseColumn: never;
|
|
1228
1228
|
identity: undefined;
|
|
1229
1229
|
generated: undefined;
|
|
1230
1230
|
}, {}, {}>;
|
|
1231
1231
|
isPrimary: import("drizzle-orm/pg-core").PgColumn<{
|
|
1232
1232
|
name: "is_primary";
|
|
1233
|
-
tableName: "
|
|
1233
|
+
tableName: "booking_item_travelers";
|
|
1234
1234
|
dataType: "boolean";
|
|
1235
1235
|
columnType: "PgBoolean";
|
|
1236
1236
|
data: boolean;
|
|
@@ -1247,7 +1247,7 @@ export declare const bookingItemParticipants: import("drizzle-orm/pg-core").PgTa
|
|
|
1247
1247
|
}, {}, {}>;
|
|
1248
1248
|
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1249
1249
|
name: "created_at";
|
|
1250
|
-
tableName: "
|
|
1250
|
+
tableName: "booking_item_travelers";
|
|
1251
1251
|
dataType: "date";
|
|
1252
1252
|
columnType: "PgTimestamp";
|
|
1253
1253
|
data: Date;
|
|
@@ -1273,6 +1273,6 @@ export type BookingFulfillment = typeof bookingFulfillments.$inferSelect;
|
|
|
1273
1273
|
export type NewBookingFulfillment = typeof bookingFulfillments.$inferInsert;
|
|
1274
1274
|
export type BookingRedemptionEvent = typeof bookingRedemptionEvents.$inferSelect;
|
|
1275
1275
|
export type NewBookingRedemptionEvent = typeof bookingRedemptionEvents.$inferInsert;
|
|
1276
|
-
export type
|
|
1277
|
-
export type
|
|
1276
|
+
export type BookingItemTraveler = typeof bookingItemTravelers.$inferSelect;
|
|
1277
|
+
export type NewBookingItemTraveler = typeof bookingItemTravelers.$inferInsert;
|
|
1278
1278
|
//# sourceMappingURL=schema-items.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-items.d.ts","sourceRo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M,MAAM,cAAc,GAAG,OAAO,YAAY,CAAC,YAAY,CAAA;AAC7D,MAAM,MAAM,iBAAiB,GAAG,OAAO,kBAAkB,CAAC,YAAY,CAAA;AACtE,MAAM,MAAM,oBAAoB,GAAG,OAAO,kBAAkB,CAAC,YAAY,CAAA;AACzE,MAAM,MAAM,kBAAkB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAA;AACxE,MAAM,MAAM,qBAAqB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAA;AAC3E,MAAM,MAAM,sBAAsB,GAAG,OAAO,uBAAuB,CAAC,YAAY,CAAA;AAChF,MAAM,MAAM,yBAAyB,GAAG,OAAO,uBAAuB,CAAC,YAAY,CAAA;AACnF,MAAM,MAAM,mBAAmB,GAAG,OAAO,oBAAoB,CAAC,YAAY,CAAA;AAC1E,MAAM,MAAM,sBAAsB,GAAG,OAAO,oBAAoB,CAAC,YAAY,CAAA"}
|
package/dist/schema-items.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
2
2
|
import { boolean, date, index, integer, jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
3
3
|
import { availabilitySlotsRef } from "./availability-ref.js";
|
|
4
|
-
import {
|
|
4
|
+
import { bookings, bookingTravelers } from "./schema-core";
|
|
5
5
|
import { bookingAllocationStatusEnum, bookingAllocationTypeEnum, bookingFulfillmentDeliveryChannelEnum, bookingFulfillmentStatusEnum, bookingFulfillmentTypeEnum, bookingItemParticipantRoleEnum, bookingItemStatusEnum, bookingItemTypeEnum, bookingRedemptionMethodEnum, } from "./schema-shared";
|
|
6
6
|
export const bookingItems = pgTable("booking_items", {
|
|
7
7
|
id: typeId("booking_items"),
|
|
@@ -34,6 +34,7 @@ export const bookingItems = pgTable("booking_items", {
|
|
|
34
34
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
35
35
|
}, (table) => [
|
|
36
36
|
index("idx_booking_items_booking").on(table.bookingId),
|
|
37
|
+
index("idx_booking_items_booking_created").on(table.bookingId, table.createdAt),
|
|
37
38
|
index("idx_booking_items_status").on(table.status),
|
|
38
39
|
]);
|
|
39
40
|
export const bookingAllocations = pgTable("booking_allocations", {
|
|
@@ -60,6 +61,7 @@ export const bookingAllocations = pgTable("booking_allocations", {
|
|
|
60
61
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
61
62
|
}, (table) => [
|
|
62
63
|
index("idx_booking_allocations_booking").on(table.bookingId),
|
|
64
|
+
index("idx_booking_allocations_booking_created").on(table.bookingId, table.createdAt),
|
|
63
65
|
index("idx_booking_allocations_item").on(table.bookingItemId),
|
|
64
66
|
index("idx_booking_allocations_slot").on(table.availabilitySlotId),
|
|
65
67
|
index("idx_booking_allocations_status").on(table.status),
|
|
@@ -72,7 +74,7 @@ export const bookingFulfillments = pgTable("booking_fulfillments", {
|
|
|
72
74
|
bookingItemId: typeIdRef("booking_item_id").references(() => bookingItems.id, {
|
|
73
75
|
onDelete: "set null",
|
|
74
76
|
}),
|
|
75
|
-
|
|
77
|
+
travelerId: typeIdRef("traveler_id").references(() => bookingTravelers.id, {
|
|
76
78
|
onDelete: "set null",
|
|
77
79
|
}),
|
|
78
80
|
fulfillmentType: bookingFulfillmentTypeEnum("fulfillment_type").notNull(),
|
|
@@ -86,8 +88,9 @@ export const bookingFulfillments = pgTable("booking_fulfillments", {
|
|
|
86
88
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
87
89
|
}, (table) => [
|
|
88
90
|
index("idx_booking_fulfillments_booking").on(table.bookingId),
|
|
91
|
+
index("idx_booking_fulfillments_booking_created").on(table.bookingId, table.createdAt),
|
|
89
92
|
index("idx_booking_fulfillments_item").on(table.bookingItemId),
|
|
90
|
-
index("
|
|
93
|
+
index("idx_booking_fulfillments_traveler").on(table.travelerId),
|
|
91
94
|
index("idx_booking_fulfillments_status").on(table.status),
|
|
92
95
|
]);
|
|
93
96
|
export const bookingRedemptionEvents = pgTable("booking_redemption_events", {
|
|
@@ -98,7 +101,7 @@ export const bookingRedemptionEvents = pgTable("booking_redemption_events", {
|
|
|
98
101
|
bookingItemId: typeIdRef("booking_item_id").references(() => bookingItems.id, {
|
|
99
102
|
onDelete: "set null",
|
|
100
103
|
}),
|
|
101
|
-
|
|
104
|
+
travelerId: typeIdRef("traveler_id").references(() => bookingTravelers.id, {
|
|
102
105
|
onDelete: "set null",
|
|
103
106
|
}),
|
|
104
107
|
redeemedAt: timestamp("redeemed_at", { withTimezone: true }).notNull().defaultNow(),
|
|
@@ -109,22 +112,24 @@ export const bookingRedemptionEvents = pgTable("booking_redemption_events", {
|
|
|
109
112
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
110
113
|
}, (table) => [
|
|
111
114
|
index("idx_booking_redemption_events_booking").on(table.bookingId),
|
|
115
|
+
index("idx_booking_redemption_events_booking_redeemed_created").on(table.bookingId, table.redeemedAt, table.createdAt),
|
|
112
116
|
index("idx_booking_redemption_events_item").on(table.bookingItemId),
|
|
113
|
-
index("
|
|
117
|
+
index("idx_booking_redemption_events_traveler").on(table.travelerId),
|
|
114
118
|
index("idx_booking_redemption_events_redeemed_at").on(table.redeemedAt),
|
|
115
119
|
]);
|
|
116
|
-
export const
|
|
117
|
-
id: typeId("
|
|
120
|
+
export const bookingItemTravelers = pgTable("booking_item_travelers", {
|
|
121
|
+
id: typeId("booking_item_travelers"),
|
|
118
122
|
bookingItemId: typeIdRef("booking_item_id")
|
|
119
123
|
.notNull()
|
|
120
124
|
.references(() => bookingItems.id, { onDelete: "cascade" }),
|
|
121
|
-
|
|
125
|
+
travelerId: typeIdRef("traveler_id")
|
|
122
126
|
.notNull()
|
|
123
|
-
.references(() =>
|
|
127
|
+
.references(() => bookingTravelers.id, { onDelete: "cascade" }),
|
|
124
128
|
role: bookingItemParticipantRoleEnum("role").notNull().default("traveler"),
|
|
125
129
|
isPrimary: boolean("is_primary").notNull().default(false),
|
|
126
130
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
127
131
|
}, (table) => [
|
|
128
|
-
index("
|
|
129
|
-
index("
|
|
132
|
+
index("idx_booking_item_travelers_item").on(table.bookingItemId),
|
|
133
|
+
index("idx_booking_item_travelers_item_primary_created").on(table.bookingItemId, table.isPrimary, table.createdAt),
|
|
134
|
+
index("idx_booking_item_travelers_traveler").on(table.travelerId),
|
|
130
135
|
]);
|
|
@@ -631,7 +631,7 @@ export declare const bookingDocuments: import("drizzle-orm/pg-core").PgTableWith
|
|
|
631
631
|
identity: undefined;
|
|
632
632
|
generated: undefined;
|
|
633
633
|
}, {}, {}>;
|
|
634
|
-
|
|
634
|
+
travelerId: import("drizzle-orm/pg-core").PgColumn<{
|
|
635
635
|
name: string;
|
|
636
636
|
tableName: "booking_documents";
|
|
637
637
|
dataType: "string";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-operations.d.ts","sourceRoot":"","sources":["../src/schema-operations.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"schema-operations.d.ts","sourceRoot":"","sources":["../src/schema-operations.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAM,sBAAsB,GAAG,OAAO,oBAAoB,CAAC,YAAY,CAAA;AAC7E,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,YAAY,CAAA;AAC1D,MAAM,MAAM,cAAc,GAAG,OAAO,YAAY,CAAC,YAAY,CAAA;AAC7D,MAAM,MAAM,eAAe,GAAG,OAAO,gBAAgB,CAAC,YAAY,CAAA;AAClE,MAAM,MAAM,kBAAkB,GAAG,OAAO,gBAAgB,CAAC,YAAY,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
2
2
|
import { index, integer, jsonb, pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
|
|
3
|
-
import {
|
|
3
|
+
import { bookings, bookingTravelers } from "./schema-core";
|
|
4
4
|
import { bookingActivityTypeEnum, bookingDocumentTypeEnum, supplierConfirmationStatusEnum, } from "./schema-shared";
|
|
5
5
|
export const bookingSupplierStatuses = pgTable("booking_supplier_statuses", {
|
|
6
6
|
id: typeId("booking_supplier_statuses"),
|
|
@@ -19,6 +19,7 @@ export const bookingSupplierStatuses = pgTable("booking_supplier_statuses", {
|
|
|
19
19
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
20
20
|
}, (table) => [
|
|
21
21
|
index("idx_booking_supplier_statuses_booking").on(table.bookingId),
|
|
22
|
+
index("idx_booking_supplier_statuses_booking_created").on(table.bookingId, table.createdAt),
|
|
22
23
|
index("idx_booking_supplier_statuses_service").on(table.supplierServiceId),
|
|
23
24
|
]);
|
|
24
25
|
export const bookingActivityLog = pgTable("booking_activity_log", {
|
|
@@ -31,7 +32,10 @@ export const bookingActivityLog = pgTable("booking_activity_log", {
|
|
|
31
32
|
description: text("description").notNull(),
|
|
32
33
|
metadata: jsonb("metadata").$type(),
|
|
33
34
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
34
|
-
}, (table) => [
|
|
35
|
+
}, (table) => [
|
|
36
|
+
index("idx_booking_activity_log_booking").on(table.bookingId),
|
|
37
|
+
index("idx_booking_activity_log_booking_created").on(table.bookingId, table.createdAt),
|
|
38
|
+
]);
|
|
35
39
|
export const bookingSessionStates = pgTable("booking_session_states", {
|
|
36
40
|
id: typeId("booking_session_states"),
|
|
37
41
|
bookingId: typeIdRef("booking_id")
|
|
@@ -57,13 +61,16 @@ export const bookingNotes = pgTable("booking_notes", {
|
|
|
57
61
|
authorId: text("author_id").notNull(),
|
|
58
62
|
content: text("content").notNull(),
|
|
59
63
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
60
|
-
}, (table) => [
|
|
64
|
+
}, (table) => [
|
|
65
|
+
index("idx_booking_notes_booking").on(table.bookingId),
|
|
66
|
+
index("idx_booking_notes_booking_created").on(table.bookingId, table.createdAt),
|
|
67
|
+
]);
|
|
61
68
|
export const bookingDocuments = pgTable("booking_documents", {
|
|
62
69
|
id: typeId("booking_documents"),
|
|
63
70
|
bookingId: typeIdRef("booking_id")
|
|
64
71
|
.notNull()
|
|
65
72
|
.references(() => bookings.id, { onDelete: "cascade" }),
|
|
66
|
-
|
|
73
|
+
travelerId: typeIdRef("traveler_id").references(() => bookingTravelers.id, {
|
|
67
74
|
onDelete: "set null",
|
|
68
75
|
}),
|
|
69
76
|
type: bookingDocumentTypeEnum("type").notNull(),
|
|
@@ -74,5 +81,6 @@ export const bookingDocuments = pgTable("booking_documents", {
|
|
|
74
81
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
75
82
|
}, (table) => [
|
|
76
83
|
index("idx_booking_documents_booking").on(table.bookingId),
|
|
77
|
-
index("
|
|
84
|
+
index("idx_booking_documents_booking_created").on(table.bookingId, table.createdAt),
|
|
85
|
+
index("idx_booking_documents_traveler").on(table.travelerId),
|
|
78
86
|
]);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const bookingsRelations: import("drizzle-orm").Relations<"bookings", {
|
|
2
|
-
participants: import("drizzle-orm").Many<"
|
|
2
|
+
participants: import("drizzle-orm").Many<"booking_travelers">;
|
|
3
|
+
staffAssignments: import("drizzle-orm").Many<"booking_staff_assignments">;
|
|
3
4
|
supplierStatuses: import("drizzle-orm").Many<"booking_supplier_statuses">;
|
|
4
5
|
activityLog: import("drizzle-orm").Many<"booking_activity_log">;
|
|
5
6
|
notes: import("drizzle-orm").Many<"booking_notes">;
|
|
@@ -18,16 +19,24 @@ export declare const bookingGroupMembersRelations: import("drizzle-orm").Relatio
|
|
|
18
19
|
group: import("drizzle-orm").One<"booking_groups", true>;
|
|
19
20
|
booking: import("drizzle-orm").One<"bookings", true>;
|
|
20
21
|
}>;
|
|
21
|
-
export declare const
|
|
22
|
+
export declare const bookingTravelersRelations: import("drizzle-orm").Relations<"booking_travelers", {
|
|
22
23
|
booking: import("drizzle-orm").One<"bookings", true>;
|
|
23
24
|
documents: import("drizzle-orm").Many<"booking_documents">;
|
|
24
25
|
fulfillments: import("drizzle-orm").Many<"booking_fulfillments">;
|
|
25
26
|
redemptionEvents: import("drizzle-orm").Many<"booking_redemption_events">;
|
|
26
|
-
itemLinks: import("drizzle-orm").Many<"
|
|
27
|
+
itemLinks: import("drizzle-orm").Many<"booking_item_travelers">;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const bookingParticipantsRelations: import("drizzle-orm").Relations<"booking_travelers", {
|
|
30
|
+
booking: import("drizzle-orm").One<"bookings", true>;
|
|
31
|
+
documents: import("drizzle-orm").Many<"booking_documents">;
|
|
32
|
+
fulfillments: import("drizzle-orm").Many<"booking_fulfillments">;
|
|
33
|
+
redemptionEvents: import("drizzle-orm").Many<"booking_redemption_events">;
|
|
34
|
+
itemLinks: import("drizzle-orm").Many<"booking_item_travelers">;
|
|
27
35
|
}>;
|
|
28
36
|
export declare const bookingItemsRelations: import("drizzle-orm").Relations<"booking_items", {
|
|
29
37
|
booking: import("drizzle-orm").One<"bookings", true>;
|
|
30
|
-
participantLinks: import("drizzle-orm").Many<"
|
|
38
|
+
participantLinks: import("drizzle-orm").Many<"booking_item_travelers">;
|
|
39
|
+
staffAssignments: import("drizzle-orm").Many<"booking_staff_assignments">;
|
|
31
40
|
allocations: import("drizzle-orm").Many<"booking_allocations">;
|
|
32
41
|
fulfillments: import("drizzle-orm").Many<"booking_fulfillments">;
|
|
33
42
|
redemptionEvents: import("drizzle-orm").Many<"booking_redemption_events">;
|
|
@@ -37,9 +46,13 @@ export declare const bookingAllocationsRelations: import("drizzle-orm").Relation
|
|
|
37
46
|
bookingItem: import("drizzle-orm").One<"booking_items", true>;
|
|
38
47
|
availabilitySlot: import("drizzle-orm").One<"availability_slots", false>;
|
|
39
48
|
}>;
|
|
40
|
-
export declare const
|
|
49
|
+
export declare const bookingItemTravelersRelations: import("drizzle-orm").Relations<"booking_item_travelers", {
|
|
41
50
|
bookingItem: import("drizzle-orm").One<"booking_items", true>;
|
|
42
|
-
|
|
51
|
+
traveler: import("drizzle-orm").One<"booking_travelers", true>;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const bookingItemParticipantsRelations: import("drizzle-orm").Relations<"booking_item_travelers", {
|
|
54
|
+
bookingItem: import("drizzle-orm").One<"booking_items", true>;
|
|
55
|
+
traveler: import("drizzle-orm").One<"booking_travelers", true>;
|
|
43
56
|
}>;
|
|
44
57
|
export declare const bookingSupplierStatusesRelations: import("drizzle-orm").Relations<"booking_supplier_statuses", {
|
|
45
58
|
booking: import("drizzle-orm").One<"bookings", true>;
|
|
@@ -47,12 +60,12 @@ export declare const bookingSupplierStatusesRelations: import("drizzle-orm").Rel
|
|
|
47
60
|
export declare const bookingFulfillmentsRelations: import("drizzle-orm").Relations<"booking_fulfillments", {
|
|
48
61
|
booking: import("drizzle-orm").One<"bookings", true>;
|
|
49
62
|
bookingItem: import("drizzle-orm").One<"booking_items", false>;
|
|
50
|
-
|
|
63
|
+
traveler: import("drizzle-orm").One<"booking_travelers", false>;
|
|
51
64
|
}>;
|
|
52
65
|
export declare const bookingRedemptionEventsRelations: import("drizzle-orm").Relations<"booking_redemption_events", {
|
|
53
66
|
booking: import("drizzle-orm").One<"bookings", true>;
|
|
54
67
|
bookingItem: import("drizzle-orm").One<"booking_items", false>;
|
|
55
|
-
|
|
68
|
+
traveler: import("drizzle-orm").One<"booking_travelers", false>;
|
|
56
69
|
}>;
|
|
57
70
|
export declare const bookingActivityLogRelations: import("drizzle-orm").Relations<"booking_activity_log", {
|
|
58
71
|
booking: import("drizzle-orm").One<"bookings", true>;
|
|
@@ -65,6 +78,10 @@ export declare const bookingNotesRelations: import("drizzle-orm").Relations<"boo
|
|
|
65
78
|
}>;
|
|
66
79
|
export declare const bookingDocumentsRelations: import("drizzle-orm").Relations<"booking_documents", {
|
|
67
80
|
booking: import("drizzle-orm").One<"bookings", true>;
|
|
68
|
-
|
|
81
|
+
traveler: import("drizzle-orm").One<"booking_travelers", false>;
|
|
82
|
+
}>;
|
|
83
|
+
export declare const bookingStaffAssignmentsRelations: import("drizzle-orm").Relations<"booking_staff_assignments", {
|
|
84
|
+
booking: import("drizzle-orm").One<"bookings", true>;
|
|
85
|
+
bookingItem: import("drizzle-orm").One<"booking_items", false>;
|
|
69
86
|
}>;
|
|
70
87
|
//# sourceMappingURL=schema-relations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-relations.d.ts","sourceRoot":"","sources":["../src/schema-relations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-relations.d.ts","sourceRoot":"","sources":["../src/schema-relations.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;EAa3B,CAAA;AAEH,eAAO,MAAM,sBAAsB;;EAEhC,CAAA;AAEH,eAAO,MAAM,4BAA4B;;;EAStC,CAAA;AAEH,eAAO,MAAM,yBAAyB;;;;;;EAMnC,CAAA;AAEH,eAAO,MAAM,4BAA4B;;;;;;EAA4B,CAAA;AAErE,eAAO,MAAM,qBAAqB;;;;;;;EAO/B,CAAA;AAEH,eAAO,MAAM,2BAA2B;;;;EAUrC,CAAA;AAEH,eAAO,MAAM,6BAA6B;;;EASvC,CAAA;AAEH,eAAO,MAAM,gCAAgC;;;EAAgC,CAAA;AAE7E,eAAO,MAAM,gCAAgC;;EAK1C,CAAA;AAEH,eAAO,MAAM,4BAA4B;;;;EAUtC,CAAA;AAEH,eAAO,MAAM,gCAAgC;;;;EAa1C,CAAA;AAEH,eAAO,MAAM,2BAA2B;;EAErC,CAAA;AAEH,eAAO,MAAM,6BAA6B;;EAKvC,CAAA;AAEH,eAAO,MAAM,qBAAqB;;EAE/B,CAAA;AAEH,eAAO,MAAM,yBAAyB;;;EAMnC,CAAA;AAEH,eAAO,MAAM,gCAAgC;;;EAS1C,CAAA"}
|
package/dist/schema-relations.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { relations } from "drizzle-orm";
|
|
2
2
|
import { availabilitySlotsRef } from "./availability-ref.js";
|
|
3
|
-
import {
|
|
3
|
+
import { bookings, bookingTravelers } from "./schema-core";
|
|
4
4
|
import { bookingGroupMembers, bookingGroups } from "./schema-groups";
|
|
5
|
-
import { bookingAllocations, bookingFulfillments,
|
|
5
|
+
import { bookingAllocations, bookingFulfillments, bookingItems, bookingItemTravelers, bookingRedemptionEvents, } from "./schema-items";
|
|
6
6
|
import { bookingActivityLog, bookingDocuments, bookingNotes, bookingSessionStates, bookingSupplierStatuses, } from "./schema-operations";
|
|
7
|
+
import { bookingStaffAssignments } from "./schema-staff";
|
|
7
8
|
export const bookingsRelations = relations(bookings, ({ many }) => ({
|
|
8
|
-
participants: many(
|
|
9
|
+
participants: many(bookingTravelers),
|
|
10
|
+
staffAssignments: many(bookingStaffAssignments),
|
|
9
11
|
supplierStatuses: many(bookingSupplierStatuses),
|
|
10
12
|
activityLog: many(bookingActivityLog),
|
|
11
13
|
notes: many(bookingNotes),
|
|
@@ -30,16 +32,18 @@ export const bookingGroupMembersRelations = relations(bookingGroupMembers, ({ on
|
|
|
30
32
|
references: [bookings.id],
|
|
31
33
|
}),
|
|
32
34
|
}));
|
|
33
|
-
export const
|
|
34
|
-
booking: one(bookings, { fields: [
|
|
35
|
+
export const bookingTravelersRelations = relations(bookingTravelers, ({ one, many }) => ({
|
|
36
|
+
booking: one(bookings, { fields: [bookingTravelers.bookingId], references: [bookings.id] }),
|
|
35
37
|
documents: many(bookingDocuments),
|
|
36
38
|
fulfillments: many(bookingFulfillments),
|
|
37
39
|
redemptionEvents: many(bookingRedemptionEvents),
|
|
38
|
-
itemLinks: many(
|
|
40
|
+
itemLinks: many(bookingItemTravelers),
|
|
39
41
|
}));
|
|
42
|
+
export const bookingParticipantsRelations = bookingTravelersRelations;
|
|
40
43
|
export const bookingItemsRelations = relations(bookingItems, ({ one, many }) => ({
|
|
41
44
|
booking: one(bookings, { fields: [bookingItems.bookingId], references: [bookings.id] }),
|
|
42
|
-
participantLinks: many(
|
|
45
|
+
participantLinks: many(bookingItemTravelers),
|
|
46
|
+
staffAssignments: many(bookingStaffAssignments),
|
|
43
47
|
allocations: many(bookingAllocations),
|
|
44
48
|
fulfillments: many(bookingFulfillments),
|
|
45
49
|
redemptionEvents: many(bookingRedemptionEvents),
|
|
@@ -55,16 +59,17 @@ export const bookingAllocationsRelations = relations(bookingAllocations, ({ one
|
|
|
55
59
|
references: [availabilitySlotsRef.id],
|
|
56
60
|
}),
|
|
57
61
|
}));
|
|
58
|
-
export const
|
|
62
|
+
export const bookingItemTravelersRelations = relations(bookingItemTravelers, ({ one }) => ({
|
|
59
63
|
bookingItem: one(bookingItems, {
|
|
60
|
-
fields: [
|
|
64
|
+
fields: [bookingItemTravelers.bookingItemId],
|
|
61
65
|
references: [bookingItems.id],
|
|
62
66
|
}),
|
|
63
|
-
|
|
64
|
-
fields: [
|
|
65
|
-
references: [
|
|
67
|
+
traveler: one(bookingTravelers, {
|
|
68
|
+
fields: [bookingItemTravelers.travelerId],
|
|
69
|
+
references: [bookingTravelers.id],
|
|
66
70
|
}),
|
|
67
71
|
}));
|
|
72
|
+
export const bookingItemParticipantsRelations = bookingItemTravelersRelations;
|
|
68
73
|
export const bookingSupplierStatusesRelations = relations(bookingSupplierStatuses, ({ one }) => ({
|
|
69
74
|
booking: one(bookings, {
|
|
70
75
|
fields: [bookingSupplierStatuses.bookingId],
|
|
@@ -77,9 +82,9 @@ export const bookingFulfillmentsRelations = relations(bookingFulfillments, ({ on
|
|
|
77
82
|
fields: [bookingFulfillments.bookingItemId],
|
|
78
83
|
references: [bookingItems.id],
|
|
79
84
|
}),
|
|
80
|
-
|
|
81
|
-
fields: [bookingFulfillments.
|
|
82
|
-
references: [
|
|
85
|
+
traveler: one(bookingTravelers, {
|
|
86
|
+
fields: [bookingFulfillments.travelerId],
|
|
87
|
+
references: [bookingTravelers.id],
|
|
83
88
|
}),
|
|
84
89
|
}));
|
|
85
90
|
export const bookingRedemptionEventsRelations = relations(bookingRedemptionEvents, ({ one }) => ({
|
|
@@ -91,9 +96,9 @@ export const bookingRedemptionEventsRelations = relations(bookingRedemptionEvent
|
|
|
91
96
|
fields: [bookingRedemptionEvents.bookingItemId],
|
|
92
97
|
references: [bookingItems.id],
|
|
93
98
|
}),
|
|
94
|
-
|
|
95
|
-
fields: [bookingRedemptionEvents.
|
|
96
|
-
references: [
|
|
99
|
+
traveler: one(bookingTravelers, {
|
|
100
|
+
fields: [bookingRedemptionEvents.travelerId],
|
|
101
|
+
references: [bookingTravelers.id],
|
|
97
102
|
}),
|
|
98
103
|
}));
|
|
99
104
|
export const bookingActivityLogRelations = relations(bookingActivityLog, ({ one }) => ({
|
|
@@ -110,8 +115,18 @@ export const bookingNotesRelations = relations(bookingNotes, ({ one }) => ({
|
|
|
110
115
|
}));
|
|
111
116
|
export const bookingDocumentsRelations = relations(bookingDocuments, ({ one }) => ({
|
|
112
117
|
booking: one(bookings, { fields: [bookingDocuments.bookingId], references: [bookings.id] }),
|
|
113
|
-
|
|
114
|
-
fields: [bookingDocuments.
|
|
115
|
-
references: [
|
|
118
|
+
traveler: one(bookingTravelers, {
|
|
119
|
+
fields: [bookingDocuments.travelerId],
|
|
120
|
+
references: [bookingTravelers.id],
|
|
121
|
+
}),
|
|
122
|
+
}));
|
|
123
|
+
export const bookingStaffAssignmentsRelations = relations(bookingStaffAssignments, ({ one }) => ({
|
|
124
|
+
booking: one(bookings, {
|
|
125
|
+
fields: [bookingStaffAssignments.bookingId],
|
|
126
|
+
references: [bookings.id],
|
|
127
|
+
}),
|
|
128
|
+
bookingItem: one(bookingItems, {
|
|
129
|
+
fields: [bookingStaffAssignments.bookingItemId],
|
|
130
|
+
references: [bookingItems.id],
|
|
116
131
|
}),
|
|
117
132
|
}));
|
package/dist/schema-shared.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const supplierConfirmationStatusEnum: import("drizzle-orm/pg-core
|
|
|
3
3
|
export declare const bookingActivityTypeEnum: import("drizzle-orm/pg-core").PgEnum<["booking_created", "booking_reserved", "booking_converted", "booking_confirmed", "hold_extended", "hold_expired", "status_change", "item_update", "allocation_released", "fulfillment_issued", "fulfillment_updated", "redemption_recorded", "supplier_update", "passenger_update", "note_added"]>;
|
|
4
4
|
export declare const bookingDocumentTypeEnum: import("drizzle-orm/pg-core").PgEnum<["visa", "insurance", "health", "passport_copy", "other"]>;
|
|
5
5
|
export declare const bookingSourceTypeEnum: import("drizzle-orm/pg-core").PgEnum<["direct", "manual", "affiliate", "ota", "reseller", "api_partner", "internal"]>;
|
|
6
|
-
export declare const bookingParticipantTypeEnum: import("drizzle-orm/pg-core").PgEnum<["traveler", "
|
|
6
|
+
export declare const bookingParticipantTypeEnum: import("drizzle-orm/pg-core").PgEnum<["traveler", "occupant", "other"]>;
|
|
7
7
|
export declare const bookingTravelerCategoryEnum: import("drizzle-orm/pg-core").PgEnum<["adult", "child", "infant", "senior", "other"]>;
|
|
8
8
|
export declare const bookingItemTypeEnum: import("drizzle-orm/pg-core").PgEnum<["unit", "extra", "service", "fee", "tax", "discount", "adjustment", "accommodation", "transport", "other"]>;
|
|
9
9
|
export declare const bookingItemStatusEnum: import("drizzle-orm/pg-core").PgEnum<["draft", "on_hold", "confirmed", "cancelled", "expired", "fulfilled"]>;
|
|
@@ -13,7 +13,8 @@ export declare const bookingFulfillmentTypeEnum: import("drizzle-orm/pg-core").P
|
|
|
13
13
|
export declare const bookingFulfillmentDeliveryChannelEnum: import("drizzle-orm/pg-core").PgEnum<["download", "email", "api", "wallet", "other"]>;
|
|
14
14
|
export declare const bookingFulfillmentStatusEnum: import("drizzle-orm/pg-core").PgEnum<["pending", "issued", "reissued", "revoked", "failed"]>;
|
|
15
15
|
export declare const bookingRedemptionMethodEnum: import("drizzle-orm/pg-core").PgEnum<["manual", "scan", "api", "other"]>;
|
|
16
|
-
export declare const bookingItemParticipantRoleEnum: import("drizzle-orm/pg-core").PgEnum<["traveler", "occupant", "
|
|
16
|
+
export declare const bookingItemParticipantRoleEnum: import("drizzle-orm/pg-core").PgEnum<["traveler", "occupant", "beneficiary", "other"]>;
|
|
17
|
+
export declare const bookingStaffAssignmentRoleEnum: import("drizzle-orm/pg-core").PgEnum<["service_assignee", "other"]>;
|
|
17
18
|
export declare const bookingPiiAccessActionEnum: import("drizzle-orm/pg-core").PgEnum<["read", "update", "delete"]>;
|
|
18
19
|
export declare const bookingPiiAccessOutcomeEnum: import("drizzle-orm/pg-core").PgEnum<["allowed", "denied"]>;
|
|
19
20
|
//# sourceMappingURL=schema-shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-shared.d.ts","sourceRoot":"","sources":["../src/schema-shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,6HAQ5B,CAAA;AAEF,eAAO,MAAM,8BAA8B,yFAKzC,CAAA;AAEF,eAAO,MAAM,uBAAuB,0UAgBlC,CAAA;AAEF,eAAO,MAAM,uBAAuB,iGAMlC,CAAA;AAEF,eAAO,MAAM,qBAAqB,uHAQhC,CAAA;AAEF,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"schema-shared.d.ts","sourceRoot":"","sources":["../src/schema-shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,6HAQ5B,CAAA;AAEF,eAAO,MAAM,8BAA8B,yFAKzC,CAAA;AAEF,eAAO,MAAM,uBAAuB,0UAgBlC,CAAA;AAEF,eAAO,MAAM,uBAAuB,iGAMlC,CAAA;AAEF,eAAO,MAAM,qBAAqB,uHAQhC,CAAA;AAEF,eAAO,MAAM,0BAA0B,yEAIrC,CAAA;AAEF,eAAO,MAAM,2BAA2B,uFAMtC,CAAA;AAEF,eAAO,MAAM,mBAAmB,mJAW9B,CAAA;AAEF,eAAO,MAAM,qBAAqB,8GAOhC,CAAA;AAEF,eAAO,MAAM,yBAAyB,sEAIpC,CAAA;AAEF,eAAO,MAAM,2BAA2B,8GAOtC,CAAA;AAEF,eAAO,MAAM,0BAA0B,6GAQrC,CAAA;AAEF,eAAO,MAAM,qCAAqC,uFAGjD,CAAA;AAED,eAAO,MAAM,4BAA4B,8FAMvC,CAAA;AAEF,eAAO,MAAM,2BAA2B,0EAKtC,CAAA;AAEF,eAAO,MAAM,8BAA8B,wFAKzC,CAAA;AAEF,eAAO,MAAM,8BAA8B,qEAGzC,CAAA;AAEF,eAAO,MAAM,0BAA0B,oEAIrC,CAAA;AAEF,eAAO,MAAM,2BAA2B,6DAGtC,CAAA"}
|
package/dist/schema-shared.js
CHANGED
|
@@ -49,10 +49,7 @@ export const bookingSourceTypeEnum = pgEnum("booking_source_type", [
|
|
|
49
49
|
]);
|
|
50
50
|
export const bookingParticipantTypeEnum = pgEnum("booking_participant_type", [
|
|
51
51
|
"traveler",
|
|
52
|
-
"booker",
|
|
53
|
-
"contact",
|
|
54
52
|
"occupant",
|
|
55
|
-
"staff",
|
|
56
53
|
"other",
|
|
57
54
|
]);
|
|
58
55
|
export const bookingTravelerCategoryEnum = pgEnum("booking_traveler_category", [
|
|
@@ -121,11 +118,13 @@ export const bookingRedemptionMethodEnum = pgEnum("booking_redemption_method", [
|
|
|
121
118
|
export const bookingItemParticipantRoleEnum = pgEnum("booking_item_participant_role", [
|
|
122
119
|
"traveler",
|
|
123
120
|
"occupant",
|
|
124
|
-
"primary_contact",
|
|
125
|
-
"service_assignee",
|
|
126
121
|
"beneficiary",
|
|
127
122
|
"other",
|
|
128
123
|
]);
|
|
124
|
+
export const bookingStaffAssignmentRoleEnum = pgEnum("booking_staff_assignment_role", [
|
|
125
|
+
"service_assignee",
|
|
126
|
+
"other",
|
|
127
|
+
]);
|
|
129
128
|
export const bookingPiiAccessActionEnum = pgEnum("booking_pii_access_action", [
|
|
130
129
|
"read",
|
|
131
130
|
"update",
|