# Generated by Django 5.2.11 on 2026-02-10 15:47

import uuid

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


class Migration(migrations.Migration):
    dependencies = [
        ("core", "0028_remove_templateaccess_template_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="UserReconciliationCsvImport",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        help_text="primary key for the record as UUID",
                        primary_key=True,
                        serialize=False,
                        verbose_name="id",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        auto_now_add=True,
                        help_text="date and time at which a record was created",
                        verbose_name="created on",
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        auto_now=True,
                        help_text="date and time at which a record was last updated",
                        verbose_name="updated on",
                    ),
                ),
                (
                    "file",
                    models.FileField(upload_to="imports/", verbose_name="CSV file"),
                ),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("pending", "Pending"),
                            ("running", "Running"),
                            ("done", "Done"),
                            ("error", "Error"),
                        ],
                        default="pending",
                        max_length=20,
                    ),
                ),
                ("logs", models.TextField(blank=True)),
            ],
            options={
                "verbose_name": "user reconciliation CSV import",
                "verbose_name_plural": "user reconciliation CSV imports",
                "db_table": "impress_user_reconciliation_csv_import",
            },
        ),
        migrations.CreateModel(
            name="UserReconciliation",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        help_text="primary key for the record as UUID",
                        primary_key=True,
                        serialize=False,
                        verbose_name="id",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        auto_now_add=True,
                        help_text="date and time at which a record was created",
                        verbose_name="created on",
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        auto_now=True,
                        help_text="date and time at which a record was last updated",
                        verbose_name="updated on",
                    ),
                ),
                (
                    "active_email",
                    models.EmailField(
                        max_length=254, verbose_name="Active email address"
                    ),
                ),
                (
                    "inactive_email",
                    models.EmailField(
                        max_length=254, verbose_name="Email address to deactivate"
                    ),
                ),
                ("active_email_checked", models.BooleanField(default=False)),
                ("inactive_email_checked", models.BooleanField(default=False)),
                (
                    "active_email_confirmation_id",
                    models.UUIDField(
                        default=uuid.uuid4, editable=False, null=True, unique=True
                    ),
                ),
                (
                    "inactive_email_confirmation_id",
                    models.UUIDField(
                        default=uuid.uuid4, editable=False, null=True, unique=True
                    ),
                ),
                (
                    "source_unique_id",
                    models.CharField(
                        blank=True,
                        max_length=100,
                        null=True,
                        verbose_name="Unique ID in the source file",
                    ),
                ),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("pending", "Pending"),
                            ("ready", "Ready"),
                            ("done", "Done"),
                            ("error", "Error"),
                        ],
                        default="pending",
                        max_length=20,
                    ),
                ),
                ("logs", models.TextField(blank=True)),
                (
                    "active_user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="active_user",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "inactive_user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="inactive_user",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "user reconciliation",
                "verbose_name_plural": "user reconciliations",
                "db_table": "impress_user_reconciliation",
                "ordering": ["-created_at"],
            },
        ),
    ]
