@voyantjs/bookings 0.10.0 → 0.12.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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/routes-groups.d.ts +4 -4
- package/dist/routes.d.ts +221 -19
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +43 -15
- package/dist/schema-groups.d.ts +3 -3
- package/dist/schema-groups.d.ts.map +1 -1
- package/dist/schema-groups.js +5 -1
- package/dist/schema-operations.d.ts +2 -2
- package/dist/schema-shared.d.ts +1 -1
- package/dist/schema-shared.d.ts.map +1 -1
- package/dist/schema-shared.js +3 -0
- package/dist/service.d.ts +177 -10
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +193 -60
- package/dist/validation.d.ts +29 -12
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +18 -5
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { type PiiAccessContext, redactBookingContact, redactEmail, redactPhone,
|
|
|
6
6
|
export type { ConvertProductData } from "./service.js";
|
|
7
7
|
export { bookingsService } from "./service.js";
|
|
8
8
|
export { type AddBookingGroupMemberInput, type BookingGroupListQuery, type BookingGroupMemberWithBooking, bookingGroupsService, type CreateBookingGroupInput, listGroupBookingTravelers, type UpdateBookingGroupInput, } from "./service-groups.js";
|
|
9
|
-
export {
|
|
9
|
+
export type { BookingStatus } from "./state-machine.js";
|
|
10
10
|
export { type ExpireStaleBookingHoldsInput, type ExpireStaleBookingHoldsResult, expireStaleBookingHolds, } from "./tasks/index.js";
|
|
11
11
|
export declare const bookingLinkable: LinkableDefinition;
|
|
12
12
|
export declare const bookingsLinkable: {
|
|
@@ -25,5 +25,5 @@ export { bookingTravelerDietarySchema, bookingTravelerIdentitySchema, bookingTra
|
|
|
25
25
|
export type { Booking, BookingActivity, BookingAllocation, BookingDocument, BookingFulfillment, BookingGroup, BookingGroupMember, BookingItem, BookingItemTraveler, BookingNote, BookingPiiAccessLog, BookingRedemptionEvent, BookingSessionState, BookingStaffAssignment, BookingSupplierStatus, BookingTraveler, NewBooking, NewBookingActivity, NewBookingAllocation, NewBookingDocument, NewBookingFulfillment, NewBookingGroup, NewBookingGroupMember, NewBookingItem, NewBookingItemTraveler, NewBookingNote, NewBookingPiiAccessLog, NewBookingRedemptionEvent, NewBookingSessionState, NewBookingStaffAssignment, NewBookingSupplierStatus, NewBookingTraveler, } from "./schema.js";
|
|
26
26
|
export { bookingActivityLog, bookingAllocations, bookingDocuments, bookingFulfillments, bookingGroupKindEnum, bookingGroupMemberRoleEnum, bookingGroupMembers, bookingGroups, bookingItems, bookingItemTravelers, bookingNotes, bookingPiiAccessLog, bookingRedemptionEvents, bookingSessionStates, bookingStaffAssignments, bookingSupplierStatuses, bookings, bookingTravelers, } from "./schema.js";
|
|
27
27
|
export { publicBookingsService, resolveSessionPricingSnapshot } from "./service-public.js";
|
|
28
|
-
export { addBookingGroupMemberSchema, bookingGroupKindSchema, bookingGroupListQuerySchema, bookingGroupMemberRoleSchema, bookingListQuerySchema, cancelBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingAllocationSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingGroupSchema, insertBookingItemSchema, insertBookingItemTravelerSchema, insertBookingNoteSchema, insertBookingSchema, insertBookingTravelerDocumentSchema, insertSupplierStatusSchema, insertTravelerSchema, internalBookingOverviewLookupQuerySchema, pricingPreviewSchema, publicBookingOverviewLookupQuerySchema, publicBookingSessionMutationSchema, publicBookingSessionRepriceItemSchema, publicBookingSessionRepriceResultSchema, publicBookingSessionRepriceSummarySchema, publicBookingSessionStateSchema, publicCreateBookingSessionSchema, publicRepriceBookingSessionSchema, publicUpdateBookingSessionSchema, publicUpsertBookingSessionStateSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, updateBookingAllocationSchema, updateBookingFulfillmentSchema, updateBookingGroupSchema, updateBookingItemSchema, updateBookingSchema,
|
|
28
|
+
export { addBookingGroupMemberSchema, bookingGroupKindSchema, bookingGroupListQuerySchema, bookingGroupMemberRoleSchema, bookingListQuerySchema, cancelBookingSchema, completeBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingAllocationSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingGroupSchema, insertBookingItemSchema, insertBookingItemTravelerSchema, insertBookingNoteSchema, insertBookingSchema, insertBookingTravelerDocumentSchema, insertSupplierStatusSchema, insertTravelerSchema, internalBookingOverviewLookupQuerySchema, overrideBookingStatusSchema, pricingPreviewSchema, publicBookingOverviewLookupQuerySchema, publicBookingSessionMutationSchema, publicBookingSessionRepriceItemSchema, publicBookingSessionRepriceResultSchema, publicBookingSessionRepriceSummarySchema, publicBookingSessionStateSchema, publicCreateBookingSessionSchema, publicRepriceBookingSessionSchema, publicUpdateBookingSessionSchema, publicUpsertBookingSessionStateSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, startBookingSchema, updateBookingAllocationSchema, updateBookingFulfillmentSchema, updateBookingGroupSchema, updateBookingItemSchema, updateBookingSchema, updateSupplierStatusSchema, updateTravelerSchema, upsertTravelerTravelDetailsSchema, } from "./validation.js";
|
|
29
29
|
//# 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,kBAAkB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAMvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AACr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9B,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,0BAA0B,EAC1B,oBAAoB,EACpB,iCAAiC,GAClC,MAAM,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ export { createBookingPiiService, } from "./pii.js";
|
|
|
6
6
|
export { redactBookingContact, redactEmail, redactPhone, redactString, redactTravelerIdentity, shouldRevealBookingPii, } from "./pii-redaction.js";
|
|
7
7
|
export { bookingsService } from "./service.js";
|
|
8
8
|
export { bookingGroupsService, listGroupBookingTravelers, } from "./service-groups.js";
|
|
9
|
-
export { BOOKING_TRANSITIONS, BookingTransitionError, canTransitionBooking, transitionBooking, } from "./state-machine.js";
|
|
10
9
|
export { expireStaleBookingHolds, } from "./tasks/index.js";
|
|
11
10
|
export const bookingLinkable = {
|
|
12
11
|
module: "bookings",
|
|
@@ -41,4 +40,4 @@ export { publicBookingRoutes } from "./routes-public.js";
|
|
|
41
40
|
export { bookingTravelerDietarySchema, bookingTravelerIdentitySchema, bookingTravelerTravelDetailInsertSchema, bookingTravelerTravelDetailSelectSchema, bookingTravelerTravelDetails, bookingTravelerTravelDetailUpdateSchema, decryptedBookingTravelerTravelDetailSchema, } from "./schema/travel-details.js";
|
|
42
41
|
export { bookingActivityLog, bookingAllocations, bookingDocuments, bookingFulfillments, bookingGroupKindEnum, bookingGroupMemberRoleEnum, bookingGroupMembers, bookingGroups, bookingItems, bookingItemTravelers, bookingNotes, bookingPiiAccessLog, bookingRedemptionEvents, bookingSessionStates, bookingStaffAssignments, bookingSupplierStatuses, bookings, bookingTravelers, } from "./schema.js";
|
|
43
42
|
export { publicBookingsService, resolveSessionPricingSnapshot } from "./service-public.js";
|
|
44
|
-
export { addBookingGroupMemberSchema, bookingGroupKindSchema, bookingGroupListQuerySchema, bookingGroupMemberRoleSchema, bookingListQuerySchema, cancelBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingAllocationSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingGroupSchema, insertBookingItemSchema, insertBookingItemTravelerSchema, insertBookingNoteSchema, insertBookingSchema, insertBookingTravelerDocumentSchema, insertSupplierStatusSchema, insertTravelerSchema, internalBookingOverviewLookupQuerySchema, pricingPreviewSchema, publicBookingOverviewLookupQuerySchema, publicBookingSessionMutationSchema, publicBookingSessionRepriceItemSchema, publicBookingSessionRepriceResultSchema, publicBookingSessionRepriceSummarySchema, publicBookingSessionStateSchema, publicCreateBookingSessionSchema, publicRepriceBookingSessionSchema, publicUpdateBookingSessionSchema, publicUpsertBookingSessionStateSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, updateBookingAllocationSchema, updateBookingFulfillmentSchema, updateBookingGroupSchema, updateBookingItemSchema, updateBookingSchema,
|
|
43
|
+
export { addBookingGroupMemberSchema, bookingGroupKindSchema, bookingGroupListQuerySchema, bookingGroupMemberRoleSchema, bookingListQuerySchema, cancelBookingSchema, completeBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingAllocationSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingGroupSchema, insertBookingItemSchema, insertBookingItemTravelerSchema, insertBookingNoteSchema, insertBookingSchema, insertBookingTravelerDocumentSchema, insertSupplierStatusSchema, insertTravelerSchema, internalBookingOverviewLookupQuerySchema, overrideBookingStatusSchema, pricingPreviewSchema, publicBookingOverviewLookupQuerySchema, publicBookingSessionMutationSchema, publicBookingSessionRepriceItemSchema, publicBookingSessionRepriceResultSchema, publicBookingSessionRepriceSummarySchema, publicBookingSessionStateSchema, publicCreateBookingSessionSchema, publicRepriceBookingSessionSchema, publicUpdateBookingSessionSchema, publicUpsertBookingSessionStateSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, startBookingSchema, updateBookingAllocationSchema, updateBookingFulfillmentSchema, updateBookingGroupSchema, updateBookingItemSchema, updateBookingSchema, updateSupplierStatusSchema, updateTravelerSchema, upsertTravelerTravelDetailsSchema, } from "./validation.js";
|
package/dist/routes-groups.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare const bookingGroupRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
18
18
|
metadata: {
|
|
19
19
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
20
20
|
} | null;
|
|
21
|
-
kind: "other" | "shared_room";
|
|
21
|
+
kind: "other" | "shared_room" | "cruise_party";
|
|
22
22
|
label: string;
|
|
23
23
|
primaryBookingId: string | null;
|
|
24
24
|
optionUnitId: string | null;
|
|
@@ -44,7 +44,7 @@ export declare const bookingGroupRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
44
44
|
metadata: {
|
|
45
45
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
46
46
|
} | null;
|
|
47
|
-
kind: "other" | "shared_room";
|
|
47
|
+
kind: "other" | "shared_room" | "cruise_party";
|
|
48
48
|
label: string;
|
|
49
49
|
primaryBookingId: string | null;
|
|
50
50
|
optionUnitId: string | null;
|
|
@@ -129,7 +129,7 @@ export declare const bookingGroupRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
129
129
|
metadata: {
|
|
130
130
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
131
131
|
} | null;
|
|
132
|
-
kind: "other" | "shared_room";
|
|
132
|
+
kind: "other" | "shared_room" | "cruise_party";
|
|
133
133
|
label: string;
|
|
134
134
|
primaryBookingId: string | null;
|
|
135
135
|
optionUnitId: string | null;
|
|
@@ -167,7 +167,7 @@ export declare const bookingGroupRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
167
167
|
metadata: {
|
|
168
168
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
169
169
|
} | null;
|
|
170
|
-
kind: "other" | "shared_room";
|
|
170
|
+
kind: "other" | "shared_room" | "cruise_party";
|
|
171
171
|
label: string;
|
|
172
172
|
primaryBookingId: string | null;
|
|
173
173
|
optionUnitId: string | null;
|
package/dist/routes.d.ts
CHANGED
|
@@ -655,8 +655,8 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
655
655
|
};
|
|
656
656
|
};
|
|
657
657
|
} & {
|
|
658
|
-
"/:id/
|
|
659
|
-
$
|
|
658
|
+
"/:id/confirm": {
|
|
659
|
+
$post: {
|
|
660
660
|
input: {
|
|
661
661
|
param: {
|
|
662
662
|
id: string;
|
|
@@ -685,7 +685,46 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
685
685
|
};
|
|
686
686
|
};
|
|
687
687
|
output: {
|
|
688
|
-
data:
|
|
688
|
+
data: {
|
|
689
|
+
id: string;
|
|
690
|
+
bookingNumber: string;
|
|
691
|
+
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
692
|
+
personId: string | null;
|
|
693
|
+
organizationId: string | null;
|
|
694
|
+
sourceType: "internal" | "reseller" | "direct" | "manual" | "affiliate" | "ota" | "api_partner";
|
|
695
|
+
externalBookingRef: string | null;
|
|
696
|
+
communicationLanguage: string | null;
|
|
697
|
+
contactFirstName: string | null;
|
|
698
|
+
contactLastName: string | null;
|
|
699
|
+
contactEmail: string | null;
|
|
700
|
+
contactPhone: string | null;
|
|
701
|
+
contactPreferredLanguage: string | null;
|
|
702
|
+
contactCountry: string | null;
|
|
703
|
+
contactRegion: string | null;
|
|
704
|
+
contactCity: string | null;
|
|
705
|
+
contactAddressLine1: string | null;
|
|
706
|
+
contactPostalCode: string | null;
|
|
707
|
+
sellCurrency: string;
|
|
708
|
+
baseCurrency: string | null;
|
|
709
|
+
fxRateSetId: string | null;
|
|
710
|
+
sellAmountCents: number | null;
|
|
711
|
+
baseSellAmountCents: number | null;
|
|
712
|
+
costAmountCents: number | null;
|
|
713
|
+
baseCostAmountCents: number | null;
|
|
714
|
+
marginPercent: number | null;
|
|
715
|
+
startDate: string | null;
|
|
716
|
+
endDate: string | null;
|
|
717
|
+
pax: number | null;
|
|
718
|
+
internalNotes: string | null;
|
|
719
|
+
holdExpiresAt: string | null;
|
|
720
|
+
confirmedAt: string | null;
|
|
721
|
+
expiredAt: string | null;
|
|
722
|
+
cancelledAt: string | null;
|
|
723
|
+
completedAt: string | null;
|
|
724
|
+
redeemedAt: string | null;
|
|
725
|
+
createdAt: string;
|
|
726
|
+
updatedAt: string;
|
|
727
|
+
} | null;
|
|
689
728
|
};
|
|
690
729
|
outputFormat: "json";
|
|
691
730
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
@@ -703,7 +742,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
703
742
|
};
|
|
704
743
|
};
|
|
705
744
|
} & {
|
|
706
|
-
"/:id/
|
|
745
|
+
"/:id/extend-hold": {
|
|
707
746
|
$post: {
|
|
708
747
|
input: {
|
|
709
748
|
param: {
|
|
@@ -790,7 +829,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
790
829
|
};
|
|
791
830
|
};
|
|
792
831
|
} & {
|
|
793
|
-
"/:id/
|
|
832
|
+
"/:id/expire": {
|
|
794
833
|
$post: {
|
|
795
834
|
input: {
|
|
796
835
|
param: {
|
|
@@ -877,7 +916,20 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
877
916
|
};
|
|
878
917
|
};
|
|
879
918
|
} & {
|
|
880
|
-
"
|
|
919
|
+
"/expire-stale": {
|
|
920
|
+
$post: {
|
|
921
|
+
input: {};
|
|
922
|
+
output: {
|
|
923
|
+
expiredIds: string[];
|
|
924
|
+
count: number;
|
|
925
|
+
cutoff: string;
|
|
926
|
+
};
|
|
927
|
+
outputFormat: "json";
|
|
928
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
929
|
+
};
|
|
930
|
+
};
|
|
931
|
+
} & {
|
|
932
|
+
"/:id/cancel": {
|
|
881
933
|
$post: {
|
|
882
934
|
input: {
|
|
883
935
|
param: {
|
|
@@ -946,7 +998,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
946
998
|
redeemedAt: string | null;
|
|
947
999
|
createdAt: string;
|
|
948
1000
|
updatedAt: string;
|
|
949
|
-
} | null;
|
|
1001
|
+
} | null | undefined;
|
|
950
1002
|
};
|
|
951
1003
|
outputFormat: "json";
|
|
952
1004
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
@@ -964,20 +1016,94 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
964
1016
|
};
|
|
965
1017
|
};
|
|
966
1018
|
} & {
|
|
967
|
-
"/
|
|
1019
|
+
"/:id/start": {
|
|
968
1020
|
$post: {
|
|
969
|
-
input: {
|
|
1021
|
+
input: {
|
|
1022
|
+
param: {
|
|
1023
|
+
id: string;
|
|
1024
|
+
};
|
|
1025
|
+
};
|
|
970
1026
|
output: {
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
1027
|
+
error: string;
|
|
1028
|
+
};
|
|
1029
|
+
outputFormat: "json";
|
|
1030
|
+
status: 404;
|
|
1031
|
+
} | {
|
|
1032
|
+
input: {
|
|
1033
|
+
param: {
|
|
1034
|
+
id: string;
|
|
1035
|
+
};
|
|
1036
|
+
};
|
|
1037
|
+
output: {
|
|
1038
|
+
error: string;
|
|
1039
|
+
};
|
|
1040
|
+
outputFormat: "json";
|
|
1041
|
+
status: 409;
|
|
1042
|
+
} | {
|
|
1043
|
+
input: {
|
|
1044
|
+
param: {
|
|
1045
|
+
id: string;
|
|
1046
|
+
};
|
|
1047
|
+
};
|
|
1048
|
+
output: {
|
|
1049
|
+
data: {
|
|
1050
|
+
id: string;
|
|
1051
|
+
bookingNumber: string;
|
|
1052
|
+
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
1053
|
+
personId: string | null;
|
|
1054
|
+
organizationId: string | null;
|
|
1055
|
+
sourceType: "internal" | "reseller" | "direct" | "manual" | "affiliate" | "ota" | "api_partner";
|
|
1056
|
+
externalBookingRef: string | null;
|
|
1057
|
+
communicationLanguage: string | null;
|
|
1058
|
+
contactFirstName: string | null;
|
|
1059
|
+
contactLastName: string | null;
|
|
1060
|
+
contactEmail: string | null;
|
|
1061
|
+
contactPhone: string | null;
|
|
1062
|
+
contactPreferredLanguage: string | null;
|
|
1063
|
+
contactCountry: string | null;
|
|
1064
|
+
contactRegion: string | null;
|
|
1065
|
+
contactCity: string | null;
|
|
1066
|
+
contactAddressLine1: string | null;
|
|
1067
|
+
contactPostalCode: string | null;
|
|
1068
|
+
sellCurrency: string;
|
|
1069
|
+
baseCurrency: string | null;
|
|
1070
|
+
fxRateSetId: string | null;
|
|
1071
|
+
sellAmountCents: number | null;
|
|
1072
|
+
baseSellAmountCents: number | null;
|
|
1073
|
+
costAmountCents: number | null;
|
|
1074
|
+
baseCostAmountCents: number | null;
|
|
1075
|
+
marginPercent: number | null;
|
|
1076
|
+
startDate: string | null;
|
|
1077
|
+
endDate: string | null;
|
|
1078
|
+
pax: number | null;
|
|
1079
|
+
internalNotes: string | null;
|
|
1080
|
+
holdExpiresAt: string | null;
|
|
1081
|
+
confirmedAt: string | null;
|
|
1082
|
+
expiredAt: string | null;
|
|
1083
|
+
cancelledAt: string | null;
|
|
1084
|
+
completedAt: string | null;
|
|
1085
|
+
redeemedAt: string | null;
|
|
1086
|
+
createdAt: string;
|
|
1087
|
+
updatedAt: string;
|
|
1088
|
+
} | null;
|
|
974
1089
|
};
|
|
975
1090
|
outputFormat: "json";
|
|
976
1091
|
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
1092
|
+
} | {
|
|
1093
|
+
input: {
|
|
1094
|
+
param: {
|
|
1095
|
+
id: string;
|
|
1096
|
+
};
|
|
1097
|
+
};
|
|
1098
|
+
output: {
|
|
1099
|
+
error: string;
|
|
1100
|
+
};
|
|
1101
|
+
outputFormat: "json";
|
|
1102
|
+
status: 400;
|
|
977
1103
|
};
|
|
978
1104
|
};
|
|
979
1105
|
} & {
|
|
980
|
-
"/:id/
|
|
1106
|
+
"/:id/complete": {
|
|
981
1107
|
$post: {
|
|
982
1108
|
input: {
|
|
983
1109
|
param: {
|
|
@@ -1000,6 +1126,82 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
1000
1126
|
};
|
|
1001
1127
|
outputFormat: "json";
|
|
1002
1128
|
status: 409;
|
|
1129
|
+
} | {
|
|
1130
|
+
input: {
|
|
1131
|
+
param: {
|
|
1132
|
+
id: string;
|
|
1133
|
+
};
|
|
1134
|
+
};
|
|
1135
|
+
output: {
|
|
1136
|
+
data: {
|
|
1137
|
+
id: string;
|
|
1138
|
+
bookingNumber: string;
|
|
1139
|
+
status: "cancelled" | "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired";
|
|
1140
|
+
personId: string | null;
|
|
1141
|
+
organizationId: string | null;
|
|
1142
|
+
sourceType: "internal" | "reseller" | "direct" | "manual" | "affiliate" | "ota" | "api_partner";
|
|
1143
|
+
externalBookingRef: string | null;
|
|
1144
|
+
communicationLanguage: string | null;
|
|
1145
|
+
contactFirstName: string | null;
|
|
1146
|
+
contactLastName: string | null;
|
|
1147
|
+
contactEmail: string | null;
|
|
1148
|
+
contactPhone: string | null;
|
|
1149
|
+
contactPreferredLanguage: string | null;
|
|
1150
|
+
contactCountry: string | null;
|
|
1151
|
+
contactRegion: string | null;
|
|
1152
|
+
contactCity: string | null;
|
|
1153
|
+
contactAddressLine1: string | null;
|
|
1154
|
+
contactPostalCode: string | null;
|
|
1155
|
+
sellCurrency: string;
|
|
1156
|
+
baseCurrency: string | null;
|
|
1157
|
+
fxRateSetId: string | null;
|
|
1158
|
+
sellAmountCents: number | null;
|
|
1159
|
+
baseSellAmountCents: number | null;
|
|
1160
|
+
costAmountCents: number | null;
|
|
1161
|
+
baseCostAmountCents: number | null;
|
|
1162
|
+
marginPercent: number | null;
|
|
1163
|
+
startDate: string | null;
|
|
1164
|
+
endDate: string | null;
|
|
1165
|
+
pax: number | null;
|
|
1166
|
+
internalNotes: string | null;
|
|
1167
|
+
holdExpiresAt: string | null;
|
|
1168
|
+
confirmedAt: string | null;
|
|
1169
|
+
expiredAt: string | null;
|
|
1170
|
+
cancelledAt: string | null;
|
|
1171
|
+
completedAt: string | null;
|
|
1172
|
+
redeemedAt: string | null;
|
|
1173
|
+
createdAt: string;
|
|
1174
|
+
updatedAt: string;
|
|
1175
|
+
} | null;
|
|
1176
|
+
};
|
|
1177
|
+
outputFormat: "json";
|
|
1178
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
1179
|
+
} | {
|
|
1180
|
+
input: {
|
|
1181
|
+
param: {
|
|
1182
|
+
id: string;
|
|
1183
|
+
};
|
|
1184
|
+
};
|
|
1185
|
+
output: {
|
|
1186
|
+
error: string;
|
|
1187
|
+
};
|
|
1188
|
+
outputFormat: "json";
|
|
1189
|
+
status: 400;
|
|
1190
|
+
};
|
|
1191
|
+
};
|
|
1192
|
+
} & {
|
|
1193
|
+
"/:id/override-status": {
|
|
1194
|
+
$post: {
|
|
1195
|
+
input: {
|
|
1196
|
+
param: {
|
|
1197
|
+
id: string;
|
|
1198
|
+
};
|
|
1199
|
+
};
|
|
1200
|
+
output: {
|
|
1201
|
+
error: string;
|
|
1202
|
+
};
|
|
1203
|
+
outputFormat: "json";
|
|
1204
|
+
status: 404;
|
|
1003
1205
|
} | {
|
|
1004
1206
|
input: {
|
|
1005
1207
|
param: {
|
|
@@ -1881,7 +2083,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
1881
2083
|
id: string;
|
|
1882
2084
|
bookingId: string;
|
|
1883
2085
|
actorId: string | null;
|
|
1884
|
-
activityType: "booking_created" | "booking_reserved" | "booking_converted" | "booking_confirmed" | "hold_extended" | "hold_expired" | "status_change" | "item_update" | "allocation_released" | "fulfillment_issued" | "fulfillment_updated" | "redemption_recorded" | "supplier_update" | "passenger_update" | "note_added";
|
|
2086
|
+
activityType: "booking_created" | "booking_reserved" | "booking_converted" | "booking_confirmed" | "booking_started" | "booking_completed" | "hold_extended" | "hold_expired" | "status_change" | "status_overridden" | "item_update" | "allocation_released" | "fulfillment_issued" | "fulfillment_updated" | "redemption_recorded" | "supplier_update" | "passenger_update" | "note_added";
|
|
1885
2087
|
description: string;
|
|
1886
2088
|
metadata: {
|
|
1887
2089
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
@@ -1910,7 +2112,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
1910
2112
|
metadata: {
|
|
1911
2113
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
1912
2114
|
} | null;
|
|
1913
|
-
kind: "other" | "shared_room";
|
|
2115
|
+
kind: "other" | "shared_room" | "cruise_party";
|
|
1914
2116
|
label: string;
|
|
1915
2117
|
primaryBookingId: string | null;
|
|
1916
2118
|
optionUnitId: string | null;
|
|
@@ -2114,7 +2316,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
2114
2316
|
metadata: {
|
|
2115
2317
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
2116
2318
|
} | null;
|
|
2117
|
-
kind: "other" | "shared_room";
|
|
2319
|
+
kind: "other" | "shared_room" | "cruise_party";
|
|
2118
2320
|
label: string;
|
|
2119
2321
|
primaryBookingId: string | null;
|
|
2120
2322
|
optionUnitId: string | null;
|
|
@@ -2140,7 +2342,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
2140
2342
|
metadata: {
|
|
2141
2343
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
2142
2344
|
} | null;
|
|
2143
|
-
kind: "other" | "shared_room";
|
|
2345
|
+
kind: "other" | "shared_room" | "cruise_party";
|
|
2144
2346
|
label: string;
|
|
2145
2347
|
primaryBookingId: string | null;
|
|
2146
2348
|
optionUnitId: string | null;
|
|
@@ -2225,7 +2427,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
2225
2427
|
metadata: {
|
|
2226
2428
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
2227
2429
|
} | null;
|
|
2228
|
-
kind: "other" | "shared_room";
|
|
2430
|
+
kind: "other" | "shared_room" | "cruise_party";
|
|
2229
2431
|
label: string;
|
|
2230
2432
|
primaryBookingId: string | null;
|
|
2231
2433
|
optionUnitId: string | null;
|
|
@@ -2263,7 +2465,7 @@ export declare const bookingRoutes: import("hono/hono-base").HonoBase<Env, ({
|
|
|
2263
2465
|
metadata: {
|
|
2264
2466
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
2265
2467
|
} | null;
|
|
2266
|
-
kind: "other" | "shared_room";
|
|
2468
|
+
kind: "other" | "shared_room" | "cruise_party";
|
|
2267
2469
|
label: string;
|
|
2268
2470
|
primaryBookingId: string | null;
|
|
2269
2471
|
optionUnitId: string | null;
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAuM7C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDA27Ba,CAAA;AAEvC,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAA;AAChD,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
|
package/dist/routes.js
CHANGED
|
@@ -8,7 +8,7 @@ import { bookingPiiAccessLog } from "./schema.js";
|
|
|
8
8
|
import { bookingsService } from "./service.js";
|
|
9
9
|
import { bookingGroupsService } from "./service-groups.js";
|
|
10
10
|
import { publicBookingsService, resolveSessionPricingSnapshot } from "./service-public.js";
|
|
11
|
-
import { bookingAggregatesQuerySchema, bookingListQuerySchema, cancelBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingItemSchema, insertBookingItemTravelerSchema, insertBookingNoteSchema, insertSupplierStatusSchema, insertTravelerSchema, internalBookingOverviewLookupQuerySchema, pricingPreviewSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, updateBookingFulfillmentSchema, updateBookingItemSchema, updateBookingSchema,
|
|
11
|
+
import { bookingAggregatesQuerySchema, bookingListQuerySchema, cancelBookingSchema, completeBookingSchema, confirmBookingSchema, convertProductSchema, createBookingSchema, expireBookingSchema, expireStaleBookingsSchema, extendBookingHoldSchema, insertBookingDocumentSchema, insertBookingFulfillmentSchema, insertBookingItemSchema, insertBookingItemTravelerSchema, insertBookingNoteSchema, insertSupplierStatusSchema, insertTravelerSchema, internalBookingOverviewLookupQuerySchema, overrideBookingStatusSchema, pricingPreviewSchema, recordBookingRedemptionSchema, reserveBookingFromTransactionSchema, reserveBookingSchema, startBookingSchema, updateBookingFulfillmentSchema, updateBookingItemSchema, updateBookingSchema, updateSupplierStatusSchema, updateTravelerSchema, upsertTravelerTravelDetailsSchema, } from "./validation.js";
|
|
12
12
|
function hasPiiScope(scopes, action) {
|
|
13
13
|
if (!scopes || scopes.length === 0) {
|
|
14
14
|
return false;
|
|
@@ -315,20 +315,6 @@ export const bookingRoutes = new Hono()
|
|
|
315
315
|
// ==========================================================================
|
|
316
316
|
// Status
|
|
317
317
|
// ==========================================================================
|
|
318
|
-
// 7. PATCH /:id/status — Change booking status
|
|
319
|
-
.patch("/:id/status", async (c) => {
|
|
320
|
-
const result = await bookingsService.updateBookingStatus(c.get("db"), c.req.param("id"), await parseJsonBody(c, updateBookingStatusSchema), c.get("userId"), { eventBus: c.get("eventBus") });
|
|
321
|
-
if (result.status === "not_found") {
|
|
322
|
-
return c.json({ error: "Booking not found" }, 404);
|
|
323
|
-
}
|
|
324
|
-
if (result.status === "invalid_transition") {
|
|
325
|
-
return c.json({ error: "Invalid booking status transition" }, 409);
|
|
326
|
-
}
|
|
327
|
-
if ("booking" in result) {
|
|
328
|
-
return c.json({ data: result.booking });
|
|
329
|
-
}
|
|
330
|
-
return c.json({ error: "Unable to update booking status" }, 400);
|
|
331
|
-
})
|
|
332
318
|
// 8. POST /:id/confirm — Confirm an on-hold booking
|
|
333
319
|
.post("/:id/confirm", async (c) => {
|
|
334
320
|
const result = await bookingsService.confirmBooking(c.get("db"), c.req.param("id"), await parseJsonBody(c, confirmBookingSchema), c.get("userId"), { eventBus: c.get("eventBus") });
|
|
@@ -394,6 +380,48 @@ export const bookingRoutes = new Hono()
|
|
|
394
380
|
return c.json({ data: result.booking });
|
|
395
381
|
}
|
|
396
382
|
return c.json({ error: "Unable to cancel booking" }, 400);
|
|
383
|
+
})
|
|
384
|
+
// 11a. POST /:id/start — Mark a confirmed booking as in-progress
|
|
385
|
+
.post("/:id/start", async (c) => {
|
|
386
|
+
const result = await bookingsService.startBooking(c.get("db"), c.req.param("id"), await parseJsonBody(c, startBookingSchema), c.get("userId"), { eventBus: c.get("eventBus") });
|
|
387
|
+
if (result.status === "not_found") {
|
|
388
|
+
return c.json({ error: "Booking not found" }, 404);
|
|
389
|
+
}
|
|
390
|
+
if (result.status === "invalid_transition") {
|
|
391
|
+
return c.json({ error: "Booking is not in a confirmed state" }, 409);
|
|
392
|
+
}
|
|
393
|
+
if ("booking" in result) {
|
|
394
|
+
return c.json({ data: result.booking });
|
|
395
|
+
}
|
|
396
|
+
return c.json({ error: "Unable to start booking" }, 400);
|
|
397
|
+
})
|
|
398
|
+
// 11b. POST /:id/complete — Mark an in-progress booking as completed
|
|
399
|
+
.post("/:id/complete", async (c) => {
|
|
400
|
+
const result = await bookingsService.completeBooking(c.get("db"), c.req.param("id"), await parseJsonBody(c, completeBookingSchema), c.get("userId"), { eventBus: c.get("eventBus") });
|
|
401
|
+
if (result.status === "not_found") {
|
|
402
|
+
return c.json({ error: "Booking not found" }, 404);
|
|
403
|
+
}
|
|
404
|
+
if (result.status === "invalid_transition") {
|
|
405
|
+
return c.json({ error: "Booking is not in an in-progress state" }, 409);
|
|
406
|
+
}
|
|
407
|
+
if ("booking" in result) {
|
|
408
|
+
return c.json({ data: result.booking });
|
|
409
|
+
}
|
|
410
|
+
return c.json({ error: "Unable to complete booking" }, 400);
|
|
411
|
+
})
|
|
412
|
+
// 11c. POST /:id/override-status — Admin override that bypasses the
|
|
413
|
+
// transition graph. Updates the booking row only — no cascade to items,
|
|
414
|
+
// allocations, or fulfillments. Always emits booking.status_overridden for
|
|
415
|
+
// audit. Requires a non-empty `reason`.
|
|
416
|
+
.post("/:id/override-status", async (c) => {
|
|
417
|
+
const result = await bookingsService.overrideBookingStatus(c.get("db"), c.req.param("id"), await parseJsonBody(c, overrideBookingStatusSchema), c.get("userId"), { eventBus: c.get("eventBus") });
|
|
418
|
+
if (result.status === "not_found") {
|
|
419
|
+
return c.json({ error: "Booking not found" }, 404);
|
|
420
|
+
}
|
|
421
|
+
if ("booking" in result) {
|
|
422
|
+
return c.json({ data: result.booking });
|
|
423
|
+
}
|
|
424
|
+
return c.json({ error: "Unable to override booking status" }, 400);
|
|
397
425
|
})
|
|
398
426
|
// 12. GET /:id/allocations — List booking allocations
|
|
399
427
|
.get("/:id/allocations", async (c) => {
|
package/dist/schema-groups.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const bookingGroupKindEnum: import("drizzle-orm/pg-core").PgEnum<["shared_room", "other"]>;
|
|
1
|
+
export declare const bookingGroupKindEnum: import("drizzle-orm/pg-core").PgEnum<["shared_room", "cruise_party", "other"]>;
|
|
2
2
|
export declare const bookingGroupMemberRoleEnum: import("drizzle-orm/pg-core").PgEnum<["primary", "shared"]>;
|
|
3
3
|
export declare const bookingGroups: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
4
|
name: "booking_groups";
|
|
@@ -26,14 +26,14 @@ export declare const bookingGroups: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
26
26
|
tableName: "booking_groups";
|
|
27
27
|
dataType: "string";
|
|
28
28
|
columnType: "PgEnumColumn";
|
|
29
|
-
data: "other" | "shared_room";
|
|
29
|
+
data: "other" | "shared_room" | "cruise_party";
|
|
30
30
|
driverParam: string;
|
|
31
31
|
notNull: true;
|
|
32
32
|
hasDefault: true;
|
|
33
33
|
isPrimaryKey: false;
|
|
34
34
|
isAutoincrement: false;
|
|
35
35
|
hasRuntimeDefault: false;
|
|
36
|
-
enumValues: ["shared_room", "other"];
|
|
36
|
+
enumValues: ["shared_room", "cruise_party", "other"];
|
|
37
37
|
baseColumn: never;
|
|
38
38
|
identity: undefined;
|
|
39
39
|
generated: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-groups.d.ts","sourceRoot":"","sources":["../src/schema-groups.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"schema-groups.d.ts","sourceRoot":"","sources":["../src/schema-groups.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,gFAI/B,CAAA;AAEF,eAAO,MAAM,0BAA0B,6DAA6D,CAAA;AAEpG,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBzB,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB/B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,aAAa,CAAC,YAAY,CAAA;AAC5D,MAAM,MAAM,eAAe,GAAG,OAAO,aAAa,CAAC,YAAY,CAAA;AAC/D,MAAM,MAAM,kBAAkB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAA;AACxE,MAAM,MAAM,qBAAqB,GAAG,OAAO,mBAAmB,CAAC,YAAY,CAAA"}
|
package/dist/schema-groups.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
2
2
|
import { index, jsonb, pgEnum, pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
|
|
3
3
|
import { bookings } from "./schema-core";
|
|
4
|
-
export const bookingGroupKindEnum = pgEnum("booking_group_kind", [
|
|
4
|
+
export const bookingGroupKindEnum = pgEnum("booking_group_kind", [
|
|
5
|
+
"shared_room",
|
|
6
|
+
"cruise_party",
|
|
7
|
+
"other",
|
|
8
|
+
]);
|
|
5
9
|
export const bookingGroupMemberRoleEnum = pgEnum("booking_group_member_role", ["primary", "shared"]);
|
|
6
10
|
export const bookingGroups = pgTable("booking_groups", {
|
|
7
11
|
id: typeId("booking_groups"),
|
|
@@ -269,14 +269,14 @@ export declare const bookingActivityLog: import("drizzle-orm/pg-core").PgTableWi
|
|
|
269
269
|
tableName: "booking_activity_log";
|
|
270
270
|
dataType: "string";
|
|
271
271
|
columnType: "PgEnumColumn";
|
|
272
|
-
data: "booking_created" | "booking_reserved" | "booking_converted" | "booking_confirmed" | "hold_extended" | "hold_expired" | "status_change" | "item_update" | "allocation_released" | "fulfillment_issued" | "fulfillment_updated" | "redemption_recorded" | "supplier_update" | "passenger_update" | "note_added";
|
|
272
|
+
data: "booking_created" | "booking_reserved" | "booking_converted" | "booking_confirmed" | "booking_started" | "booking_completed" | "hold_extended" | "hold_expired" | "status_change" | "status_overridden" | "item_update" | "allocation_released" | "fulfillment_issued" | "fulfillment_updated" | "redemption_recorded" | "supplier_update" | "passenger_update" | "note_added";
|
|
273
273
|
driverParam: string;
|
|
274
274
|
notNull: true;
|
|
275
275
|
hasDefault: false;
|
|
276
276
|
isPrimaryKey: false;
|
|
277
277
|
isAutoincrement: false;
|
|
278
278
|
hasRuntimeDefault: false;
|
|
279
|
-
enumValues: ["booking_created", "booking_reserved", "booking_converted", "booking_confirmed", "hold_extended", "hold_expired", "status_change", "item_update", "allocation_released", "fulfillment_issued", "fulfillment_updated", "redemption_recorded", "supplier_update", "passenger_update", "note_added"];
|
|
279
|
+
enumValues: ["booking_created", "booking_reserved", "booking_converted", "booking_confirmed", "booking_started", "booking_completed", "hold_extended", "hold_expired", "status_change", "status_overridden", "item_update", "allocation_released", "fulfillment_issued", "fulfillment_updated", "redemption_recorded", "supplier_update", "passenger_update", "note_added"];
|
|
280
280
|
baseColumn: never;
|
|
281
281
|
identity: undefined;
|
|
282
282
|
generated: undefined;
|
package/dist/schema-shared.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const bookingStatusEnum: import("drizzle-orm/pg-core").PgEnum<["draft", "on_hold", "confirmed", "in_progress", "completed", "expired", "cancelled"]>;
|
|
2
2
|
export declare const supplierConfirmationStatusEnum: import("drizzle-orm/pg-core").PgEnum<["pending", "confirmed", "rejected", "cancelled"]>;
|
|
3
|
-
export declare const bookingActivityTypeEnum: import("drizzle-orm/pg-core").PgEnum<["booking_created", "booking_reserved", "booking_converted", "booking_confirmed", "hold_extended", "hold_expired", "status_change", "item_update", "allocation_released", "fulfillment_issued", "fulfillment_updated", "redemption_recorded", "supplier_update", "passenger_update", "note_added"]>;
|
|
3
|
+
export declare const bookingActivityTypeEnum: import("drizzle-orm/pg-core").PgEnum<["booking_created", "booking_reserved", "booking_converted", "booking_confirmed", "booking_started", "booking_completed", "hold_extended", "hold_expired", "status_change", "status_overridden", "item_update", "allocation_released", "fulfillment_issued", "fulfillment_updated", "redemption_recorded", "supplier_update", "passenger_update", "note_added"]>;
|
|
4
4
|
export declare const bookingDocumentTypeEnum: import("drizzle-orm/pg-core").PgEnum<["visa", "insurance", "health", "passport_copy", "other"]>;
|
|
5
5
|
export declare const bookingSourceTypeEnum: import("drizzle-orm/pg-core").PgEnum<["direct", "manual", "affiliate", "ota", "reseller", "api_partner", "internal"]>;
|
|
6
6
|
export declare const bookingParticipantTypeEnum: import("drizzle-orm/pg-core").PgEnum<["traveler", "occupant", "other"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-shared.d.ts","sourceRoot":"","sources":["../src/schema-shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,6HAQ5B,CAAA;AAEF,eAAO,MAAM,8BAA8B,yFAKzC,CAAA;AAEF,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"schema-shared.d.ts","sourceRoot":"","sources":["../src/schema-shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,6HAQ5B,CAAA;AAEF,eAAO,MAAM,8BAA8B,yFAKzC,CAAA;AAEF,eAAO,MAAM,uBAAuB,uYAmBlC,CAAA;AAEF,eAAO,MAAM,uBAAuB,iGAMlC,CAAA;AAEF,eAAO,MAAM,qBAAqB,uHAQhC,CAAA;AAEF,eAAO,MAAM,0BAA0B,yEAIrC,CAAA;AAEF,eAAO,MAAM,2BAA2B,uFAMtC,CAAA;AAEF,eAAO,MAAM,mBAAmB,mJAW9B,CAAA;AAEF,eAAO,MAAM,qBAAqB,8GAOhC,CAAA;AAEF,eAAO,MAAM,yBAAyB,sEAIpC,CAAA;AAEF,eAAO,MAAM,2BAA2B,8GAOtC,CAAA;AAEF,eAAO,MAAM,0BAA0B,6GAQrC,CAAA;AAEF,eAAO,MAAM,qCAAqC,uFAGjD,CAAA;AAED,eAAO,MAAM,4BAA4B,8FAMvC,CAAA;AAEF,eAAO,MAAM,2BAA2B,0EAKtC,CAAA;AAEF,eAAO,MAAM,8BAA8B,wFAKzC,CAAA;AAEF,eAAO,MAAM,8BAA8B,qEAGzC,CAAA;AAEF,eAAO,MAAM,0BAA0B,oEAIrC,CAAA;AAEF,eAAO,MAAM,2BAA2B,6DAGtC,CAAA"}
|
package/dist/schema-shared.js
CHANGED
|
@@ -19,9 +19,12 @@ export const bookingActivityTypeEnum = pgEnum("booking_activity_type", [
|
|
|
19
19
|
"booking_reserved",
|
|
20
20
|
"booking_converted",
|
|
21
21
|
"booking_confirmed",
|
|
22
|
+
"booking_started",
|
|
23
|
+
"booking_completed",
|
|
22
24
|
"hold_extended",
|
|
23
25
|
"hold_expired",
|
|
24
26
|
"status_change",
|
|
27
|
+
"status_overridden",
|
|
25
28
|
"item_update",
|
|
26
29
|
"allocation_released",
|
|
27
30
|
"fulfillment_issued",
|