Created and activated the booking integrity ExecPlan, then implemented staff availability, overlap prevention, and duration validation with backend tests.
Added a staff availability model and migration, a booking validation service, and serializer enforcement.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("salons", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="StaffAvailability",
|
||||
fields=[
|
||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||
(
|
||||
"day_of_week",
|
||||
models.PositiveSmallIntegerField(
|
||||
choices=[
|
||||
(0, "Monday"),
|
||||
(1, "Tuesday"),
|
||||
(2, "Wednesday"),
|
||||
(3, "Thursday"),
|
||||
(4, "Friday"),
|
||||
(5, "Saturday"),
|
||||
(6, "Sunday"),
|
||||
]
|
||||
),
|
||||
),
|
||||
("start_time", models.TimeField()),
|
||||
("end_time", models.TimeField()),
|
||||
("is_active", models.BooleanField(default=True)),
|
||||
(
|
||||
"staff",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="availability",
|
||||
to="salons.staffprofile",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"ordering": ["staff_id", "day_of_week", "start_time"],
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user