Skip to content

Instantly share code, notes, and snippets.

View tsialas's full-sized avatar

Christos Tsialas tsialas

  • 17:07 (UTC +03:00)
View GitHub Profile
[
"US;city;California_San Bernardino County_Fontana",
"US;city;California_Los Angeles County_Los Angeles",
"US;city;California_San Bernardino County_Ontario",
"US;city;California_Ventura County_Oxnard",
"US;city;California_Riverside County_Riverside",
"US;city;California_Los Angeles County_San Fernando",
"US;city;California_Orange County_Santa Ana",
"US;city;California_Los Angeles County_West Covina",
"US;city;California_Los Angeles County_Alhambra",

Requirement

As a doctor, I want to be able to reschedule an appointment for any given datetime. We always assume that the doc has already confirmed the new appointment time with their patient. Current restrictions not allowing free rescheduling should be bypassed as elegantly as possible. Execution starts @ ConsultationController->postReschedule()

Solution

After reviewing the business requirements of the "rescheduling by doctor" case, it's evident that it's indeed a special case with lots of differences in the handling logic (compared to a simple booking or patient rescheduling). This justifies some basic code refactoring to avoid adding code complexity or duplication.