feat(scheduling): tenant webhooks for booking lifecycle

This commit is contained in:
Ronni Baslund
2026-06-07 09:08:45 +02:00
parent e33b7f18a3
commit b9b4d56a2d
9 changed files with 758 additions and 1 deletions
@@ -12,6 +12,8 @@ import { Host, HostSchema } from '../schemas/scheduling-host.schema.js'
import { SlotLock, SlotLockSchema } from '../schemas/slot-lock.schema.js'
import { Tenant, TenantSchema } from '../schemas/tenant.schema.js'
import { User, UserSchema } from '../schemas/user.schema.js'
import { WebhookDelivery, WebhookDeliverySchema } from '../schemas/webhook-delivery.schema.js'
import { WebhookSubscription, WebhookSubscriptionSchema } from '../schemas/webhook-subscription.schema.js'
import { TenantsModule } from '../tenants/tenants.module.js'
import { ABUSE_GUARD, abuseGuardFactory } from './abuse/abuse-guard.js'
import { AvailabilityService } from './availability/availability.service.js'
@@ -26,6 +28,9 @@ import { BookingReminderWorker } from './reminders/booking-reminder.worker.js'
import { SchedulingAdminController } from './scheduling-admin.controller.js'
import { SlotService } from './slots/slot.service.js'
import { StalwartCalendarModule } from './stalwart-calendar/stalwart-calendar.module.js'
import { WebhookDeliveryWorker } from './webhooks/webhook-delivery.worker.js'
import { WebhooksController } from './webhooks/webhooks.controller.js'
import { WebhooksService } from './webhooks/webhooks.service.js'
// dezky Scheduling — Calendly-style booking on top of Stalwart calendars. Public
// pages (booking.dezky.eu) hit the unauthenticated /api/v1/public routes; host
@@ -41,6 +46,8 @@ import { StalwartCalendarModule } from './stalwart-calendar/stalwart-calendar.mo
{ name: SlotLock.name, schema: SlotLockSchema },
{ name: Tenant.name, schema: TenantSchema },
{ name: User.name, schema: UserSchema },
{ name: WebhookSubscription.name, schema: WebhookSubscriptionSchema },
{ name: WebhookDelivery.name, schema: WebhookDeliverySchema },
]),
// Drives the @Cron booking reminder worker.
ScheduleModule.forRoot(),
@@ -52,7 +59,7 @@ import { StalwartCalendarModule } from './stalwart-calendar/stalwart-calendar.mo
IntegrationsModule, // StalwartClient — host→account lookup during onboarding
StalwartCalendarModule,
],
controllers: [SchedulingAdminController, PublicSchedulingController],
controllers: [WebhooksController, SchedulingAdminController, PublicSchedulingController],
providers: [
HostsService,
AvailabilityService,
@@ -63,6 +70,8 @@ import { StalwartCalendarModule } from './stalwart-calendar/stalwart-calendar.mo
JmapMailer,
BookingReminderWorker,
CalendarRetryWorker,
WebhooksService,
WebhookDeliveryWorker,
// Pluggable captcha guard for the public booking surface (Turnstile when
// TURNSTILE_SECRET is set, otherwise a no-op).
{ provide: ABUSE_GUARD, useFactory: abuseGuardFactory, inject: [ConfigService] },