I am building a doctor appointment app with Django and Django Rest Framework. The app will have the functionality for secretaries to add appointments to a Doctor's calendar, and each Doctor may have more than one clinic (and multiple secretaries).
I built this Calendar
Model to store the availability information of a doctor, which needs to basically inform:
- on a given day, at what time the doctor starts and finishes work
- on a given day, at what time the doctor starts and finishes their break time (if they do).
Is this the optimal way to do it?
class Calendar(models.Model):
doctor = models.ForeignKey(Doctor, on_delete=models.CASCADE, related_name="appointments")
clinic = models.ForeignKey(Clinic, on_delete=models.CASCADE, related_name="appointments")
monday_start = models.TimeField()
monday_end = models.TimeField()
monday_break_start = models.TimeField()
monday_break_end = models.TimeField()
# continues for every single day of the week
Calendar
with all those columns for D-C1 and D-C2 combinations? \$\endgroup\$