# Generated by Django 4.1.4 on 2023-12-12 14:22

from django.conf import settings
import django.contrib.postgres.fields.ranges
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('generic', '0009_modality_short_code_alter_modality_modality'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='RotaRotation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Name of the rotation', max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='UserRotaDetails',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('end_date', models.DateField(blank=True, help_text='The date the user should be roted up until, for example their CCT date', null=True)),
                ('start_date', models.DateField(blank=True, help_text='The date the user should be roted from, for example if they join part way through a rota cycle', null=True)),
                ('full_time_equivalence', models.IntegerField(default=100, help_text='Percentage of FTE, 100 = Full Time', validators=[django.core.validators.MaxValueValidator(100), django.core.validators.MinValueValidator(0)])),
                ('nwd_monday', models.BooleanField(default=False)),
                ('nwd_tuesday', models.BooleanField(default=False)),
                ('nwd_wednesday', models.BooleanField(default=False)),
                ('nwd_thursday', models.BooleanField(default=False)),
                ('nwd_friday', models.BooleanField(default=False)),
                ('proc_site', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='generic.site')),
                ('rotation', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='rota.rotarotation')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Rota',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_date', models.DateField(help_text='The rota start date')),
                ('weeks_to_rota', models.IntegerField(default=26, help_text='The number of (whole) weeks the rota cycle runs for')),
                ('rotations', models.ManyToManyField(help_text='The rotations that are in the rota', to='rota.rotarotation')),
            ],
        ),
        migrations.CreateModel(
            name='OutOfProgrameEvent',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_range', django.contrib.postgres.fields.ranges.DateRangeField(help_text='The range of the out of programe event')),
                ('end_date', models.DateField()),
                ('reason', models.CharField(max_length=255)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='MultiLeaveRequest',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_range', django.contrib.postgres.fields.ranges.DateRangeField(help_text='The range of the leave request')),
                ('reason', models.CharField(max_length=255)),
                ('users', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='LeaveRequest',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_range', django.contrib.postgres.fields.ranges.DateRangeField(help_text='The range of the leave request')),
                ('status', models.CharField(choices=[('UNDECIDED', 'Undecided'), ('REJECTED', 'Rejected'), ('ACCEPTED', 'Accepted')], default='UNDECIDED', max_length=10)),
                ('reason', models.CharField(max_length=255)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
