# Generated by Django 4.2.11 on 2024-05-19 14:49

import core.fields
import datetime
import dirtyfields.dirtyfields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("claim", "0028_claimattachmenttype_claimattachment_predefined_type"),
        (
            "claim_sampling",
            "0002_remove_claimsamplingbatchassignment_claim_batch_id_and_more",
        ),
    ]

    operations = [
        migrations.CreateModel(
            name="ClaimSamplingBatch",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        db_column="UUID",
                        default=None,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "is_deleted",
                    models.BooleanField(db_column="isDeleted", default=False),
                ),
                (
                    "json_ext",
                    models.JSONField(blank=True, db_column="Json_ext", null=True),
                ),
                (
                    "date_created",
                    core.fields.DateTimeField(
                        db_column="DateCreated",
                        default=datetime.datetime.now,
                        null=True,
                    ),
                ),
                (
                    "date_updated",
                    core.fields.DateTimeField(
                        db_column="DateUpdated",
                        default=datetime.datetime.now,
                        null=True,
                    ),
                ),
                ("version", models.IntegerField(default=1)),
                ("is_completed", models.BooleanField()),
                ("is_applied", models.BooleanField()),
                (
                    "computed_value",
                    models.JSONField(blank=True, db_column="ComputedValue", null=True),
                ),
                (
                    "assigned_value",
                    models.JSONField(blank=True, db_column="AssignedValue", null=True),
                ),
                (
                    "user_created",
                    models.ForeignKey(
                        db_column="UserCreatedUUID",
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="%(class)s_user_created",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "user_updated",
                    models.ForeignKey(
                        db_column="UserUpdatedUUID",
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="%(class)s_user_updated",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(dirtyfields.dirtyfields.DirtyFieldsMixin, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalClaimSamplingBatchAssignment",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        db_column="UUID", db_index=True, default=None, editable=False
                    ),
                ),
                (
                    "is_deleted",
                    models.BooleanField(db_column="isDeleted", default=False),
                ),
                (
                    "json_ext",
                    models.JSONField(blank=True, db_column="Json_ext", null=True),
                ),
                (
                    "date_created",
                    core.fields.DateTimeField(
                        db_column="DateCreated",
                        default=datetime.datetime.now,
                        null=True,
                    ),
                ),
                (
                    "date_updated",
                    core.fields.DateTimeField(
                        db_column="DateUpdated",
                        default=datetime.datetime.now,
                        null=True,
                    ),
                ),
                ("version", models.IntegerField(default=1)),
                (
                    "status",
                    models.CharField(
                        choices=[("R", "Reviewed"), ("S", "Skipped"), ("I", "Idle")],
                        default="I",
                        max_length=2,
                    ),
                ),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField(db_index=True)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "claim_batch_id",
                    models.ForeignKey(
                        blank=True,
                        db_column="ClaimSamplingBatchID",
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="claim_sampling.claimsamplingbatch",
                    ),
                ),
                (
                    "claim_id",
                    models.ForeignKey(
                        blank=True,
                        db_column="ClaimID",
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="claim.claim",
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "user_created",
                    models.ForeignKey(
                        blank=True,
                        db_column="UserCreatedUUID",
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "user_updated",
                    models.ForeignKey(
                        blank=True,
                        db_column="UserUpdatedUUID",
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical claim sampling batch assignment",
                "verbose_name_plural": "historical claim sampling batch assignments",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="HistoricalClaimSamplingBatch",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        db_column="UUID", db_index=True, default=None, editable=False
                    ),
                ),
                (
                    "is_deleted",
                    models.BooleanField(db_column="isDeleted", default=False),
                ),
                (
                    "json_ext",
                    models.JSONField(blank=True, db_column="Json_ext", null=True),
                ),
                (
                    "date_created",
                    core.fields.DateTimeField(
                        db_column="DateCreated",
                        default=datetime.datetime.now,
                        null=True,
                    ),
                ),
                (
                    "date_updated",
                    core.fields.DateTimeField(
                        db_column="DateUpdated",
                        default=datetime.datetime.now,
                        null=True,
                    ),
                ),
                ("version", models.IntegerField(default=1)),
                ("is_completed", models.BooleanField()),
                ("is_applied", models.BooleanField()),
                (
                    "computed_value",
                    models.JSONField(blank=True, db_column="ComputedValue", null=True),
                ),
                (
                    "assigned_value",
                    models.JSONField(blank=True, db_column="AssignedValue", null=True),
                ),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField(db_index=True)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "user_created",
                    models.ForeignKey(
                        blank=True,
                        db_column="UserCreatedUUID",
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "user_updated",
                    models.ForeignKey(
                        blank=True,
                        db_column="UserUpdatedUUID",
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "historical claim sampling batch",
                "verbose_name_plural": "historical claim sampling batchs",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name="ClaimSamplingBatchAssignment",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        db_column="UUID",
                        default=None,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "is_deleted",
                    models.BooleanField(db_column="isDeleted", default=False),
                ),
                (
                    "json_ext",
                    models.JSONField(blank=True, db_column="Json_ext", null=True),
                ),
                (
                    "date_created",
                    core.fields.DateTimeField(
                        db_column="DateCreated",
                        default=datetime.datetime.now,
                        null=True,
                    ),
                ),
                (
                    "date_updated",
                    core.fields.DateTimeField(
                        db_column="DateUpdated",
                        default=datetime.datetime.now,
                        null=True,
                    ),
                ),
                ("version", models.IntegerField(default=1)),
                (
                    "status",
                    models.CharField(
                        choices=[("R", "Reviewed"), ("S", "Skipped"), ("I", "Idle")],
                        default="I",
                        max_length=2,
                    ),
                ),
                (
                    "claim_batch_id",
                    models.ForeignKey(
                        db_column="ClaimSamplingBatchID",
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="ClaimSamplingBatchID",
                        to="claim_sampling.claimsamplingbatch",
                    ),
                ),
                (
                    "claim_id",
                    models.ForeignKey(
                        db_column="ClaimID",
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="ClaimID",
                        to="claim.claim",
                    ),
                ),
                (
                    "user_created",
                    models.ForeignKey(
                        db_column="UserCreatedUUID",
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="%(class)s_user_created",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "user_updated",
                    models.ForeignKey(
                        db_column="UserUpdatedUUID",
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="%(class)s_user_updated",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(dirtyfields.dirtyfields.DirtyFieldsMixin, models.Model),
        ),
    ]
