# Generated by Django 3.1.6 on 2021-05-05 08:56

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('account', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Schedule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('day', models.DateField()),
                ('start_time', models.TimeField()),
                ('end_time', models.TimeField()),
                ('isBooked', models.BooleanField(default=False)),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='provider_account', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Provider',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone', models.CharField(blank=True, help_text='Contact phone number', max_length=10)),
                ('years_of_experience', models.CharField(choices=[('0-2', 'Entry (0-2yrs)'), ('3-5', 'Mid (3-5yrs)'), ('5+', 'Senior (5+ yrs)')], default='0-2', max_length=4)),
                ('registered_council', models.CharField(choices=[('HPCSA', 'Health Professions Council of South Africa'), ('CCSA', 'Council for Counsellors in South Africa')], default='HPCSA', max_length=5)),
                ('electronic_card', models.FileField(blank=True, null=True, upload_to='provider_files')),
                ('profile', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='provider_profile', to='account.profile')),
            ],
        ),
        migrations.CreateModel(
            name='Booking',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('room_code', models.CharField(default=provider.models.generate_room_code, max_length=20, null=True, unique=True)),
                ('isAccepted', models.BooleanField(default=False)),
                ('isEnded', models.BooleanField(default=False)),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='patient_booking', to=settings.AUTH_USER_MODEL)),
                ('provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='booked_physician', to=settings.AUTH_USER_MODEL)),
                ('timeslot', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='provider_timeslot', to='provider.schedule')),
            ],
        ),
    ]
