@voyant-travel/charters 0.131.0 → 0.132.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.
- package/dist/service.d.ts +76 -91
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +4 -3
- package/package.json +5 -4
package/dist/service.d.ts
CHANGED
|
@@ -8,35 +8,30 @@ import type { ReplaceVoyageSchedule } from "./validation-itinerary.js";
|
|
|
8
8
|
import type { ReplaceVoyageSuites } from "./validation-pricing.js";
|
|
9
9
|
import type { InsertYacht, UpdateYacht, YachtListQuery } from "./validation-yachts.js";
|
|
10
10
|
export declare const chartersService: {
|
|
11
|
-
listProducts(db: PostgresJsDatabase, query: ProductListQuery): Promise<{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}[];
|
|
36
|
-
total: number;
|
|
37
|
-
limit: number;
|
|
38
|
-
offset: number;
|
|
39
|
-
}>;
|
|
11
|
+
listProducts(db: PostgresJsDatabase, query: ProductListQuery): Promise<import("@voyant-travel/types").ListResponse<{
|
|
12
|
+
id: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
name: string;
|
|
15
|
+
lineSupplierId: string | null;
|
|
16
|
+
defaultYachtId: string | null;
|
|
17
|
+
description: string | null;
|
|
18
|
+
shortDescription: string | null;
|
|
19
|
+
heroImageUrl: string | null;
|
|
20
|
+
mapImageUrl: string | null;
|
|
21
|
+
regions: string[] | null;
|
|
22
|
+
themes: string[] | null;
|
|
23
|
+
status: "live" | "draft" | "awaiting_review" | "archived";
|
|
24
|
+
defaultBookingModes: ("per_suite" | "whole_yacht")[] | null;
|
|
25
|
+
defaultMybaTemplateId: string | null;
|
|
26
|
+
defaultApaPercent: string | null;
|
|
27
|
+
lowestPriceCachedAmount: string | null;
|
|
28
|
+
lowestPriceCachedCurrency: string | null;
|
|
29
|
+
earliestVoyageCached: string | null;
|
|
30
|
+
latestVoyageCached: string | null;
|
|
31
|
+
externalRefs: Record<string, string> | null;
|
|
32
|
+
createdAt: Date;
|
|
33
|
+
updatedAt: Date;
|
|
34
|
+
}>>;
|
|
40
35
|
getProductById(db: PostgresJsDatabase, id: string, options?: {
|
|
41
36
|
withVoyages?: boolean;
|
|
42
37
|
withYacht?: boolean;
|
|
@@ -50,37 +45,32 @@ export declare const chartersService: {
|
|
|
50
45
|
recomputeProductAggregates(db: PostgresJsDatabase, productId: string, options?: {
|
|
51
46
|
browseCurrency?: string;
|
|
52
47
|
}): Promise<CharterProduct | null>;
|
|
53
|
-
listVoyages(db: PostgresJsDatabase, query: VoyageListQuery): Promise<{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}[];
|
|
80
|
-
total: number;
|
|
81
|
-
limit: number;
|
|
82
|
-
offset: number;
|
|
83
|
-
}>;
|
|
48
|
+
listVoyages(db: PostgresJsDatabase, query: VoyageListQuery): Promise<import("@voyant-travel/types").ListResponse<{
|
|
49
|
+
id: string;
|
|
50
|
+
productId: string;
|
|
51
|
+
yachtId: string;
|
|
52
|
+
voyageCode: string;
|
|
53
|
+
name: string | null;
|
|
54
|
+
embarkPortFacilityId: string | null;
|
|
55
|
+
embarkPortName: string | null;
|
|
56
|
+
disembarkPortFacilityId: string | null;
|
|
57
|
+
disembarkPortName: string | null;
|
|
58
|
+
departureDate: string;
|
|
59
|
+
returnDate: string;
|
|
60
|
+
nights: number;
|
|
61
|
+
bookingModes: ("per_suite" | "whole_yacht")[];
|
|
62
|
+
appointmentOnly: boolean;
|
|
63
|
+
wholeYachtPricesByCurrency: Record<string, string>;
|
|
64
|
+
apaPercentOverride: string | null;
|
|
65
|
+
mybaTemplateIdOverride: string | null;
|
|
66
|
+
charterAreaOverride: string | null;
|
|
67
|
+
salesStatus: "open" | "on_request" | "wait_list" | "sold_out" | "closed";
|
|
68
|
+
availabilityNote: string | null;
|
|
69
|
+
externalRefs: Record<string, string> | null;
|
|
70
|
+
lastSyncedAt: Date | null;
|
|
71
|
+
createdAt: Date;
|
|
72
|
+
updatedAt: Date;
|
|
73
|
+
}>>;
|
|
84
74
|
getVoyageById(db: PostgresJsDatabase, id: string, options?: {
|
|
85
75
|
withSuites?: boolean;
|
|
86
76
|
withSchedule?: boolean;
|
|
@@ -92,38 +82,33 @@ export declare const chartersService: {
|
|
|
92
82
|
updateVoyage(db: PostgresJsDatabase, id: string, data: UpdateVoyage): Promise<CharterVoyage | null>;
|
|
93
83
|
replaceVoyageSuites(db: PostgresJsDatabase, payload: ReplaceVoyageSuites): Promise<CharterSuite[]>;
|
|
94
84
|
replaceVoyageSchedule(db: PostgresJsDatabase, payload: ReplaceVoyageSchedule): Promise<CharterScheduleDay[]>;
|
|
95
|
-
listYachts(db: PostgresJsDatabase, query: YachtListQuery): Promise<{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
listYachts(db: PostgresJsDatabase, query: YachtListQuery): Promise<import("@voyant-travel/types").ListResponse<{
|
|
86
|
+
id: string;
|
|
87
|
+
lineSupplierId: string | null;
|
|
88
|
+
name: string;
|
|
89
|
+
slug: string;
|
|
90
|
+
yachtClass: "luxury_motor" | "luxury_sailing" | "expedition" | "small_cruise";
|
|
91
|
+
capacityGuests: number | null;
|
|
92
|
+
capacityCrew: number | null;
|
|
93
|
+
lengthMeters: string | null;
|
|
94
|
+
yearBuilt: number | null;
|
|
95
|
+
yearRefurbished: number | null;
|
|
96
|
+
imo: string | null;
|
|
97
|
+
description: string | null;
|
|
98
|
+
gallery: string[] | null;
|
|
99
|
+
amenities: Record<string, unknown> | null;
|
|
100
|
+
crewBios: {
|
|
101
|
+
role: string;
|
|
99
102
|
name: string;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
gallery: string[] | null;
|
|
110
|
-
amenities: Record<string, unknown> | null;
|
|
111
|
-
crewBios: {
|
|
112
|
-
role: string;
|
|
113
|
-
name: string;
|
|
114
|
-
bio?: string;
|
|
115
|
-
photoUrl?: string;
|
|
116
|
-
}[] | null;
|
|
117
|
-
defaultCharterAreas: string[] | null;
|
|
118
|
-
externalRefs: Record<string, string> | null;
|
|
119
|
-
isActive: boolean;
|
|
120
|
-
createdAt: Date;
|
|
121
|
-
updatedAt: Date;
|
|
122
|
-
}[];
|
|
123
|
-
total: number;
|
|
124
|
-
limit: number;
|
|
125
|
-
offset: number;
|
|
126
|
-
}>;
|
|
103
|
+
bio?: string;
|
|
104
|
+
photoUrl?: string;
|
|
105
|
+
}[] | null;
|
|
106
|
+
defaultCharterAreas: string[] | null;
|
|
107
|
+
externalRefs: Record<string, string> | null;
|
|
108
|
+
isActive: boolean;
|
|
109
|
+
createdAt: Date;
|
|
110
|
+
updatedAt: Date;
|
|
111
|
+
}>>;
|
|
127
112
|
getYachtById(db: PostgresJsDatabase, id: string): Promise<CharterYacht | null>;
|
|
128
113
|
createYacht(db: PostgresJsDatabase, data: InsertYacht): Promise<CharterYacht>;
|
|
129
114
|
updateYacht(db: PostgresJsDatabase, id: string, data: UpdateYacht): Promise<CharterYacht | null>;
|
package/dist/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAKnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,KAAK,kBAAkB,EAAuB,MAAM,uBAAuB,CAAA;AACpF,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,qBAAqB,CAAA;AACtE,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,oBAAoB,CAAA;AACrE,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAQtF,eAAO,MAAM,eAAe;qBAGH,kBAAkB,SAAS,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;uBAgC5D,kBAAkB,MAClB,MAAM,YACD;QAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GACtD,OAAO,CAAC,CAAC,cAAc,GAAG;QAAE,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;sBAyBxE,kBAAkB,QAAQ,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;sBAUnF,kBAAkB,MAClB,MAAM,QACJ,aAAa,G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ilike, lte, or, sql } from "drizzle-orm";
|
|
2
3
|
import { charterProducts, charterVoyages, } from "./schema-core.js";
|
|
3
4
|
import { charterScheduleDays } from "./schema-itinerary.js";
|
|
@@ -35,7 +36,7 @@ export const chartersService = {
|
|
|
35
36
|
.offset(offset),
|
|
36
37
|
db.select({ value: count() }).from(charterProducts).where(where),
|
|
37
38
|
]);
|
|
38
|
-
return
|
|
39
|
+
return listResponse(rows, { total: totalRows[0]?.value ?? 0, limit, offset });
|
|
39
40
|
},
|
|
40
41
|
async getProductById(db, id, options = {}) {
|
|
41
42
|
const [row] = await db.select().from(charterProducts).where(eq(charterProducts.id, id)).limit(1);
|
|
@@ -154,7 +155,7 @@ export const chartersService = {
|
|
|
154
155
|
.offset(offset),
|
|
155
156
|
db.select({ value: count() }).from(charterVoyages).where(where),
|
|
156
157
|
]);
|
|
157
|
-
return
|
|
158
|
+
return listResponse(rows, { total: totalRows[0]?.value ?? 0, limit, offset });
|
|
158
159
|
},
|
|
159
160
|
async getVoyageById(db, id, options = {}) {
|
|
160
161
|
const [row] = await db.select().from(charterVoyages).where(eq(charterVoyages.id, id)).limit(1);
|
|
@@ -256,7 +257,7 @@ export const chartersService = {
|
|
|
256
257
|
.offset(offset),
|
|
257
258
|
db.select({ value: count() }).from(charterYachts).where(where),
|
|
258
259
|
]);
|
|
259
|
-
return
|
|
260
|
+
return listResponse(rows, { total: totalRows[0]?.value ?? 0, limit, offset });
|
|
260
261
|
},
|
|
261
262
|
async getYachtById(db, id) {
|
|
262
263
|
const [row] = await db.select().from(charterYachts).where(eq(charterYachts.id, id)).limit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/charters",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.132.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -74,12 +74,13 @@
|
|
|
74
74
|
"drizzle-orm": "^0.45.2",
|
|
75
75
|
"hono": "^4.12.10",
|
|
76
76
|
"zod": "^4.3.6",
|
|
77
|
-
"@voyant-travel/bookings": "^0.
|
|
77
|
+
"@voyant-travel/bookings": "^0.134.0",
|
|
78
78
|
"@voyant-travel/charters-contracts": "^0.104.1",
|
|
79
79
|
"@voyant-travel/core": "^0.111.0",
|
|
80
80
|
"@voyant-travel/db": "^0.109.0",
|
|
81
|
-
"@voyant-travel/
|
|
82
|
-
"@voyant-travel/
|
|
81
|
+
"@voyant-travel/types": "^0.106.0",
|
|
82
|
+
"@voyant-travel/hono": "^0.115.0",
|
|
83
|
+
"@voyant-travel/catalog": "^0.132.0"
|
|
83
84
|
},
|
|
84
85
|
"devDependencies": {
|
|
85
86
|
"drizzle-kit": "^0.31.10",
|