# Generated by Django 3.1.7 on 2021-03-22 00:02

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Clinic',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('rnc', models.CharField(max_length=9)),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=30)),
                ('id_card', models.CharField(max_length=11, null=True)),
                ('phone_no', models.CharField(max_length=10)),
                ('email', models.CharField(max_length=75)),
                ('birth_date', models.DateField()),
                ('registration_date', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name_plural': 'People',
            },
        ),
        migrations.CreateModel(
            name='Secretary',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('clinic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='appointments.clinic')),
                ('person', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='appointments.person')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Secretaries',
            },
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('Active', 'Active'), ('Inactive', 'Inactive')], default='Active', max_length=20)),
                ('person', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='appointments.person')),
            ],
        ),
        migrations.CreateModel(
            name='Dentist',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('clinic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='appointments.clinic')),
                ('person', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='appointments.person')),
            ],
        ),
        migrations.CreateModel(
            name='Appointment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('appointment_reason', models.CharField(choices=[('CG', 'Consulta General'), ('LD', 'Limpieza Dental'), ('OR', 'Ortodoncia'), ('EX', 'Extracción'), ('RX', 'Radiografías')], default='CG', max_length=2)),
                ('payment_method', models.CharField(choices=[('CS', 'Cash'), ('DC', 'Debit Card'), ('CC', 'Credit Card')], default='CS', max_length=2)),
                ('date', models.DateTimeField()),
                ('clinic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='appointments.clinic')),
                ('dentist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='appointments.dentist')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='appointments.patient')),
            ],
        ),
    ]
