# Generated by Django 3.2.8 on 2021-10-26 14:24

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="Approval",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "type",
                    models.CharField(
                        choices=[
                            ("head_of_profession", "Head of Profession"),
                            ("busops", "BusOps"),
                            ("chief", "Chief"),
                            ("hrbp", "HRBP"),
                            ("finance", "Finance"),
                            ("commercial", "Commercial"),
                        ],
                        max_length=20,
                    ),
                ),
                ("approved", models.BooleanField(null=True)),
                ("timestamp", models.DateTimeField(auto_now_add=True)),
            ],
            options={
                "ordering": ["-timestamp"],
                "permissions": (
                    (
                        "can_give_head_of_profession_approval",
                        "Can give head of profession approval",
                    ),
                    ("can_give_busops_approval", "Can give BusOps approval"),
                    ("can_give_chief_approval", "Can give chief approval"),
                    ("can_give_hrbp_approval", "Can give HRBP approval"),
                    ("can_give_finance_approval", "Can give finance approval"),
                    ("can_give_commercial_approval", "Can give commercial approval"),
                ),
            },
        ),
        migrations.CreateModel(
            name="ResourcingRequest",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "state",
                    models.SmallIntegerField(
                        choices=[
                            (0, "Draft"),
                            (1, "Awaiting approvals"),
                            (2, "Approved"),
                        ],
                        default=0,
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                (
                    "is_ir35",
                    models.BooleanField(
                        choices=[(True, "Yes"), (False, "No")],
                        null=True,
                        verbose_name="Is the role inside IR35?",
                    ),
                ),
                (
                    "busops_approval",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="busops_approval",
                        to="main.approval",
                    ),
                ),
                (
                    "chief",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "chief_approval",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="chief_approval",
                        to="main.approval",
                    ),
                ),
                (
                    "commercial_approval",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="commercial_approval",
                        to="main.approval",
                    ),
                ),
                (
                    "finance_approval",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="finance_approval",
                        to="main.approval",
                    ),
                ),
                (
                    "head_of_profession_approval",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="head_of_profession_approval",
                        to="main.approval",
                    ),
                ),
                (
                    "hrbp_approval",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="hrbp_approval",
                        to="main.approval",
                    ),
                ),
                (
                    "requestor",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="resourcing_requests",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="StatementOfWork",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("company_name", models.CharField(max_length=255)),
                (
                    "resourcing_request",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="statement_of_work",
                        to="main.resourcingrequest",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="SdsStatusDetermination",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("todo", models.TextField()),
                (
                    "resourcing_request",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sds_status_determination",
                        to="main.resourcingrequest",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="JobDescription",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "title",
                    models.CharField(max_length=255, verbose_name="Vacancy Title"),
                ),
                (
                    "role_purpose",
                    models.TextField(
                        help_text="Use this space to outline what the person is responsible for delivering and how this contributes to the success of the department. More detail on this will be added in the next section."
                    ),
                ),
                (
                    "key_accountabilities",
                    models.TextField(
                        help_text="Outline what the individual needs to do in order to achieve to deliverables outlined above."
                    ),
                ),
                ("line_management_responsibility", models.TextField()),
                (
                    "personal_attributes_and_skills",
                    models.TextField(
                        help_text="Insert information about what the ideal candidate would be like in their character and what they’d bring to your team. This will enhance our search ability and interview quality."
                    ),
                ),
                (
                    "essential_and_preferred_experience",
                    models.TextField(
                        help_text="You must ensure the successful candidate meets your specification entirely, so do not put expectations that are not vital.\n\nThe diversity of applicants you receive to roles increases when shorter lists of personal and experience requirements are listed, which creates a better pool of candidates to select from at interview."
                    ),
                ),
                (
                    "resourcing_request",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="job_description",
                        to="main.resourcingrequest",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="InterimRequest",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("todo", models.TextField()),
                (
                    "resourcing_request",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="interim_request",
                        to="main.resourcingrequest",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Comment",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("timestamp", models.DateTimeField(auto_now_add=True)),
                ("text", models.TextField(verbose_name="Add a comment")),
                (
                    "resourcing_request",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="comments",
                        to="main.resourcingrequest",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="comments",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="CestRationale",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("todo", models.TextField()),
                (
                    "resourcing_request",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cest_rationale",
                        to="main.resourcingrequest",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="approval",
            name="reason",
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="reason",
                to="main.comment",
            ),
        ),
        migrations.AddField(
            model_name="approval",
            name="resourcing_request",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="approvals",
                to="main.resourcingrequest",
            ),
        ),
        migrations.AddField(
            model_name="approval",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddIndex(
            model_name="resourcingrequest",
            index=models.Index(fields=["state"], name="state_index"),
        ),
        migrations.AddIndex(
            model_name="approval",
            index=models.Index(fields=["type"], name="main_approv_type_b98f30_idx"),
        ),
    ]
