@voyantjs/travel-composer 0.104.1 → 0.105.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/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/routes.d.ts +78 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +42 -1
- package/dist/schema.d.ts +360 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +43 -0
- package/dist/service-snapshots.d.ts +8 -0
- package/dist/service-snapshots.d.ts.map +1 -0
- package/dist/service-snapshots.js +115 -0
- package/dist/service.d.ts +5 -0
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +5 -0
- package/dist/validation.d.ts +86 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +35 -0
- package/package.json +13 -7
package/dist/index.d.ts
CHANGED
|
@@ -13,9 +13,9 @@ export interface TravelComposerHonoModuleOptions extends TravelComposerRoutesOpt
|
|
|
13
13
|
export declare function createTravelComposerHonoModule(options?: TravelComposerHonoModuleOptions): HonoModule;
|
|
14
14
|
export { type CreateTripArgs, createTripTool, type PriceTripArgs, priceTripTool, type ReserveTripArgs, type ReviseTripArgs, reserveTripTool, reviseTripTool, type TravelComposerMcpServices, travelComposerMcpTools, } from "./mcp-tools.js";
|
|
15
15
|
export { travelComposerRoutes } from "./routes.js";
|
|
16
|
-
export type { NewTripComponent, NewTripComponentEvent, NewTripEnvelope, TripComponent, TripComponentEvent, TripComponentPricingSnapshot, TripComponentTaxLineSnapshot, TripEnvelope, TripEnvelopePricingSnapshot, } from "./schema.js";
|
|
17
|
-
export { tripComponentEvents, tripComponentEventTypeEnum, tripComponentKindEnum, tripComponentStatusEnum, tripComponents, tripEnvelopeStatusEnum, tripEnvelopes, } from "./schema.js";
|
|
18
|
-
export { aggregateComponentPricing, applyQuoteToComponent, assertTripComponentCanBeReserved, assertTripComponentCanBeUpdated, assertTripComponentCanReceiveRefs, assertTripComponentCanStartCheckout, type CancelComponentInput, type CancelComponentResult, type CancelTripComponentsDeps, type CancelTripComponentsResult, type CatalogComponentQuoteInput, type CheckoutHandoffKind, type CompleteTripCheckoutInput, type CompleteTripCheckoutResult, type ComponentCancellationAction, type ComponentCancellationPreview, type ComponentCancellationPreviewInput, type ComponentCheckoutInput, type ComponentCheckoutResult, checkoutResultToComponentPatch, completeTripCheckout, hasCommittedComponentReference, type PreviewTripCancellationDeps, type PriceTripDeps, type PriceTripResult, pricingSnapshotFromBreakdown, type ReleaseReservedComponentInput, type ReleaseReservedComponentResult, type ReserveComponentInput, type ReserveComponentPreflightResult, type ReserveComponentPreflightStatus, type ReserveComponentResult, type ReserveTripDeps, type ReserveTripResult, reserveResultToComponentPatch, type StartCheckoutDeps, type StartCheckoutResult, type StartCheckoutTarget, type StartedTripComponentCheckout, shouldReplayCheckout, shouldReplayReserve, TravelComposerInvariantError, type Trip, type TripCancellationPreviewResult, type TripCheckoutInput, type TripCheckoutResult, type TripListResult, taxLinesFromBreakdown, travelComposerService, } from "./service.js";
|
|
16
|
+
export type { NewTripComponent, NewTripComponentEvent, NewTripEnvelope, NewTripSnapshot, TripComponent, TripComponentEvent, TripComponentPricingSnapshot, TripComponentTaxLineSnapshot, TripEnvelope, TripEnvelopePricingSnapshot, TripSnapshot, TripSnapshotProposal, TripSnapshotProposalLine, } from "./schema.js";
|
|
17
|
+
export { tripComponentEvents, tripComponentEventTypeEnum, tripComponentKindEnum, tripComponentStatusEnum, tripComponents, tripEnvelopeStatusEnum, tripEnvelopes, tripSnapshots, } from "./schema.js";
|
|
18
|
+
export { aggregateComponentPricing, applyQuoteToComponent, assertTripComponentCanBeReserved, assertTripComponentCanBeUpdated, assertTripComponentCanReceiveRefs, assertTripComponentCanStartCheckout, buildTripSnapshotProposal, type CancelComponentInput, type CancelComponentResult, type CancelTripComponentsDeps, type CancelTripComponentsResult, type CatalogComponentQuoteInput, type CheckoutHandoffKind, type CompleteTripCheckoutInput, type CompleteTripCheckoutResult, type ComponentCancellationAction, type ComponentCancellationPreview, type ComponentCancellationPreviewInput, type ComponentCheckoutInput, type ComponentCheckoutResult, checkoutResultToComponentPatch, completeTripCheckout, freezeTripSnapshot, getTripSnapshotById, hasCommittedComponentReference, listTripSnapshots, type PreviewTripCancellationDeps, type PriceTripDeps, type PriceTripResult, pricingSnapshotFromBreakdown, type ReleaseReservedComponentInput, type ReleaseReservedComponentResult, type ReserveComponentInput, type ReserveComponentPreflightResult, type ReserveComponentPreflightStatus, type ReserveComponentResult, type ReserveTripDeps, type ReserveTripResult, reserveResultToComponentPatch, type StartCheckoutDeps, type StartCheckoutResult, type StartCheckoutTarget, type StartedTripComponentCheckout, shouldReplayCheckout, shouldReplayReserve, TravelComposerInvariantError, type Trip, type TripCancellationPreviewResult, type TripCheckoutInput, type TripCheckoutResult, type TripListResult, taxLinesFromBreakdown, travelComposerService, } from "./service.js";
|
|
19
19
|
export { assertTripTravelerPartyComplete, validateTripTravelerParty, } from "./traveler-party-validation.js";
|
|
20
|
-
export { type CancelTripComponentsInput, type CreateTripComponentBodyInput, type CreateTripComponentInput, type CreateTripEnvelopeInput, cancelTripComponentsSchema, catalogComponentReferenceSchema, committedComponentReferenceSchema, createTripComponentBodySchema, createTripComponentSchema, createTripEnvelopeSchema, isAllowedTripComponentStatusTransition, isTerminalTripComponentStatus, type ListTripsQuery, listTripsQuerySchema, type PreviewTripCancellationInput, type PriceTripInput, previewTripCancellationSchema, priceTripSchema, type ReserveTripInput, reorderTripComponentsSchema, reserveTripSchema, type StartTripCheckoutInput, startTripCheckoutSchema, type TravelComposerHealthCheck, type TravelComposerStatus, type TripComponentEventType, type TripComponentKind, type TripComponentStatus, type TripEnvelopeStatus, type TripsListSortDir, type TripsListSortField, travelComposerHealthCheckSchema, travelComposerStatusSchema, tripComponentEventTypeSchema, tripComponentKindSchema, tripComponentPricingSnapshotSchema, tripComponentStatusSchema, tripComponentStatusTransitionSchema, tripComponentTaxLineSchema, tripEnvelopePricingSnapshotSchema, tripEnvelopeStatusSchema, tripsListSortDirSchema, tripsListSortFieldSchema, type UpdateTripComponentInput, updateTripComponentRefsSchema, updateTripComponentSchema, updateTripEnvelopeSchema, } from "./validation.js";
|
|
20
|
+
export { type CancelTripComponentsInput, type CreateTripComponentBodyInput, type CreateTripComponentInput, type CreateTripEnvelopeInput, type CreateTripSnapshotInput, cancelTripComponentsSchema, catalogComponentReferenceSchema, committedComponentReferenceSchema, createTripComponentBodySchema, createTripComponentSchema, createTripEnvelopeSchema, createTripSnapshotSchema, isAllowedTripComponentStatusTransition, isTerminalTripComponentStatus, type ListTripsQuery, listTripsQuerySchema, type PreviewTripCancellationInput, type PriceTripInput, previewTripCancellationSchema, priceTripSchema, type ReserveTripInput, reorderTripComponentsSchema, reserveTripSchema, type StartTripCheckoutInput, startTripCheckoutSchema, type TravelComposerHealthCheck, type TravelComposerStatus, type TripComponentEventType, type TripComponentKind, type TripComponentStatus, type TripEnvelopeStatus, type TripsListSortDir, type TripsListSortField, travelComposerHealthCheckSchema, travelComposerStatusSchema, tripComponentEventTypeSchema, tripComponentKindSchema, tripComponentPricingSnapshotSchema, tripComponentStatusSchema, tripComponentStatusTransitionSchema, tripComponentTaxLineSchema, tripEnvelopePricingSnapshotSchema, tripEnvelopeStatusSchema, tripSnapshotProposalLineSchema, tripSnapshotProposalSchema, tripsListSortDirSchema, tripsListSortFieldSchema, type UpdateTripComponentInput, updateTripComponentRefsSchema, updateTripComponentSchema, updateTripEnvelopeSchema, } from "./validation.js";
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAEL,KAA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qBAAqB,EACrB,qBAAqB,GACtB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,EACjC,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,sCAAsC,EACtC,6BAA6B,EAC7B,KAAK,cAAc,EACnB,oBAAoB,EACpB,KAAK,4BAA4B,EACjC,KAAK,cAAc,EACnB,6BAA6B,EAC7B,eAAe,EACf,KAAK,gBAAgB,EACrB,2BAA2B,EAC3B,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,+BAA+B,EAC/B,0BAA0B,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,kCAAkC,EAClC,yBAAyB,EACzB,mCAAmC,EACnC,0BAA0B,EAC1B,iCAAiC,EACjC,wBAAwB,EACxB,8BAA8B,EAC9B,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ export function createTravelComposerHonoModule(options = {}) {
|
|
|
23
23
|
}
|
|
24
24
|
export { createTripTool, priceTripTool, reserveTripTool, reviseTripTool, travelComposerMcpTools, } from "./mcp-tools.js";
|
|
25
25
|
export { travelComposerRoutes } from "./routes.js";
|
|
26
|
-
export { tripComponentEvents, tripComponentEventTypeEnum, tripComponentKindEnum, tripComponentStatusEnum, tripComponents, tripEnvelopeStatusEnum, tripEnvelopes, } from "./schema.js";
|
|
27
|
-
export { aggregateComponentPricing, applyQuoteToComponent, assertTripComponentCanBeReserved, assertTripComponentCanBeUpdated, assertTripComponentCanReceiveRefs, assertTripComponentCanStartCheckout, checkoutResultToComponentPatch, completeTripCheckout, hasCommittedComponentReference, pricingSnapshotFromBreakdown, reserveResultToComponentPatch, shouldReplayCheckout, shouldReplayReserve, TravelComposerInvariantError, taxLinesFromBreakdown, travelComposerService, } from "./service.js";
|
|
26
|
+
export { tripComponentEvents, tripComponentEventTypeEnum, tripComponentKindEnum, tripComponentStatusEnum, tripComponents, tripEnvelopeStatusEnum, tripEnvelopes, tripSnapshots, } from "./schema.js";
|
|
27
|
+
export { aggregateComponentPricing, applyQuoteToComponent, assertTripComponentCanBeReserved, assertTripComponentCanBeUpdated, assertTripComponentCanReceiveRefs, assertTripComponentCanStartCheckout, buildTripSnapshotProposal, checkoutResultToComponentPatch, completeTripCheckout, freezeTripSnapshot, getTripSnapshotById, hasCommittedComponentReference, listTripSnapshots, pricingSnapshotFromBreakdown, reserveResultToComponentPatch, shouldReplayCheckout, shouldReplayReserve, TravelComposerInvariantError, taxLinesFromBreakdown, travelComposerService, } from "./service.js";
|
|
28
28
|
export { assertTripTravelerPartyComplete, validateTripTravelerParty, } from "./traveler-party-validation.js";
|
|
29
|
-
export { cancelTripComponentsSchema, catalogComponentReferenceSchema, committedComponentReferenceSchema, createTripComponentBodySchema, createTripComponentSchema, createTripEnvelopeSchema, isAllowedTripComponentStatusTransition, isTerminalTripComponentStatus, listTripsQuerySchema, previewTripCancellationSchema, priceTripSchema, reorderTripComponentsSchema, reserveTripSchema, startTripCheckoutSchema, travelComposerHealthCheckSchema, travelComposerStatusSchema, tripComponentEventTypeSchema, tripComponentKindSchema, tripComponentPricingSnapshotSchema, tripComponentStatusSchema, tripComponentStatusTransitionSchema, tripComponentTaxLineSchema, tripEnvelopePricingSnapshotSchema, tripEnvelopeStatusSchema, tripsListSortDirSchema, tripsListSortFieldSchema, updateTripComponentRefsSchema, updateTripComponentSchema, updateTripEnvelopeSchema, } from "./validation.js";
|
|
29
|
+
export { cancelTripComponentsSchema, catalogComponentReferenceSchema, committedComponentReferenceSchema, createTripComponentBodySchema, createTripComponentSchema, createTripEnvelopeSchema, createTripSnapshotSchema, isAllowedTripComponentStatusTransition, isTerminalTripComponentStatus, listTripsQuerySchema, previewTripCancellationSchema, priceTripSchema, reorderTripComponentsSchema, reserveTripSchema, startTripCheckoutSchema, travelComposerHealthCheckSchema, travelComposerStatusSchema, tripComponentEventTypeSchema, tripComponentKindSchema, tripComponentPricingSnapshotSchema, tripComponentStatusSchema, tripComponentStatusTransitionSchema, tripComponentTaxLineSchema, tripEnvelopePricingSnapshotSchema, tripEnvelopeStatusSchema, tripSnapshotProposalLineSchema, tripSnapshotProposalSchema, tripsListSortDirSchema, tripsListSortFieldSchema, updateTripComponentRefsSchema, updateTripComponentSchema, updateTripEnvelopeSchema, } from "./validation.js";
|
package/dist/routes.d.ts
CHANGED
|
@@ -372,6 +372,45 @@ export declare function createTravelComposerRoutes(options?: TravelComposerRoute
|
|
|
372
372
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
373
373
|
};
|
|
374
374
|
};
|
|
375
|
+
} & {
|
|
376
|
+
"/trips/:envelopeId/snapshots": {
|
|
377
|
+
$get: {
|
|
378
|
+
input: {
|
|
379
|
+
param: {
|
|
380
|
+
envelopeId: string;
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
output: {};
|
|
384
|
+
outputFormat: string;
|
|
385
|
+
status: import("hono/utils/http-status").StatusCode;
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
} & {
|
|
389
|
+
"/trips/:envelopeId/snapshots": {
|
|
390
|
+
$post: {
|
|
391
|
+
input: {
|
|
392
|
+
param: {
|
|
393
|
+
envelopeId: string;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
output: {};
|
|
397
|
+
outputFormat: string;
|
|
398
|
+
status: import("hono/utils/http-status").StatusCode;
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
} & {
|
|
402
|
+
"/trip-snapshots/:snapshotId": {
|
|
403
|
+
$get: {
|
|
404
|
+
input: {
|
|
405
|
+
param: {
|
|
406
|
+
snapshotId: string;
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
output: {};
|
|
410
|
+
outputFormat: string;
|
|
411
|
+
status: import("hono/utils/http-status").StatusCode;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
375
414
|
} & {
|
|
376
415
|
"/trips/:envelopeId": {
|
|
377
416
|
$patch: {
|
|
@@ -1356,6 +1395,45 @@ export declare const travelComposerRoutes: import("hono/hono-base").HonoBase<Env
|
|
|
1356
1395
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
1357
1396
|
};
|
|
1358
1397
|
};
|
|
1398
|
+
} & {
|
|
1399
|
+
"/trips/:envelopeId/snapshots": {
|
|
1400
|
+
$get: {
|
|
1401
|
+
input: {
|
|
1402
|
+
param: {
|
|
1403
|
+
envelopeId: string;
|
|
1404
|
+
};
|
|
1405
|
+
};
|
|
1406
|
+
output: {};
|
|
1407
|
+
outputFormat: string;
|
|
1408
|
+
status: import("hono/utils/http-status").StatusCode;
|
|
1409
|
+
};
|
|
1410
|
+
};
|
|
1411
|
+
} & {
|
|
1412
|
+
"/trips/:envelopeId/snapshots": {
|
|
1413
|
+
$post: {
|
|
1414
|
+
input: {
|
|
1415
|
+
param: {
|
|
1416
|
+
envelopeId: string;
|
|
1417
|
+
};
|
|
1418
|
+
};
|
|
1419
|
+
output: {};
|
|
1420
|
+
outputFormat: string;
|
|
1421
|
+
status: import("hono/utils/http-status").StatusCode;
|
|
1422
|
+
};
|
|
1423
|
+
};
|
|
1424
|
+
} & {
|
|
1425
|
+
"/trip-snapshots/:snapshotId": {
|
|
1426
|
+
$get: {
|
|
1427
|
+
input: {
|
|
1428
|
+
param: {
|
|
1429
|
+
snapshotId: string;
|
|
1430
|
+
};
|
|
1431
|
+
};
|
|
1432
|
+
output: {};
|
|
1433
|
+
outputFormat: string;
|
|
1434
|
+
status: import("hono/utils/http-status").StatusCode;
|
|
1435
|
+
};
|
|
1436
|
+
};
|
|
1359
1437
|
} & {
|
|
1360
1438
|
"/trips/:envelopeId": {
|
|
1361
1439
|
$patch: {
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAGnC,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAGvB,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAGnC,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAGvB,MAAM,cAAc,CAAA;AAiBrB,KAAK,GAAG,GAAG;IACT,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,SAAS,EAAE;QACT,EAAE,EAAE,YAAY,CAAA;KACjB,CAAA;CACF,CAAA;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAC5B,aAAa,CAAC,EAAE,uBAAuB,CAAC,aAAa,CAAC,CAAA;IACtD,eAAe,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAA+B,CAAA;AAEhE,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAA"}
|
package/dist/routes.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { parseJsonBody, parseQuery } from "@voyantjs/hono";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
3
|
import { TravelComposerInvariantError, travelComposerService, } from "./service.js";
|
|
4
|
-
import { cancelTripComponentsSchema, createTripComponentBodySchema, createTripEnvelopeSchema, listTripsQuerySchema, previewTripCancellationSchema, priceTripSchema, reorderTripComponentsSchema, reserveTripSchema, startTripCheckoutSchema, updateTripComponentRefsSchema, updateTripComponentSchema, updateTripEnvelopeSchema, } from "./validation.js";
|
|
4
|
+
import { cancelTripComponentsSchema, createTripComponentBodySchema, createTripEnvelopeSchema, createTripSnapshotSchema, listTripsQuerySchema, previewTripCancellationSchema, priceTripSchema, reorderTripComponentsSchema, reserveTripSchema, startTripCheckoutSchema, updateTripComponentRefsSchema, updateTripComponentSchema, updateTripEnvelopeSchema, } from "./validation.js";
|
|
5
5
|
const priceTripBodySchema = priceTripSchema.omit({ envelopeId: true });
|
|
6
|
+
const createTripSnapshotBodySchema = createTripSnapshotSchema.omit({ envelopeId: true });
|
|
6
7
|
const reserveTripBodySchema = reserveTripSchema.omit({ envelopeId: true });
|
|
7
8
|
const startCheckoutBodySchema = startTripCheckoutSchema.omit({ envelopeId: true });
|
|
8
9
|
const previewCancellationBodySchema = previewTripCancellationSchema.omit({ envelopeId: true });
|
|
@@ -40,6 +41,12 @@ function envelopeIdParam(c) {
|
|
|
40
41
|
throw new TravelComposerInvariantError("Trip envelope id is required");
|
|
41
42
|
return envelopeId;
|
|
42
43
|
}
|
|
44
|
+
function snapshotIdParam(c) {
|
|
45
|
+
const snapshotId = c.req.param("snapshotId");
|
|
46
|
+
if (!snapshotId)
|
|
47
|
+
throw new TravelComposerInvariantError("Trip snapshot id is required");
|
|
48
|
+
return snapshotId;
|
|
49
|
+
}
|
|
43
50
|
async function listTripsHandler(c) {
|
|
44
51
|
const query = parseQuery(c, listTripsQuerySchema);
|
|
45
52
|
return c.json(await travelComposerService.listTrips(c.get("db"), query));
|
|
@@ -60,6 +67,37 @@ async function getTripHandler(c) {
|
|
|
60
67
|
return c.json({ error: "Trip envelope not found" }, 404);
|
|
61
68
|
return c.json({ data: trip });
|
|
62
69
|
}
|
|
70
|
+
async function listTripSnapshotsHandler(c, options) {
|
|
71
|
+
if (isPublicSurface(options))
|
|
72
|
+
return publicForbidden();
|
|
73
|
+
return c.json({
|
|
74
|
+
data: await travelComposerService.listTripSnapshots(c.get("db"), envelopeIdParam(c)),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
async function createTripSnapshotHandler(c, options) {
|
|
78
|
+
if (isPublicSurface(options))
|
|
79
|
+
return publicForbidden();
|
|
80
|
+
try {
|
|
81
|
+
const body = await parseJsonBody(c, createTripSnapshotBodySchema);
|
|
82
|
+
const snapshot = await travelComposerService.freezeTripSnapshot(c.get("db"), {
|
|
83
|
+
...body,
|
|
84
|
+
envelopeId: envelopeIdParam(c),
|
|
85
|
+
});
|
|
86
|
+
return c.json({ data: snapshot }, 201);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
const { message, status } = routeError(error);
|
|
90
|
+
return c.json({ error: message }, status);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function getTripSnapshotHandler(c, options) {
|
|
94
|
+
if (isPublicSurface(options))
|
|
95
|
+
return publicForbidden();
|
|
96
|
+
const snapshot = await travelComposerService.getTripSnapshotById(c.get("db"), snapshotIdParam(c));
|
|
97
|
+
if (!snapshot)
|
|
98
|
+
return c.json({ error: "Trip snapshot not found" }, 404);
|
|
99
|
+
return c.json({ data: snapshot });
|
|
100
|
+
}
|
|
63
101
|
async function updateTripHandler(c, options) {
|
|
64
102
|
if (isPublicSurface(options))
|
|
65
103
|
return publicForbidden();
|
|
@@ -185,6 +223,9 @@ export function createTravelComposerRoutes(options = {}) {
|
|
|
185
223
|
.get("/trips", listTripsHandler)
|
|
186
224
|
.post("/trips", createTripHandler)
|
|
187
225
|
.get("/trips/:envelopeId", getTripHandler)
|
|
226
|
+
.get("/trips/:envelopeId/snapshots", (c) => listTripSnapshotsHandler(c, options))
|
|
227
|
+
.post("/trips/:envelopeId/snapshots", (c) => createTripSnapshotHandler(c, options))
|
|
228
|
+
.get("/trip-snapshots/:snapshotId", (c) => getTripSnapshotHandler(c, options))
|
|
188
229
|
.patch("/trips/:envelopeId", (c) => updateTripHandler(c, options))
|
|
189
230
|
.post("/trips/:envelopeId/components", addTripComponentHandler)
|
|
190
231
|
.post("/trips/:envelopeId/components/reorder", (c) => reorderTripComponentsHandler(c, options))
|
package/dist/schema.d.ts
CHANGED
|
@@ -29,6 +29,37 @@ export type TripComponentTaxLineSnapshot = {
|
|
|
29
29
|
includedInPrice?: boolean;
|
|
30
30
|
source?: string;
|
|
31
31
|
};
|
|
32
|
+
export type TripSnapshotProposalLine = {
|
|
33
|
+
componentId: string;
|
|
34
|
+
sequence: number;
|
|
35
|
+
kind: string;
|
|
36
|
+
status: string;
|
|
37
|
+
title: string | null;
|
|
38
|
+
description: string;
|
|
39
|
+
entityModule: string | null;
|
|
40
|
+
entityId: string | null;
|
|
41
|
+
sourceKind: string | null;
|
|
42
|
+
currency: string;
|
|
43
|
+
subtotalAmountCents: number;
|
|
44
|
+
taxAmountCents: number;
|
|
45
|
+
totalAmountCents: number;
|
|
46
|
+
priceExpiresAt: string | null;
|
|
47
|
+
warnings: string[];
|
|
48
|
+
};
|
|
49
|
+
export type TripSnapshotProposal = {
|
|
50
|
+
envelopeId: string;
|
|
51
|
+
title: string | null;
|
|
52
|
+
description: string | null;
|
|
53
|
+
currency: string;
|
|
54
|
+
subtotalAmountCents: number;
|
|
55
|
+
taxAmountCents: number;
|
|
56
|
+
totalAmountCents: number;
|
|
57
|
+
componentCount: number;
|
|
58
|
+
pricedComponentCount: number;
|
|
59
|
+
warnings: string[];
|
|
60
|
+
frozenAt: string;
|
|
61
|
+
lines: TripSnapshotProposalLine[];
|
|
62
|
+
};
|
|
32
63
|
export declare const tripEnvelopes: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
33
64
|
name: "trip_envelopes";
|
|
34
65
|
schema: undefined;
|
|
@@ -1207,9 +1238,333 @@ export declare const tripComponentEvents: import("drizzle-orm/pg-core").PgTableW
|
|
|
1207
1238
|
};
|
|
1208
1239
|
dialect: "pg";
|
|
1209
1240
|
}>;
|
|
1241
|
+
export declare const tripSnapshots: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1242
|
+
name: "trip_snapshots";
|
|
1243
|
+
schema: undefined;
|
|
1244
|
+
columns: {
|
|
1245
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
1246
|
+
name: string;
|
|
1247
|
+
tableName: "trip_snapshots";
|
|
1248
|
+
dataType: "string";
|
|
1249
|
+
columnType: "PgText";
|
|
1250
|
+
data: string;
|
|
1251
|
+
driverParam: string;
|
|
1252
|
+
notNull: true;
|
|
1253
|
+
hasDefault: true;
|
|
1254
|
+
isPrimaryKey: true;
|
|
1255
|
+
isAutoincrement: false;
|
|
1256
|
+
hasRuntimeDefault: true;
|
|
1257
|
+
enumValues: [string, ...string[]];
|
|
1258
|
+
baseColumn: never;
|
|
1259
|
+
identity: undefined;
|
|
1260
|
+
generated: undefined;
|
|
1261
|
+
}, {}, {}>;
|
|
1262
|
+
envelopeId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1263
|
+
name: string;
|
|
1264
|
+
tableName: "trip_snapshots";
|
|
1265
|
+
dataType: "string";
|
|
1266
|
+
columnType: "PgText";
|
|
1267
|
+
data: string;
|
|
1268
|
+
driverParam: string;
|
|
1269
|
+
notNull: true;
|
|
1270
|
+
hasDefault: false;
|
|
1271
|
+
isPrimaryKey: false;
|
|
1272
|
+
isAutoincrement: false;
|
|
1273
|
+
hasRuntimeDefault: false;
|
|
1274
|
+
enumValues: [string, ...string[]];
|
|
1275
|
+
baseColumn: never;
|
|
1276
|
+
identity: undefined;
|
|
1277
|
+
generated: undefined;
|
|
1278
|
+
}, {}, {}>;
|
|
1279
|
+
sourceEnvelopeUpdatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1280
|
+
name: "source_envelope_updated_at";
|
|
1281
|
+
tableName: "trip_snapshots";
|
|
1282
|
+
dataType: "date";
|
|
1283
|
+
columnType: "PgTimestamp";
|
|
1284
|
+
data: Date;
|
|
1285
|
+
driverParam: string;
|
|
1286
|
+
notNull: true;
|
|
1287
|
+
hasDefault: false;
|
|
1288
|
+
isPrimaryKey: false;
|
|
1289
|
+
isAutoincrement: false;
|
|
1290
|
+
hasRuntimeDefault: false;
|
|
1291
|
+
enumValues: undefined;
|
|
1292
|
+
baseColumn: never;
|
|
1293
|
+
identity: undefined;
|
|
1294
|
+
generated: undefined;
|
|
1295
|
+
}, {}, {}>;
|
|
1296
|
+
titleSnapshot: import("drizzle-orm/pg-core").PgColumn<{
|
|
1297
|
+
name: "title_snapshot";
|
|
1298
|
+
tableName: "trip_snapshots";
|
|
1299
|
+
dataType: "string";
|
|
1300
|
+
columnType: "PgText";
|
|
1301
|
+
data: string;
|
|
1302
|
+
driverParam: string;
|
|
1303
|
+
notNull: false;
|
|
1304
|
+
hasDefault: false;
|
|
1305
|
+
isPrimaryKey: false;
|
|
1306
|
+
isAutoincrement: false;
|
|
1307
|
+
hasRuntimeDefault: false;
|
|
1308
|
+
enumValues: [string, ...string[]];
|
|
1309
|
+
baseColumn: never;
|
|
1310
|
+
identity: undefined;
|
|
1311
|
+
generated: undefined;
|
|
1312
|
+
}, {}, {}>;
|
|
1313
|
+
descriptionSnapshot: import("drizzle-orm/pg-core").PgColumn<{
|
|
1314
|
+
name: "description_snapshot";
|
|
1315
|
+
tableName: "trip_snapshots";
|
|
1316
|
+
dataType: "string";
|
|
1317
|
+
columnType: "PgText";
|
|
1318
|
+
data: string;
|
|
1319
|
+
driverParam: string;
|
|
1320
|
+
notNull: false;
|
|
1321
|
+
hasDefault: false;
|
|
1322
|
+
isPrimaryKey: false;
|
|
1323
|
+
isAutoincrement: false;
|
|
1324
|
+
hasRuntimeDefault: false;
|
|
1325
|
+
enumValues: [string, ...string[]];
|
|
1326
|
+
baseColumn: never;
|
|
1327
|
+
identity: undefined;
|
|
1328
|
+
generated: undefined;
|
|
1329
|
+
}, {}, {}>;
|
|
1330
|
+
travelerPartySnapshot: import("drizzle-orm/pg-core").PgColumn<{
|
|
1331
|
+
name: "traveler_party_snapshot";
|
|
1332
|
+
tableName: "trip_snapshots";
|
|
1333
|
+
dataType: "json";
|
|
1334
|
+
columnType: "PgJsonb";
|
|
1335
|
+
data: Record<string, unknown>;
|
|
1336
|
+
driverParam: unknown;
|
|
1337
|
+
notNull: true;
|
|
1338
|
+
hasDefault: true;
|
|
1339
|
+
isPrimaryKey: false;
|
|
1340
|
+
isAutoincrement: false;
|
|
1341
|
+
hasRuntimeDefault: false;
|
|
1342
|
+
enumValues: undefined;
|
|
1343
|
+
baseColumn: never;
|
|
1344
|
+
identity: undefined;
|
|
1345
|
+
generated: undefined;
|
|
1346
|
+
}, {}, {
|
|
1347
|
+
$type: Record<string, unknown>;
|
|
1348
|
+
}>;
|
|
1349
|
+
constraintsSnapshot: import("drizzle-orm/pg-core").PgColumn<{
|
|
1350
|
+
name: "constraints_snapshot";
|
|
1351
|
+
tableName: "trip_snapshots";
|
|
1352
|
+
dataType: "json";
|
|
1353
|
+
columnType: "PgJsonb";
|
|
1354
|
+
data: Record<string, unknown>;
|
|
1355
|
+
driverParam: unknown;
|
|
1356
|
+
notNull: true;
|
|
1357
|
+
hasDefault: true;
|
|
1358
|
+
isPrimaryKey: false;
|
|
1359
|
+
isAutoincrement: false;
|
|
1360
|
+
hasRuntimeDefault: false;
|
|
1361
|
+
enumValues: undefined;
|
|
1362
|
+
baseColumn: never;
|
|
1363
|
+
identity: undefined;
|
|
1364
|
+
generated: undefined;
|
|
1365
|
+
}, {}, {
|
|
1366
|
+
$type: Record<string, unknown>;
|
|
1367
|
+
}>;
|
|
1368
|
+
currency: import("drizzle-orm/pg-core").PgColumn<{
|
|
1369
|
+
name: "currency";
|
|
1370
|
+
tableName: "trip_snapshots";
|
|
1371
|
+
dataType: "string";
|
|
1372
|
+
columnType: "PgText";
|
|
1373
|
+
data: string;
|
|
1374
|
+
driverParam: string;
|
|
1375
|
+
notNull: true;
|
|
1376
|
+
hasDefault: false;
|
|
1377
|
+
isPrimaryKey: false;
|
|
1378
|
+
isAutoincrement: false;
|
|
1379
|
+
hasRuntimeDefault: false;
|
|
1380
|
+
enumValues: [string, ...string[]];
|
|
1381
|
+
baseColumn: never;
|
|
1382
|
+
identity: undefined;
|
|
1383
|
+
generated: undefined;
|
|
1384
|
+
}, {}, {}>;
|
|
1385
|
+
subtotalAmountCents: import("drizzle-orm/pg-core").PgColumn<{
|
|
1386
|
+
name: "subtotal_amount_cents";
|
|
1387
|
+
tableName: "trip_snapshots";
|
|
1388
|
+
dataType: "number";
|
|
1389
|
+
columnType: "PgInteger";
|
|
1390
|
+
data: number;
|
|
1391
|
+
driverParam: string | number;
|
|
1392
|
+
notNull: true;
|
|
1393
|
+
hasDefault: true;
|
|
1394
|
+
isPrimaryKey: false;
|
|
1395
|
+
isAutoincrement: false;
|
|
1396
|
+
hasRuntimeDefault: false;
|
|
1397
|
+
enumValues: undefined;
|
|
1398
|
+
baseColumn: never;
|
|
1399
|
+
identity: undefined;
|
|
1400
|
+
generated: undefined;
|
|
1401
|
+
}, {}, {}>;
|
|
1402
|
+
taxAmountCents: import("drizzle-orm/pg-core").PgColumn<{
|
|
1403
|
+
name: "tax_amount_cents";
|
|
1404
|
+
tableName: "trip_snapshots";
|
|
1405
|
+
dataType: "number";
|
|
1406
|
+
columnType: "PgInteger";
|
|
1407
|
+
data: number;
|
|
1408
|
+
driverParam: string | number;
|
|
1409
|
+
notNull: true;
|
|
1410
|
+
hasDefault: true;
|
|
1411
|
+
isPrimaryKey: false;
|
|
1412
|
+
isAutoincrement: false;
|
|
1413
|
+
hasRuntimeDefault: false;
|
|
1414
|
+
enumValues: undefined;
|
|
1415
|
+
baseColumn: never;
|
|
1416
|
+
identity: undefined;
|
|
1417
|
+
generated: undefined;
|
|
1418
|
+
}, {}, {}>;
|
|
1419
|
+
totalAmountCents: import("drizzle-orm/pg-core").PgColumn<{
|
|
1420
|
+
name: "total_amount_cents";
|
|
1421
|
+
tableName: "trip_snapshots";
|
|
1422
|
+
dataType: "number";
|
|
1423
|
+
columnType: "PgInteger";
|
|
1424
|
+
data: number;
|
|
1425
|
+
driverParam: string | number;
|
|
1426
|
+
notNull: true;
|
|
1427
|
+
hasDefault: true;
|
|
1428
|
+
isPrimaryKey: false;
|
|
1429
|
+
isAutoincrement: false;
|
|
1430
|
+
hasRuntimeDefault: false;
|
|
1431
|
+
enumValues: undefined;
|
|
1432
|
+
baseColumn: never;
|
|
1433
|
+
identity: undefined;
|
|
1434
|
+
generated: undefined;
|
|
1435
|
+
}, {}, {}>;
|
|
1436
|
+
componentCount: import("drizzle-orm/pg-core").PgColumn<{
|
|
1437
|
+
name: "component_count";
|
|
1438
|
+
tableName: "trip_snapshots";
|
|
1439
|
+
dataType: "number";
|
|
1440
|
+
columnType: "PgInteger";
|
|
1441
|
+
data: number;
|
|
1442
|
+
driverParam: string | number;
|
|
1443
|
+
notNull: true;
|
|
1444
|
+
hasDefault: true;
|
|
1445
|
+
isPrimaryKey: false;
|
|
1446
|
+
isAutoincrement: false;
|
|
1447
|
+
hasRuntimeDefault: false;
|
|
1448
|
+
enumValues: undefined;
|
|
1449
|
+
baseColumn: never;
|
|
1450
|
+
identity: undefined;
|
|
1451
|
+
generated: undefined;
|
|
1452
|
+
}, {}, {}>;
|
|
1453
|
+
pricedComponentCount: import("drizzle-orm/pg-core").PgColumn<{
|
|
1454
|
+
name: "priced_component_count";
|
|
1455
|
+
tableName: "trip_snapshots";
|
|
1456
|
+
dataType: "number";
|
|
1457
|
+
columnType: "PgInteger";
|
|
1458
|
+
data: number;
|
|
1459
|
+
driverParam: string | number;
|
|
1460
|
+
notNull: true;
|
|
1461
|
+
hasDefault: true;
|
|
1462
|
+
isPrimaryKey: false;
|
|
1463
|
+
isAutoincrement: false;
|
|
1464
|
+
hasRuntimeDefault: false;
|
|
1465
|
+
enumValues: undefined;
|
|
1466
|
+
baseColumn: never;
|
|
1467
|
+
identity: undefined;
|
|
1468
|
+
generated: undefined;
|
|
1469
|
+
}, {}, {}>;
|
|
1470
|
+
frozenEnvelope: import("drizzle-orm/pg-core").PgColumn<{
|
|
1471
|
+
name: "frozen_envelope";
|
|
1472
|
+
tableName: "trip_snapshots";
|
|
1473
|
+
dataType: "json";
|
|
1474
|
+
columnType: "PgJsonb";
|
|
1475
|
+
data: Record<string, unknown>;
|
|
1476
|
+
driverParam: unknown;
|
|
1477
|
+
notNull: true;
|
|
1478
|
+
hasDefault: false;
|
|
1479
|
+
isPrimaryKey: false;
|
|
1480
|
+
isAutoincrement: false;
|
|
1481
|
+
hasRuntimeDefault: false;
|
|
1482
|
+
enumValues: undefined;
|
|
1483
|
+
baseColumn: never;
|
|
1484
|
+
identity: undefined;
|
|
1485
|
+
generated: undefined;
|
|
1486
|
+
}, {}, {
|
|
1487
|
+
$type: Record<string, unknown>;
|
|
1488
|
+
}>;
|
|
1489
|
+
frozenComponents: import("drizzle-orm/pg-core").PgColumn<{
|
|
1490
|
+
name: "frozen_components";
|
|
1491
|
+
tableName: "trip_snapshots";
|
|
1492
|
+
dataType: "json";
|
|
1493
|
+
columnType: "PgJsonb";
|
|
1494
|
+
data: Record<string, unknown>[];
|
|
1495
|
+
driverParam: unknown;
|
|
1496
|
+
notNull: true;
|
|
1497
|
+
hasDefault: true;
|
|
1498
|
+
isPrimaryKey: false;
|
|
1499
|
+
isAutoincrement: false;
|
|
1500
|
+
hasRuntimeDefault: false;
|
|
1501
|
+
enumValues: undefined;
|
|
1502
|
+
baseColumn: never;
|
|
1503
|
+
identity: undefined;
|
|
1504
|
+
generated: undefined;
|
|
1505
|
+
}, {}, {
|
|
1506
|
+
$type: Record<string, unknown>[];
|
|
1507
|
+
}>;
|
|
1508
|
+
proposal: import("drizzle-orm/pg-core").PgColumn<{
|
|
1509
|
+
name: "proposal";
|
|
1510
|
+
tableName: "trip_snapshots";
|
|
1511
|
+
dataType: "json";
|
|
1512
|
+
columnType: "PgJsonb";
|
|
1513
|
+
data: TripSnapshotProposal;
|
|
1514
|
+
driverParam: unknown;
|
|
1515
|
+
notNull: true;
|
|
1516
|
+
hasDefault: false;
|
|
1517
|
+
isPrimaryKey: false;
|
|
1518
|
+
isAutoincrement: false;
|
|
1519
|
+
hasRuntimeDefault: false;
|
|
1520
|
+
enumValues: undefined;
|
|
1521
|
+
baseColumn: never;
|
|
1522
|
+
identity: undefined;
|
|
1523
|
+
generated: undefined;
|
|
1524
|
+
}, {}, {
|
|
1525
|
+
$type: TripSnapshotProposal;
|
|
1526
|
+
}>;
|
|
1527
|
+
createdBy: import("drizzle-orm/pg-core").PgColumn<{
|
|
1528
|
+
name: "created_by";
|
|
1529
|
+
tableName: "trip_snapshots";
|
|
1530
|
+
dataType: "string";
|
|
1531
|
+
columnType: "PgText";
|
|
1532
|
+
data: string;
|
|
1533
|
+
driverParam: string;
|
|
1534
|
+
notNull: false;
|
|
1535
|
+
hasDefault: false;
|
|
1536
|
+
isPrimaryKey: false;
|
|
1537
|
+
isAutoincrement: false;
|
|
1538
|
+
hasRuntimeDefault: false;
|
|
1539
|
+
enumValues: [string, ...string[]];
|
|
1540
|
+
baseColumn: never;
|
|
1541
|
+
identity: undefined;
|
|
1542
|
+
generated: undefined;
|
|
1543
|
+
}, {}, {}>;
|
|
1544
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1545
|
+
name: "created_at";
|
|
1546
|
+
tableName: "trip_snapshots";
|
|
1547
|
+
dataType: "date";
|
|
1548
|
+
columnType: "PgTimestamp";
|
|
1549
|
+
data: Date;
|
|
1550
|
+
driverParam: string;
|
|
1551
|
+
notNull: true;
|
|
1552
|
+
hasDefault: true;
|
|
1553
|
+
isPrimaryKey: false;
|
|
1554
|
+
isAutoincrement: false;
|
|
1555
|
+
hasRuntimeDefault: false;
|
|
1556
|
+
enumValues: undefined;
|
|
1557
|
+
baseColumn: never;
|
|
1558
|
+
identity: undefined;
|
|
1559
|
+
generated: undefined;
|
|
1560
|
+
}, {}, {}>;
|
|
1561
|
+
};
|
|
1562
|
+
dialect: "pg";
|
|
1563
|
+
}>;
|
|
1210
1564
|
export declare const tripEnvelopeRelations: import("drizzle-orm").Relations<"trip_envelopes", {
|
|
1211
1565
|
components: import("drizzle-orm").Many<"trip_components">;
|
|
1212
1566
|
events: import("drizzle-orm").Many<"trip_component_events">;
|
|
1567
|
+
snapshots: import("drizzle-orm").Many<"trip_snapshots">;
|
|
1213
1568
|
}>;
|
|
1214
1569
|
export declare const tripComponentRelations: import("drizzle-orm").Relations<"trip_components", {
|
|
1215
1570
|
envelope: import("drizzle-orm").One<"trip_envelopes", true>;
|
|
@@ -1219,10 +1574,15 @@ export declare const tripComponentEventRelations: import("drizzle-orm").Relation
|
|
|
1219
1574
|
envelope: import("drizzle-orm").One<"trip_envelopes", true>;
|
|
1220
1575
|
component: import("drizzle-orm").One<"trip_components", false>;
|
|
1221
1576
|
}>;
|
|
1577
|
+
export declare const tripSnapshotRelations: import("drizzle-orm").Relations<"trip_snapshots", {
|
|
1578
|
+
envelope: import("drizzle-orm").One<"trip_envelopes", true>;
|
|
1579
|
+
}>;
|
|
1222
1580
|
export type TripEnvelope = typeof tripEnvelopes.$inferSelect;
|
|
1223
1581
|
export type NewTripEnvelope = typeof tripEnvelopes.$inferInsert;
|
|
1224
1582
|
export type TripComponent = typeof tripComponents.$inferSelect;
|
|
1225
1583
|
export type NewTripComponent = typeof tripComponents.$inferInsert;
|
|
1226
1584
|
export type TripComponentEvent = typeof tripComponentEvents.$inferSelect;
|
|
1227
1585
|
export type NewTripComponentEvent = typeof tripComponentEvents.$inferInsert;
|
|
1586
|
+
export type TripSnapshot = typeof tripSnapshots.$inferSelect;
|
|
1587
|
+
export type NewTripSnapshot = typeof tripSnapshots.$inferInsert;
|
|
1228
1588
|
//# sourceMappingURL=schema.d.ts.map
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,mJASjC,CAAA;AAEF,eAAO,MAAM,qBAAqB,yIAMhC,CAAA;AAEF,eAAO,MAAM,uBAAuB,kJAUlC,CAAA;AAEF,eAAO,MAAM,0BAA0B,qLAWrC,CAAA;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,MAAM,CAAA;IAChB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;IACtB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,MAAM,CAAA;IAChB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAA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K/B,CAAA;AAEH,MAAM,MAAM,YAAY,GAAG,OAAO,aAAa,CAAC,YAAY,CAAA;AAC5D,MAAM,MAAM,eAAe,GAAG,OAAO,aAAa,CAAC,YAAY,CAAA;AAC/D,MAAM,MAAM,aAAa,GAAG,OAAO,cAAc,CAAC,YAAY,CAAA;AAC9D,MAAM,MAAM,gBAAgB,GAAG,OAAO,cAAc,CAAC,YAAY,CAAA;AACjE,MAAM,MAAM,kBAAkB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAA;AACxE,MAAM,MAAM,qBAAqB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAA;AAC3E,MAAM,MAAM,YAAY,GAAG,OAAO,aAAa,CAAC,YAAY,CAAA;AAC5D,MAAM,MAAM,eAAe,GAAG,OAAO,aAAa,CAAC,YAAY,CAAA"}
|
package/dist/schema.js
CHANGED
|
@@ -140,9 +140,46 @@ export const tripComponentEvents = pgTable("trip_component_events", {
|
|
|
140
140
|
index("idx_trip_component_events_component_time").on(table.componentId, table.occurredAt),
|
|
141
141
|
index("idx_trip_component_events_type_time").on(table.eventType, table.occurredAt),
|
|
142
142
|
]);
|
|
143
|
+
export const tripSnapshots = pgTable("trip_snapshots", {
|
|
144
|
+
id: typeId("trip_snapshots"),
|
|
145
|
+
envelopeId: typeIdRef("envelope_id")
|
|
146
|
+
.notNull()
|
|
147
|
+
.references(() => tripEnvelopes.id, { onDelete: "restrict" }),
|
|
148
|
+
sourceEnvelopeUpdatedAt: timestamp("source_envelope_updated_at", {
|
|
149
|
+
withTimezone: true,
|
|
150
|
+
}).notNull(),
|
|
151
|
+
titleSnapshot: text("title_snapshot"),
|
|
152
|
+
descriptionSnapshot: text("description_snapshot"),
|
|
153
|
+
travelerPartySnapshot: jsonb("traveler_party_snapshot")
|
|
154
|
+
.$type()
|
|
155
|
+
.notNull()
|
|
156
|
+
.default({}),
|
|
157
|
+
constraintsSnapshot: jsonb("constraints_snapshot")
|
|
158
|
+
.$type()
|
|
159
|
+
.notNull()
|
|
160
|
+
.default({}),
|
|
161
|
+
currency: text("currency").notNull(),
|
|
162
|
+
subtotalAmountCents: integer("subtotal_amount_cents").notNull().default(0),
|
|
163
|
+
taxAmountCents: integer("tax_amount_cents").notNull().default(0),
|
|
164
|
+
totalAmountCents: integer("total_amount_cents").notNull().default(0),
|
|
165
|
+
componentCount: integer("component_count").notNull().default(0),
|
|
166
|
+
pricedComponentCount: integer("priced_component_count").notNull().default(0),
|
|
167
|
+
frozenEnvelope: jsonb("frozen_envelope").$type().notNull(),
|
|
168
|
+
frozenComponents: jsonb("frozen_components")
|
|
169
|
+
.$type()
|
|
170
|
+
.notNull()
|
|
171
|
+
.default([]),
|
|
172
|
+
proposal: jsonb("proposal").$type().notNull(),
|
|
173
|
+
createdBy: text("created_by"),
|
|
174
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
175
|
+
}, (table) => [
|
|
176
|
+
index("idx_trip_snapshots_envelope_created").on(table.envelopeId, table.createdAt),
|
|
177
|
+
index("idx_trip_snapshots_created").on(table.createdAt),
|
|
178
|
+
]);
|
|
143
179
|
export const tripEnvelopeRelations = relations(tripEnvelopes, ({ many }) => ({
|
|
144
180
|
components: many(tripComponents),
|
|
145
181
|
events: many(tripComponentEvents),
|
|
182
|
+
snapshots: many(tripSnapshots),
|
|
146
183
|
}));
|
|
147
184
|
export const tripComponentRelations = relations(tripComponents, ({ one, many }) => ({
|
|
148
185
|
envelope: one(tripEnvelopes, {
|
|
@@ -161,3 +198,9 @@ export const tripComponentEventRelations = relations(tripComponentEvents, ({ one
|
|
|
161
198
|
references: [tripComponents.id],
|
|
162
199
|
}),
|
|
163
200
|
}));
|
|
201
|
+
export const tripSnapshotRelations = relations(tripSnapshots, ({ one }) => ({
|
|
202
|
+
envelope: one(tripEnvelopes, {
|
|
203
|
+
fields: [tripSnapshots.envelopeId],
|
|
204
|
+
references: [tripEnvelopes.id],
|
|
205
|
+
}),
|
|
206
|
+
}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnyDrizzleDb } from "@voyantjs/db";
|
|
2
|
+
import type { TripComponent, TripEnvelope, TripSnapshot, TripSnapshotProposal } from "./schema.js";
|
|
3
|
+
import type { CreateTripSnapshotInput } from "./validation.js";
|
|
4
|
+
export declare function freezeTripSnapshot(db: AnyDrizzleDb, input: CreateTripSnapshotInput): Promise<TripSnapshot>;
|
|
5
|
+
export declare function getTripSnapshotById(db: AnyDrizzleDb, snapshotId: string): Promise<TripSnapshot | null>;
|
|
6
|
+
export declare function listTripSnapshots(db: AnyDrizzleDb, envelopeId: string): Promise<TripSnapshot[]>;
|
|
7
|
+
export declare function buildTripSnapshotProposal(envelope: TripEnvelope, components: TripComponent[], frozenAt: Date): TripSnapshotProposal;
|
|
8
|
+
//# sourceMappingURL=service-snapshots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-snapshots.d.ts","sourceRoot":"","sources":["../src/service-snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGhD,OAAO,KAAK,EAEV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,oBAAoB,EAErB,MAAM,aAAa,CAAA;AAKpB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAE9D,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,YAAY,EAChB,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,YAAY,CAAC,CAwCvB;AAED,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,YAAY,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAO9B;AAED,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,YAAY,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC,CAMzB;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,aAAa,EAAE,EAC3B,QAAQ,EAAE,IAAI,GACb,oBAAoB,CAgBtB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { desc, eq } from "drizzle-orm";
|
|
2
|
+
import { tripSnapshots } from "./schema.js";
|
|
3
|
+
import { aggregateComponentPricing } from "./service-helpers.js";
|
|
4
|
+
import { getTrip } from "./service-trips.js";
|
|
5
|
+
import { TravelComposerInvariantError } from "./service-types.js";
|
|
6
|
+
export async function freezeTripSnapshot(db, input) {
|
|
7
|
+
const trip = await getTrip(db, input.envelopeId);
|
|
8
|
+
if (!trip) {
|
|
9
|
+
throw new TravelComposerInvariantError(`Trip envelope ${input.envelopeId} was not found`);
|
|
10
|
+
}
|
|
11
|
+
const components = trip.components.filter((component) => component.status !== "removed");
|
|
12
|
+
const missingPricing = components.filter((component) => !component.pricingSnapshot);
|
|
13
|
+
if (missingPricing.length > 0) {
|
|
14
|
+
throw new TravelComposerInvariantError(`Cannot freeze trip ${input.envelopeId}; components missing pricing snapshots: ${missingPricing
|
|
15
|
+
.map((component) => component.id)
|
|
16
|
+
.join(", ")}`);
|
|
17
|
+
}
|
|
18
|
+
const frozenAt = new Date();
|
|
19
|
+
const proposal = buildTripSnapshotProposal(trip.envelope, components, frozenAt);
|
|
20
|
+
const values = {
|
|
21
|
+
envelopeId: trip.envelope.id,
|
|
22
|
+
sourceEnvelopeUpdatedAt: trip.envelope.updatedAt ?? frozenAt,
|
|
23
|
+
titleSnapshot: trip.envelope.title,
|
|
24
|
+
descriptionSnapshot: trip.envelope.description,
|
|
25
|
+
travelerPartySnapshot: snapshotJsonRecord(trip.envelope.travelerParty),
|
|
26
|
+
constraintsSnapshot: snapshotJsonRecord(trip.envelope.constraints),
|
|
27
|
+
currency: proposal.currency,
|
|
28
|
+
subtotalAmountCents: proposal.subtotalAmountCents,
|
|
29
|
+
taxAmountCents: proposal.taxAmountCents,
|
|
30
|
+
totalAmountCents: proposal.totalAmountCents,
|
|
31
|
+
componentCount: proposal.componentCount,
|
|
32
|
+
pricedComponentCount: proposal.pricedComponentCount,
|
|
33
|
+
frozenEnvelope: snapshotJsonRecord(trip.envelope),
|
|
34
|
+
frozenComponents: components.map(snapshotJsonRecord),
|
|
35
|
+
proposal,
|
|
36
|
+
createdBy: input.createdBy ?? null,
|
|
37
|
+
};
|
|
38
|
+
const [snapshot] = (await db.insert(tripSnapshots).values(values).returning());
|
|
39
|
+
if (!snapshot)
|
|
40
|
+
throw new Error("freezeTripSnapshot: insert returned no snapshot");
|
|
41
|
+
return snapshot;
|
|
42
|
+
}
|
|
43
|
+
export async function getTripSnapshotById(db, snapshotId) {
|
|
44
|
+
const [snapshot] = (await db
|
|
45
|
+
.select()
|
|
46
|
+
.from(tripSnapshots)
|
|
47
|
+
.where(eq(tripSnapshots.id, snapshotId))
|
|
48
|
+
.limit(1));
|
|
49
|
+
return snapshot ?? null;
|
|
50
|
+
}
|
|
51
|
+
export async function listTripSnapshots(db, envelopeId) {
|
|
52
|
+
return (await db
|
|
53
|
+
.select()
|
|
54
|
+
.from(tripSnapshots)
|
|
55
|
+
.where(eq(tripSnapshots.envelopeId, envelopeId))
|
|
56
|
+
.orderBy(desc(tripSnapshots.createdAt)));
|
|
57
|
+
}
|
|
58
|
+
export function buildTripSnapshotProposal(envelope, components, frozenAt) {
|
|
59
|
+
const aggregate = aggregateComponentPricing(components, envelope.aggregateCurrency ?? undefined);
|
|
60
|
+
return {
|
|
61
|
+
envelopeId: envelope.id,
|
|
62
|
+
title: envelope.title,
|
|
63
|
+
description: envelope.description,
|
|
64
|
+
currency: aggregate.currency,
|
|
65
|
+
subtotalAmountCents: aggregate.subtotalAmountCents,
|
|
66
|
+
taxAmountCents: aggregate.taxAmountCents,
|
|
67
|
+
totalAmountCents: aggregate.totalAmountCents,
|
|
68
|
+
componentCount: aggregate.componentCount,
|
|
69
|
+
pricedComponentCount: aggregate.pricedComponentCount,
|
|
70
|
+
warnings: aggregate.warnings ?? [],
|
|
71
|
+
frozenAt: frozenAt.toISOString(),
|
|
72
|
+
lines: components.map(componentToProposalLine),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function componentToProposalLine(component) {
|
|
76
|
+
const pricing = component.pricingSnapshot;
|
|
77
|
+
if (!pricing) {
|
|
78
|
+
throw new TravelComposerInvariantError(`Cannot build proposal line for unpriced component ${component.id}`);
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
componentId: component.id,
|
|
82
|
+
sequence: component.sequence,
|
|
83
|
+
kind: component.kind,
|
|
84
|
+
status: component.status,
|
|
85
|
+
title: component.title,
|
|
86
|
+
description: componentDisplayName(component),
|
|
87
|
+
entityModule: component.entityModule,
|
|
88
|
+
entityId: component.entityId,
|
|
89
|
+
sourceKind: component.sourceKind,
|
|
90
|
+
currency: pricing.currency,
|
|
91
|
+
subtotalAmountCents: pricing.subtotalAmountCents,
|
|
92
|
+
taxAmountCents: pricing.taxAmountCents,
|
|
93
|
+
totalAmountCents: pricing.totalAmountCents,
|
|
94
|
+
priceExpiresAt: pricing.priceExpiresAt ?? component.priceExpiresAt?.toISOString() ?? null,
|
|
95
|
+
warnings: [...new Set([...(pricing.warnings ?? []), ...(component.warningCodes ?? [])])],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function componentDisplayName(component) {
|
|
99
|
+
const metadata = component.metadata;
|
|
100
|
+
const manualServiceName = metadata.manualService?.name;
|
|
101
|
+
if (typeof component.title === "string" && component.title.trim())
|
|
102
|
+
return component.title;
|
|
103
|
+
if (typeof manualServiceName === "string" && manualServiceName.trim()) {
|
|
104
|
+
return manualServiceName.trim();
|
|
105
|
+
}
|
|
106
|
+
if (typeof component.description === "string" && component.description.trim()) {
|
|
107
|
+
return component.description;
|
|
108
|
+
}
|
|
109
|
+
if (component.entityModule && component.entityId)
|
|
110
|
+
return `${component.entityModule}:${component.entityId}`;
|
|
111
|
+
return component.kind.replaceAll("_", " ");
|
|
112
|
+
}
|
|
113
|
+
function snapshotJsonRecord(value) {
|
|
114
|
+
return JSON.parse(JSON.stringify(value));
|
|
115
|
+
}
|
package/dist/service.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { completeTripCheckout, startCheckout } from "./service-checkout.js";
|
|
|
4
4
|
export { aggregateComponentPricing, assertTripComponentCanBeReserved, assertTripComponentCanBeUpdated, assertTripComponentCanReceiveRefs, assertTripComponentCanStartCheckout, checkoutResultToComponentPatch, hasCommittedComponentReference, pricingSnapshotFromBreakdown, reserveResultToComponentPatch, shouldReplayCheckout, shouldReplayReserve, taxLinesFromBreakdown, } from "./service-helpers.js";
|
|
5
5
|
export { applyQuoteToComponent, priceTrip } from "./service-pricing.js";
|
|
6
6
|
export { reserveTrip } from "./service-reservation.js";
|
|
7
|
+
export { buildTripSnapshotProposal, freezeTripSnapshot, getTripSnapshotById, listTripSnapshots, } from "./service-snapshots.js";
|
|
7
8
|
export { addComponent, createTrip, getTrip, listTrips, removeComponent, reorderComponents, updateComponent, updateComponentRefs, updateTrip, } from "./service-trips.js";
|
|
8
9
|
export type { CancelComponentInput, CancelComponentResult, CancelTripComponentsDeps, CancelTripComponentsResult, CatalogComponentQuoteInput, CheckoutHandoffKind, CompleteTripCheckoutInput, CompleteTripCheckoutResult, ComponentCancellationAction, ComponentCancellationPreview, ComponentCancellationPreviewInput, ComponentCheckoutInput, ComponentCheckoutResult, PreviewTripCancellationDeps, PriceTripDeps, PriceTripResult, ReleaseReservedComponentInput, ReleaseReservedComponentResult, ReserveComponentInput, ReserveComponentPreflightResult, ReserveComponentPreflightStatus, ReserveComponentResult, ReserveTripDeps, ReserveTripResult, StartCheckoutDeps, StartCheckoutResult, StartCheckoutTarget, StartedTripComponentCheckout, Trip, TripCancellationPreviewResult, TripCheckoutInput, TripCheckoutResult, TripListResult, } from "./service-types.js";
|
|
9
10
|
export { TravelComposerInvariantError } from "./service-types.js";
|
|
@@ -11,6 +12,7 @@ import { cancelComponents, previewCancellation } from "./service-cancellation.js
|
|
|
11
12
|
import { completeTripCheckout, startCheckout } from "./service-checkout.js";
|
|
12
13
|
import { priceTrip } from "./service-pricing.js";
|
|
13
14
|
import { reserveTrip } from "./service-reservation.js";
|
|
15
|
+
import { freezeTripSnapshot, getTripSnapshotById, listTripSnapshots } from "./service-snapshots.js";
|
|
14
16
|
import { addComponent, createTrip, getTrip, listTrips, removeComponent, reorderComponents, updateComponent, updateComponentRefs, updateTrip } from "./service-trips.js";
|
|
15
17
|
export declare const travelComposerService: {
|
|
16
18
|
getStatus(): TravelComposerStatus;
|
|
@@ -25,6 +27,9 @@ export declare const travelComposerService: {
|
|
|
25
27
|
reorderComponents: typeof reorderComponents;
|
|
26
28
|
priceTrip: typeof priceTrip;
|
|
27
29
|
reserveTrip: typeof reserveTrip;
|
|
30
|
+
freezeTripSnapshot: typeof freezeTripSnapshot;
|
|
31
|
+
getTripSnapshotById: typeof getTripSnapshotById;
|
|
32
|
+
listTripSnapshots: typeof listTripSnapshots;
|
|
28
33
|
startCheckout: typeof startCheckout;
|
|
29
34
|
completeTripCheckout: typeof completeTripCheckout;
|
|
30
35
|
previewCancellation: typeof previewCancellation;
|
package/dist/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAE3D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACjF,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC3E,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,+BAA+B,EAC/B,iCAAiC,EACjC,mCAAmC,EACnC,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,6BAA6B,EAC7B,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,qB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AmB,EACnB,4BAA4B,EAC5B,IAAI,EACJ,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEjE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACjF,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACnG,OAAO,EACL,YAAY,EACZ,UAAU,EACV,OAAO,EACP,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,UAAU,EACX,MAAM,oBAAoB,CAAA;AAE3B,eAAO,MAAM,qBAAqB;iBACnB,oBAAoB;;;;;;;;;;;;;;;;;;;CAwBlC,CAAA"}
|
package/dist/service.js
CHANGED
|
@@ -3,12 +3,14 @@ export { completeTripCheckout, startCheckout } from "./service-checkout.js";
|
|
|
3
3
|
export { aggregateComponentPricing, assertTripComponentCanBeReserved, assertTripComponentCanBeUpdated, assertTripComponentCanReceiveRefs, assertTripComponentCanStartCheckout, checkoutResultToComponentPatch, hasCommittedComponentReference, pricingSnapshotFromBreakdown, reserveResultToComponentPatch, shouldReplayCheckout, shouldReplayReserve, taxLinesFromBreakdown, } from "./service-helpers.js";
|
|
4
4
|
export { applyQuoteToComponent, priceTrip } from "./service-pricing.js";
|
|
5
5
|
export { reserveTrip } from "./service-reservation.js";
|
|
6
|
+
export { buildTripSnapshotProposal, freezeTripSnapshot, getTripSnapshotById, listTripSnapshots, } from "./service-snapshots.js";
|
|
6
7
|
export { addComponent, createTrip, getTrip, listTrips, removeComponent, reorderComponents, updateComponent, updateComponentRefs, updateTrip, } from "./service-trips.js";
|
|
7
8
|
export { TravelComposerInvariantError } from "./service-types.js";
|
|
8
9
|
import { cancelComponents, previewCancellation } from "./service-cancellation.js";
|
|
9
10
|
import { completeTripCheckout, startCheckout } from "./service-checkout.js";
|
|
10
11
|
import { priceTrip } from "./service-pricing.js";
|
|
11
12
|
import { reserveTrip } from "./service-reservation.js";
|
|
13
|
+
import { freezeTripSnapshot, getTripSnapshotById, listTripSnapshots } from "./service-snapshots.js";
|
|
12
14
|
import { addComponent, createTrip, getTrip, listTrips, removeComponent, reorderComponents, updateComponent, updateComponentRefs, updateTrip, } from "./service-trips.js";
|
|
13
15
|
export const travelComposerService = {
|
|
14
16
|
getStatus() {
|
|
@@ -28,6 +30,9 @@ export const travelComposerService = {
|
|
|
28
30
|
reorderComponents,
|
|
29
31
|
priceTrip,
|
|
30
32
|
reserveTrip,
|
|
33
|
+
freezeTripSnapshot,
|
|
34
|
+
getTripSnapshotById,
|
|
35
|
+
listTripSnapshots,
|
|
31
36
|
startCheckout,
|
|
32
37
|
completeTripCheckout,
|
|
33
38
|
previewCancellation,
|
package/dist/validation.d.ts
CHANGED
|
@@ -144,6 +144,92 @@ export declare const listTripsQuerySchema: z.ZodObject<{
|
|
|
144
144
|
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
145
145
|
}, z.core.$strip>;
|
|
146
146
|
export type ListTripsQuery = z.infer<typeof listTripsQuerySchema>;
|
|
147
|
+
export declare const tripSnapshotProposalLineSchema: z.ZodObject<{
|
|
148
|
+
componentId: z.ZodString;
|
|
149
|
+
sequence: z.ZodNumber;
|
|
150
|
+
kind: z.ZodEnum<{
|
|
151
|
+
catalog_booking: "catalog_booking";
|
|
152
|
+
manual_placeholder: "manual_placeholder";
|
|
153
|
+
flight_placeholder: "flight_placeholder";
|
|
154
|
+
flight_order: "flight_order";
|
|
155
|
+
external_order: "external_order";
|
|
156
|
+
}>;
|
|
157
|
+
status: z.ZodEnum<{
|
|
158
|
+
unavailable: "unavailable";
|
|
159
|
+
cancelled: "cancelled";
|
|
160
|
+
draft: "draft";
|
|
161
|
+
held: "held";
|
|
162
|
+
failed: "failed";
|
|
163
|
+
priced: "priced";
|
|
164
|
+
checkout_started: "checkout_started";
|
|
165
|
+
booked: "booked";
|
|
166
|
+
removed: "removed";
|
|
167
|
+
}>;
|
|
168
|
+
title: z.ZodNullable<z.ZodString>;
|
|
169
|
+
description: z.ZodString;
|
|
170
|
+
entityModule: z.ZodNullable<z.ZodString>;
|
|
171
|
+
entityId: z.ZodNullable<z.ZodString>;
|
|
172
|
+
sourceKind: z.ZodNullable<z.ZodString>;
|
|
173
|
+
currency: z.ZodString;
|
|
174
|
+
subtotalAmountCents: z.ZodNumber;
|
|
175
|
+
taxAmountCents: z.ZodNumber;
|
|
176
|
+
totalAmountCents: z.ZodNumber;
|
|
177
|
+
priceExpiresAt: z.ZodNullable<z.ZodString>;
|
|
178
|
+
warnings: z.ZodArray<z.ZodString>;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
export type TripSnapshotProposalLine = z.infer<typeof tripSnapshotProposalLineSchema>;
|
|
181
|
+
export declare const tripSnapshotProposalSchema: z.ZodObject<{
|
|
182
|
+
envelopeId: z.ZodString;
|
|
183
|
+
title: z.ZodNullable<z.ZodString>;
|
|
184
|
+
description: z.ZodNullable<z.ZodString>;
|
|
185
|
+
currency: z.ZodString;
|
|
186
|
+
subtotalAmountCents: z.ZodNumber;
|
|
187
|
+
taxAmountCents: z.ZodNumber;
|
|
188
|
+
totalAmountCents: z.ZodNumber;
|
|
189
|
+
componentCount: z.ZodNumber;
|
|
190
|
+
pricedComponentCount: z.ZodNumber;
|
|
191
|
+
warnings: z.ZodArray<z.ZodString>;
|
|
192
|
+
frozenAt: z.ZodString;
|
|
193
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
194
|
+
componentId: z.ZodString;
|
|
195
|
+
sequence: z.ZodNumber;
|
|
196
|
+
kind: z.ZodEnum<{
|
|
197
|
+
catalog_booking: "catalog_booking";
|
|
198
|
+
manual_placeholder: "manual_placeholder";
|
|
199
|
+
flight_placeholder: "flight_placeholder";
|
|
200
|
+
flight_order: "flight_order";
|
|
201
|
+
external_order: "external_order";
|
|
202
|
+
}>;
|
|
203
|
+
status: z.ZodEnum<{
|
|
204
|
+
unavailable: "unavailable";
|
|
205
|
+
cancelled: "cancelled";
|
|
206
|
+
draft: "draft";
|
|
207
|
+
held: "held";
|
|
208
|
+
failed: "failed";
|
|
209
|
+
priced: "priced";
|
|
210
|
+
checkout_started: "checkout_started";
|
|
211
|
+
booked: "booked";
|
|
212
|
+
removed: "removed";
|
|
213
|
+
}>;
|
|
214
|
+
title: z.ZodNullable<z.ZodString>;
|
|
215
|
+
description: z.ZodString;
|
|
216
|
+
entityModule: z.ZodNullable<z.ZodString>;
|
|
217
|
+
entityId: z.ZodNullable<z.ZodString>;
|
|
218
|
+
sourceKind: z.ZodNullable<z.ZodString>;
|
|
219
|
+
currency: z.ZodString;
|
|
220
|
+
subtotalAmountCents: z.ZodNumber;
|
|
221
|
+
taxAmountCents: z.ZodNumber;
|
|
222
|
+
totalAmountCents: z.ZodNumber;
|
|
223
|
+
priceExpiresAt: z.ZodNullable<z.ZodString>;
|
|
224
|
+
warnings: z.ZodArray<z.ZodString>;
|
|
225
|
+
}, z.core.$strip>>;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
export type TripSnapshotProposal = z.infer<typeof tripSnapshotProposalSchema>;
|
|
228
|
+
export declare const createTripSnapshotSchema: z.ZodObject<{
|
|
229
|
+
envelopeId: z.ZodString;
|
|
230
|
+
createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
export type CreateTripSnapshotInput = z.infer<typeof createTripSnapshotSchema>;
|
|
147
233
|
export declare const updateTripEnvelopeSchema: z.ZodObject<{
|
|
148
234
|
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
149
235
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,wBAAwB;;;;;;;;;EASnC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,uBAAuB;;;;;;EAMlC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,yBAAyB;;;;;;;;;;EAUpC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,4BAA4B;;;;;;;;;;;EAWvC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEjF,eAAO,MAAM,0BAA0B;;;;;;;;;iBASrC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E,eAAO,MAAM,kCAAkC;;;;;;;iBAO7C,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAE7F,eAAO,MAAM,iCAAiC;;;;;;;;iBAQ5C,CAAA;AAEF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAE3F,eAAO,MAAM,+BAA+B;;;;;;iBAM1C,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,C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(100).default(50),
|
|
110
110
|
offset: z.coerce.number().int().min(0).default(0),
|
|
111
111
|
});
|
|
112
|
+
export const tripSnapshotProposalLineSchema = z.object({
|
|
113
|
+
componentId: z.string().min(1),
|
|
114
|
+
sequence: z.number().int().min(0),
|
|
115
|
+
kind: tripComponentKindSchema,
|
|
116
|
+
status: tripComponentStatusSchema,
|
|
117
|
+
title: z.string().nullable(),
|
|
118
|
+
description: z.string().min(1),
|
|
119
|
+
entityModule: z.string().nullable(),
|
|
120
|
+
entityId: z.string().nullable(),
|
|
121
|
+
sourceKind: z.string().nullable(),
|
|
122
|
+
currency: z.string().length(3),
|
|
123
|
+
subtotalAmountCents: z.number().int(),
|
|
124
|
+
taxAmountCents: z.number().int(),
|
|
125
|
+
totalAmountCents: z.number().int(),
|
|
126
|
+
priceExpiresAt: z.string().datetime().nullable(),
|
|
127
|
+
warnings: z.array(z.string()),
|
|
128
|
+
});
|
|
129
|
+
export const tripSnapshotProposalSchema = z.object({
|
|
130
|
+
envelopeId: z.string().min(1),
|
|
131
|
+
title: z.string().nullable(),
|
|
132
|
+
description: z.string().nullable(),
|
|
133
|
+
currency: z.string().length(3),
|
|
134
|
+
subtotalAmountCents: z.number().int(),
|
|
135
|
+
taxAmountCents: z.number().int(),
|
|
136
|
+
totalAmountCents: z.number().int(),
|
|
137
|
+
componentCount: z.number().int().nonnegative(),
|
|
138
|
+
pricedComponentCount: z.number().int().nonnegative(),
|
|
139
|
+
warnings: z.array(z.string()),
|
|
140
|
+
frozenAt: z.string().datetime(),
|
|
141
|
+
lines: z.array(tripSnapshotProposalLineSchema),
|
|
142
|
+
});
|
|
143
|
+
export const createTripSnapshotSchema = z.object({
|
|
144
|
+
envelopeId: z.string().min(1),
|
|
145
|
+
createdBy: z.string().min(1).nullable().optional(),
|
|
146
|
+
});
|
|
112
147
|
export const updateTripEnvelopeSchema = z.object({
|
|
113
148
|
title: z.string().min(1).max(255).nullable().optional(),
|
|
114
149
|
description: z.string().nullable().optional(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/travel-composer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.105.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -40,20 +40,26 @@
|
|
|
40
40
|
"default": "./dist/routes.js"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
+
"voyant": {
|
|
44
|
+
"schema": "./schema",
|
|
45
|
+
"requiresSchemas": [
|
|
46
|
+
"@voyantjs/db"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
43
49
|
"dependencies": {
|
|
44
50
|
"drizzle-orm": "^0.45.2",
|
|
45
51
|
"hono": "^4.12.10",
|
|
46
52
|
"zod": "^4.3.6",
|
|
47
|
-
"@voyantjs/core": "0.
|
|
48
|
-
"@voyantjs/catalog": "0.
|
|
49
|
-
"@voyantjs/catalog-mcp": "0.
|
|
50
|
-
"@voyantjs/db": "0.104.
|
|
51
|
-
"@voyantjs/hono": "0.104.
|
|
53
|
+
"@voyantjs/core": "^0.105.0",
|
|
54
|
+
"@voyantjs/catalog": "^0.105.0",
|
|
55
|
+
"@voyantjs/catalog-mcp": "^0.105.0",
|
|
56
|
+
"@voyantjs/db": "^0.104.3",
|
|
57
|
+
"@voyantjs/hono": "^0.104.2"
|
|
52
58
|
},
|
|
53
59
|
"devDependencies": {
|
|
54
60
|
"typescript": "^6.0.2",
|
|
55
61
|
"vitest": "^4.1.2",
|
|
56
|
-
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
62
|
+
"@voyantjs/voyant-typescript-config": "^0.1.0"
|
|
57
63
|
},
|
|
58
64
|
"files": [
|
|
59
65
|
"dist"
|