feat: create email template for TTO reservation confirmation

feat: implement order notifications service with TTO reservation confirmation handling

feat: create migration for TTO booking email webhook trigger
This commit is contained in:
Danel Kungla
2025-09-30 16:05:43 +03:00
parent 4003284f3a
commit 72f6f2b716
56 changed files with 3692 additions and 294 deletions

View File

@@ -48,6 +48,12 @@ class DatabaseWebhookRouterService {
return this.handleAnalysisOrdersWebhook(payload);
}
case 'connected_online_reservation': {
const payload = body as RecordChange<typeof body.table>;
return this.handleTtoOrdersWebhook(payload);
}
default: {
return;
}
@@ -100,13 +106,27 @@ class DatabaseWebhookRouterService {
return;
}
const { createAnalysisOrderWebhooksService } = await import(
'@kit/notifications/webhooks/analysis-order-notifications.service'
const { createOrderWebhooksService } = await import(
'@kit/notifications/webhooks/order-notifications.service'
);
const service = createAnalysisOrderWebhooksService();
const service = createOrderWebhooksService();
return service.handleStatusChangeWebhook(record);
}
}
private async handleTtoOrdersWebhook(
body: RecordChange<'connected_online_reservation'>,
) {
if (body.type === 'UPDATE' && body.record) {
const { createOrderWebhooksService } = await import(
'@kit/notifications/webhooks/order-notifications.service'
);
const service = createOrderWebhooksService();
return service.handleTtoReservationConfirmationWebhook(body.record);
}
}
}