@voyantjs/transactions 0.6.7 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/pii.d.ts +16 -9
- package/dist/pii.d.ts.map +1 -1
- package/dist/pii.js +76 -70
- package/dist/routes-offers.d.ts +462 -28
- package/dist/routes-offers.d.ts.map +1 -1
- package/dist/routes-offers.js +199 -84
- package/dist/routes-orders.d.ts +461 -27
- package/dist/routes-orders.d.ts.map +1 -1
- package/dist/routes-orders.js +199 -84
- package/dist/routes-shared.d.ts +20 -13
- package/dist/routes-shared.d.ts.map +1 -1
- package/dist/routes-shared.js +7 -6
- package/dist/schema/participant-identity.d.ts +43 -6
- package/dist/schema/participant-identity.d.ts.map +1 -1
- package/dist/schema/participant-identity.js +12 -5
- package/dist/schema-audit.d.ts +4 -4
- package/dist/schema-audit.js +3 -3
- package/dist/schema-contacts.d.ts +529 -0
- package/dist/schema-contacts.d.ts.map +1 -0
- package/dist/schema-contacts.js +57 -0
- package/dist/schema-offers.d.ts +177 -3
- package/dist/schema-offers.d.ts.map +1 -1
- package/dist/schema-offers.js +26 -15
- package/dist/schema-orders.d.ts +177 -3
- package/dist/schema-orders.d.ts.map +1 -1
- package/dist/schema-orders.js +31 -20
- package/dist/schema-relations.d.ts +24 -0
- package/dist/schema-relations.d.ts.map +1 -1
- package/dist/schema-relations.js +40 -2
- package/dist/schema-shared.d.ts +3 -1
- package/dist/schema-shared.d.ts.map +1 -1
- package/dist/schema-shared.js +8 -2
- package/dist/schema-staff.d.ts +529 -0
- package/dist/schema-staff.d.ts.map +1 -0
- package/dist/schema-staff.js +57 -0
- package/dist/schema.d.ts +2 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +2 -0
- package/dist/service-offers.d.ts +275 -29
- package/dist/service-offers.d.ts.map +1 -1
- package/dist/service-offers.js +306 -43
- package/dist/service-orders.d.ts +227 -25
- package/dist/service-orders.d.ts.map +1 -1
- package/dist/service-orders.js +127 -22
- package/dist/service-shared.d.ts +144 -22
- package/dist/service-shared.d.ts.map +1 -1
- package/dist/service-shared.js +30 -2
- package/dist/service.d.ts +62 -22
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +42 -2
- package/dist/storefront-offers.d.ts +39 -5
- package/dist/storefront-offers.d.ts.map +1 -1
- package/dist/storefront-offers.js +3 -3
- package/dist/validation.d.ts +674 -36
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +186 -29
- package/package.json +5 -5
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const offersRelations: import("drizzle-orm").Relations<"offers", {
|
|
2
2
|
participants: import("drizzle-orm").Many<"offer_participants">;
|
|
3
|
+
contactAssignments: import("drizzle-orm").Many<"offer_contact_assignments">;
|
|
4
|
+
staffAssignments: import("drizzle-orm").Many<"offer_staff_assignments">;
|
|
3
5
|
items: import("drizzle-orm").Many<"offer_items">;
|
|
4
6
|
orders: import("drizzle-orm").Many<"orders">;
|
|
5
7
|
terms: import("drizzle-orm").Many<"order_terms">;
|
|
@@ -11,6 +13,8 @@ export declare const offerParticipantsRelations: import("drizzle-orm").Relations
|
|
|
11
13
|
export declare const offerItemsRelations: import("drizzle-orm").Relations<"offer_items", {
|
|
12
14
|
offer: import("drizzle-orm").One<"offers", true>;
|
|
13
15
|
participants: import("drizzle-orm").Many<"offer_item_participants">;
|
|
16
|
+
contactAssignments: import("drizzle-orm").Many<"offer_contact_assignments">;
|
|
17
|
+
staffAssignments: import("drizzle-orm").Many<"offer_staff_assignments">;
|
|
14
18
|
}>;
|
|
15
19
|
export declare const offerItemParticipantsRelations: import("drizzle-orm").Relations<"offer_item_participants", {
|
|
16
20
|
offerItem: import("drizzle-orm").One<"offer_items", true>;
|
|
@@ -19,6 +23,8 @@ export declare const offerItemParticipantsRelations: import("drizzle-orm").Relat
|
|
|
19
23
|
export declare const ordersRelations: import("drizzle-orm").Relations<"orders", {
|
|
20
24
|
offer: import("drizzle-orm").One<"offers", false>;
|
|
21
25
|
participants: import("drizzle-orm").Many<"order_participants">;
|
|
26
|
+
contactAssignments: import("drizzle-orm").Many<"order_contact_assignments">;
|
|
27
|
+
staffAssignments: import("drizzle-orm").Many<"order_staff_assignments">;
|
|
22
28
|
items: import("drizzle-orm").Many<"order_items">;
|
|
23
29
|
terms: import("drizzle-orm").Many<"order_terms">;
|
|
24
30
|
}>;
|
|
@@ -30,6 +36,8 @@ export declare const orderItemsRelations: import("drizzle-orm").Relations<"order
|
|
|
30
36
|
order: import("drizzle-orm").One<"orders", true>;
|
|
31
37
|
offerItem: import("drizzle-orm").One<"offer_items", false>;
|
|
32
38
|
participants: import("drizzle-orm").Many<"order_item_participants">;
|
|
39
|
+
contactAssignments: import("drizzle-orm").Many<"order_contact_assignments">;
|
|
40
|
+
staffAssignments: import("drizzle-orm").Many<"order_staff_assignments">;
|
|
33
41
|
}>;
|
|
34
42
|
export declare const orderItemParticipantsRelations: import("drizzle-orm").Relations<"order_item_participants", {
|
|
35
43
|
orderItem: import("drizzle-orm").One<"order_items", true>;
|
|
@@ -39,4 +47,20 @@ export declare const orderTermsRelations: import("drizzle-orm").Relations<"order
|
|
|
39
47
|
offer: import("drizzle-orm").One<"offers", false>;
|
|
40
48
|
order: import("drizzle-orm").One<"orders", false>;
|
|
41
49
|
}>;
|
|
50
|
+
export declare const offerStaffAssignmentsRelations: import("drizzle-orm").Relations<"offer_staff_assignments", {
|
|
51
|
+
offer: import("drizzle-orm").One<"offers", true>;
|
|
52
|
+
offerItem: import("drizzle-orm").One<"offer_items", false>;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const offerContactAssignmentsRelations: import("drizzle-orm").Relations<"offer_contact_assignments", {
|
|
55
|
+
offer: import("drizzle-orm").One<"offers", true>;
|
|
56
|
+
offerItem: import("drizzle-orm").One<"offer_items", false>;
|
|
57
|
+
}>;
|
|
58
|
+
export declare const orderStaffAssignmentsRelations: import("drizzle-orm").Relations<"order_staff_assignments", {
|
|
59
|
+
order: import("drizzle-orm").One<"orders", true>;
|
|
60
|
+
orderItem: import("drizzle-orm").One<"order_items", false>;
|
|
61
|
+
}>;
|
|
62
|
+
export declare const orderContactAssignmentsRelations: import("drizzle-orm").Relations<"order_contact_assignments", {
|
|
63
|
+
order: import("drizzle-orm").One<"orders", true>;
|
|
64
|
+
orderItem: import("drizzle-orm").One<"order_items", false>;
|
|
65
|
+
}>;
|
|
42
66
|
//# sourceMappingURL=schema-relations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-relations.d.ts","sourceRoot":"","sources":["../src/schema-relations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-relations.d.ts","sourceRoot":"","sources":["../src/schema-relations.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,eAAe;;;;;;;EAOzB,CAAA;AAEH,eAAO,MAAM,0BAA0B;;;EAGpC,CAAA;AAEH,eAAO,MAAM,mBAAmB;;;;;EAK7B,CAAA;AAEH,eAAO,MAAM,8BAA8B;;;EASxC,CAAA;AAEH,eAAO,MAAM,eAAe;;;;;;;EAOzB,CAAA;AAEH,eAAO,MAAM,0BAA0B;;;EAGpC,CAAA;AAEH,eAAO,MAAM,mBAAmB;;;;;;EAM7B,CAAA;AAEH,eAAO,MAAM,8BAA8B;;;EASxC,CAAA;AAEH,eAAO,MAAM,mBAAmB;;;EAG7B,CAAA;AAEH,eAAO,MAAM,8BAA8B;;;EAMxC,CAAA;AAEH,eAAO,MAAM,gCAAgC;;;EAM1C,CAAA;AAEH,eAAO,MAAM,8BAA8B;;;EAMxC,CAAA;AAEH,eAAO,MAAM,gCAAgC;;;EAM1C,CAAA"}
|
package/dist/schema-relations.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { relations } from "drizzle-orm";
|
|
2
|
+
import { offerContactAssignments, orderContactAssignments } from "./schema-contacts";
|
|
2
3
|
import { offerItemParticipants, offerItems, offerParticipants, offers } from "./schema-offers";
|
|
3
4
|
import { orderItemParticipants, orderItems, orderParticipants, orders, orderTerms, } from "./schema-orders";
|
|
5
|
+
import { offerStaffAssignments, orderStaffAssignments } from "./schema-staff";
|
|
4
6
|
export const offersRelations = relations(offers, ({ many }) => ({
|
|
5
7
|
participants: many(offerParticipants),
|
|
8
|
+
contactAssignments: many(offerContactAssignments),
|
|
9
|
+
staffAssignments: many(offerStaffAssignments),
|
|
6
10
|
items: many(offerItems),
|
|
7
11
|
orders: many(orders),
|
|
8
12
|
terms: many(orderTerms),
|
|
@@ -14,6 +18,8 @@ export const offerParticipantsRelations = relations(offerParticipants, ({ one, m
|
|
|
14
18
|
export const offerItemsRelations = relations(offerItems, ({ one, many }) => ({
|
|
15
19
|
offer: one(offers, { fields: [offerItems.offerId], references: [offers.id] }),
|
|
16
20
|
participants: many(offerItemParticipants),
|
|
21
|
+
contactAssignments: many(offerContactAssignments),
|
|
22
|
+
staffAssignments: many(offerStaffAssignments),
|
|
17
23
|
}));
|
|
18
24
|
export const offerItemParticipantsRelations = relations(offerItemParticipants, ({ one }) => ({
|
|
19
25
|
offerItem: one(offerItems, {
|
|
@@ -21,13 +27,15 @@ export const offerItemParticipantsRelations = relations(offerItemParticipants, (
|
|
|
21
27
|
references: [offerItems.id],
|
|
22
28
|
}),
|
|
23
29
|
participant: one(offerParticipants, {
|
|
24
|
-
fields: [offerItemParticipants.
|
|
30
|
+
fields: [offerItemParticipants.travelerId],
|
|
25
31
|
references: [offerParticipants.id],
|
|
26
32
|
}),
|
|
27
33
|
}));
|
|
28
34
|
export const ordersRelations = relations(orders, ({ one, many }) => ({
|
|
29
35
|
offer: one(offers, { fields: [orders.offerId], references: [offers.id] }),
|
|
30
36
|
participants: many(orderParticipants),
|
|
37
|
+
contactAssignments: many(orderContactAssignments),
|
|
38
|
+
staffAssignments: many(orderStaffAssignments),
|
|
31
39
|
items: many(orderItems),
|
|
32
40
|
terms: many(orderTerms),
|
|
33
41
|
}));
|
|
@@ -39,6 +47,8 @@ export const orderItemsRelations = relations(orderItems, ({ one, many }) => ({
|
|
|
39
47
|
order: one(orders, { fields: [orderItems.orderId], references: [orders.id] }),
|
|
40
48
|
offerItem: one(offerItems, { fields: [orderItems.offerItemId], references: [offerItems.id] }),
|
|
41
49
|
participants: many(orderItemParticipants),
|
|
50
|
+
contactAssignments: many(orderContactAssignments),
|
|
51
|
+
staffAssignments: many(orderStaffAssignments),
|
|
42
52
|
}));
|
|
43
53
|
export const orderItemParticipantsRelations = relations(orderItemParticipants, ({ one }) => ({
|
|
44
54
|
orderItem: one(orderItems, {
|
|
@@ -46,7 +56,7 @@ export const orderItemParticipantsRelations = relations(orderItemParticipants, (
|
|
|
46
56
|
references: [orderItems.id],
|
|
47
57
|
}),
|
|
48
58
|
participant: one(orderParticipants, {
|
|
49
|
-
fields: [orderItemParticipants.
|
|
59
|
+
fields: [orderItemParticipants.travelerId],
|
|
50
60
|
references: [orderParticipants.id],
|
|
51
61
|
}),
|
|
52
62
|
}));
|
|
@@ -54,3 +64,31 @@ export const orderTermsRelations = relations(orderTerms, ({ one }) => ({
|
|
|
54
64
|
offer: one(offers, { fields: [orderTerms.offerId], references: [offers.id] }),
|
|
55
65
|
order: one(orders, { fields: [orderTerms.orderId], references: [orders.id] }),
|
|
56
66
|
}));
|
|
67
|
+
export const offerStaffAssignmentsRelations = relations(offerStaffAssignments, ({ one }) => ({
|
|
68
|
+
offer: one(offers, { fields: [offerStaffAssignments.offerId], references: [offers.id] }),
|
|
69
|
+
offerItem: one(offerItems, {
|
|
70
|
+
fields: [offerStaffAssignments.offerItemId],
|
|
71
|
+
references: [offerItems.id],
|
|
72
|
+
}),
|
|
73
|
+
}));
|
|
74
|
+
export const offerContactAssignmentsRelations = relations(offerContactAssignments, ({ one }) => ({
|
|
75
|
+
offer: one(offers, { fields: [offerContactAssignments.offerId], references: [offers.id] }),
|
|
76
|
+
offerItem: one(offerItems, {
|
|
77
|
+
fields: [offerContactAssignments.offerItemId],
|
|
78
|
+
references: [offerItems.id],
|
|
79
|
+
}),
|
|
80
|
+
}));
|
|
81
|
+
export const orderStaffAssignmentsRelations = relations(orderStaffAssignments, ({ one }) => ({
|
|
82
|
+
order: one(orders, { fields: [orderStaffAssignments.orderId], references: [orders.id] }),
|
|
83
|
+
orderItem: one(orderItems, {
|
|
84
|
+
fields: [orderStaffAssignments.orderItemId],
|
|
85
|
+
references: [orderItems.id],
|
|
86
|
+
}),
|
|
87
|
+
}));
|
|
88
|
+
export const orderContactAssignmentsRelations = relations(orderContactAssignments, ({ one }) => ({
|
|
89
|
+
order: one(orders, { fields: [orderContactAssignments.orderId], references: [orders.id] }),
|
|
90
|
+
orderItem: one(orderItems, {
|
|
91
|
+
fields: [orderContactAssignments.orderItemId],
|
|
92
|
+
references: [orderItems.id],
|
|
93
|
+
}),
|
|
94
|
+
}));
|
package/dist/schema-shared.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export declare const offerStatusEnum: import("drizzle-orm/pg-core").PgEnum<["draft", "published", "sent", "accepted", "expired", "withdrawn", "converted"]>;
|
|
2
2
|
export declare const orderStatusEnum: import("drizzle-orm/pg-core").PgEnum<["draft", "pending", "confirmed", "fulfilled", "cancelled", "expired"]>;
|
|
3
|
-
export declare const transactionParticipantTypeEnum: import("drizzle-orm/pg-core").PgEnum<["traveler", "
|
|
3
|
+
export declare const transactionParticipantTypeEnum: import("drizzle-orm/pg-core").PgEnum<["traveler", "occupant", "staff", "other"]>;
|
|
4
4
|
export declare const transactionTravelerCategoryEnum: import("drizzle-orm/pg-core").PgEnum<["adult", "child", "infant", "senior", "other"]>;
|
|
5
5
|
export declare const transactionItemTypeEnum: import("drizzle-orm/pg-core").PgEnum<["unit", "service", "extra", "fee", "tax", "discount", "adjustment", "accommodation", "transport", "other"]>;
|
|
6
6
|
export declare const transactionItemStatusEnum: import("drizzle-orm/pg-core").PgEnum<["draft", "priced", "confirmed", "cancelled", "fulfilled"]>;
|
|
7
7
|
export declare const transactionItemParticipantRoleEnum: import("drizzle-orm/pg-core").PgEnum<["traveler", "occupant", "primary_contact", "beneficiary", "service_assignee", "other"]>;
|
|
8
|
+
export declare const transactionContactAssignmentRoleEnum: import("drizzle-orm/pg-core").PgEnum<["primary_contact", "other"]>;
|
|
9
|
+
export declare const transactionStaffAssignmentRoleEnum: import("drizzle-orm/pg-core").PgEnum<["service_assignee", "other"]>;
|
|
8
10
|
export declare const transactionPiiAccessActionEnum: import("drizzle-orm/pg-core").PgEnum<["read", "update", "delete"]>;
|
|
9
11
|
export declare const transactionPiiAccessOutcomeEnum: import("drizzle-orm/pg-core").PgEnum<["allowed", "denied"]>;
|
|
10
12
|
export declare const orderTermTypeEnum: import("drizzle-orm/pg-core").PgEnum<["terms_and_conditions", "cancellation", "guarantee", "payment", "pricing", "commission", "other"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-shared.d.ts","sourceRoot":"","sources":["../src/schema-shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,uHAQ1B,CAAA;AAEF,eAAO,MAAM,eAAe,8GAO1B,CAAA;AAEF,eAAO,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"schema-shared.d.ts","sourceRoot":"","sources":["../src/schema-shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,uHAQ1B,CAAA;AAEF,eAAO,MAAM,eAAe,8GAO1B,CAAA;AAEF,eAAO,MAAM,8BAA8B,kFAKzC,CAAA;AAEF,eAAO,MAAM,+BAA+B,uFAM1C,CAAA;AAEF,eAAO,MAAM,uBAAuB,mJAWlC,CAAA;AAEF,eAAO,MAAM,yBAAyB,kGAMpC,CAAA;AAEF,eAAO,MAAM,kCAAkC,+HAO7C,CAAA;AAEF,eAAO,MAAM,oCAAoC,oEAG/C,CAAA;AAEF,eAAO,MAAM,kCAAkC,qEAG7C,CAAA;AAEF,eAAO,MAAM,8BAA8B,oEAIzC,CAAA;AAEF,eAAO,MAAM,+BAA+B,6DAG1C,CAAA;AAEF,eAAO,MAAM,iBAAiB,0IAQ5B,CAAA;AAEF,eAAO,MAAM,6BAA6B,2FAKxC,CAAA"}
|
package/dist/schema-shared.js
CHANGED
|
@@ -18,8 +18,6 @@ export const orderStatusEnum = pgEnum("order_status", [
|
|
|
18
18
|
]);
|
|
19
19
|
export const transactionParticipantTypeEnum = pgEnum("transaction_participant_type", [
|
|
20
20
|
"traveler",
|
|
21
|
-
"booker",
|
|
22
|
-
"contact",
|
|
23
21
|
"occupant",
|
|
24
22
|
"staff",
|
|
25
23
|
"other",
|
|
@@ -58,6 +56,14 @@ export const transactionItemParticipantRoleEnum = pgEnum("transaction_item_parti
|
|
|
58
56
|
"service_assignee",
|
|
59
57
|
"other",
|
|
60
58
|
]);
|
|
59
|
+
export const transactionContactAssignmentRoleEnum = pgEnum("transaction_contact_assignment_role", [
|
|
60
|
+
"primary_contact",
|
|
61
|
+
"other",
|
|
62
|
+
]);
|
|
63
|
+
export const transactionStaffAssignmentRoleEnum = pgEnum("transaction_staff_assignment_role", [
|
|
64
|
+
"service_assignee",
|
|
65
|
+
"other",
|
|
66
|
+
]);
|
|
61
67
|
export const transactionPiiAccessActionEnum = pgEnum("transaction_pii_access_action", [
|
|
62
68
|
"read",
|
|
63
69
|
"update",
|