# Generated by Django 5.2.8 on 2025-11-11 02:02

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


class Migration(migrations.Migration):

    dependencies = [
        ("core", "0093_drop_existing_todos"),
        ("ocpp", "0043_cpfirmwarerequest"),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=[],
            state_operations=[
                migrations.DeleteModel(name="Brand"),
                migrations.DeleteModel(name="ElectricVehicle"),
                migrations.DeleteModel(name="EVModel"),
                migrations.CreateModel(
                    name="Brand",
                    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=100, unique=True)),
                    ],
                    options={
                        "verbose_name": "EV Brand",
                        "verbose_name_plural": "EV Brands",
                        "db_table": "core_brand",
                    },
                ),
                migrations.CreateModel(
                    name="WMICode",
                    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)),
                        ("code", models.CharField(max_length=3, unique=True)),
                        (
                            "brand",
                            models.ForeignKey(
                                on_delete=django.db.models.deletion.CASCADE,
                                related_name="wmi_codes",
                                to="ocpp.brand",
                            ),
                        ),
                    ],
                    options={
                        "verbose_name": "WMI Code",
                        "verbose_name_plural": "WMI Codes",
                        "db_table": "core_wmicode",
                    },
                ),
                migrations.CreateModel(
                    name="EVModel",
                    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=100)),
                        (
                            "battery_capacity_kwh",
                            models.DecimalField(
                                blank=True,
                                decimal_places=2,
                                max_digits=6,
                                null=True,
                                verbose_name="Battery Capacity (kWh)",
                            ),
                        ),
                        (
                            "est_battery_kwh",
                            models.DecimalField(
                                blank=True,
                                decimal_places=2,
                                max_digits=6,
                                null=True,
                                verbose_name="Estimated Battery (kWh)",
                            ),
                        ),
                        (
                            "ac_110v_power_kw",
                            models.DecimalField(
                                blank=True,
                                decimal_places=2,
                                max_digits=5,
                                null=True,
                                verbose_name="110V AC (kW)",
                            ),
                        ),
                        (
                            "ac_220v_power_kw",
                            models.DecimalField(
                                blank=True,
                                decimal_places=2,
                                max_digits=5,
                                null=True,
                                verbose_name="220V AC (kW)",
                            ),
                        ),
                        (
                            "dc_60_power_kw",
                            models.DecimalField(
                                blank=True,
                                decimal_places=2,
                                max_digits=5,
                                null=True,
                                verbose_name="60kW DC (kW)",
                            ),
                        ),
                        (
                            "dc_100_power_kw",
                            models.DecimalField(
                                blank=True,
                                decimal_places=2,
                                max_digits=5,
                                null=True,
                                verbose_name="100kW DC (kW)",
                            ),
                        ),
                        (
                            "brand",
                            models.ForeignKey(
                                on_delete=django.db.models.deletion.CASCADE,
                                related_name="ev_models",
                                to="ocpp.brand",
                            ),
                        ),
                    ],
                    options={
                        "verbose_name": "EV Model",
                        "verbose_name_plural": "EV Models",
                        "db_table": "core_evmodel",
                        "unique_together": {("brand", "name")},
                    },
                ),
                migrations.CreateModel(
                    name="ElectricVehicle",
                    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)),
                        (
                            "vin",
                            models.CharField(max_length=17, unique=True, verbose_name="VIN"),
                        ),
                        (
                            "license_plate",
                            models.CharField(
                                blank=True,
                                max_length=20,
                                verbose_name="License Plate",
                            ),
                        ),
                        (
                            "account",
                            models.ForeignKey(
                                on_delete=django.db.models.deletion.CASCADE,
                                related_name="vehicles",
                                to="core.energyaccount",
                            ),
                        ),
                        (
                            "brand",
                            models.ForeignKey(
                                blank=True,
                                null=True,
                                on_delete=django.db.models.deletion.SET_NULL,
                                related_name="vehicles",
                                to="ocpp.brand",
                            ),
                        ),
                        (
                            "model",
                            models.ForeignKey(
                                blank=True,
                                null=True,
                                on_delete=django.db.models.deletion.SET_NULL,
                                related_name="vehicles",
                                to="ocpp.evmodel",
                            ),
                        ),
                    ],
                    options={
                        "verbose_name": "Electric Vehicle",
                        "verbose_name_plural": "Electric Vehicles",
                        "db_table": "core_electricvehicle",
                    },
                ),
            ],
        ),
    ]
