getAvailabilities
returns 7 days of slots, including date of request.
- Each day must be generated using events of type
opening
by dividing the period betweenstarts_at
andends_at
into 30 minutes slots - if an appointment exists between those hours, subtract it from availabilities
weekly_recurring
openings must be taken into account
- Do
starts_at
andends_at
always fall on 1/2h dates - Do
starts_at
andends_at
happen on the same day - How long should we look backwards for a
weekly_recurring
event ?
- Yes => this should be enforced by the database
- Yes => this should be enforced by the database
- For the purpose of the exercise, all
weekly_recurring
event should be used. IRL, we should probably consider those of the current year maybe?
- Sanitize argument date (should be a date without time)
- Ensure slots are valid (datetime - 1/2h periods)
- Validate edge cases (midnight cases, openings or appointments spanning multiple days)
- Especially: Verify where query with
starts_at
andends_at
- Especially: Verify where query with
- Validate overlapping opening/ appointments
- Timezones: the provided test uses the system TZ. Should we use UTC instead ?
- Optimize queries