@voyantjs/transactions 0.1.0 → 0.1.1
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/booking-extension.d.ts.map +1 -1
- package/dist/booking-extension.js +2 -5
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/pii.d.ts +1 -1
- package/dist/pii.d.ts.map +1 -1
- package/dist/pii.js +4 -4
- package/dist/routes.d.ts +6 -6
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +11 -4
- package/dist/service.d.ts +9 -9
- package/package.json +10 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking-extension.d.ts","sourceRoot":"","sources":["../src/booking-extension.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAG1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"booking-extension.d.ts","sourceRoot":"","sources":["../src/booking-extension.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAG1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUrC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,OAAO,yBAAyB,CAAC,YAAY,CAAA;AACpF,MAAM,MAAM,2BAA2B,GAAG,OAAO,yBAAyB,CAAC,YAAY,CAAA;AAIvF,QAAA,MAAM,8BAA8B;;;iBAGlC,CAAA;AAIF,eAAO,MAAM,kCAAkC;YAC/B,kBAAkB,aAAa,MAAM;;;;;;;eAU7C,kBAAkB,aACX,MAAM,QACX,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC;;;;;;;eAqBrC,kBAAkB,aAAa,MAAM;;;CAOvD,CAAA;AAiDD,eAAO,MAAM,4BAA4B,EAAE,aAG1C,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { index, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
2
1
|
import { eq } from "drizzle-orm";
|
|
2
|
+
import { index, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
3
3
|
import { Hono } from "hono";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
// ---------- schema ----------
|
|
@@ -9,10 +9,7 @@ export const bookingTransactionDetails = pgTable("booking_transaction_details",
|
|
|
9
9
|
orderId: text("order_id"),
|
|
10
10
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
11
11
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
12
|
-
}, (t) => [
|
|
13
|
-
index("idx_btd_offer").on(t.offerId),
|
|
14
|
-
index("idx_btd_order").on(t.orderId),
|
|
15
|
-
]);
|
|
12
|
+
}, (t) => [index("idx_btd_offer").on(t.offerId), index("idx_btd_order").on(t.orderId)]);
|
|
16
13
|
// ---------- validation ----------
|
|
17
14
|
const bookingTransactionDetailSchema = z.object({
|
|
18
15
|
offerId: z.string().optional().nullable(),
|
package/dist/index.d.ts
CHANGED
|
@@ -11,11 +11,11 @@ export declare const transactionsLinkable: {
|
|
|
11
11
|
};
|
|
12
12
|
export declare const transactionsModule: Module;
|
|
13
13
|
export declare const transactionsHonoModule: HonoModule;
|
|
14
|
-
export
|
|
15
|
-
export { offerItemParticipants, offerItems, offerParticipants, offerStatusEnum, offers, orderItemParticipants, orderItems, orderParticipants, orderStatusEnum, orders, orderTermAcceptanceStatusEnum, orderTerms, orderTermTypeEnum, transactionPiiAccessActionEnum, transactionPiiAccessLog, transactionPiiAccessOutcomeEnum, transactionItemParticipantRoleEnum, transactionItemStatusEnum, transactionItemTypeEnum, transactionParticipantTypeEnum, transactionTravelerCategoryEnum, } from "./schema.js";
|
|
16
|
-
export { insertOfferItemParticipantSchema, insertOfferItemSchema, insertOfferParticipantSchema, insertOfferSchema, insertOrderItemParticipantSchema, insertOrderItemSchema, insertOrderParticipantSchema, insertOrderSchema, insertOrderTermSchema, offerItemListQuerySchema, offerItemParticipantListQuerySchema, offerListQuerySchema, offerParticipantListQuerySchema, offerStatusSchema, orderItemListQuerySchema, orderItemParticipantListQuerySchema, orderListQuerySchema, orderParticipantListQuerySchema, orderStatusSchema, orderTermAcceptanceStatusSchema, orderTermListQuerySchema, orderTermTypeSchema, transactionItemParticipantRoleSchema, transactionItemStatusSchema, transactionItemTypeSchema, transactionParticipantTypeSchema, transactionTravelerCategorySchema, updateOfferItemParticipantSchema, updateOfferItemSchema, updateOfferParticipantSchema, updateOfferSchema, updateOrderItemParticipantSchema, updateOrderItemSchema, updateOrderParticipantSchema, updateOrderSchema, updateOrderTermSchema, } from "./validation.js";
|
|
14
|
+
export { transactionsBookingExtension } from "./booking-extension.js";
|
|
17
15
|
export type { DecryptedTransactionParticipantIdentity, TransactionParticipantIdentity, TransactionParticipantIdentityEnvelope, } from "./schema/participant-identity.js";
|
|
18
16
|
export { decryptedTransactionParticipantIdentitySchema, transactionParticipantIdentityEnvelopeSchema, transactionParticipantIdentitySchema, } from "./schema/participant-identity.js";
|
|
17
|
+
export type { NewOffer, NewOfferItem, NewOfferItemParticipant, NewOfferParticipant, NewOrder, NewOrderItem, NewOrderItemParticipant, NewOrderParticipant, NewOrderTerm, Offer, OfferItem, OfferItemParticipant, OfferParticipant, Order, OrderItem, OrderItemParticipant, OrderParticipant, OrderTerm, } from "./schema.js";
|
|
18
|
+
export { offerItemParticipants, offerItems, offerParticipants, offerStatusEnum, offers, orderItemParticipants, orderItems, orderParticipants, orderStatusEnum, orders, orderTermAcceptanceStatusEnum, orderTerms, orderTermTypeEnum, transactionItemParticipantRoleEnum, transactionItemStatusEnum, transactionItemTypeEnum, transactionParticipantTypeEnum, transactionPiiAccessActionEnum, transactionPiiAccessLog, transactionPiiAccessOutcomeEnum, transactionTravelerCategoryEnum, } from "./schema.js";
|
|
19
|
+
export { insertOfferItemParticipantSchema, insertOfferItemSchema, insertOfferParticipantSchema, insertOfferSchema, insertOrderItemParticipantSchema, insertOrderItemSchema, insertOrderParticipantSchema, insertOrderSchema, insertOrderTermSchema, offerItemListQuerySchema, offerItemParticipantListQuerySchema, offerListQuerySchema, offerParticipantListQuerySchema, offerStatusSchema, orderItemListQuerySchema, orderItemParticipantListQuerySchema, orderListQuerySchema, orderParticipantListQuerySchema, orderStatusSchema, orderTermAcceptanceStatusSchema, orderTermListQuerySchema, orderTermTypeSchema, transactionItemParticipantRoleSchema, transactionItemStatusSchema, transactionItemTypeSchema, transactionParticipantTypeSchema, transactionTravelerCategorySchema, updateOfferItemParticipantSchema, updateOfferItemSchema, updateOfferParticipantSchema, updateOfferSchema, updateOrderItemParticipantSchema, updateOrderItemSchema, updateOrderParticipantSchema, updateOrderSchema, updateOrderTermSchema, } from "./validation.js";
|
|
19
20
|
export { transactionsService };
|
|
20
|
-
export { transactionsBookingExtension } from "./booking-extension.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,kBAAkB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE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GACV,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,MAAM,EACN,qBAAqB,EACrB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,MAAM,EACN,6BAA6B,EAC7B,UAAU,EACV,iBAAiB,EACjB,kCAAkC,EAClC,yBAAyB,EACzB,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,gCAAgC,EAChC,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,gCAAgC,EAChC,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,mCAAmC,EACnC,oBAAoB,EACpB,+BAA+B,EAC/B,iBAAiB,EACjB,wBAAwB,EACxB,mCAAmC,EACnC,oBAAoB,EACpB,+BAA+B,EAC/B,iBAAiB,EACjB,+BAA+B,EAC/B,wBAAwB,EACxB,mBAAmB,EACnB,oCAAoC,EACpC,2BAA2B,EAC3B,yBAAyB,EACzB,gCAAgC,EAChC,iCAAiC,EACjC,gCAAgC,EAChC,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,gCAAgC,EAChC,qBAAqB,EACrB,4BAA4B,EAC5B,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -25,8 +25,8 @@ export const transactionsHonoModule = {
|
|
|
25
25
|
module: transactionsModule,
|
|
26
26
|
routes: transactionsRoutes,
|
|
27
27
|
};
|
|
28
|
-
export {
|
|
29
|
-
export { insertOfferItemParticipantSchema, insertOfferItemSchema, insertOfferParticipantSchema, insertOfferSchema, insertOrderItemParticipantSchema, insertOrderItemSchema, insertOrderParticipantSchema, insertOrderSchema, insertOrderTermSchema, offerItemListQuerySchema, offerItemParticipantListQuerySchema, offerListQuerySchema, offerParticipantListQuerySchema, offerStatusSchema, orderItemListQuerySchema, orderItemParticipantListQuerySchema, orderListQuerySchema, orderParticipantListQuerySchema, orderStatusSchema, orderTermAcceptanceStatusSchema, orderTermListQuerySchema, orderTermTypeSchema, transactionItemParticipantRoleSchema, transactionItemStatusSchema, transactionItemTypeSchema, transactionParticipantTypeSchema, transactionTravelerCategorySchema, updateOfferItemParticipantSchema, updateOfferItemSchema, updateOfferParticipantSchema, updateOfferSchema, updateOrderItemParticipantSchema, updateOrderItemSchema, updateOrderParticipantSchema, updateOrderSchema, updateOrderTermSchema, } from "./validation.js";
|
|
28
|
+
export { transactionsBookingExtension } from "./booking-extension.js";
|
|
30
29
|
export { decryptedTransactionParticipantIdentitySchema, transactionParticipantIdentityEnvelopeSchema, transactionParticipantIdentitySchema, } from "./schema/participant-identity.js";
|
|
30
|
+
export { offerItemParticipants, offerItems, offerParticipants, offerStatusEnum, offers, orderItemParticipants, orderItems, orderParticipants, orderStatusEnum, orders, orderTermAcceptanceStatusEnum, orderTerms, orderTermTypeEnum, transactionItemParticipantRoleEnum, transactionItemStatusEnum, transactionItemTypeEnum, transactionParticipantTypeEnum, transactionPiiAccessActionEnum, transactionPiiAccessLog, transactionPiiAccessOutcomeEnum, transactionTravelerCategoryEnum, } from "./schema.js";
|
|
31
|
+
export { insertOfferItemParticipantSchema, insertOfferItemSchema, insertOfferParticipantSchema, insertOfferSchema, insertOrderItemParticipantSchema, insertOrderItemSchema, insertOrderParticipantSchema, insertOrderSchema, insertOrderTermSchema, offerItemListQuerySchema, offerItemParticipantListQuerySchema, offerListQuerySchema, offerParticipantListQuerySchema, offerStatusSchema, orderItemListQuerySchema, orderItemParticipantListQuerySchema, orderListQuerySchema, orderParticipantListQuerySchema, orderStatusSchema, orderTermAcceptanceStatusSchema, orderTermListQuerySchema, orderTermTypeSchema, transactionItemParticipantRoleSchema, transactionItemStatusSchema, transactionItemTypeSchema, transactionParticipantTypeSchema, transactionTravelerCategorySchema, updateOfferItemParticipantSchema, updateOfferItemSchema, updateOfferParticipantSchema, updateOfferSchema, updateOrderItemParticipantSchema, updateOrderItemSchema, updateOrderParticipantSchema, updateOrderSchema, updateOrderTermSchema, } from "./validation.js";
|
|
31
32
|
export { transactionsService };
|
|
32
|
-
export { transactionsBookingExtension } from "./booking-extension.js";
|
package/dist/pii.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { KeyRef, KmsProvider } from "@voyantjs/utils";
|
|
1
2
|
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
2
|
-
import type { KmsProvider, KeyRef } from "@voyantjs/utils";
|
|
3
3
|
import { type DecryptedTransactionParticipantIdentity } from "./schema/participant-identity.js";
|
|
4
4
|
export interface UpsertTransactionParticipantIdentityInput {
|
|
5
5
|
dateOfBirth?: string | null;
|
package/dist/pii.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pii.d.ts","sourceRoot":"","sources":["../src/pii.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pii.d.ts","sourceRoot":"","sources":["../src/pii.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,EACL,KAAK,uCAAuC,EAG7C,MAAM,kCAAkC,CAAA;AAQzC,MAAM,WAAW,yCAAyC;IACxD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACpC,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,OAAO,GAAG,OAAO,CAAA;IAClC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,4BAA4B;IAC3C,GAAG,EAAE,WAAW,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpE;AA6DD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,4BAA4B;+BAKvE,kBAAkB,mBACL,OAAO,GAAG,OAAO,iBACnB,MAAM,YACX,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,uCAAuC,GAAG,IAAI,CAAC;kCA2BpD,kBAAkB,mBACL,OAAO,GAAG,OAAO,iBACnB,MAAM,SACd,yCAAyC,YACtC,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,uCAAuC,GAAG,IAAI,CAAC;kCA+BpD,kBAAkB,mBACL,OAAO,GAAG,OAAO,iBACnB,MAAM,YACX,MAAM,GAAG,IAAI;;;;EAuB5B"}
|
package/dist/pii.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { decryptOptionalJsonEnvelope, encryptOptionalJsonEnvelope } from "@voyantjs/utils";
|
|
1
2
|
import { eq } from "drizzle-orm";
|
|
2
|
-
import { decryptOptionalJsonEnvelope, encryptOptionalJsonEnvelope, } from "@voyantjs/utils";
|
|
3
|
-
import { offerParticipants, orderParticipants, } from "./schema.js";
|
|
4
3
|
import { decryptedTransactionParticipantIdentitySchema, transactionParticipantIdentitySchema, } from "./schema/participant-identity.js";
|
|
4
|
+
import { offerParticipants, orderParticipants, } from "./schema.js";
|
|
5
5
|
function buildIdentityPayload(input) {
|
|
6
6
|
const payload = transactionParticipantIdentitySchema.parse({
|
|
7
7
|
dateOfBirth: input.dateOfBirth ?? null,
|
|
@@ -24,7 +24,7 @@ async function getOfferParticipant(db, participantId) {
|
|
|
24
24
|
.from(offerParticipants)
|
|
25
25
|
.where(eq(offerParticipants.id, participantId))
|
|
26
26
|
.limit(1);
|
|
27
|
-
return row ?
|
|
27
|
+
return row ? { ...row, kind: "offer" } : null;
|
|
28
28
|
}
|
|
29
29
|
async function getOrderParticipant(db, participantId) {
|
|
30
30
|
const [row] = await db
|
|
@@ -32,7 +32,7 @@ async function getOrderParticipant(db, participantId) {
|
|
|
32
32
|
.from(orderParticipants)
|
|
33
33
|
.where(eq(orderParticipants.id, participantId))
|
|
34
34
|
.limit(1);
|
|
35
|
-
return row ?
|
|
35
|
+
return row ? { ...row, kind: "order" } : null;
|
|
36
36
|
}
|
|
37
37
|
async function findParticipant(db, participantKind, participantId) {
|
|
38
38
|
return participantKind === "offer"
|
package/dist/routes.d.ts
CHANGED
|
@@ -90,9 +90,9 @@ export declare const transactionsRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
90
90
|
data: {
|
|
91
91
|
createdAt: string;
|
|
92
92
|
updatedAt: string;
|
|
93
|
-
id: string;
|
|
94
93
|
currency: string;
|
|
95
94
|
notes: string | null;
|
|
95
|
+
id: string;
|
|
96
96
|
offerNumber: string;
|
|
97
97
|
title: string;
|
|
98
98
|
status: "draft" | "published" | "sent" | "accepted" | "expired" | "withdrawn" | "converted";
|
|
@@ -631,8 +631,8 @@ export declare const transactionsRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
631
631
|
createdAt: string;
|
|
632
632
|
updatedAt: string;
|
|
633
633
|
description: string | null;
|
|
634
|
-
id: string;
|
|
635
634
|
notes: string | null;
|
|
635
|
+
id: string;
|
|
636
636
|
title: string;
|
|
637
637
|
status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
|
|
638
638
|
taxAmountCents: number | null;
|
|
@@ -819,10 +819,10 @@ export declare const transactionsRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
819
819
|
output: {
|
|
820
820
|
data: {
|
|
821
821
|
createdAt: string;
|
|
822
|
+
participantId: string;
|
|
822
823
|
id: string;
|
|
823
824
|
isPrimary: boolean;
|
|
824
825
|
offerItemId: string;
|
|
825
|
-
participantId: string;
|
|
826
826
|
role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
|
|
827
827
|
} | null;
|
|
828
828
|
};
|
|
@@ -973,9 +973,9 @@ export declare const transactionsRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
973
973
|
offerId: string | null;
|
|
974
974
|
createdAt: string;
|
|
975
975
|
updatedAt: string;
|
|
976
|
-
id: string;
|
|
977
976
|
currency: string;
|
|
978
977
|
notes: string | null;
|
|
978
|
+
id: string;
|
|
979
979
|
title: string;
|
|
980
980
|
status: "draft" | "expired" | "pending" | "confirmed" | "fulfilled" | "cancelled";
|
|
981
981
|
personId: string | null;
|
|
@@ -1514,8 +1514,8 @@ export declare const transactionsRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
1514
1514
|
createdAt: string;
|
|
1515
1515
|
updatedAt: string;
|
|
1516
1516
|
description: string | null;
|
|
1517
|
-
id: string;
|
|
1518
1517
|
notes: string | null;
|
|
1518
|
+
id: string;
|
|
1519
1519
|
title: string;
|
|
1520
1520
|
status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
|
|
1521
1521
|
taxAmountCents: number | null;
|
|
@@ -1705,9 +1705,9 @@ export declare const transactionsRoutes: import("hono/hono-base").HonoBase<Env,
|
|
|
1705
1705
|
output: {
|
|
1706
1706
|
data: {
|
|
1707
1707
|
createdAt: string;
|
|
1708
|
+
participantId: string;
|
|
1708
1709
|
id: string;
|
|
1709
1710
|
isPrimary: boolean;
|
|
1710
|
-
participantId: string;
|
|
1711
1711
|
role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
|
|
1712
1712
|
orderItemId: string;
|
|
1713
1713
|
} | null;
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAgpB3B,CAAA;AAEJ,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAA"}
|
package/dist/routes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Hono } from "hono";
|
|
2
1
|
import { createKmsProviderFromEnv } from "@voyantjs/utils";
|
|
2
|
+
import { Hono } from "hono";
|
|
3
3
|
import { createTransactionPiiService } from "./pii.js";
|
|
4
4
|
import { transactionPiiAccessLog } from "./schema.js";
|
|
5
5
|
import { transactionsService } from "./service.js";
|
|
@@ -23,7 +23,10 @@ function hasParticipantIdentityInput(body) {
|
|
|
23
23
|
return "dateOfBirth" in body || "nationality" in body;
|
|
24
24
|
}
|
|
25
25
|
async function logTransactionPiiAccess(c, input) {
|
|
26
|
-
await c
|
|
26
|
+
await c
|
|
27
|
+
.get("db")
|
|
28
|
+
.insert(transactionPiiAccessLog)
|
|
29
|
+
.values({
|
|
27
30
|
participantKind: input.participantKind,
|
|
28
31
|
parentId: input.parentId ?? null,
|
|
29
32
|
participantId: input.participantId ?? null,
|
|
@@ -166,7 +169,9 @@ export const transactionsRoutes = new Hono()
|
|
|
166
169
|
},
|
|
167
170
|
});
|
|
168
171
|
await pii.upsertParticipantIdentity(c.get("db"), "offer", row.id, payload, c.get("userId"));
|
|
169
|
-
return c.json({
|
|
172
|
+
return c.json({
|
|
173
|
+
data: await transactionsService.getOfferParticipantById(c.get("db"), row.id),
|
|
174
|
+
});
|
|
170
175
|
}
|
|
171
176
|
return c.json({ data: row });
|
|
172
177
|
})
|
|
@@ -409,7 +414,9 @@ export const transactionsRoutes = new Hono()
|
|
|
409
414
|
},
|
|
410
415
|
});
|
|
411
416
|
await pii.upsertParticipantIdentity(c.get("db"), "order", row.id, payload, c.get("userId"));
|
|
412
|
-
return c.json({
|
|
417
|
+
return c.json({
|
|
418
|
+
data: await transactionsService.getOrderParticipantById(c.get("db"), row.id),
|
|
419
|
+
});
|
|
413
420
|
}
|
|
414
421
|
return c.json({ data: row });
|
|
415
422
|
})
|
package/dist/service.d.ts
CHANGED
|
@@ -107,9 +107,9 @@ export declare const transactionsService: {
|
|
|
107
107
|
createOffer(db: PostgresJsDatabase, data: CreateOfferInput): Promise<{
|
|
108
108
|
createdAt: Date;
|
|
109
109
|
updatedAt: Date;
|
|
110
|
-
id: string;
|
|
111
110
|
currency: string;
|
|
112
111
|
notes: string | null;
|
|
112
|
+
id: string;
|
|
113
113
|
offerNumber: string;
|
|
114
114
|
title: string;
|
|
115
115
|
status: "draft" | "published" | "sent" | "accepted" | "expired" | "withdrawn" | "converted";
|
|
@@ -137,9 +137,9 @@ export declare const transactionsService: {
|
|
|
137
137
|
offer: {
|
|
138
138
|
createdAt: Date;
|
|
139
139
|
updatedAt: Date;
|
|
140
|
-
id: string;
|
|
141
140
|
currency: string;
|
|
142
141
|
notes: string | null;
|
|
142
|
+
id: string;
|
|
143
143
|
offerNumber: string;
|
|
144
144
|
title: string;
|
|
145
145
|
status: "draft" | "published" | "sent" | "accepted" | "expired" | "withdrawn" | "converted";
|
|
@@ -185,8 +185,8 @@ export declare const transactionsService: {
|
|
|
185
185
|
createdAt: Date;
|
|
186
186
|
updatedAt: Date;
|
|
187
187
|
description: string | null;
|
|
188
|
-
id: string;
|
|
189
188
|
notes: string | null;
|
|
189
|
+
id: string;
|
|
190
190
|
title: string;
|
|
191
191
|
status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
|
|
192
192
|
taxAmountCents: number | null;
|
|
@@ -210,10 +210,10 @@ export declare const transactionsService: {
|
|
|
210
210
|
}[];
|
|
211
211
|
itemParticipants: {
|
|
212
212
|
createdAt: Date;
|
|
213
|
+
participantId: string;
|
|
213
214
|
id: string;
|
|
214
215
|
isPrimary: boolean;
|
|
215
216
|
offerItemId: string;
|
|
216
|
-
participantId: string;
|
|
217
217
|
role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
|
|
218
218
|
}[];
|
|
219
219
|
} | null>;
|
|
@@ -391,8 +391,8 @@ export declare const transactionsService: {
|
|
|
391
391
|
createdAt: Date;
|
|
392
392
|
updatedAt: Date;
|
|
393
393
|
description: string | null;
|
|
394
|
-
id: string;
|
|
395
394
|
notes: string | null;
|
|
395
|
+
id: string;
|
|
396
396
|
title: string;
|
|
397
397
|
status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
|
|
398
398
|
taxAmountCents: number | null;
|
|
@@ -468,10 +468,10 @@ export declare const transactionsService: {
|
|
|
468
468
|
} | null>;
|
|
469
469
|
createOfferItemParticipant(db: PostgresJsDatabase, data: CreateOfferItemParticipantInput): Promise<{
|
|
470
470
|
createdAt: Date;
|
|
471
|
+
participantId: string;
|
|
471
472
|
id: string;
|
|
472
473
|
isPrimary: boolean;
|
|
473
474
|
offerItemId: string;
|
|
474
|
-
participantId: string;
|
|
475
475
|
role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
|
|
476
476
|
} | null>;
|
|
477
477
|
updateOfferItemParticipant(db: PostgresJsDatabase, id: string, data: UpdateOfferItemParticipantInput): Promise<{
|
|
@@ -552,9 +552,9 @@ export declare const transactionsService: {
|
|
|
552
552
|
offerId: string | null;
|
|
553
553
|
createdAt: Date;
|
|
554
554
|
updatedAt: Date;
|
|
555
|
-
id: string;
|
|
556
555
|
currency: string;
|
|
557
556
|
notes: string | null;
|
|
557
|
+
id: string;
|
|
558
558
|
title: string;
|
|
559
559
|
status: "draft" | "expired" | "pending" | "confirmed" | "fulfilled" | "cancelled";
|
|
560
560
|
personId: string | null;
|
|
@@ -753,8 +753,8 @@ export declare const transactionsService: {
|
|
|
753
753
|
createdAt: Date;
|
|
754
754
|
updatedAt: Date;
|
|
755
755
|
description: string | null;
|
|
756
|
-
id: string;
|
|
757
756
|
notes: string | null;
|
|
757
|
+
id: string;
|
|
758
758
|
title: string;
|
|
759
759
|
status: "draft" | "confirmed" | "fulfilled" | "cancelled" | "priced";
|
|
760
760
|
taxAmountCents: number | null;
|
|
@@ -832,9 +832,9 @@ export declare const transactionsService: {
|
|
|
832
832
|
} | null>;
|
|
833
833
|
createOrderItemParticipant(db: PostgresJsDatabase, data: CreateOrderItemParticipantInput): Promise<{
|
|
834
834
|
createdAt: Date;
|
|
835
|
+
participantId: string;
|
|
835
836
|
id: string;
|
|
836
837
|
isPrimary: boolean;
|
|
837
|
-
participantId: string;
|
|
838
838
|
role: "other" | "traveler" | "occupant" | "primary_contact" | "beneficiary" | "service_assignee";
|
|
839
839
|
orderItemId: string;
|
|
840
840
|
} | null>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/transactions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"drizzle-orm": "^0.45.2",
|
|
30
30
|
"hono": "^4.12.10",
|
|
31
31
|
"zod": "^4.3.6",
|
|
32
|
-
"@voyantjs/
|
|
33
|
-
"@voyantjs/
|
|
34
|
-
"@voyantjs/
|
|
35
|
-
"@voyantjs/utils": "0.1.
|
|
32
|
+
"@voyantjs/db": "0.1.1",
|
|
33
|
+
"@voyantjs/hono": "0.1.1",
|
|
34
|
+
"@voyantjs/core": "0.1.1",
|
|
35
|
+
"@voyantjs/utils": "0.1.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"typescript": "^6.0.2",
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://github.com/voyantjs/voyant.git",
|
|
50
|
+
"directory": "packages/transactions"
|
|
51
|
+
},
|
|
47
52
|
"scripts": {
|
|
48
53
|
"typecheck": "tsc --noEmit",
|
|
49
54
|
"lint": "biome check src/",
|