Skip to content

Conversation

adamspd
Copy link
Owner

@adamspd adamspd commented Jun 10, 2025

Add recurring appointments feature

What changed

  • Added full recurring appointments functionality with daily, weekly, and monthly patterns
  • Calendar selection auto-syncs with recurring settings (until date and day picker)
  • Added toggle switch, day picker, and preview text in UI
  • Recurring appointments block slots and appear in email notifications
  • Added admin interface for managing recurring appointment records

Core functionality

  • RecurringAppointment model: Stores recurrence rules using django-recurrence
  • Slot exclusion: Prevents double-booking recurring appointment times
  • Form validation: Requires end date and day selection for weekly recurring
  • ICS integration: Calendar files include RRULE for recurring events
  • Email updates: All appointment emails show recurrence details

UI improvements

  • Compact day picker for weekly selection
  • Live preview shows "Every week on Monday, Wednesday until June 11th, 2025"
  • Preview appears in both config panel and service details
  • Auto-updates when calendar date changes

Technical details

  • Uses django-recurrence for RRULE parsing and date calculations
  • Added Config.max_recurring_months (default: 3 months)
  • Enhanced appointment exclusion logic in slot calculation
  • Updated all email templates to show recurrence info
  • Added proper form validation and error handling

Files changed

  • models.py - Added RecurringAppointment model
  • forms.py - Added recurring fields to AppointmentRequestForm
  • views.py - Handle recurring appointment creation
  • services.py - Exclude recurring slots from availability
  • templates/ - Updated all email templates and appointment form
  • static/ - New CSS and JS for recurring UI
  • utils/ - Enhanced ICS generation and email context

Dependencies

  • Added django-recurrence>=1.11.1

What needs to be done

  • Tests
  • User can only choose daily recurrence if staff member works daily and the slot time is free until the end date.

@github-actions github-actions bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file user-interface feature labels Jun 10, 2025
adamspd added 4 commits June 10, 2025 05:00
# Conflicts:
#	requirements.txt
Selected date on calendar is the same in "until" field by default
Added documentation (needs update)
Added RecurrenceAppointment object in admin.py
Removed the JS for recurring appointment in HTML file (added in its own
js file)
@adamspd adamspd force-pushed the feature-recurring-appointments branch from 994f09b to 15702f0 Compare June 10, 2025 03:01
@adamspd adamspd self-assigned this Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation feature user-interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant