mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-10-28 07:41:16 +00:00
feat(reminders): SMS channel for reminder jobs
Tenants paying for the SMS add-on still got email-only reminders — the channel column existed but nothing armed or dispatched sms jobs. Booking creation now adds a second job when SMS is enabled and the customer left a phone; dispatch routes sms jobs through an injected sender adapter wired to the existing sms.Service, so monthly limits, usage metering, and Stripe billing apply unchanged. Lifecycle handling from the previous milestone clears and re-arms both channels together. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
c7172544b8
commit
7509e82261
8 files changed
+164
-1
No files matched your search
@@ -366,6 +366,17 @@ func (s *Service) Create(ctx context.Context, request domain.CreateBookingReques
|
||||
}); err != nil {
|
||||
return domain.CreateBookingResponse{}, err
|
||||
}
|
||||
// SMS reminders are a per-tenant opt-in and need a customer phone.
|
||||
if request.CustomerPhone != "" {
|
||||
if smsSettings, err := s.repo.GetTenantSMSSettings(ctx, tenant.ID); err == nil && smsSettings.Enabled {
|
||||
_ = s.repo.CreateReminderJob(ctx, db.ReminderJobParams{
|
||||
TenantID: tenant.ID,
|
||||
BookingID: created.ID,
|
||||
Channel: "sms",
|
||||
ScheduledFor: scheduledFor,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Send confirmation emails (async - don't fail booking if email fails)
|
||||
|
||||
Reference in new issue
Block a user