mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-10-28 07:41:16 +00:00
feat(classes): weekly recurring schedules with lazy session materialization
class_schedules rules generate concrete session rows for a rolling 28-day horizon — no cron; materialize runs idempotently on dashboard and public reads via a partial unique index on (schedule_id, starts_at). Rule delete stops future sessions; existing sessions keep bookings and overrides. 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
7b9080eb1c
commit
ad60167a31
15 files changed
+1029
-7
No files matched your search
@@ -160,6 +160,11 @@ func (s *Service) Availability(ctx context.Context, tenantSlug string, filter Av
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Recurring schedules write their concrete sessions here so the public
|
||||
// booking page sees them without a background job. Idempotent.
|
||||
if err := s.repo.MaterializeScheduleSessions(ctx, tenant.ID, now, 28); err != nil {
|
||||
return domain.PublicAvailability{}, err
|
||||
}
|
||||
classSessions, err := s.repo.ListClassSessionsByTenant(ctx, tenant.ID, windowStart, 8)
|
||||
if err != nil {
|
||||
return domain.PublicAvailability{}, err
|
||||
|
||||
Reference in new issue
Block a user