# Generated by Django 6.0.7 on 2026-07-23 12:44

import apps.customer.fields
import django.db.models.deletion
import timezone_field.fields
import tinymce.models
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("language", "0001_initial"),
        ("sites", "0002_alter_domain_unique"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Customer",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        primary_key=True,
                        serialize=False,
                        unique=True,
                        verbose_name="model.field.id",
                    ),
                ),
                (
                    "nickname",
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        verbose_name="model.field.nickname",
                    ),
                ),
                (
                    "gender",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("male", "enum.customer-gender.male"),
                            ("female", "enum.customer-gender.female"),
                            ("none", "enum.customer-gender.none"),
                        ],
                        default="none",
                        max_length=255,
                        null=True,
                        verbose_name="model.field.gender",
                    ),
                ),
                (
                    "avatar",
                    apps.customer.fields.CustomerImageField(
                        blank=True,
                        crop=["middle", "center"],
                        force_format=None,
                        keep_meta=True,
                        null=True,
                        quality=100,
                        scale=None,
                        size=[1024, 1024],
                        upload_to="images/customer/avatar/%Y/%m/%d",
                        verbose_name="model.field.avatar",
                    ),
                ),
                (
                    "timezone",
                    timezone_field.fields.TimeZoneField(
                        default="America/Sao_Paulo",
                        max_length=255,
                        verbose_name="model.field.timezone",
                    ),
                ),
                (
                    "activate_token",
                    models.UUIDField(
                        blank=True,
                        default=None,
                        editable=False,
                        null=True,
                        unique=True,
                        verbose_name="model.field.activate-token",
                    ),
                ),
                (
                    "recovery_token",
                    models.UUIDField(
                        blank=True,
                        default=None,
                        editable=False,
                        null=True,
                        unique=True,
                        verbose_name="model.field.recovery-token",
                    ),
                ),
                (
                    "recovery_token_created_at",
                    models.DateTimeField(
                        blank=True,
                        default=None,
                        editable=False,
                        null=True,
                        verbose_name="model.field.recovery-token-created-at",
                    ),
                ),
                (
                    "credits",
                    models.IntegerField(default=0, verbose_name="model.field.credits"),
                ),
                (
                    "obs",
                    tinymce.models.HTMLField(
                        blank=True, null=True, verbose_name="model.field.obs"
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="model.field.created-at"
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        auto_now=True, verbose_name="model.field.updated-at"
                    ),
                ),
                (
                    "language",
                    models.ForeignKey(
                        default=0,
                        on_delete=django.db.models.deletion.RESTRICT,
                        to="language.language",
                        verbose_name="model.field.language",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="customers",
                        to="sites.site",
                        verbose_name="model.field.site",
                    ),
                ),
                (
                    "user",
                    models.OneToOneField(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="customer",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="model.field.user",
                    ),
                ),
            ],
            options={
                "verbose_name": "model.customer.name",
                "verbose_name_plural": "model.customer.name.plural",
                "db_table": "customer",
            },
        ),
        migrations.CreateModel(
            name="CustomerAddress",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        primary_key=True,
                        serialize=False,
                        unique=True,
                        verbose_name="model.field.id",
                    ),
                ),
                (
                    "address_type",
                    models.CharField(
                        choices=[("main", "enum.customer-address-type.main")],
                        default="main",
                        max_length=255,
                        verbose_name="model.field.address-type",
                    ),
                ),
                (
                    "address_line1",
                    models.CharField(
                        max_length=255, verbose_name="model.field.address-line1"
                    ),
                ),
                (
                    "address_line2",
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        verbose_name="model.field.address-line2",
                    ),
                ),
                (
                    "street_number",
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        verbose_name="model.field.street-number",
                    ),
                ),
                (
                    "complement",
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        verbose_name="model.field.complement",
                    ),
                ),
                (
                    "city",
                    models.CharField(max_length=255, verbose_name="model.field.city"),
                ),
                (
                    "state",
                    models.CharField(max_length=255, verbose_name="model.field.state"),
                ),
                (
                    "postal_code",
                    models.CharField(
                        max_length=255, verbose_name="model.field.postal-code"
                    ),
                ),
                (
                    "country_code",
                    models.CharField(
                        help_text="model.field.country-code.help",
                        max_length=2,
                        verbose_name="model.field.country-code",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="model.field.created-at"
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        auto_now=True, verbose_name="model.field.updated-at"
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="addresses",
                        to="customer.customer",
                        verbose_name="model.field.customer",
                    ),
                ),
            ],
            options={
                "verbose_name": "model.customer-address.name",
                "verbose_name_plural": "model.customer-address.name.plural",
                "db_table": "customer_address",
            },
        ),
        migrations.AddIndex(
            model_name="customer",
            index=models.Index(fields=["nickname"], name="customer_nickname"),
        ),
        migrations.AddIndex(
            model_name="customer",
            index=models.Index(fields=["gender"], name="customer_gender"),
        ),
        migrations.AddIndex(
            model_name="customer",
            index=models.Index(
                fields=["activate_token"], name="customer_activate_token"
            ),
        ),
        migrations.AddIndex(
            model_name="customer",
            index=models.Index(
                fields=["recovery_token"], name="customer_recovery_token"
            ),
        ),
        migrations.AddIndex(
            model_name="customer",
            index=models.Index(fields=["created_at"], name="customer_created_at"),
        ),
        migrations.AddIndex(
            model_name="customeraddress",
            index=models.Index(
                fields=["address_type"], name="customer_address_address_type"
            ),
        ),
        migrations.AddIndex(
            model_name="customeraddress",
            index=models.Index(fields=["city"], name="customer_address_city"),
        ),
        migrations.AddIndex(
            model_name="customeraddress",
            index=models.Index(fields=["state"], name="customer_address_state"),
        ),
        migrations.AddIndex(
            model_name="customeraddress",
            index=models.Index(
                fields=["postal_code"], name="customer_address_postal_code"
            ),
        ),
        migrations.AddIndex(
            model_name="customeraddress",
            index=models.Index(
                fields=["country_code"], name="customer_address_country_code"
            ),
        ),
    ]
