# Generated by Django 5.2.8 on 2025-11-10 23:14

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


class Migration(migrations.Migration):

    dependencies = [
        ("ocpp", "0042_chargerlogrequest_chargerlogstatus_securityevent"),
    ]

    operations = [
        migrations.CreateModel(
            name="CPFirmwareRequest",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "connector_id",
                    models.PositiveIntegerField(
                        blank=True, null=True, verbose_name="Connector ID"
                    ),
                ),
                ("vendor_id", models.CharField(blank=True, max_length=255)),
                ("requested_at", models.DateTimeField(auto_now_add=True)),
                ("responded_at", models.DateTimeField(blank=True, null=True)),
                ("status", models.CharField(blank=True, max_length=64)),
                ("response_payload", models.JSONField(blank=True, null=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "charger",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="firmware_requests",
                        to="ocpp.charger",
                    ),
                ),
                (
                    "message",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="firmware_request",
                        to="ocpp.datatransfermessage",
                    ),
                ),
            ],
            options={
                "verbose_name": "CP Firmware Request",
                "verbose_name_plural": "CP Firmware Requests",
                "ordering": ["-requested_at"],
            },
        ),
    ]
