@voyantjs/notifications 0.6.8 → 0.7.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/README.md +1 -1
- package/dist/index.d.ts +27 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -4
- package/dist/liquid.d.ts +5 -0
- package/dist/liquid.d.ts.map +1 -0
- package/dist/liquid.js +156 -0
- package/dist/routes.d.ts +88 -2
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +54 -1
- package/dist/schema.d.ts +1 -1
- package/dist/service-booking-documents.d.ts +128 -0
- package/dist/service-booking-documents.d.ts.map +1 -1
- package/dist/service-booking-documents.js +56 -4
- package/dist/service-deliveries.d.ts.map +1 -1
- package/dist/service-deliveries.js +25 -7
- package/dist/service-reminders.d.ts +1 -1
- package/dist/service-reminders.d.ts.map +1 -1
- package/dist/service-reminders.js +98 -78
- package/dist/service-shared.d.ts +48 -3
- package/dist/service-shared.d.ts.map +1 -1
- package/dist/service-shared.js +300 -40
- package/dist/service-templates.d.ts +2 -2
- package/dist/service.d.ts +119 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +4 -1
- package/dist/tasks/deliver-reminder.d.ts +1 -1
- package/dist/template-authoring.d.ts +23 -0
- package/dist/template-authoring.d.ts.map +1 -0
- package/dist/template-authoring.js +386 -0
- package/dist/validation.d.ts +102 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +57 -0
- package/package.json +8 -7
package/dist/service-shared.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { SQLWrapper } from "drizzle-orm/sql";
|
|
|
4
4
|
import type { z } from "zod";
|
|
5
5
|
import type { notificationReminderRules } from "./schema.js";
|
|
6
6
|
import type { NotificationAttachment, NotificationChannel, NotificationPayload, NotificationProvider, NotificationResult } from "./types.js";
|
|
7
|
-
import type { bookingDocumentBundleItemSchema, insertNotificationReminderRuleSchema, insertNotificationTemplateSchema, notificationDeliveryListQuerySchema, notificationReminderRuleListQuerySchema, notificationReminderRunListQuerySchema, notificationReminderRunRecordSchema, notificationTemplateListQuerySchema, runDueRemindersSchema, sendBookingDocumentsNotificationSchema, sendInvoiceNotificationSchema, sendNotificationSchema, sendPaymentSessionNotificationSchema, updateNotificationReminderRuleSchema, updateNotificationTemplateSchema } from "./validation.js";
|
|
7
|
+
import type { bookingDocumentBundleItemSchema, insertNotificationReminderRuleSchema, insertNotificationTemplateSchema, notificationDeliveryListQuerySchema, notificationReminderRuleListQuerySchema, notificationReminderRunListQuerySchema, notificationReminderRunRecordSchema, notificationTemplateListQuerySchema, previewNotificationTemplateSchema, runDueRemindersSchema, sendBookingDocumentsNotificationSchema, sendInvoiceNotificationSchema, sendNotificationSchema, sendPaymentSessionNotificationSchema, updateNotificationReminderRuleSchema, updateNotificationTemplateSchema } from "./validation.js";
|
|
8
8
|
export type NotificationTemplateListQuery = z.infer<typeof notificationTemplateListQuerySchema>;
|
|
9
9
|
export type NotificationDeliveryListQuery = z.infer<typeof notificationDeliveryListQuerySchema>;
|
|
10
10
|
export type CreateNotificationTemplateInput = z.infer<typeof insertNotificationTemplateSchema>;
|
|
@@ -16,6 +16,7 @@ export type NotificationReminderRunRecord = z.infer<typeof notificationReminderR
|
|
|
16
16
|
export type CreateNotificationReminderRuleInput = z.infer<typeof insertNotificationReminderRuleSchema>;
|
|
17
17
|
export type UpdateNotificationReminderRuleInput = z.infer<typeof updateNotificationReminderRuleSchema>;
|
|
18
18
|
export type RunDueRemindersInput = z.infer<typeof runDueRemindersSchema>;
|
|
19
|
+
export type PreviewNotificationTemplateInput = z.infer<typeof previewNotificationTemplateSchema>;
|
|
19
20
|
export type SendPaymentSessionNotificationInput = z.infer<typeof sendPaymentSessionNotificationSchema>;
|
|
20
21
|
export type SendInvoiceNotificationInput = z.infer<typeof sendInvoiceNotificationSchema>;
|
|
21
22
|
export type SendBookingDocumentsNotificationInput = z.infer<typeof sendBookingDocumentsNotificationSchema>;
|
|
@@ -51,12 +52,55 @@ export declare function summarizeNotificationAttachments(attachments: ReadonlyAr
|
|
|
51
52
|
contentId: string | null;
|
|
52
53
|
}[];
|
|
53
54
|
export declare function renderNotificationTemplate(template: string | null | undefined, data: Record<string, unknown>): string | null;
|
|
55
|
+
export declare function previewNotificationTemplate(input: PreviewNotificationTemplateInput): {
|
|
56
|
+
channel: "email" | "sms";
|
|
57
|
+
provider: string | null;
|
|
58
|
+
fromAddress: string | null;
|
|
59
|
+
subject: string | null;
|
|
60
|
+
html: string | null;
|
|
61
|
+
text: string | null;
|
|
62
|
+
};
|
|
54
63
|
export declare function toTimestamp(value?: string | null): Date | null;
|
|
64
|
+
export declare function normalizeNotificationTemplateData(data: Record<string, unknown>): {
|
|
65
|
+
traveler: unknown;
|
|
66
|
+
travelers: unknown[];
|
|
67
|
+
billingPerson: unknown;
|
|
68
|
+
billing: unknown;
|
|
69
|
+
booking: unknown;
|
|
70
|
+
invoice: unknown;
|
|
71
|
+
paymentSession: unknown;
|
|
72
|
+
paymentSchedule: unknown;
|
|
73
|
+
payment: {
|
|
74
|
+
amount: {} | null;
|
|
75
|
+
currency: {} | null;
|
|
76
|
+
dueDate: {} | null;
|
|
77
|
+
daysLeft: {} | null;
|
|
78
|
+
reference: {} | null;
|
|
79
|
+
method: {} | null;
|
|
80
|
+
link: {} | null;
|
|
81
|
+
payMode: {} | null;
|
|
82
|
+
paidAmount: {} | null;
|
|
83
|
+
balanceDue: {} | null;
|
|
84
|
+
isPaidInFull: boolean;
|
|
85
|
+
} | null;
|
|
86
|
+
documents: unknown[];
|
|
87
|
+
documentsCount: number;
|
|
88
|
+
items: unknown[];
|
|
89
|
+
product: {
|
|
90
|
+
title: {} | null;
|
|
91
|
+
} | null;
|
|
92
|
+
};
|
|
55
93
|
export declare function startOfUtcDay(value: Date): Date;
|
|
56
94
|
export declare function addUtcDays(value: Date, days: number): Date;
|
|
57
95
|
export declare function toDateString(value: Date): string;
|
|
58
96
|
export declare function buildReminderDedupeKey(ruleId: string, targetId: string, runDate: string): string;
|
|
59
|
-
export declare function resolveReminderRecipient(
|
|
97
|
+
export declare function resolveReminderRecipient(booking: {
|
|
98
|
+
contactFirstName: string | null;
|
|
99
|
+
contactLastName: string | null;
|
|
100
|
+
contactEmail: string | null;
|
|
101
|
+
contactPhone: string | null;
|
|
102
|
+
contactPreferredLanguage: string | null;
|
|
103
|
+
} | null, participants: Array<{
|
|
60
104
|
email: string | null;
|
|
61
105
|
isPrimary: boolean;
|
|
62
106
|
participantType: string;
|
|
@@ -74,9 +118,10 @@ export declare function listBookingNotificationParticipants(db: PostgresJsDataba
|
|
|
74
118
|
firstName: string;
|
|
75
119
|
lastName: string;
|
|
76
120
|
email: string | null;
|
|
77
|
-
participantType: "
|
|
121
|
+
participantType: "other" | "traveler" | "occupant";
|
|
78
122
|
isPrimary: boolean;
|
|
79
123
|
}[]>;
|
|
124
|
+
export declare function listBookingNotificationItems(db: PostgresJsDatabase, bookingId: string): Promise<unknown[]>;
|
|
80
125
|
export declare function paginate<T>(rowsPromise: Promise<T[]>, totalPromise: Promise<Array<{
|
|
81
126
|
total: number;
|
|
82
127
|
}>>, limit: number, offset: number): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-shared.d.ts","sourceRoot":"","sources":["../src/service-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"service-shared.d.ts","sourceRoot":"","sources":["../src/service-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAA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B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAA;CACxC,GAAG,IAAI,EACR,YAAY,EAAE,KAAK,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC;WALO,MAAM,GAAG,IAAI;eACT,OAAO;qBACD,MAAM;eACZ,MAAM;cACP,MAAM;SAmCnB;AAED,wBAAsB,mCAAmC,CACvD,EAAE,EAAE,kBAAkB,EACtB,SAAS,EAAE,MAAM;;;;;;;KAclB;AAED,wBAAsB,4BAA4B,CAAC,EAAE,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,sBAkB3F;AAED,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,WAAW,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EACzB,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,EAC/C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM;;;;;GASf;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC,kDAGtF"}
|
package/dist/service-shared.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bookingItems, bookingTravelers } from "@voyantjs/bookings/schema";
|
|
2
2
|
import { and, desc, eq } from "drizzle-orm";
|
|
3
|
+
import { renderLiquidTemplate } from "./liquid.js";
|
|
3
4
|
export class NotificationError extends Error {
|
|
4
5
|
constructor(message) {
|
|
5
6
|
super(message);
|
|
@@ -48,35 +49,265 @@ export function summarizeNotificationAttachments(attachments) {
|
|
|
48
49
|
contentId: attachment.contentId ?? null,
|
|
49
50
|
}));
|
|
50
51
|
}
|
|
51
|
-
function resolveMustachePath(path, scope) {
|
|
52
|
-
const parts = path.match(/[^.[\]]+/g) ?? [];
|
|
53
|
-
let current = scope;
|
|
54
|
-
for (const part of parts) {
|
|
55
|
-
if (current == null || typeof current !== "object")
|
|
56
|
-
return undefined;
|
|
57
|
-
current = current[part];
|
|
58
|
-
}
|
|
59
|
-
return current;
|
|
60
|
-
}
|
|
61
|
-
function stringifyRenderedValue(value) {
|
|
62
|
-
if (value == null)
|
|
63
|
-
return "";
|
|
64
|
-
if (typeof value === "string")
|
|
65
|
-
return value;
|
|
66
|
-
if (typeof value === "number" || typeof value === "boolean")
|
|
67
|
-
return String(value);
|
|
68
|
-
return JSON.stringify(value);
|
|
69
|
-
}
|
|
70
52
|
export function renderNotificationTemplate(template, data) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
return renderLiquidTemplate(template, normalizeNotificationTemplateData(data));
|
|
54
|
+
}
|
|
55
|
+
export function previewNotificationTemplate(input) {
|
|
56
|
+
const data = normalizeNotificationTemplateData(input.data ?? {});
|
|
57
|
+
return {
|
|
58
|
+
channel: input.channel,
|
|
59
|
+
provider: input.provider ?? null,
|
|
60
|
+
fromAddress: input.fromAddress ?? null,
|
|
61
|
+
subject: renderNotificationTemplate(input.subjectTemplate, data),
|
|
62
|
+
html: renderNotificationTemplate(input.htmlTemplate, data),
|
|
63
|
+
text: renderNotificationTemplate(input.textTemplate, data),
|
|
64
|
+
};
|
|
76
65
|
}
|
|
77
66
|
export function toTimestamp(value) {
|
|
78
67
|
return value ? new Date(value) : null;
|
|
79
68
|
}
|
|
69
|
+
function centsToAmount(value) {
|
|
70
|
+
if (typeof value !== "number")
|
|
71
|
+
return null;
|
|
72
|
+
return value / 100;
|
|
73
|
+
}
|
|
74
|
+
function buildFullName(firstName, lastName) {
|
|
75
|
+
return [firstName, lastName]
|
|
76
|
+
.map((part) => (typeof part === "string" ? part.trim() : ""))
|
|
77
|
+
.filter(Boolean)
|
|
78
|
+
.join(" ");
|
|
79
|
+
}
|
|
80
|
+
function parseDate(value) {
|
|
81
|
+
if (!value)
|
|
82
|
+
return null;
|
|
83
|
+
const date = value instanceof Date ? value : new Date(String(value));
|
|
84
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
85
|
+
}
|
|
86
|
+
function dateDiffInDays(from, to) {
|
|
87
|
+
const diff = to.getTime() - from.getTime();
|
|
88
|
+
return Math.ceil(diff / (24 * 60 * 60 * 1000));
|
|
89
|
+
}
|
|
90
|
+
function enrichTraveler(value) {
|
|
91
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
92
|
+
return value;
|
|
93
|
+
const traveler = value;
|
|
94
|
+
const fullName = buildFullName(traveler.firstName, traveler.lastName);
|
|
95
|
+
return {
|
|
96
|
+
...traveler,
|
|
97
|
+
fullName: fullName || null,
|
|
98
|
+
name: fullName || null,
|
|
99
|
+
role: traveler.participantType ?? null,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function enrichBooking(value) {
|
|
103
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
104
|
+
return value;
|
|
105
|
+
const booking = value;
|
|
106
|
+
const bookingNumber = typeof booking.bookingNumber === "string"
|
|
107
|
+
? booking.bookingNumber
|
|
108
|
+
: typeof booking.reference === "string"
|
|
109
|
+
? booking.reference
|
|
110
|
+
: typeof booking.code === "string"
|
|
111
|
+
? booking.code
|
|
112
|
+
: typeof booking.number === "string"
|
|
113
|
+
? booking.number
|
|
114
|
+
: null;
|
|
115
|
+
const currency = typeof booking.currency === "string"
|
|
116
|
+
? booking.currency
|
|
117
|
+
: typeof booking.sellCurrency === "string"
|
|
118
|
+
? booking.sellCurrency
|
|
119
|
+
: null;
|
|
120
|
+
const totalAmount = centsToAmount(booking.totalAmountCents) ??
|
|
121
|
+
centsToAmount(booking.sellAmountCents) ??
|
|
122
|
+
(typeof booking.totalAmount === "number" ? booking.totalAmount : null);
|
|
123
|
+
const startDate = parseDate(booking.startDate);
|
|
124
|
+
const endDate = parseDate(booking.endDate);
|
|
125
|
+
const dateRange = startDate && endDate
|
|
126
|
+
? `${startDate.toISOString().slice(0, 10)} - ${endDate.toISOString().slice(0, 10)}`
|
|
127
|
+
: null;
|
|
128
|
+
return {
|
|
129
|
+
...booking,
|
|
130
|
+
code: bookingNumber,
|
|
131
|
+
number: bookingNumber,
|
|
132
|
+
reference: bookingNumber,
|
|
133
|
+
currency,
|
|
134
|
+
total: totalAmount,
|
|
135
|
+
totalAmount,
|
|
136
|
+
totalPrice: totalAmount,
|
|
137
|
+
dateRange,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function enrichInvoice(value) {
|
|
141
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
142
|
+
return value;
|
|
143
|
+
const invoice = value;
|
|
144
|
+
return {
|
|
145
|
+
...invoice,
|
|
146
|
+
number: typeof invoice.number === "string"
|
|
147
|
+
? invoice.number
|
|
148
|
+
: typeof invoice.invoiceNumber === "string"
|
|
149
|
+
? invoice.invoiceNumber
|
|
150
|
+
: null,
|
|
151
|
+
type: typeof invoice.type === "string"
|
|
152
|
+
? invoice.type
|
|
153
|
+
: typeof invoice.invoiceType === "string"
|
|
154
|
+
? invoice.invoiceType
|
|
155
|
+
: null,
|
|
156
|
+
subtotalAmount: centsToAmount(invoice.subtotalCents) ??
|
|
157
|
+
(typeof invoice.subtotalAmount === "number" ? invoice.subtotalAmount : null),
|
|
158
|
+
taxAmount: centsToAmount(invoice.taxCents) ??
|
|
159
|
+
(typeof invoice.taxAmount === "number" ? invoice.taxAmount : null),
|
|
160
|
+
totalAmount: centsToAmount(invoice.totalCents) ??
|
|
161
|
+
(typeof invoice.totalAmount === "number" ? invoice.totalAmount : null),
|
|
162
|
+
paidAmount: centsToAmount(invoice.paidCents) ??
|
|
163
|
+
(typeof invoice.paidAmount === "number" ? invoice.paidAmount : null),
|
|
164
|
+
balanceDueAmount: centsToAmount(invoice.balanceDueCents) ??
|
|
165
|
+
(typeof invoice.balanceDueAmount === "number" ? invoice.balanceDueAmount : null),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function enrichPaymentSession(value) {
|
|
169
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
170
|
+
return value;
|
|
171
|
+
const session = value;
|
|
172
|
+
return {
|
|
173
|
+
...session,
|
|
174
|
+
amount: centsToAmount(session.amountCents) ??
|
|
175
|
+
(typeof session.amount === "number" ? session.amount : null),
|
|
176
|
+
paymentUrl: typeof session.paymentUrl === "string"
|
|
177
|
+
? session.paymentUrl
|
|
178
|
+
: typeof session.redirectUrl === "string"
|
|
179
|
+
? session.redirectUrl
|
|
180
|
+
: null,
|
|
181
|
+
reference: typeof session.reference === "string"
|
|
182
|
+
? session.reference
|
|
183
|
+
: typeof session.externalReference === "string"
|
|
184
|
+
? session.externalReference
|
|
185
|
+
: null,
|
|
186
|
+
method: typeof session.method === "string"
|
|
187
|
+
? session.method
|
|
188
|
+
: typeof session.paymentMethod === "string"
|
|
189
|
+
? session.paymentMethod
|
|
190
|
+
: null,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function enrichPaymentSchedule(value) {
|
|
194
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
195
|
+
return value;
|
|
196
|
+
const schedule = value;
|
|
197
|
+
const dueDate = parseDate(schedule.dueDate);
|
|
198
|
+
const today = new Date();
|
|
199
|
+
return {
|
|
200
|
+
...schedule,
|
|
201
|
+
amountDue: centsToAmount(schedule.amountCents) ??
|
|
202
|
+
(typeof schedule.amountDue === "number" ? schedule.amountDue : null),
|
|
203
|
+
type: typeof schedule.type === "string"
|
|
204
|
+
? schedule.type
|
|
205
|
+
: typeof schedule.scheduleType === "string"
|
|
206
|
+
? schedule.scheduleType
|
|
207
|
+
: null,
|
|
208
|
+
daysLeft: dueDate ? dateDiffInDays(today, dueDate) : null,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function enrichDocument(value) {
|
|
212
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
213
|
+
return value;
|
|
214
|
+
return value;
|
|
215
|
+
}
|
|
216
|
+
function enrichBookingItem(value) {
|
|
217
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
218
|
+
return value;
|
|
219
|
+
const item = value;
|
|
220
|
+
return {
|
|
221
|
+
...item,
|
|
222
|
+
description: typeof item.description === "string" && item.description.trim().length > 0
|
|
223
|
+
? item.description
|
|
224
|
+
: typeof item.title === "string"
|
|
225
|
+
? item.title
|
|
226
|
+
: null,
|
|
227
|
+
currency: typeof item.currency === "string"
|
|
228
|
+
? item.currency
|
|
229
|
+
: typeof item.sellCurrency === "string"
|
|
230
|
+
? item.sellCurrency
|
|
231
|
+
: null,
|
|
232
|
+
unitPrice: centsToAmount(item.unitSellAmountCents) ??
|
|
233
|
+
(typeof item.unitPrice === "number" ? item.unitPrice : null),
|
|
234
|
+
total: centsToAmount(item.totalSellAmountCents) ??
|
|
235
|
+
(typeof item.total === "number" ? item.total : null),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
export function normalizeNotificationTemplateData(data) {
|
|
239
|
+
const traveler = enrichTraveler(data.traveler);
|
|
240
|
+
const travelers = Array.isArray(data.travelers)
|
|
241
|
+
? data.travelers.map((entry) => enrichTraveler(entry))
|
|
242
|
+
: traveler
|
|
243
|
+
? [traveler]
|
|
244
|
+
: [];
|
|
245
|
+
const booking = enrichBooking(data.booking);
|
|
246
|
+
const invoice = enrichInvoice(data.invoice);
|
|
247
|
+
const paymentSession = enrichPaymentSession(data.paymentSession);
|
|
248
|
+
const paymentSchedule = enrichPaymentSchedule(data.paymentSchedule);
|
|
249
|
+
const documents = Array.isArray(data.documents)
|
|
250
|
+
? data.documents.map((document) => enrichDocument(document))
|
|
251
|
+
: [];
|
|
252
|
+
const items = Array.isArray(data.items) ? data.items.map((item) => enrichBookingItem(item)) : [];
|
|
253
|
+
const payment = paymentSchedule && typeof paymentSchedule === "object"
|
|
254
|
+
? {
|
|
255
|
+
amount: paymentSchedule.amountDue ?? null,
|
|
256
|
+
currency: paymentSchedule.currency ?? null,
|
|
257
|
+
dueDate: paymentSchedule.dueDate ?? null,
|
|
258
|
+
daysLeft: paymentSchedule.daysLeft ?? null,
|
|
259
|
+
reference: booking?.reference ??
|
|
260
|
+
invoice?.number ??
|
|
261
|
+
null,
|
|
262
|
+
method: paymentSession?.method ??
|
|
263
|
+
paymentSession?.provider ??
|
|
264
|
+
null,
|
|
265
|
+
link: paymentSession?.paymentUrl ?? null,
|
|
266
|
+
payMode: paymentSchedule.type ?? null,
|
|
267
|
+
paidAmount: invoice?.paidAmount ?? null,
|
|
268
|
+
balanceDue: invoice?.balanceDueAmount ?? null,
|
|
269
|
+
isPaidInFull: invoice?.balanceDueAmount === 0,
|
|
270
|
+
}
|
|
271
|
+
: paymentSession && typeof paymentSession === "object"
|
|
272
|
+
? {
|
|
273
|
+
amount: paymentSession.amount ?? null,
|
|
274
|
+
currency: paymentSession.currency ?? null,
|
|
275
|
+
dueDate: null,
|
|
276
|
+
daysLeft: null,
|
|
277
|
+
reference: paymentSession.reference ?? null,
|
|
278
|
+
method: paymentSession.method ?? null,
|
|
279
|
+
link: paymentSession.paymentUrl ?? null,
|
|
280
|
+
payMode: null,
|
|
281
|
+
paidAmount: null,
|
|
282
|
+
balanceDue: invoice?.balanceDueAmount ?? null,
|
|
283
|
+
isPaidInFull: invoice?.balanceDueAmount ===
|
|
284
|
+
0,
|
|
285
|
+
}
|
|
286
|
+
: null;
|
|
287
|
+
const product = items.length > 0 && items[0] && typeof items[0] === "object"
|
|
288
|
+
? {
|
|
289
|
+
title: items[0].title ??
|
|
290
|
+
items[0].description ??
|
|
291
|
+
null,
|
|
292
|
+
}
|
|
293
|
+
: null;
|
|
294
|
+
return {
|
|
295
|
+
...data,
|
|
296
|
+
traveler,
|
|
297
|
+
travelers,
|
|
298
|
+
billingPerson: traveler,
|
|
299
|
+
billing: traveler,
|
|
300
|
+
booking,
|
|
301
|
+
invoice,
|
|
302
|
+
paymentSession,
|
|
303
|
+
paymentSchedule,
|
|
304
|
+
payment,
|
|
305
|
+
documents,
|
|
306
|
+
documentsCount: documents.length,
|
|
307
|
+
items,
|
|
308
|
+
product,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
80
311
|
export function startOfUtcDay(value) {
|
|
81
312
|
return new Date(Date.UTC(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate()));
|
|
82
313
|
}
|
|
@@ -89,37 +320,66 @@ export function toDateString(value) {
|
|
|
89
320
|
export function buildReminderDedupeKey(ruleId, targetId, runDate) {
|
|
90
321
|
return `${ruleId}:${targetId}:${runDate}`;
|
|
91
322
|
}
|
|
92
|
-
export function resolveReminderRecipient(participants) {
|
|
93
|
-
|
|
323
|
+
export function resolveReminderRecipient(booking, participants) {
|
|
324
|
+
if (booking?.contactEmail) {
|
|
325
|
+
return {
|
|
326
|
+
email: booking.contactEmail,
|
|
327
|
+
firstName: booking.contactFirstName ?? "",
|
|
328
|
+
lastName: booking.contactLastName ?? "",
|
|
329
|
+
participantType: "booking_contact",
|
|
330
|
+
isPrimary: true,
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
const withEmail = participants.filter((traveler) => traveler.email);
|
|
94
334
|
if (withEmail.length === 0) {
|
|
95
335
|
return null;
|
|
96
336
|
}
|
|
97
|
-
const
|
|
337
|
+
const nonStaffWithEmail = withEmail.filter((traveler) => traveler.participantType !== "staff");
|
|
338
|
+
const primary = nonStaffWithEmail.find((traveler) => traveler.isPrimary) ??
|
|
339
|
+
withEmail.find((traveler) => traveler.isPrimary);
|
|
98
340
|
if (primary) {
|
|
99
341
|
return primary;
|
|
100
342
|
}
|
|
101
|
-
const preferredTypes = ["
|
|
343
|
+
const preferredTypes = ["traveler", "occupant", "other"];
|
|
102
344
|
for (const type of preferredTypes) {
|
|
103
|
-
const match =
|
|
345
|
+
const match = nonStaffWithEmail.find((traveler) => traveler.participantType === type);
|
|
104
346
|
if (match) {
|
|
105
347
|
return match;
|
|
106
348
|
}
|
|
107
349
|
}
|
|
108
|
-
return withEmail[0] ?? null;
|
|
350
|
+
return nonStaffWithEmail[0] ?? withEmail[0] ?? null;
|
|
109
351
|
}
|
|
110
352
|
export async function listBookingNotificationParticipants(db, bookingId) {
|
|
111
353
|
return db
|
|
112
354
|
.select({
|
|
113
|
-
id:
|
|
114
|
-
firstName:
|
|
115
|
-
lastName:
|
|
116
|
-
email:
|
|
117
|
-
participantType:
|
|
118
|
-
isPrimary:
|
|
355
|
+
id: bookingTravelers.id,
|
|
356
|
+
firstName: bookingTravelers.firstName,
|
|
357
|
+
lastName: bookingTravelers.lastName,
|
|
358
|
+
email: bookingTravelers.email,
|
|
359
|
+
participantType: bookingTravelers.participantType,
|
|
360
|
+
isPrimary: bookingTravelers.isPrimary,
|
|
361
|
+
})
|
|
362
|
+
.from(bookingTravelers)
|
|
363
|
+
.where(eq(bookingTravelers.bookingId, bookingId))
|
|
364
|
+
.orderBy(desc(bookingTravelers.isPrimary), bookingTravelers.createdAt);
|
|
365
|
+
}
|
|
366
|
+
export async function listBookingNotificationItems(db, bookingId) {
|
|
367
|
+
const rows = await db
|
|
368
|
+
.select({
|
|
369
|
+
id: bookingItems.id,
|
|
370
|
+
title: bookingItems.title,
|
|
371
|
+
description: bookingItems.description,
|
|
372
|
+
quantity: bookingItems.quantity,
|
|
373
|
+
itemType: bookingItems.itemType,
|
|
374
|
+
serviceDate: bookingItems.serviceDate,
|
|
375
|
+
sellCurrency: bookingItems.sellCurrency,
|
|
376
|
+
unitSellAmountCents: bookingItems.unitSellAmountCents,
|
|
377
|
+
totalSellAmountCents: bookingItems.totalSellAmountCents,
|
|
119
378
|
})
|
|
120
|
-
.from(
|
|
121
|
-
.where(eq(
|
|
122
|
-
.orderBy(
|
|
379
|
+
.from(bookingItems)
|
|
380
|
+
.where(eq(bookingItems.bookingId, bookingId))
|
|
381
|
+
.orderBy(bookingItems.createdAt);
|
|
382
|
+
return rows.map((row) => enrichBookingItem(row));
|
|
123
383
|
}
|
|
124
384
|
export async function paginate(rowsPromise, totalPromise, limit, offset) {
|
|
125
385
|
const [data, totalRows] = await Promise.all([rowsPromise, totalPromise]);
|
|
@@ -161,7 +161,7 @@ export declare function listReminderRuns(db: PostgresJsDatabase, query: Notifica
|
|
|
161
161
|
targetType: "invoice" | "booking_payment_schedule";
|
|
162
162
|
targetId: string;
|
|
163
163
|
dedupeKey: string;
|
|
164
|
-
status: "failed" | "sent" | "processing" | "
|
|
164
|
+
status: "failed" | "sent" | "processing" | "skipped" | "queued";
|
|
165
165
|
recipient: string | null;
|
|
166
166
|
scheduledFor: string;
|
|
167
167
|
processedAt: string;
|
|
@@ -212,7 +212,7 @@ export declare function getReminderRunById(db: PostgresJsDatabase, id: string):
|
|
|
212
212
|
targetType: "invoice" | "booking_payment_schedule";
|
|
213
213
|
targetId: string;
|
|
214
214
|
dedupeKey: string;
|
|
215
|
-
status: "failed" | "sent" | "processing" | "
|
|
215
|
+
status: "failed" | "sent" | "processing" | "skipped" | "queued";
|
|
216
216
|
recipient: string | null;
|
|
217
217
|
scheduledFor: string;
|
|
218
218
|
processedAt: string;
|
package/dist/service.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { createDefaultBookingDocumentAttachment } from "./service-booking-documents.js";
|
|
2
2
|
export type { NotificationService } from "./service-shared.js";
|
|
3
|
-
export { createNotificationService, NotificationError, renderNotificationTemplate, summarizeNotificationAttachments, } from "./service-shared.js";
|
|
3
|
+
export { createNotificationService, NotificationError, previewNotificationTemplate, renderNotificationTemplate, summarizeNotificationAttachments, } from "./service-shared.js";
|
|
4
4
|
import { createDefaultBookingDocumentAttachment } from "./service-booking-documents.js";
|
|
5
5
|
import { getDeliveryById, listDeliveries, sendInvoiceNotification, sendNotification, sendPaymentSessionNotification } from "./service-deliveries.js";
|
|
6
6
|
import { runDueReminders } from "./service-reminders.js";
|
|
7
|
+
import { previewNotificationTemplate } from "./service-shared.js";
|
|
7
8
|
import { createReminderRule, createTemplate, getReminderRuleById, getReminderRunById, getTemplateById, getTemplateBySlug, listReminderRules, listReminderRuns, listTemplates, updateReminderRule, updateTemplate } from "./service-templates.js";
|
|
8
9
|
export declare const notificationsService: {
|
|
9
10
|
listTemplates: typeof listTemplates;
|
|
@@ -11,6 +12,7 @@ export declare const notificationsService: {
|
|
|
11
12
|
getTemplateBySlug: typeof getTemplateBySlug;
|
|
12
13
|
createTemplate: typeof createTemplate;
|
|
13
14
|
updateTemplate: typeof updateTemplate;
|
|
15
|
+
previewNotificationTemplate: typeof previewNotificationTemplate;
|
|
14
16
|
listDeliveries: typeof listDeliveries;
|
|
15
17
|
getDeliveryById: typeof getDeliveryById;
|
|
16
18
|
sendNotification: typeof sendNotification;
|
|
@@ -130,6 +132,122 @@ export declare const notificationsService: {
|
|
|
130
132
|
updatedAt: Date;
|
|
131
133
|
};
|
|
132
134
|
}>;
|
|
135
|
+
confirmAndDispatchBooking: (db: import("drizzle-orm/postgres-js").PostgresJsDatabase, dispatcher: import("./service-shared.js").NotificationService, bookingId: string, input: {
|
|
136
|
+
sendNotification?: boolean;
|
|
137
|
+
} & import("./service-shared.js").SendBookingDocumentsNotificationInput, runtime?: import("./service-booking-documents.js").SendBookingDocumentsRuntimeOptions) => Promise<{
|
|
138
|
+
status: "not_found";
|
|
139
|
+
bookingId?: undefined;
|
|
140
|
+
documents?: undefined;
|
|
141
|
+
skipReason?: undefined;
|
|
142
|
+
recipient?: undefined;
|
|
143
|
+
delivery?: undefined;
|
|
144
|
+
} | {
|
|
145
|
+
status: "preview";
|
|
146
|
+
bookingId: string;
|
|
147
|
+
documents: {
|
|
148
|
+
key: string;
|
|
149
|
+
source: "finance" | "legal";
|
|
150
|
+
documentType: "invoice" | "proforma" | "contract";
|
|
151
|
+
bookingId: string;
|
|
152
|
+
name: string;
|
|
153
|
+
createdAt: string;
|
|
154
|
+
contractId?: string | null | undefined;
|
|
155
|
+
invoiceId?: string | null | undefined;
|
|
156
|
+
attachmentId?: string | null | undefined;
|
|
157
|
+
renditionId?: string | null | undefined;
|
|
158
|
+
contractStatus?: string | null | undefined;
|
|
159
|
+
invoiceStatus?: string | null | undefined;
|
|
160
|
+
format?: string | null | undefined;
|
|
161
|
+
mimeType?: string | null | undefined;
|
|
162
|
+
storageKey?: string | null | undefined;
|
|
163
|
+
downloadUrl?: string | null | undefined;
|
|
164
|
+
language?: string | null | undefined;
|
|
165
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
166
|
+
}[];
|
|
167
|
+
skipReason?: undefined;
|
|
168
|
+
recipient?: undefined;
|
|
169
|
+
delivery?: undefined;
|
|
170
|
+
} | {
|
|
171
|
+
status: "skipped";
|
|
172
|
+
bookingId: string;
|
|
173
|
+
documents: {
|
|
174
|
+
key: string;
|
|
175
|
+
source: "finance" | "legal";
|
|
176
|
+
documentType: "invoice" | "proforma" | "contract";
|
|
177
|
+
bookingId: string;
|
|
178
|
+
name: string;
|
|
179
|
+
createdAt: string;
|
|
180
|
+
contractId?: string | null | undefined;
|
|
181
|
+
invoiceId?: string | null | undefined;
|
|
182
|
+
attachmentId?: string | null | undefined;
|
|
183
|
+
renditionId?: string | null | undefined;
|
|
184
|
+
contractStatus?: string | null | undefined;
|
|
185
|
+
invoiceStatus?: string | null | undefined;
|
|
186
|
+
format?: string | null | undefined;
|
|
187
|
+
mimeType?: string | null | undefined;
|
|
188
|
+
storageKey?: string | null | undefined;
|
|
189
|
+
downloadUrl?: string | null | undefined;
|
|
190
|
+
language?: string | null | undefined;
|
|
191
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
192
|
+
}[];
|
|
193
|
+
skipReason: "no_documents" | "no_recipient" | "no_attachments" | "send_failed";
|
|
194
|
+
recipient?: undefined;
|
|
195
|
+
delivery?: undefined;
|
|
196
|
+
} | {
|
|
197
|
+
status: "dispatched";
|
|
198
|
+
bookingId: string;
|
|
199
|
+
documents: {
|
|
200
|
+
key: string;
|
|
201
|
+
source: "finance" | "legal";
|
|
202
|
+
documentType: "invoice" | "proforma" | "contract";
|
|
203
|
+
bookingId: string;
|
|
204
|
+
name: string;
|
|
205
|
+
createdAt: string;
|
|
206
|
+
contractId?: string | null | undefined;
|
|
207
|
+
invoiceId?: string | null | undefined;
|
|
208
|
+
attachmentId?: string | null | undefined;
|
|
209
|
+
renditionId?: string | null | undefined;
|
|
210
|
+
contractStatus?: string | null | undefined;
|
|
211
|
+
invoiceStatus?: string | null | undefined;
|
|
212
|
+
format?: string | null | undefined;
|
|
213
|
+
mimeType?: string | null | undefined;
|
|
214
|
+
storageKey?: string | null | undefined;
|
|
215
|
+
downloadUrl?: string | null | undefined;
|
|
216
|
+
language?: string | null | undefined;
|
|
217
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
218
|
+
}[];
|
|
219
|
+
recipient: string;
|
|
220
|
+
delivery: {
|
|
221
|
+
id: string;
|
|
222
|
+
templateId: string | null;
|
|
223
|
+
templateSlug: string | null;
|
|
224
|
+
targetType: "organization" | "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "payment_session";
|
|
225
|
+
targetId: string | null;
|
|
226
|
+
personId: string | null;
|
|
227
|
+
organizationId: string | null;
|
|
228
|
+
bookingId: string | null;
|
|
229
|
+
invoiceId: string | null;
|
|
230
|
+
paymentSessionId: string | null;
|
|
231
|
+
channel: "email" | "sms";
|
|
232
|
+
provider: string;
|
|
233
|
+
providerMessageId: string | null;
|
|
234
|
+
status: "pending" | "cancelled" | "failed" | "sent";
|
|
235
|
+
toAddress: string;
|
|
236
|
+
fromAddress: string | null;
|
|
237
|
+
subject: string | null;
|
|
238
|
+
htmlBody: string | null;
|
|
239
|
+
textBody: string | null;
|
|
240
|
+
payloadData: Record<string, unknown> | null;
|
|
241
|
+
metadata: Record<string, unknown> | null;
|
|
242
|
+
errorMessage: string | null;
|
|
243
|
+
scheduledFor: Date | null;
|
|
244
|
+
sentAt: Date | null;
|
|
245
|
+
failedAt: Date | null;
|
|
246
|
+
createdAt: Date;
|
|
247
|
+
updatedAt: Date;
|
|
248
|
+
};
|
|
249
|
+
skipReason?: undefined;
|
|
250
|
+
}>;
|
|
133
251
|
createDefaultBookingDocumentAttachment: typeof createDefaultBookingDocumentAttachment;
|
|
134
252
|
};
|
|
135
253
|
//# sourceMappingURL=service.d.ts.map
|
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,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAA;AACvF,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAEL,sCAAsC,EACvC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,8BAA8B,EAC/B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,cAAc,EACf,MAAM,wBAAwB,CAAA;AAE/B,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAA;AACvF,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EAC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