# Generated by Django 3.2 on 2021-05-25 17:12

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('accounts', '0001_initial'),
        ('entities_details', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='ServiceAppointment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('A', 'Accepted'), ('C', 'Canceled'), ('R', 'Rejected'), ('W', 'Waiting')], default='W', max_length=1, verbose_name='status')),
                ('booking_date', models.DateTimeField(auto_now_add=True, verbose_name='booking date')),
                ('appointment_date', models.DateField(verbose_name='appointment date')),
                ('schedule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appointments', to='entities_details.serviceschedule', verbose_name='schedule')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='services_appointments', to='accounts.user', verbose_name='user')),
            ],
            options={
                'verbose_name': 'service appointment',
                'verbose_name_plural': 'Services Appointments',
            },
        ),
        migrations.CreateModel(
            name='ClinicAppointment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('A', 'Accepted'), ('C', 'Canceled'), ('R', 'Rejected'), ('W', 'Waiting')], default='W', max_length=1, verbose_name='status')),
                ('booking_date', models.DateTimeField(auto_now_add=True, verbose_name='booking date')),
                ('appointment_date', models.DateField(verbose_name='appointment date')),
                ('schedule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appointments', to='entities_details.clinicschedule', verbose_name='schedule')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='clinics_appointments', to='accounts.user', verbose_name='user')),
            ],
            options={
                'verbose_name': 'clinic appointment',
                'verbose_name_plural': 'Clinics Appointments',
            },
        ),
        migrations.AddConstraint(
            model_name='serviceappointment',
            constraint=models.UniqueConstraint(fields=('user', 'schedule', 'appointment_date'), name='unique_service_appointment'),
        ),
        migrations.AddConstraint(
            model_name='clinicappointment',
            constraint=models.UniqueConstraint(fields=('user', 'schedule', 'appointment_date'), name='unique_clinic_appointment'),
        ),
    ]
