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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user