# Generated by Django 5.2.8 on 2025-12-06 15:03

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="GoogleMapsLocation",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                (
                    "place_id",
                    models.CharField(
                        help_text="Google Maps place identifier for the location.",
                        max_length=255,
                        unique=True,
                        verbose_name="Place ID",
                    ),
                ),
                (
                    "map_url",
                    models.URLField(
                        blank=True,
                        default="",
                        help_text="Public map URL returned by Google Maps.",
                        verbose_name="Map URL",
                    ),
                ),
                (
                    "embed_url",
                    models.URLField(
                        blank=True,
                        default="",
                        help_text="Embeddable map URL for dashboards and reports.",
                        verbose_name="Embed URL",
                    ),
                ),
                (
                    "formatted_address",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="Normalized address provided by Google Maps.",
                        max_length=255,
                        verbose_name="Formatted address",
                    ),
                ),
                (
                    "coordinates",
                    models.JSONField(
                        blank=True,
                        help_text="Latitude/longitude and viewport details from Google Maps.",
                        null=True,
                        verbose_name="Coordinates",
                    ),
                ),
            ],
            options={
                "verbose_name": "Google Maps location",
                "verbose_name_plural": "Google Maps locations",
                "db_table": "maps_google_maps_location",
            },
        ),
        migrations.CreateModel(
            name="Location",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("name", models.CharField(max_length=200)),
                (
                    "latitude",
                    models.DecimalField(
                        blank=True, decimal_places=6, max_digits=9, null=True
                    ),
                ),
                (
                    "longitude",
                    models.DecimalField(
                        blank=True, decimal_places=6, max_digits=9, null=True
                    ),
                ),
                (
                    "zone",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("1", "Zone 1"),
                            ("1A", "Zone 1A"),
                            ("1B", "Zone 1B"),
                            ("1C", "Zone 1C"),
                            ("1D", "Zone 1D"),
                            ("1E", "Zone 1E"),
                            ("1F", "Zone 1F"),
                        ],
                        help_text="CFE climate zone used to select matching energy tariffs.",
                        max_length=3,
                    ),
                ),
                (
                    "contract_type",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("domestic", "Domestic service (Tarifa 1)"),
                            ("dac", "High consumption domestic (DAC)"),
                            ("pdbt", "General service low demand (PDBT)"),
                            ("gdbt", "General service high demand (GDBT)"),
                            ("gdmto", "General distribution medium tension (GDMTO)"),
                            (
                                "gdmth",
                                "General distribution medium tension hourly (GDMTH)",
                            ),
                        ],
                        help_text="CFE service contract type required to match energy tariff pricing.",
                        max_length=16,
                    ),
                ),
                (
                    "address_line1",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="Primary street address or location description.",
                        max_length=255,
                        verbose_name="Street address",
                    ),
                ),
                (
                    "address_line2",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="Additional address information such as suite or building.",
                        max_length=255,
                        verbose_name="Street address line 2",
                    ),
                ),
                (
                    "city",
                    models.CharField(
                        blank=True, default="", max_length=128, verbose_name="City"
                    ),
                ),
                (
                    "state",
                    models.CharField(
                        blank=True,
                        default="",
                        max_length=128,
                        verbose_name="State / Province",
                    ),
                ),
                (
                    "postal_code",
                    models.CharField(
                        blank=True,
                        default="",
                        max_length=32,
                        verbose_name="Postal code",
                    ),
                ),
                (
                    "country",
                    models.CharField(
                        blank=True, default="", max_length=64, verbose_name="Country"
                    ),
                ),
                (
                    "phone_number",
                    models.CharField(
                        blank=True,
                        default="",
                        max_length=32,
                        verbose_name="Phone number",
                    ),
                ),
            ],
            options={
                "verbose_name": "Location",
                "verbose_name_plural": "Locations",
                "db_table": "core_location",
            },
        ),
    ]
