@voyant-travel/cruises 0.118.2
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/LICENSE +201 -0
- package/README.md +50 -0
- package/dist/adapters/connect-compat.d.ts +20 -0
- package/dist/adapters/connect-compat.d.ts.map +1 -0
- package/dist/adapters/connect-compat.js +71 -0
- package/dist/adapters/contract-fixture.d.ts +32 -0
- package/dist/adapters/contract-fixture.d.ts.map +1 -0
- package/dist/adapters/contract-fixture.js +152 -0
- package/dist/adapters/index.d.ts +331 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +16 -0
- package/dist/adapters/memoize.d.ts +28 -0
- package/dist/adapters/memoize.d.ts.map +1 -0
- package/dist/adapters/memoize.js +131 -0
- package/dist/adapters/mock.d.ts +44 -0
- package/dist/adapters/mock.d.ts.map +1 -0
- package/dist/adapters/mock.js +192 -0
- package/dist/adapters/registry.d.ts +26 -0
- package/dist/adapters/registry.d.ts.map +1 -0
- package/dist/adapters/registry.js +42 -0
- package/dist/adapters/source-adapter-shim.d.ts +80 -0
- package/dist/adapters/source-adapter-shim.d.ts.map +1 -0
- package/dist/adapters/source-adapter-shim.js +390 -0
- package/dist/booking-engine/handler.d.ts +108 -0
- package/dist/booking-engine/handler.d.ts.map +1 -0
- package/dist/booking-engine/handler.js +225 -0
- package/dist/booking-engine/index.d.ts +9 -0
- package/dist/booking-engine/index.d.ts.map +1 -0
- package/dist/booking-engine/index.js +8 -0
- package/dist/booking-extension.d.ts +1179 -0
- package/dist/booking-extension.d.ts.map +1 -0
- package/dist/booking-extension.js +342 -0
- package/dist/cabin-features.d.ts +8 -0
- package/dist/cabin-features.d.ts.map +1 -0
- package/dist/cabin-features.js +7 -0
- package/dist/catalog-policy-cabins.d.ts +18 -0
- package/dist/catalog-policy-cabins.d.ts.map +1 -0
- package/dist/catalog-policy-cabins.js +96 -0
- package/dist/catalog-policy-core.d.ts +3 -0
- package/dist/catalog-policy-core.d.ts.map +1 -0
- package/dist/catalog-policy-core.js +247 -0
- package/dist/catalog-policy-structure.d.ts +3 -0
- package/dist/catalog-policy-structure.d.ts.map +1 -0
- package/dist/catalog-policy-structure.js +387 -0
- package/dist/catalog-policy.d.ts +15 -0
- package/dist/catalog-policy.d.ts.map +1 -0
- package/dist/catalog-policy.js +19 -0
- package/dist/content-shape.d.ts +5 -0
- package/dist/content-shape.d.ts.map +1 -0
- package/dist/content-shape.js +13 -0
- package/dist/draft-shape.d.ts +59 -0
- package/dist/draft-shape.d.ts.map +1 -0
- package/dist/draft-shape.js +98 -0
- package/dist/events.d.ts +21 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +21 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +66 -0
- package/dist/lib/key.d.ts +41 -0
- package/dist/lib/key.d.ts.map +1 -0
- package/dist/lib/key.js +100 -0
- package/dist/routes-booking-payloads.d.ts +133 -0
- package/dist/routes-booking-payloads.d.ts.map +1 -0
- package/dist/routes-booking-payloads.js +142 -0
- package/dist/routes-content.d.ts +53 -0
- package/dist/routes-content.d.ts.map +1 -0
- package/dist/routes-content.js +158 -0
- package/dist/routes-core.d.ts +4 -0
- package/dist/routes-core.d.ts.map +1 -0
- package/dist/routes-core.js +68 -0
- package/dist/routes-detail.d.ts +4 -0
- package/dist/routes-detail.d.ts.map +1 -0
- package/dist/routes-detail.js +261 -0
- package/dist/routes-env.d.ts +13 -0
- package/dist/routes-env.d.ts.map +1 -0
- package/dist/routes-env.js +1 -0
- package/dist/routes-keying.d.ts +28 -0
- package/dist/routes-keying.d.ts.map +1 -0
- package/dist/routes-keying.js +70 -0
- package/dist/routes-public.d.ts +911 -0
- package/dist/routes-public.d.ts.map +1 -0
- package/dist/routes-public.js +252 -0
- package/dist/routes-sailings-prices.d.ts +4 -0
- package/dist/routes-sailings-prices.d.ts.map +1 -0
- package/dist/routes-sailings-prices.js +278 -0
- package/dist/routes-search-index.d.ts +4 -0
- package/dist/routes-search-index.d.ts.map +1 -0
- package/dist/routes-search-index.js +25 -0
- package/dist/routes-ships.d.ts +4 -0
- package/dist/routes-ships.d.ts.map +1 -0
- package/dist/routes-ships.js +147 -0
- package/dist/routes-voyage-groups.d.ts +4 -0
- package/dist/routes-voyage-groups.d.ts.map +1 -0
- package/dist/routes-voyage-groups.js +85 -0
- package/dist/routes.d.ts +5 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +14 -0
- package/dist/schema-cabins.d.ts +1098 -0
- package/dist/schema-cabins.d.ts.map +1 -0
- package/dist/schema-cabins.js +105 -0
- package/dist/schema-content.d.ts +577 -0
- package/dist/schema-content.d.ts.map +1 -0
- package/dist/schema-content.js +63 -0
- package/dist/schema-core.d.ts +1790 -0
- package/dist/schema-core.d.ts.map +1 -0
- package/dist/schema-core.js +171 -0
- package/dist/schema-itinerary.d.ts +556 -0
- package/dist/schema-itinerary.d.ts.map +1 -0
- package/dist/schema-itinerary.js +50 -0
- package/dist/schema-pricing.d.ts +633 -0
- package/dist/schema-pricing.d.ts.map +1 -0
- package/dist/schema-pricing.js +73 -0
- package/dist/schema-search.d.ts +611 -0
- package/dist/schema-search.d.ts.map +1 -0
- package/dist/schema-search.js +64 -0
- package/dist/schema-shared.d.ts +23 -0
- package/dist/schema-shared.d.ts.map +1 -0
- package/dist/schema-shared.js +107 -0
- package/dist/schema-sourced-content.d.ts +247 -0
- package/dist/schema-sourced-content.d.ts.map +1 -0
- package/dist/schema-sourced-content.js +38 -0
- package/dist/schema.d.ts +10 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +9 -0
- package/dist/service-booking-helpers.d.ts +12 -0
- package/dist/service-booking-helpers.d.ts.map +1 -0
- package/dist/service-booking-helpers.js +94 -0
- package/dist/service-booking-types.d.ts +101 -0
- package/dist/service-booking-types.d.ts.map +1 -0
- package/dist/service-booking-types.js +1 -0
- package/dist/service-bookings.d.ts +46 -0
- package/dist/service-bookings.d.ts.map +1 -0
- package/dist/service-bookings.js +420 -0
- package/dist/service-catalog-plane-cabins.d.ts +24 -0
- package/dist/service-catalog-plane-cabins.d.ts.map +1 -0
- package/dist/service-catalog-plane-cabins.js +90 -0
- package/dist/service-catalog-plane.d.ts +74 -0
- package/dist/service-catalog-plane.d.ts.map +1 -0
- package/dist/service-catalog-plane.js +194 -0
- package/dist/service-content-synthesizer.d.ts +42 -0
- package/dist/service-content-synthesizer.d.ts.map +1 -0
- package/dist/service-content-synthesizer.js +144 -0
- package/dist/service-content.d.ts +74 -0
- package/dist/service-content.d.ts.map +1 -0
- package/dist/service-content.js +315 -0
- package/dist/service-core.d.ts +134 -0
- package/dist/service-core.d.ts.map +1 -0
- package/dist/service-core.js +257 -0
- package/dist/service-detach.d.ts +18 -0
- package/dist/service-detach.d.ts.map +1 -0
- package/dist/service-detach.js +199 -0
- package/dist/service-enrichment.d.ts +11 -0
- package/dist/service-enrichment.d.ts.map +1 -0
- package/dist/service-enrichment.js +47 -0
- package/dist/service-external-refresh.d.ts +39 -0
- package/dist/service-external-refresh.d.ts.map +1 -0
- package/dist/service-external-refresh.js +47 -0
- package/dist/service-itinerary.d.ts +22 -0
- package/dist/service-itinerary.d.ts.map +1 -0
- package/dist/service-itinerary.js +34 -0
- package/dist/service-prices.d.ts +46 -0
- package/dist/service-prices.d.ts.map +1 -0
- package/dist/service-prices.js +89 -0
- package/dist/service-pricing.d.ts +97 -0
- package/dist/service-pricing.d.ts.map +1 -0
- package/dist/service-pricing.js +198 -0
- package/dist/service-sailings.d.ts +48 -0
- package/dist/service-sailings.d.ts.map +1 -0
- package/dist/service-sailings.js +145 -0
- package/dist/service-search-types.d.ts +54 -0
- package/dist/service-search-types.d.ts.map +1 -0
- package/dist/service-search-types.js +1 -0
- package/dist/service-search.d.ts +65 -0
- package/dist/service-search.d.ts.map +1 -0
- package/dist/service-search.js +467 -0
- package/dist/service-shared.d.ts +22 -0
- package/dist/service-shared.d.ts.map +1 -0
- package/dist/service-shared.js +22 -0
- package/dist/service-ships.d.ts +47 -0
- package/dist/service-ships.d.ts.map +1 -0
- package/dist/service-ships.js +156 -0
- package/dist/service.d.ts +255 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +12 -0
- package/dist/validation-cabins.d.ts +267 -0
- package/dist/validation-cabins.d.ts.map +1 -0
- package/dist/validation-cabins.js +77 -0
- package/dist/validation-content.d.ts +123 -0
- package/dist/validation-content.d.ts.map +1 -0
- package/dist/validation-content.js +40 -0
- package/dist/validation-core.d.ts +393 -0
- package/dist/validation-core.d.ts.map +1 -0
- package/dist/validation-core.js +162 -0
- package/dist/validation-itinerary.d.ts +123 -0
- package/dist/validation-itinerary.d.ts.map +1 -0
- package/dist/validation-itinerary.js +47 -0
- package/dist/validation-pricing.d.ts +137 -0
- package/dist/validation-pricing.d.ts.map +1 -0
- package/dist/validation-pricing.js +49 -0
- package/dist/validation-search.d.ts +118 -0
- package/dist/validation-search.d.ts.map +1 -0
- package/dist/validation-search.js +60 -0
- package/dist/validation-shared.d.ts +123 -0
- package/dist/validation-shared.d.ts.map +1 -0
- package/dist/validation-shared.js +103 -0
- package/dist/validation.d.ts +8 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +7 -0
- package/package.json +146 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { and, asc, count, eq, ilike } from "drizzle-orm";
|
|
2
|
+
import { cruiseCabinCategories, cruiseCabins, cruiseDecks, cruiseShips } from "./schema-cabins.js";
|
|
3
|
+
import { paginate, setUpdated } from "./service-shared.js";
|
|
4
|
+
export const cruiseShipService = {
|
|
5
|
+
async listShips(db, query) {
|
|
6
|
+
const conditions = [];
|
|
7
|
+
if (query.lineSupplierId)
|
|
8
|
+
conditions.push(eq(cruiseShips.lineSupplierId, query.lineSupplierId));
|
|
9
|
+
if (query.shipType)
|
|
10
|
+
conditions.push(eq(cruiseShips.shipType, query.shipType));
|
|
11
|
+
if (typeof query.isActive === "boolean")
|
|
12
|
+
conditions.push(eq(cruiseShips.isActive, query.isActive));
|
|
13
|
+
if (query.search)
|
|
14
|
+
conditions.push(ilike(cruiseShips.name, `%${query.search}%`));
|
|
15
|
+
const where = conditions.length > 0 ? and(...conditions) : undefined;
|
|
16
|
+
const { limit, offset } = paginate(query);
|
|
17
|
+
const [rows, totalRows] = await Promise.all([
|
|
18
|
+
db
|
|
19
|
+
.select()
|
|
20
|
+
.from(cruiseShips)
|
|
21
|
+
.where(where)
|
|
22
|
+
.orderBy(asc(cruiseShips.name))
|
|
23
|
+
.limit(limit)
|
|
24
|
+
.offset(offset),
|
|
25
|
+
db.select({ value: count() }).from(cruiseShips).where(where),
|
|
26
|
+
]);
|
|
27
|
+
return { data: rows, total: totalRows[0]?.value ?? 0, limit, offset };
|
|
28
|
+
},
|
|
29
|
+
async getShipById(db, id) {
|
|
30
|
+
const [row] = await db.select().from(cruiseShips).where(eq(cruiseShips.id, id)).limit(1);
|
|
31
|
+
return row ?? null;
|
|
32
|
+
},
|
|
33
|
+
async createShip(db, data) {
|
|
34
|
+
const [row] = await db.insert(cruiseShips).values(data).returning();
|
|
35
|
+
if (!row)
|
|
36
|
+
throw new Error("Failed to create ship");
|
|
37
|
+
return row;
|
|
38
|
+
},
|
|
39
|
+
async updateShip(db, id, data) {
|
|
40
|
+
const [row] = await db
|
|
41
|
+
.update(cruiseShips)
|
|
42
|
+
.set({ ...data, ...setUpdated })
|
|
43
|
+
.where(eq(cruiseShips.id, id))
|
|
44
|
+
.returning();
|
|
45
|
+
return row ?? null;
|
|
46
|
+
},
|
|
47
|
+
async listShipDecks(db, shipId) {
|
|
48
|
+
return db
|
|
49
|
+
.select()
|
|
50
|
+
.from(cruiseDecks)
|
|
51
|
+
.where(eq(cruiseDecks.shipId, shipId))
|
|
52
|
+
.orderBy(asc(cruiseDecks.level));
|
|
53
|
+
},
|
|
54
|
+
async upsertDeck(db, data) {
|
|
55
|
+
const [existing] = await db
|
|
56
|
+
.select()
|
|
57
|
+
.from(cruiseDecks)
|
|
58
|
+
.where(and(eq(cruiseDecks.shipId, data.shipId), eq(cruiseDecks.name, data.name)))
|
|
59
|
+
.limit(1);
|
|
60
|
+
if (existing) {
|
|
61
|
+
const [row] = await db
|
|
62
|
+
.update(cruiseDecks)
|
|
63
|
+
.set({ ...data, ...setUpdated })
|
|
64
|
+
.where(eq(cruiseDecks.id, existing.id))
|
|
65
|
+
.returning();
|
|
66
|
+
if (!row)
|
|
67
|
+
throw new Error("Failed to update deck");
|
|
68
|
+
return row;
|
|
69
|
+
}
|
|
70
|
+
const [row] = await db.insert(cruiseDecks).values(data).returning();
|
|
71
|
+
if (!row)
|
|
72
|
+
throw new Error("Failed to insert deck");
|
|
73
|
+
return row;
|
|
74
|
+
},
|
|
75
|
+
async updateDeck(db, id, data) {
|
|
76
|
+
const [row] = await db
|
|
77
|
+
.update(cruiseDecks)
|
|
78
|
+
.set({ ...data, ...setUpdated })
|
|
79
|
+
.where(eq(cruiseDecks.id, id))
|
|
80
|
+
.returning();
|
|
81
|
+
return row ?? null;
|
|
82
|
+
},
|
|
83
|
+
async listShipCabinCategories(db, shipId) {
|
|
84
|
+
return db
|
|
85
|
+
.select()
|
|
86
|
+
.from(cruiseCabinCategories)
|
|
87
|
+
.where(eq(cruiseCabinCategories.shipId, shipId))
|
|
88
|
+
.orderBy(asc(cruiseCabinCategories.code));
|
|
89
|
+
},
|
|
90
|
+
async upsertCabinCategory(db, data) {
|
|
91
|
+
const [existing] = await db
|
|
92
|
+
.select()
|
|
93
|
+
.from(cruiseCabinCategories)
|
|
94
|
+
.where(and(eq(cruiseCabinCategories.shipId, data.shipId), eq(cruiseCabinCategories.code, data.code)))
|
|
95
|
+
.limit(1);
|
|
96
|
+
if (existing) {
|
|
97
|
+
const [row] = await db
|
|
98
|
+
.update(cruiseCabinCategories)
|
|
99
|
+
.set({ ...data, ...setUpdated })
|
|
100
|
+
.where(eq(cruiseCabinCategories.id, existing.id))
|
|
101
|
+
.returning();
|
|
102
|
+
if (!row)
|
|
103
|
+
throw new Error("Failed to update cabin category");
|
|
104
|
+
return row;
|
|
105
|
+
}
|
|
106
|
+
const [row] = await db.insert(cruiseCabinCategories).values(data).returning();
|
|
107
|
+
if (!row)
|
|
108
|
+
throw new Error("Failed to insert cabin category");
|
|
109
|
+
return row;
|
|
110
|
+
},
|
|
111
|
+
async updateCabinCategory(db, id, data) {
|
|
112
|
+
const [row] = await db
|
|
113
|
+
.update(cruiseCabinCategories)
|
|
114
|
+
.set({ ...data, ...setUpdated })
|
|
115
|
+
.where(eq(cruiseCabinCategories.id, id))
|
|
116
|
+
.returning();
|
|
117
|
+
return row ?? null;
|
|
118
|
+
},
|
|
119
|
+
async listCabinsByCategory(db, categoryId) {
|
|
120
|
+
return db
|
|
121
|
+
.select()
|
|
122
|
+
.from(cruiseCabins)
|
|
123
|
+
.where(eq(cruiseCabins.categoryId, categoryId))
|
|
124
|
+
.orderBy(asc(cruiseCabins.cabinNumber));
|
|
125
|
+
},
|
|
126
|
+
async upsertCabin(db, data) {
|
|
127
|
+
const [existing] = await db
|
|
128
|
+
.select()
|
|
129
|
+
.from(cruiseCabins)
|
|
130
|
+
.where(and(eq(cruiseCabins.categoryId, data.categoryId), eq(cruiseCabins.cabinNumber, data.cabinNumber)))
|
|
131
|
+
.limit(1);
|
|
132
|
+
if (existing) {
|
|
133
|
+
const [row] = await db
|
|
134
|
+
.update(cruiseCabins)
|
|
135
|
+
.set({ ...data, ...setUpdated })
|
|
136
|
+
.where(eq(cruiseCabins.id, existing.id))
|
|
137
|
+
.returning();
|
|
138
|
+
if (!row)
|
|
139
|
+
throw new Error("Failed to update cabin");
|
|
140
|
+
return row;
|
|
141
|
+
}
|
|
142
|
+
const [row] = await db.insert(cruiseCabins).values(data).returning();
|
|
143
|
+
if (!row)
|
|
144
|
+
throw new Error("Failed to insert cabin");
|
|
145
|
+
return row;
|
|
146
|
+
},
|
|
147
|
+
async updateCabin(db, id, data) {
|
|
148
|
+
const [row] = await db
|
|
149
|
+
.update(cruiseCabins)
|
|
150
|
+
.set({ ...data, ...setUpdated })
|
|
151
|
+
.where(eq(cruiseCabins.id, id))
|
|
152
|
+
.returning();
|
|
153
|
+
return row ?? null;
|
|
154
|
+
},
|
|
155
|
+
// ---------- prices ----------
|
|
156
|
+
};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
export type { EffectiveItineraryDay } from "./service-itinerary.js";
|
|
2
|
+
export type { CruiseMutationRuntime } from "./service-shared.js";
|
|
3
|
+
export declare const cruisesService: {
|
|
4
|
+
listEnrichmentPrograms(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, cruiseId: string): Promise<import("./schema-content.js").CruiseEnrichmentProgram[]>;
|
|
5
|
+
createEnrichmentProgram(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./validation-content.js").InsertEnrichmentProgram): Promise<import("./schema-content.js").CruiseEnrichmentProgram>;
|
|
6
|
+
updateEnrichmentProgram(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: import("./validation-content.js").UpdateEnrichmentProgram): Promise<import("./schema-content.js").CruiseEnrichmentProgram | null>;
|
|
7
|
+
deleteEnrichmentProgram(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<boolean>;
|
|
8
|
+
replaceEnrichmentPrograms(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, payload: import("./validation-content.js").ReplaceEnrichmentPrograms): Promise<import("./schema-content.js").CruiseEnrichmentProgram[]>;
|
|
9
|
+
listPrices(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./validation-pricing.js").PriceListQuery): Promise<{
|
|
10
|
+
data: {
|
|
11
|
+
id: string;
|
|
12
|
+
sailingId: string;
|
|
13
|
+
cabinCategoryId: string;
|
|
14
|
+
occupancy: number;
|
|
15
|
+
fareCode: string | null;
|
|
16
|
+
fareCodeName: string | null;
|
|
17
|
+
fareVariant: "cruise_only" | "air_inclusive";
|
|
18
|
+
currency: string;
|
|
19
|
+
pricePerPerson: string;
|
|
20
|
+
originalPricePerPerson: string | null;
|
|
21
|
+
secondGuestPricePerPerson: string | null;
|
|
22
|
+
singlePricePerPerson: string | null;
|
|
23
|
+
singleSupplementPercent: string | null;
|
|
24
|
+
availability: "on_request" | "wait_list" | "sold_out" | "available" | "limited";
|
|
25
|
+
availabilityCount: number | null;
|
|
26
|
+
priceCatalogId: string | null;
|
|
27
|
+
priceScheduleId: string | null;
|
|
28
|
+
bookingDeadline: string | null;
|
|
29
|
+
earlyBookingDeadline: string | null;
|
|
30
|
+
earlyBookingBonusDescription: string | null;
|
|
31
|
+
requiresRequest: boolean;
|
|
32
|
+
notes: string | null;
|
|
33
|
+
externalRefs: Record<string, string> | null;
|
|
34
|
+
lastSyncedAt: Date | null;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
}[];
|
|
38
|
+
total: number;
|
|
39
|
+
limit: number;
|
|
40
|
+
offset: number;
|
|
41
|
+
}>;
|
|
42
|
+
createPrice(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./validation-pricing.js").InsertPrice): Promise<import("./schema-pricing.js").CruisePrice>;
|
|
43
|
+
updatePrice(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: import("./validation-pricing.js").UpdatePrice): Promise<import("./schema-pricing.js").CruisePrice | null>;
|
|
44
|
+
replaceSailingPricing(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, sailingId: string, payload: {
|
|
45
|
+
prices: Array<import("./validation-pricing.js").InsertPrice & {
|
|
46
|
+
components?: Array<Omit<import("./validation-pricing.js").InsertPriceComponent, "priceId">>;
|
|
47
|
+
}>;
|
|
48
|
+
}): Promise<import("./schema-pricing.js").CruisePrice[]>;
|
|
49
|
+
listShips(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./validation-cabins.js").ShipListQuery): Promise<{
|
|
50
|
+
data: {
|
|
51
|
+
id: string;
|
|
52
|
+
lineSupplierId: string | null;
|
|
53
|
+
name: string;
|
|
54
|
+
slug: string;
|
|
55
|
+
shipType: "ocean" | "river" | "expedition" | "coastal" | "yacht" | "sailing";
|
|
56
|
+
capacityGuests: number | null;
|
|
57
|
+
capacityCrew: number | null;
|
|
58
|
+
cabinCount: number | null;
|
|
59
|
+
deckCount: number | null;
|
|
60
|
+
lengthMeters: string | null;
|
|
61
|
+
cruisingSpeedKnots: string | null;
|
|
62
|
+
yearBuilt: number | null;
|
|
63
|
+
yearRefurbished: number | null;
|
|
64
|
+
imo: string | null;
|
|
65
|
+
description: string | null;
|
|
66
|
+
deckPlanUrl: string | null;
|
|
67
|
+
gallery: string[] | null;
|
|
68
|
+
amenities: Record<string, unknown> | null;
|
|
69
|
+
externalRefs: Record<string, string> | null;
|
|
70
|
+
isActive: boolean;
|
|
71
|
+
createdAt: Date;
|
|
72
|
+
updatedAt: Date;
|
|
73
|
+
}[];
|
|
74
|
+
total: number;
|
|
75
|
+
limit: number;
|
|
76
|
+
offset: number;
|
|
77
|
+
}>;
|
|
78
|
+
getShipById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<import("./schema-cabins.js").CruiseShip | null>;
|
|
79
|
+
createShip(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./validation-cabins.js").InsertShip): Promise<import("./schema-cabins.js").CruiseShip>;
|
|
80
|
+
updateShip(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: import("./validation-cabins.js").UpdateShip): Promise<import("./schema-cabins.js").CruiseShip | null>;
|
|
81
|
+
listShipDecks(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, shipId: string): Promise<import("./schema-cabins.js").CruiseDeck[]>;
|
|
82
|
+
upsertDeck(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./validation-cabins.js").InsertDeck): Promise<import("./schema-cabins.js").CruiseDeck>;
|
|
83
|
+
updateDeck(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: import("./validation-cabins.js").UpdateDeck): Promise<import("./schema-cabins.js").CruiseDeck | null>;
|
|
84
|
+
listShipCabinCategories(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, shipId: string): Promise<import("./schema-cabins.js").CruiseCabinCategory[]>;
|
|
85
|
+
upsertCabinCategory(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./validation-cabins.js").InsertCabinCategory): Promise<import("./schema-cabins.js").CruiseCabinCategory>;
|
|
86
|
+
updateCabinCategory(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: import("./validation-cabins.js").UpdateCabinCategory): Promise<import("./schema-cabins.js").CruiseCabinCategory | null>;
|
|
87
|
+
listCabinsByCategory(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, categoryId: string): Promise<import("./schema-cabins.js").CruiseCabin[]>;
|
|
88
|
+
upsertCabin(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./validation-cabins.js").InsertCabin): Promise<import("./schema-cabins.js").CruiseCabin>;
|
|
89
|
+
updateCabin(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: import("./validation-cabins.js").UpdateCabin): Promise<import("./schema-cabins.js").CruiseCabin | null>;
|
|
90
|
+
listSailings(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./validation-core.js").SailingListQuery): Promise<{
|
|
91
|
+
data: {
|
|
92
|
+
id: string;
|
|
93
|
+
cruiseId: string;
|
|
94
|
+
shipId: string;
|
|
95
|
+
departureDate: string;
|
|
96
|
+
returnDate: string;
|
|
97
|
+
embarkPortFacilityId: string | null;
|
|
98
|
+
embarkPortCanonicalPlaceId: string | null;
|
|
99
|
+
disembarkPortFacilityId: string | null;
|
|
100
|
+
disembarkPortCanonicalPlaceId: string | null;
|
|
101
|
+
direction: "upstream" | "downstream" | "round_trip" | "one_way" | null;
|
|
102
|
+
availabilityNote: string | null;
|
|
103
|
+
isCharter: boolean;
|
|
104
|
+
salesStatus: "open" | "on_request" | "wait_list" | "sold_out" | "closed";
|
|
105
|
+
externalRefs: Record<string, string> | null;
|
|
106
|
+
customerPaymentPolicy: unknown;
|
|
107
|
+
lastSyncedAt: Date | null;
|
|
108
|
+
createdAt: Date;
|
|
109
|
+
updatedAt: Date;
|
|
110
|
+
}[];
|
|
111
|
+
total: number;
|
|
112
|
+
limit: number;
|
|
113
|
+
offset: number;
|
|
114
|
+
}>;
|
|
115
|
+
getSailingById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, options?: {
|
|
116
|
+
withPricing?: boolean;
|
|
117
|
+
withItinerary?: boolean;
|
|
118
|
+
}): Promise<(import("./schema-core.js").CruiseSailing & {
|
|
119
|
+
prices?: import("./schema-pricing.js").CruisePrice[];
|
|
120
|
+
priceComponents?: import("./schema-pricing.js").CruisePriceComponent[];
|
|
121
|
+
effectiveDays?: import("./service-itinerary.js").EffectiveItineraryDay[];
|
|
122
|
+
}) | null>;
|
|
123
|
+
upsertSailing(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./validation-core.js").InsertSailing): Promise<import("./schema-core.js").CruiseSailing>;
|
|
124
|
+
updateSailing(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: import("./validation-core.js").UpdateSailing): Promise<import("./schema-core.js").CruiseSailing | null>;
|
|
125
|
+
getEffectiveItinerary(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, sailingId: string): Promise<import("./service-itinerary.js").EffectiveItineraryDay[]>;
|
|
126
|
+
replaceCruiseDays(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, payload: import("./validation-itinerary.js").ReplaceCruiseDays): Promise<import("./schema-itinerary.js").CruiseDay[]>;
|
|
127
|
+
replaceSailingDays(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, payload: import("./validation-itinerary.js").ReplaceSailingDays): Promise<import("./schema-itinerary.js").CruiseSailingDay[]>;
|
|
128
|
+
listVoyageGroups(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./validation-core.js").VoyageGroupListQuery): Promise<{
|
|
129
|
+
data: {
|
|
130
|
+
id: string;
|
|
131
|
+
slug: string;
|
|
132
|
+
name: string;
|
|
133
|
+
groupKind: "combination" | "grand_voyage" | "world_cruise" | "cruise_tour";
|
|
134
|
+
lineSupplierId: string | null;
|
|
135
|
+
nights: number;
|
|
136
|
+
embarkPortFacilityId: string | null;
|
|
137
|
+
embarkPortCanonicalPlaceId: string | null;
|
|
138
|
+
disembarkPortFacilityId: string | null;
|
|
139
|
+
disembarkPortCanonicalPlaceId: string | null;
|
|
140
|
+
description: string | null;
|
|
141
|
+
shortDescription: string | null;
|
|
142
|
+
highlights: string[] | null;
|
|
143
|
+
regions: string[] | null;
|
|
144
|
+
themes: string[] | null;
|
|
145
|
+
heroImageUrl: string | null;
|
|
146
|
+
mapImageUrl: string | null;
|
|
147
|
+
status: "draft" | "awaiting_review" | "live" | "archived";
|
|
148
|
+
lowestPriceCached: string | null;
|
|
149
|
+
lowestPriceCurrencyCached: string | null;
|
|
150
|
+
earliestDepartureCached: string | null;
|
|
151
|
+
latestDepartureCached: string | null;
|
|
152
|
+
externalRefs: Record<string, string> | null;
|
|
153
|
+
createdAt: Date;
|
|
154
|
+
updatedAt: Date;
|
|
155
|
+
}[];
|
|
156
|
+
total: number;
|
|
157
|
+
limit: number;
|
|
158
|
+
offset: number;
|
|
159
|
+
}>;
|
|
160
|
+
getVoyageGroupById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, options?: {
|
|
161
|
+
withSegments?: boolean;
|
|
162
|
+
}): Promise<(import("./schema-core.js").CruiseVoyageGroup & {
|
|
163
|
+
segments?: import("./schema-core.js").CruiseVoyageGroupSegment[];
|
|
164
|
+
}) | null>;
|
|
165
|
+
createVoyageGroup(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./validation-core.js").InsertVoyageGroup): Promise<import("./schema-core.js").CruiseVoyageGroup>;
|
|
166
|
+
updateVoyageGroup(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: import("./validation-core.js").UpdateVoyageGroup): Promise<import("./schema-core.js").CruiseVoyageGroup | null>;
|
|
167
|
+
archiveVoyageGroup(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<import("./schema-core.js").CruiseVoyageGroup | null>;
|
|
168
|
+
listVoyageGroupSegments(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./validation-core.js").VoyageGroupSegmentListQuery): Promise<{
|
|
169
|
+
data: {
|
|
170
|
+
id: string;
|
|
171
|
+
voyageGroupId: string;
|
|
172
|
+
sortOrder: number;
|
|
173
|
+
segmentKind: "rail" | "other" | "transfer" | "cruise" | "land" | "hotel" | "air";
|
|
174
|
+
segmentRole: "core" | "pre_extension" | "post_extension";
|
|
175
|
+
title: string;
|
|
176
|
+
description: string | null;
|
|
177
|
+
cruiseId: string | null;
|
|
178
|
+
sailingId: string | null;
|
|
179
|
+
startDay: number | null;
|
|
180
|
+
endDay: number | null;
|
|
181
|
+
startDate: string | null;
|
|
182
|
+
endDate: string | null;
|
|
183
|
+
embarkPortFacilityId: string | null;
|
|
184
|
+
embarkPortCanonicalPlaceId: string | null;
|
|
185
|
+
disembarkPortFacilityId: string | null;
|
|
186
|
+
disembarkPortCanonicalPlaceId: string | null;
|
|
187
|
+
nights: number | null;
|
|
188
|
+
externalRefs: Record<string, string> | null;
|
|
189
|
+
metadata: Record<string, unknown> | null;
|
|
190
|
+
createdAt: Date;
|
|
191
|
+
updatedAt: Date;
|
|
192
|
+
}[];
|
|
193
|
+
total: number;
|
|
194
|
+
limit: number;
|
|
195
|
+
offset: number;
|
|
196
|
+
}>;
|
|
197
|
+
createVoyageGroupSegment(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./validation-core.js").InsertVoyageGroupSegment): Promise<import("./schema-core.js").CruiseVoyageGroupSegment>;
|
|
198
|
+
updateVoyageGroupSegment(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: import("./validation-core.js").UpdateVoyageGroupSegment): Promise<import("./schema-core.js").CruiseVoyageGroupSegment | null>;
|
|
199
|
+
deleteVoyageGroupSegment(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<boolean>;
|
|
200
|
+
listCruises(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./validation-core.js").CruiseListQuery): Promise<{
|
|
201
|
+
data: {
|
|
202
|
+
id: string;
|
|
203
|
+
slug: string;
|
|
204
|
+
name: string;
|
|
205
|
+
cruiseType: "ocean" | "river" | "expedition" | "coastal";
|
|
206
|
+
lineSupplierId: string | null;
|
|
207
|
+
defaultShipId: string | null;
|
|
208
|
+
nights: number;
|
|
209
|
+
embarkPortFacilityId: string | null;
|
|
210
|
+
embarkPortCanonicalPlaceId: string | null;
|
|
211
|
+
disembarkPortFacilityId: string | null;
|
|
212
|
+
disembarkPortCanonicalPlaceId: string | null;
|
|
213
|
+
description: string | null;
|
|
214
|
+
shortDescription: string | null;
|
|
215
|
+
highlights: string[] | null;
|
|
216
|
+
inclusionsHtml: string | null;
|
|
217
|
+
exclusionsHtml: string | null;
|
|
218
|
+
regionIds: string[] | null;
|
|
219
|
+
waterwayIds: string[] | null;
|
|
220
|
+
portIds: string[] | null;
|
|
221
|
+
countryIso: string[] | null;
|
|
222
|
+
regions: string[] | null;
|
|
223
|
+
waterways: string[] | null;
|
|
224
|
+
ports: string[] | null;
|
|
225
|
+
countries: string[] | null;
|
|
226
|
+
themes: string[] | null;
|
|
227
|
+
heroImageUrl: string | null;
|
|
228
|
+
mapImageUrl: string | null;
|
|
229
|
+
status: "draft" | "awaiting_review" | "live" | "archived";
|
|
230
|
+
lowestPriceCached: string | null;
|
|
231
|
+
lowestPriceCurrencyCached: string | null;
|
|
232
|
+
earliestDepartureCached: string | null;
|
|
233
|
+
latestDepartureCached: string | null;
|
|
234
|
+
externalRefs: Record<string, string> | null;
|
|
235
|
+
customerPaymentPolicy: unknown;
|
|
236
|
+
createdAt: Date;
|
|
237
|
+
updatedAt: Date;
|
|
238
|
+
}[];
|
|
239
|
+
total: number;
|
|
240
|
+
limit: number;
|
|
241
|
+
offset: number;
|
|
242
|
+
}>;
|
|
243
|
+
getCruiseById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, options?: {
|
|
244
|
+
withSailings?: boolean;
|
|
245
|
+
withDays?: boolean;
|
|
246
|
+
}): Promise<(import("./schema-core.js").Cruise & {
|
|
247
|
+
sailings?: import("./schema-core.js").CruiseSailing[];
|
|
248
|
+
days?: import("./schema-itinerary.js").CruiseDay[];
|
|
249
|
+
}) | null>;
|
|
250
|
+
createCruise(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, data: import("./validation-core.js").InsertCruise, runtime?: import("./service-shared.js").CruiseMutationRuntime): Promise<import("./schema-core.js").Cruise>;
|
|
251
|
+
updateCruise(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, data: import("./validation-core.js").UpdateCruise, runtime?: import("./service-shared.js").CruiseMutationRuntime): Promise<import("./schema-core.js").Cruise | null>;
|
|
252
|
+
archiveCruise(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, runtime?: import("./service-shared.js").CruiseMutationRuntime): Promise<import("./schema-core.js").Cruise | null>;
|
|
253
|
+
recomputeCruiseAggregates(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, cruiseId: string): Promise<import("./schema-core.js").Cruise | null>;
|
|
254
|
+
};
|
|
255
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAMA,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACnE,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAEhE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAO67D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAriB,CAAC;qBAAwB,CAAC;;cAAuE,CAAC;uBAAuC,CAAC;qBAA8C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAgY,CAAC;;gBAA6E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAulK,CAAC;gBAAmB,CAAC;;gBAAkE,CAAC;YAA8B,CAAC;;;;;;CADzwO,CAAA"}
|
package/dist/service.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cruiseCoreService } from "./service-core.js";
|
|
2
|
+
import { cruiseEnrichmentService } from "./service-enrichment.js";
|
|
3
|
+
import { cruisePriceRowsService } from "./service-prices.js";
|
|
4
|
+
import { cruiseSailingsService } from "./service-sailings.js";
|
|
5
|
+
import { cruiseShipService } from "./service-ships.js";
|
|
6
|
+
export const cruisesService = {
|
|
7
|
+
...cruiseCoreService,
|
|
8
|
+
...cruiseSailingsService,
|
|
9
|
+
...cruiseShipService,
|
|
10
|
+
...cruisePriceRowsService,
|
|
11
|
+
...cruiseEnrichmentService,
|
|
12
|
+
};
|