@voyant-travel/notifications 0.111.7

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.
Files changed (96) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +179 -0
  3. package/dist/index.d.ts +61 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +196 -0
  6. package/dist/liquid.d.ts +5 -0
  7. package/dist/liquid.d.ts.map +1 -0
  8. package/dist/liquid.js +156 -0
  9. package/dist/providers/local.d.ts +22 -0
  10. package/dist/providers/local.d.ts.map +1 -0
  11. package/dist/providers/local.js +23 -0
  12. package/dist/providers/voyant-cloud-email.d.ts +27 -0
  13. package/dist/providers/voyant-cloud-email.d.ts.map +1 -0
  14. package/dist/providers/voyant-cloud-email.js +73 -0
  15. package/dist/providers/voyant-cloud-sms.d.ts +26 -0
  16. package/dist/providers/voyant-cloud-sms.d.ts.map +1 -0
  17. package/dist/providers/voyant-cloud-sms.js +24 -0
  18. package/dist/routes.d.ts +1546 -0
  19. package/dist/routes.d.ts.map +1 -0
  20. package/dist/routes.js +337 -0
  21. package/dist/schema.d.ts +2119 -0
  22. package/dist/schema.d.ts.map +1 -0
  23. package/dist/schema.js +356 -0
  24. package/dist/service-booking-document-lifecycle.d.ts +99 -0
  25. package/dist/service-booking-document-lifecycle.d.ts.map +1 -0
  26. package/dist/service-booking-document-lifecycle.js +259 -0
  27. package/dist/service-booking-documents.d.ts +256 -0
  28. package/dist/service-booking-documents.d.ts.map +1 -0
  29. package/dist/service-booking-documents.js +323 -0
  30. package/dist/service-deliveries.d.ts +183 -0
  31. package/dist/service-deliveries.d.ts.map +1 -0
  32. package/dist/service-deliveries.js +413 -0
  33. package/dist/service-delivery-metadata.d.ts +42 -0
  34. package/dist/service-delivery-metadata.d.ts.map +1 -0
  35. package/dist/service-delivery-metadata.js +114 -0
  36. package/dist/service-reminder-authoring.d.ts +33 -0
  37. package/dist/service-reminder-authoring.d.ts.map +1 -0
  38. package/dist/service-reminder-authoring.js +247 -0
  39. package/dist/service-reminder-booking-context.d.ts +94 -0
  40. package/dist/service-reminder-booking-context.d.ts.map +1 -0
  41. package/dist/service-reminder-booking-context.js +164 -0
  42. package/dist/service-reminder-events.d.ts +33 -0
  43. package/dist/service-reminder-events.d.ts.map +1 -0
  44. package/dist/service-reminder-events.js +178 -0
  45. package/dist/service-reminder-run-state.d.ts +114 -0
  46. package/dist/service-reminder-run-state.d.ts.map +1 -0
  47. package/dist/service-reminder-run-state.js +100 -0
  48. package/dist/service-reminder-stage-runs.d.ts +6 -0
  49. package/dist/service-reminder-stage-runs.d.ts.map +1 -0
  50. package/dist/service-reminder-stage-runs.js +310 -0
  51. package/dist/service-reminders.d.ts +30 -0
  52. package/dist/service-reminders.d.ts.map +1 -0
  53. package/dist/service-reminders.js +189 -0
  54. package/dist/service-sequence-targets.d.ts +50 -0
  55. package/dist/service-sequence-targets.d.ts.map +1 -0
  56. package/dist/service-sequence-targets.js +136 -0
  57. package/dist/service-sequence.d.ts +68 -0
  58. package/dist/service-sequence.d.ts.map +1 -0
  59. package/dist/service-sequence.js +316 -0
  60. package/dist/service-shared.d.ts +107 -0
  61. package/dist/service-shared.d.ts.map +1 -0
  62. package/dist/service-shared.js +159 -0
  63. package/dist/service-stages.d.ts +23 -0
  64. package/dist/service-stages.d.ts.map +1 -0
  65. package/dist/service-stages.js +203 -0
  66. package/dist/service-template-data.d.ts +19 -0
  67. package/dist/service-template-data.d.ts.map +1 -0
  68. package/dist/service-template-data.js +278 -0
  69. package/dist/service-templates.d.ts +260 -0
  70. package/dist/service-templates.d.ts.map +1 -0
  71. package/dist/service-templates.js +293 -0
  72. package/dist/service.d.ts +273 -0
  73. package/dist/service.d.ts.map +1 -0
  74. package/dist/service.js +51 -0
  75. package/dist/task-runtime.d.ts +19 -0
  76. package/dist/task-runtime.d.ts.map +1 -0
  77. package/dist/task-runtime.js +11 -0
  78. package/dist/tasks/deliver-reminder.d.ts +9 -0
  79. package/dist/tasks/deliver-reminder.d.ts.map +1 -0
  80. package/dist/tasks/deliver-reminder.js +12 -0
  81. package/dist/tasks/index.d.ts +3 -0
  82. package/dist/tasks/index.d.ts.map +1 -0
  83. package/dist/tasks/index.js +2 -0
  84. package/dist/tasks/send-due-reminders.d.ts +7 -0
  85. package/dist/tasks/send-due-reminders.d.ts.map +1 -0
  86. package/dist/tasks/send-due-reminders.js +31 -0
  87. package/dist/template-authoring.d.ts +23 -0
  88. package/dist/template-authoring.d.ts.map +1 -0
  89. package/dist/template-authoring.js +386 -0
  90. package/dist/types.d.ts +82 -0
  91. package/dist/types.d.ts.map +1 -0
  92. package/dist/types.js +1 -0
  93. package/dist/validation.d.ts +1093 -0
  94. package/dist/validation.d.ts.map +1 -0
  95. package/dist/validation.js +451 -0
  96. package/package.json +102 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAErE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAc5D,eAAO,MAAM,uBAAuB,wDAAmD,CAAA;AAEvF,eAAO,MAAM,8BAA8B,uEAIzC,CAAA;AAEF,eAAO,MAAM,8BAA8B,kFAKzC,CAAA;AAEF,eAAO,MAAM,0BAA0B,qKASrC,CAAA;AAEF,eAAO,MAAM,8BAA8B,uEAIzC,CAAA;AAEF,eAAO,MAAM,kCAAkC,yJAM7C,CAAA;AAEF,eAAO,MAAM,iCAAiC,6FAM5C,CAAA;AAEF,eAAO,MAAM,mCAAmC,iIAM9C,CAAA;AAEF,eAAO,MAAM,wCAAwC,8EAGpD,CAAA;AAED,eAAO,MAAM,kCAAkC,gEAI7C,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,oBAAoB,CAAC,YAAY,CAAA;AAE9E;;;;GAIG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWrD,CAAA;AAED,MAAM,MAAM,wCAAwC,GAClD,OAAO,yCAAyC,CAAC,YAAY,CAAA;AAC/D,MAAM,MAAM,2CAA2C,GACrD,OAAO,yCAAyC,CAAC,YAAY,CAAA;AAE/D,eAAO,MAAM,8BAA8B;;;EAGxC,CAAA;AAEH,eAAO,MAAM,+BAA+B;;EAKzC,CAAA;AAEH,eAAO,MAAM,kCAAkC;;;;EAU9C,CAAA;AAED,eAAO,MAAM,iCAAiC;;;EAS3C,CAAA;AAEH,eAAO,MAAM,uCAAuC;;;EASnD,CAAA;AAED,eAAO,MAAM,0CAA0C;;;EAYtD,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAK1C,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAK1C,CAAA;AAED,eAAO,MAAM,gCAAgC,EAAE,kBAK9C,CAAA;AAED,eAAO,MAAM,+BAA+B,EAAE,kBAK7C,CAAA;AAED,eAAO,MAAM,qCAAqC,EAAE,kBAKnD,CAAA;AAED,eAAO,MAAM,wCAAwC,EAAE,kBAKtD,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAK1C,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;;;CAQjC,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,MAIjC,CAAA;AAGD,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAA"}
package/dist/schema.js ADDED
@@ -0,0 +1,356 @@
1
+ import { typeId, typeIdRef } from "@voyant-travel/db/lib/typeid-column";
2
+ import { relations } from "drizzle-orm";
3
+ import { boolean, index, integer, jsonb, pgEnum, pgTable, text, timestamp, uniqueIndex, } from "drizzle-orm/pg-core";
4
+ export const notificationChannelEnum = pgEnum("notification_channel", ["email", "sms"]);
5
+ export const notificationTemplateStatusEnum = pgEnum("notification_template_status", [
6
+ "draft",
7
+ "active",
8
+ "archived",
9
+ ]);
10
+ export const notificationDeliveryStatusEnum = pgEnum("notification_delivery_status", [
11
+ "pending",
12
+ "sent",
13
+ "failed",
14
+ "cancelled",
15
+ ]);
16
+ export const notificationTargetTypeEnum = pgEnum("notification_target_type", [
17
+ "booking",
18
+ "booking_payment_schedule",
19
+ "booking_guarantee",
20
+ "invoice",
21
+ "payment_session",
22
+ "person",
23
+ "organization",
24
+ "other",
25
+ ]);
26
+ export const notificationReminderStatusEnum = pgEnum("notification_reminder_status", [
27
+ "draft",
28
+ "active",
29
+ "archived",
30
+ ]);
31
+ export const notificationReminderTargetTypeEnum = pgEnum("notification_reminder_target_type", [
32
+ "booking_confirmed",
33
+ "booking_payment_schedule",
34
+ "payment_complete",
35
+ "booking_cancelled_non_payment",
36
+ "invoice",
37
+ ]);
38
+ export const notificationReminderRunStatusEnum = pgEnum("notification_reminder_run_status", [
39
+ "queued",
40
+ "processing",
41
+ "sent",
42
+ "skipped",
43
+ "failed",
44
+ ]);
45
+ export const notificationReminderStageAnchorEnum = pgEnum("notification_reminder_stage_anchor", [
46
+ "due_date",
47
+ "booking_created_at",
48
+ "departure_date",
49
+ "invoice_issued_at",
50
+ "last_send_at",
51
+ ]);
52
+ export const notificationReminderStageCadenceKindEnum = pgEnum("notification_reminder_stage_cadence_kind", ["once", "every_n_days", "escalating"]);
53
+ export const notificationStageRecipientKindEnum = pgEnum("notification_stage_recipient_kind", [
54
+ "primary",
55
+ "cc",
56
+ "bcc",
57
+ ]);
58
+ export const notificationTemplates = pgTable("notification_templates", {
59
+ id: typeId("notification_templates"),
60
+ slug: text("slug").notNull().unique(),
61
+ name: text("name").notNull(),
62
+ channel: notificationChannelEnum("channel").notNull(),
63
+ provider: text("provider"),
64
+ status: notificationTemplateStatusEnum("status").notNull().default("draft"),
65
+ subjectTemplate: text("subject_template"),
66
+ htmlTemplate: text("html_template"),
67
+ textTemplate: text("text_template"),
68
+ fromAddress: text("from_address"),
69
+ isSystem: boolean("is_system").notNull().default(false),
70
+ metadata: jsonb("metadata").$type(),
71
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
72
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
73
+ }, (table) => [
74
+ index("idx_notification_templates_updated").on(table.updatedAt),
75
+ index("idx_notification_templates_channel_updated").on(table.channel, table.updatedAt),
76
+ index("idx_notification_templates_provider_updated").on(table.provider, table.updatedAt),
77
+ index("idx_notification_templates_status_updated").on(table.status, table.updatedAt),
78
+ uniqueIndex("uidx_notification_templates_slug").on(table.slug),
79
+ ]);
80
+ export const notificationDeliveries = pgTable("notification_deliveries", {
81
+ id: typeId("notification_deliveries"),
82
+ templateId: typeIdRef("template_id").references(() => notificationTemplates.id, {
83
+ onDelete: "set null",
84
+ }),
85
+ templateSlug: text("template_slug"),
86
+ targetType: notificationTargetTypeEnum("target_type").notNull().default("other"),
87
+ targetId: text("target_id"),
88
+ personId: text("person_id"),
89
+ organizationId: text("organization_id"),
90
+ bookingId: text("booking_id"),
91
+ invoiceId: text("invoice_id"),
92
+ paymentSessionId: text("payment_session_id"),
93
+ channel: notificationChannelEnum("channel").notNull(),
94
+ provider: text("provider").notNull(),
95
+ providerMessageId: text("provider_message_id"),
96
+ status: notificationDeliveryStatusEnum("status").notNull().default("pending"),
97
+ toAddress: text("to_address").notNull(),
98
+ fromAddress: text("from_address"),
99
+ subject: text("subject"),
100
+ htmlBody: text("html_body"),
101
+ textBody: text("text_body"),
102
+ payloadData: jsonb("payload_data").$type(),
103
+ metadata: jsonb("metadata").$type(),
104
+ errorMessage: text("error_message"),
105
+ scheduledFor: timestamp("scheduled_for", { withTimezone: true }),
106
+ sentAt: timestamp("sent_at", { withTimezone: true }),
107
+ failedAt: timestamp("failed_at", { withTimezone: true }),
108
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
109
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
110
+ }, (table) => [
111
+ index("idx_notification_deliveries_created").on(table.createdAt),
112
+ index("idx_notification_deliveries_template_created").on(table.templateId, table.createdAt),
113
+ index("idx_notification_deliveries_target_created").on(table.targetType, table.targetId, table.createdAt),
114
+ index("idx_notification_deliveries_person_created").on(table.personId, table.createdAt),
115
+ index("idx_notification_deliveries_org_created").on(table.organizationId, table.createdAt),
116
+ index("idx_notification_deliveries_booking_created").on(table.bookingId, table.createdAt),
117
+ index("idx_notification_deliveries_invoice_created").on(table.invoiceId, table.createdAt),
118
+ index("idx_notification_deliveries_payment_session_created").on(table.paymentSessionId, table.createdAt),
119
+ index("idx_notification_deliveries_channel_created").on(table.channel, table.createdAt),
120
+ index("idx_notification_deliveries_provider_created").on(table.provider, table.createdAt),
121
+ index("idx_notification_deliveries_status_created").on(table.status, table.createdAt),
122
+ index("idx_notification_deliveries_scheduled_for").on(table.scheduledFor),
123
+ ]);
124
+ export const notificationReminderRules = pgTable("notification_reminder_rules", {
125
+ id: typeId("notification_reminder_rules"),
126
+ slug: text("slug").notNull().unique(),
127
+ name: text("name").notNull(),
128
+ status: notificationReminderStatusEnum("status").notNull().default("draft"),
129
+ targetType: notificationReminderTargetTypeEnum("target_type").notNull(),
130
+ channel: notificationChannelEnum("channel").notNull(),
131
+ provider: text("provider"),
132
+ templateId: typeIdRef("template_id").references(() => notificationTemplates.id, {
133
+ onDelete: "set null",
134
+ }),
135
+ templateSlug: text("template_slug"),
136
+ priority: integer("priority").notNull().default(0),
137
+ suppressionGroup: text("suppression_group"),
138
+ isSystem: boolean("is_system").notNull().default(false),
139
+ metadata: jsonb("metadata").$type(),
140
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
141
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
142
+ }, (table) => [
143
+ index("idx_notification_reminder_rules_updated").on(table.updatedAt),
144
+ index("idx_notification_reminder_rules_status_updated").on(table.status, table.updatedAt),
145
+ index("idx_notification_reminder_rules_target_updated").on(table.targetType, table.updatedAt),
146
+ index("idx_notification_reminder_rules_channel_updated").on(table.channel, table.updatedAt),
147
+ index("idx_notification_reminder_rules_priority").on(table.priority),
148
+ index("idx_notification_reminder_rules_suppression_group").on(table.suppressionGroup),
149
+ uniqueIndex("uidx_notification_reminder_rules_slug").on(table.slug),
150
+ ]);
151
+ export const notificationReminderRuns = pgTable("notification_reminder_runs", {
152
+ id: typeId("notification_reminder_runs"),
153
+ reminderRuleId: typeIdRef("reminder_rule_id")
154
+ .notNull()
155
+ .references(() => notificationReminderRules.id, { onDelete: "cascade" }),
156
+ targetType: notificationReminderTargetTypeEnum("target_type").notNull(),
157
+ targetId: text("target_id").notNull(),
158
+ dedupeKey: text("dedupe_key").notNull().unique(),
159
+ bookingId: text("booking_id"),
160
+ personId: text("person_id"),
161
+ organizationId: text("organization_id"),
162
+ paymentSessionId: text("payment_session_id"),
163
+ notificationDeliveryId: typeIdRef("notification_delivery_id").references(() => notificationDeliveries.id, { onDelete: "set null" }),
164
+ status: notificationReminderRunStatusEnum("status").notNull(),
165
+ recipient: text("recipient"),
166
+ scheduledFor: timestamp("scheduled_for", { withTimezone: true }).notNull(),
167
+ processedAt: timestamp("processed_at", { withTimezone: true }).notNull().defaultNow(),
168
+ errorMessage: text("error_message"),
169
+ metadata: jsonb("metadata").$type(),
170
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
171
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
172
+ }, (table) => [
173
+ index("idx_notification_reminder_runs_created").on(table.createdAt),
174
+ index("idx_notification_reminder_runs_rule_created").on(table.reminderRuleId, table.createdAt),
175
+ index("idx_notification_reminder_runs_target_created").on(table.targetType, table.targetId, table.createdAt),
176
+ index("idx_notification_reminder_runs_booking_created").on(table.bookingId, table.createdAt),
177
+ index("idx_notification_reminder_runs_payment_session_created").on(table.paymentSessionId, table.createdAt),
178
+ index("idx_notification_reminder_runs_delivery_created").on(table.notificationDeliveryId, table.createdAt),
179
+ index("idx_notification_reminder_runs_person_created").on(table.personId, table.createdAt),
180
+ index("idx_notification_reminder_runs_org_created").on(table.organizationId, table.createdAt),
181
+ index("idx_notification_reminder_runs_recipient_created").on(table.recipient, table.createdAt),
182
+ index("idx_notification_reminder_runs_status_created").on(table.status, table.createdAt),
183
+ uniqueIndex("uidx_notification_reminder_runs_dedupe").on(table.dedupeKey),
184
+ ]);
185
+ export const notificationReminderRuleStages = pgTable("notification_reminder_rule_stages", {
186
+ id: typeId("notification_reminder_rule_stages"),
187
+ reminderRuleId: typeIdRef("reminder_rule_id")
188
+ .notNull()
189
+ .references(() => notificationReminderRules.id, { onDelete: "cascade" }),
190
+ orderIndex: integer("order_index").notNull(),
191
+ name: text("name"),
192
+ anchor: notificationReminderStageAnchorEnum("anchor").notNull(),
193
+ windowStartDays: integer("window_start_days").notNull(),
194
+ windowEndDays: integer("window_end_days").notNull(),
195
+ cadenceKind: notificationReminderStageCadenceKindEnum("cadence_kind").notNull(),
196
+ cadenceEveryDays: integer("cadence_every_days"),
197
+ cadenceIntervals: jsonb("cadence_intervals").$type(),
198
+ maxSendsInStage: integer("max_sends_in_stage"),
199
+ respectQuietHours: boolean("respect_quiet_hours").notNull().default(true),
200
+ metadata: jsonb("metadata").$type(),
201
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
202
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
203
+ }, (table) => [
204
+ uniqueIndex("uidx_notification_reminder_rule_stages_rule_order").on(table.reminderRuleId, table.orderIndex),
205
+ index("idx_notification_reminder_rule_stages_rule").on(table.reminderRuleId),
206
+ index("idx_notification_reminder_rule_stages_anchor").on(table.anchor),
207
+ ]);
208
+ export const notificationReminderStageChannels = pgTable("notification_reminder_stage_channels", {
209
+ id: typeId("notification_reminder_stage_channels"),
210
+ stageId: typeIdRef("stage_id")
211
+ .notNull()
212
+ .references(() => notificationReminderRuleStages.id, { onDelete: "cascade" }),
213
+ orderIndex: integer("order_index").notNull().default(0),
214
+ channel: notificationChannelEnum("channel").notNull(),
215
+ provider: text("provider"),
216
+ templateId: typeIdRef("template_id").references(() => notificationTemplates.id, {
217
+ onDelete: "set null",
218
+ }),
219
+ templateSlug: text("template_slug"),
220
+ recipientKind: notificationStageRecipientKindEnum("recipient_kind")
221
+ .notNull()
222
+ .default("primary"),
223
+ recipientRole: text("recipient_role"),
224
+ metadata: jsonb("metadata").$type(),
225
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
226
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
227
+ }, (table) => [
228
+ index("idx_notification_reminder_stage_channels_stage").on(table.stageId),
229
+ index("idx_notification_reminder_stage_channels_template").on(table.templateId),
230
+ ]);
231
+ export const notificationSettings = pgTable("notification_settings", {
232
+ id: typeId("notification_settings"),
233
+ scope: text("scope").notNull().default("default"),
234
+ quietHoursLocal: jsonb("quiet_hours_local").$type(),
235
+ blackoutDates: jsonb("blackout_dates").$type(),
236
+ skipWeekends: boolean("skip_weekends").notNull().default(false),
237
+ recipientRateLimitPerDay: integer("recipient_rate_limit_per_day"),
238
+ suppressionWindowHours: integer("suppression_window_hours").notNull().default(24),
239
+ metadata: jsonb("metadata").$type(),
240
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
241
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
242
+ }, (table) => [uniqueIndex("uidx_notification_settings_scope").on(table.scope)]);
243
+ /**
244
+ * Dedup ledger for composite reminder-rule authoring. A compose request creates
245
+ * several rows, so retried calls need a stable way to return the original rule
246
+ * instead of building a second graph.
247
+ */
248
+ export const notificationReminderRuleAuthoringRequests = pgTable("notification_reminder_rule_authoring_requests", {
249
+ idempotencyKey: text("idempotency_key").primaryKey(),
250
+ reminderRuleId: typeIdRef("reminder_rule_id")
251
+ .notNull()
252
+ .references(() => notificationReminderRules.id, { onDelete: "cascade" }),
253
+ operation: text("operation").notNull(),
254
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
255
+ }, (table) => [index("idx_notification_reminder_rule_authoring_rule").on(table.reminderRuleId)]);
256
+ export const notificationTemplatesRelations = relations(notificationTemplates, ({ many }) => ({
257
+ deliveries: many(notificationDeliveries),
258
+ reminderRules: many(notificationReminderRules),
259
+ }));
260
+ export const notificationDeliveriesRelations = relations(notificationDeliveries, ({ one }) => ({
261
+ template: one(notificationTemplates, {
262
+ fields: [notificationDeliveries.templateId],
263
+ references: [notificationTemplates.id],
264
+ }),
265
+ }));
266
+ export const notificationReminderRulesRelations = relations(notificationReminderRules, ({ many, one }) => ({
267
+ template: one(notificationTemplates, {
268
+ fields: [notificationReminderRules.templateId],
269
+ references: [notificationTemplates.id],
270
+ }),
271
+ runs: many(notificationReminderRuns),
272
+ stages: many(notificationReminderRuleStages),
273
+ }));
274
+ export const notificationReminderRunsRelations = relations(notificationReminderRuns, ({ one }) => ({
275
+ reminderRule: one(notificationReminderRules, {
276
+ fields: [notificationReminderRuns.reminderRuleId],
277
+ references: [notificationReminderRules.id],
278
+ }),
279
+ notificationDelivery: one(notificationDeliveries, {
280
+ fields: [notificationReminderRuns.notificationDeliveryId],
281
+ references: [notificationDeliveries.id],
282
+ }),
283
+ }));
284
+ export const notificationReminderRuleStagesRelations = relations(notificationReminderRuleStages, ({ many, one }) => ({
285
+ rule: one(notificationReminderRules, {
286
+ fields: [notificationReminderRuleStages.reminderRuleId],
287
+ references: [notificationReminderRules.id],
288
+ }),
289
+ channels: many(notificationReminderStageChannels),
290
+ }));
291
+ export const notificationReminderStageChannelsRelations = relations(notificationReminderStageChannels, ({ one }) => ({
292
+ stage: one(notificationReminderRuleStages, {
293
+ fields: [notificationReminderStageChannels.stageId],
294
+ references: [notificationReminderRuleStages.id],
295
+ }),
296
+ template: one(notificationTemplates, {
297
+ fields: [notificationReminderStageChannels.templateId],
298
+ references: [notificationTemplates.id],
299
+ }),
300
+ }));
301
+ export const notificationTemplateLinkable = {
302
+ module: "notifications",
303
+ entity: "notificationTemplate",
304
+ table: "notification_templates",
305
+ idPrefix: "ntpl",
306
+ };
307
+ export const notificationDeliveryLinkable = {
308
+ module: "notifications",
309
+ entity: "notificationDelivery",
310
+ table: "notification_deliveries",
311
+ idPrefix: "ntdl",
312
+ };
313
+ export const notificationReminderRuleLinkable = {
314
+ module: "notifications",
315
+ entity: "notificationReminderRule",
316
+ table: "notification_reminder_rules",
317
+ idPrefix: "ntrl",
318
+ };
319
+ export const notificationReminderRunLinkable = {
320
+ module: "notifications",
321
+ entity: "notificationReminderRun",
322
+ table: "notification_reminder_runs",
323
+ idPrefix: "ntrn",
324
+ };
325
+ export const notificationReminderRuleStageLinkable = {
326
+ module: "notifications",
327
+ entity: "notificationReminderRuleStage",
328
+ table: "notification_reminder_rule_stages",
329
+ idPrefix: "ntrs",
330
+ };
331
+ export const notificationReminderStageChannelLinkable = {
332
+ module: "notifications",
333
+ entity: "notificationReminderStageChannel",
334
+ table: "notification_reminder_stage_channels",
335
+ idPrefix: "ntsc",
336
+ };
337
+ export const notificationSettingsLinkable = {
338
+ module: "notifications",
339
+ entity: "notificationSettings",
340
+ table: "notification_settings",
341
+ idPrefix: "nset",
342
+ };
343
+ export const notificationsLinkable = {
344
+ notificationTemplate: notificationTemplateLinkable,
345
+ notificationDelivery: notificationDeliveryLinkable,
346
+ notificationReminderRule: notificationReminderRuleLinkable,
347
+ notificationReminderRun: notificationReminderRunLinkable,
348
+ notificationReminderRuleStage: notificationReminderRuleStageLinkable,
349
+ notificationReminderStageChannel: notificationReminderStageChannelLinkable,
350
+ notificationSettings: notificationSettingsLinkable,
351
+ };
352
+ export const notificationsModule = {
353
+ name: "notifications",
354
+ linkable: notificationsLinkable,
355
+ requiresTransactionalDb: true,
356
+ };
@@ -0,0 +1,99 @@
1
+ import { bookings } from "@voyant-travel/bookings/schema";
2
+ import type { EventBus } from "@voyant-travel/core";
3
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
4
+ import { type BookingDocumentAttachmentResolver } from "./service-booking-documents.js";
5
+ import type { BookingDocumentBundleItem, NotificationService, SendBookingDocumentsNotificationInput } from "./service-shared.js";
6
+ import { listBookingNotificationItems, listBookingNotificationParticipants, resolveReminderRecipient } from "./service-shared.js";
7
+ export declare const BOOKING_FULLY_PAID_EVENT: "booking.fully-paid";
8
+ export type BookingDocumentBundleLifecycleTrigger = "booking.confirmed" | typeof BOOKING_FULLY_PAID_EVENT;
9
+ export type BookingDocumentBundleLifecycleDocumentType = BookingDocumentBundleItem["documentType"];
10
+ export interface BookingDocumentBundleLifecycleEvent {
11
+ bookingId: string;
12
+ bookingNumber?: string | null;
13
+ actorId?: string | null;
14
+ [key: string]: unknown;
15
+ }
16
+ export interface BookingFullyPaidEvent extends BookingDocumentBundleLifecycleEvent {
17
+ paymentSessionId?: string | null;
18
+ invoiceId?: string | null;
19
+ amountCents?: number | null;
20
+ currency?: string | null;
21
+ provider?: string | null;
22
+ }
23
+ type BookingNotificationParticipant = Awaited<ReturnType<typeof listBookingNotificationParticipants>>[number];
24
+ type BookingNotificationItem = Awaited<ReturnType<typeof listBookingNotificationItems>>[number];
25
+ export interface BookingDocumentBundleLifecycleContext {
26
+ trigger: BookingDocumentBundleLifecycleTrigger;
27
+ event: BookingDocumentBundleLifecycleEvent;
28
+ booking: typeof bookings.$inferSelect;
29
+ customer: ReturnType<typeof resolveReminderRecipient>;
30
+ travelers: BookingNotificationParticipant[];
31
+ items: BookingNotificationItem[];
32
+ existingDocuments: BookingDocumentBundleItem[];
33
+ }
34
+ export interface BookingDocumentBundleLifecycleStep {
35
+ source: "legal" | "finance" | "products" | "notification" | "policy";
36
+ documentType?: BookingDocumentBundleLifecycleDocumentType;
37
+ status: "existing" | "created" | "skipped" | "sent" | "failed";
38
+ reason?: string;
39
+ }
40
+ export type BookingDocumentBundleLifecyclePolicyResult = {
41
+ status: "ok";
42
+ bookingId: string;
43
+ documents: BookingDocumentBundleItem[];
44
+ steps: BookingDocumentBundleLifecycleStep[];
45
+ } | {
46
+ status: "failed";
47
+ bookingId: string;
48
+ steps: BookingDocumentBundleLifecycleStep[];
49
+ error: string;
50
+ };
51
+ export type BookingDocumentBundleLifecycleResult = BookingDocumentBundleLifecyclePolicyResult | {
52
+ status: "not_found";
53
+ bookingId: string;
54
+ };
55
+ export interface BookingDocumentBundleLifecyclePolicyHelpers {
56
+ refreshDocuments(): Promise<BookingDocumentBundleItem[]>;
57
+ ensureLegalDocuments?: BookingDocumentBundleLifecycleEnsureDocuments;
58
+ ensureFinanceDocuments?: BookingDocumentBundleLifecycleEnsureDocuments;
59
+ resolveBrochureDocuments?: BookingDocumentBundleLifecycleResolveBrochures;
60
+ }
61
+ export type BookingDocumentBundleLifecyclePolicy = (context: BookingDocumentBundleLifecycleContext, helpers: BookingDocumentBundleLifecyclePolicyHelpers) => Promise<BookingDocumentBundleLifecyclePolicyResult> | BookingDocumentBundleLifecyclePolicyResult;
62
+ export type BookingDocumentBundleLifecycleEnsureDocuments = (context: BookingDocumentBundleLifecycleContext, request: {
63
+ trigger: BookingDocumentBundleLifecycleTrigger;
64
+ documentTypes: BookingDocumentBundleLifecycleDocumentType[];
65
+ }) => Promise<undefined | BookingDocumentBundleLifecycleStep[]> | undefined | BookingDocumentBundleLifecycleStep[];
66
+ export type BookingDocumentBundleLifecycleResolveBrochures = (context: BookingDocumentBundleLifecycleContext) => Promise<BookingDocumentBundleItem[]> | BookingDocumentBundleItem[];
67
+ export type BookingDocumentBundleNotificationPolicy = (context: BookingDocumentBundleLifecycleContext, result: Extract<BookingDocumentBundleLifecyclePolicyResult, {
68
+ status: "ok";
69
+ }>) => Promise<SendBookingDocumentsNotificationInput | false | null | undefined> | SendBookingDocumentsNotificationInput | false | null | undefined;
70
+ export interface BookingDocumentBundleLifecycleStageOptions {
71
+ documentTypes?: BookingDocumentBundleLifecycleDocumentType[];
72
+ notification?: SendBookingDocumentsNotificationInput | false;
73
+ }
74
+ export interface BookingDocumentBundleLifecycleOptions {
75
+ enabled?: boolean;
76
+ confirmation?: BookingDocumentBundleLifecycleStageOptions;
77
+ fullyPaid?: BookingDocumentBundleLifecycleStageOptions;
78
+ policy?: BookingDocumentBundleLifecyclePolicy;
79
+ notificationPolicy?: BookingDocumentBundleNotificationPolicy;
80
+ ensureLegalDocuments?: BookingDocumentBundleLifecycleEnsureDocuments;
81
+ ensureFinanceDocuments?: BookingDocumentBundleLifecycleEnsureDocuments;
82
+ resolveBrochureDocuments?: BookingDocumentBundleLifecycleResolveBrochures;
83
+ }
84
+ export interface RunBookingDocumentBundleLifecycleInput {
85
+ trigger: BookingDocumentBundleLifecycleTrigger;
86
+ event: BookingDocumentBundleLifecycleEvent;
87
+ }
88
+ export interface BookingDocumentBundleLifecycleRuntime {
89
+ eventBus?: EventBus;
90
+ attachmentResolver?: BookingDocumentAttachmentResolver;
91
+ resolveContext?: (db: PostgresJsDatabase, input: RunBookingDocumentBundleLifecycleInput) => Promise<BookingDocumentBundleLifecycleContext | null>;
92
+ }
93
+ export declare function resolveBookingDocumentBundleLifecycleContext(db: PostgresJsDatabase, input: RunBookingDocumentBundleLifecycleInput): Promise<BookingDocumentBundleLifecycleContext | null>;
94
+ export declare function createDefaultBookingDocumentBundlePolicy(options: BookingDocumentBundleLifecycleOptions): BookingDocumentBundleLifecyclePolicy;
95
+ export declare const bookingDocumentBundleLifecycleService: {
96
+ run(db: PostgresJsDatabase, dispatcher: NotificationService, input: RunBookingDocumentBundleLifecycleInput, options?: BookingDocumentBundleLifecycleOptions, runtime?: BookingDocumentBundleLifecycleRuntime): Promise<BookingDocumentBundleLifecycleResult>;
97
+ };
98
+ export {};
99
+ //# sourceMappingURL=service-booking-document-lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-booking-document-lifecycle.d.ts","sourceRoot":"","sources":["../src/service-booking-document-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAg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