Files
mohd 411180e312 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.
2026-02-28 12:05:57 +03:00

46 lines
1.5 KiB
Python

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"],
},
),
]