# Generated by Django 5.2.8 on 2025-11-21 00:20

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


class Migration(migrations.Migration):

    dependencies = [
        ("ocpp", "0059_simulator_default_simulator_unique_default_simulator"),
    ]

    operations = [
        migrations.CreateModel(
            name="StationModel",
            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)),
                ("vendor", models.CharField(max_length=100, verbose_name="Vendor")),
                (
                    "model_family",
                    models.CharField(max_length=100, verbose_name="Model Family"),
                ),
                ("model", models.CharField(max_length=100, verbose_name="Model")),
                (
                    "max_power_kw",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        help_text="Maximum sustained charging power supported by this model.",
                        max_digits=6,
                        null=True,
                        verbose_name="Max Power (kW)",
                    ),
                ),
                (
                    "max_voltage_v",
                    models.PositiveIntegerField(
                        blank=True,
                        help_text="Maximum supported operating voltage.",
                        null=True,
                        verbose_name="Max Voltage (V)",
                    ),
                ),
                (
                    "connector_type",
                    models.CharField(
                        blank=True,
                        help_text="Primary connector format supported by this model.",
                        max_length=64,
                        verbose_name="Connector Type",
                    ),
                ),
                (
                    "notes",
                    models.TextField(
                        blank=True,
                        default="",
                        help_text="Optional comments about capabilities or certifications.",
                    ),
                ),
            ],
            options={
                "verbose_name": "Station Model",
                "verbose_name_plural": "Station Models",
                "db_table": "core_stationmodel",
                "unique_together": {("vendor", "model_family", "model")},
            },
        ),
        migrations.AddField(
            model_name="charger",
            name="station_model",
            field=models.ForeignKey(
                blank=True,
                help_text="Optional hardware model for this EVCS.",
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="chargers",
                to="ocpp.stationmodel",
                verbose_name="Station Model",
            ),
        ),
    ]
