# Generated by Django 5.2.7 on 2025-11-06 00:05

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


class Migration(migrations.Migration):

    dependencies = [
        ("core", "0085_remove_manualtask"),
        ("ocpp", "0037_cpfirmware_cpfirmwaredeployment"),
    ]

    operations = [
        migrations.CreateModel(
            name="RFIDSessionAttempt",
            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)),
                (
                    "rfid",
                    models.CharField(blank=True, max_length=255, verbose_name="RFID"),
                ),
                (
                    "status",
                    models.CharField(
                        choices=[("accepted", "Accepted"), ("rejected", "Rejected")],
                        max_length=16,
                    ),
                ),
                ("attempted_at", models.DateTimeField(auto_now_add=True)),
                (
                    "account",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="rfid_attempts",
                        to="core.energyaccount",
                    ),
                ),
                (
                    "charger",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="rfid_attempts",
                        to="ocpp.charger",
                    ),
                ),
                (
                    "transaction",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="rfid_attempts",
                        to="ocpp.transaction",
                    ),
                ),
            ],
            options={
                "verbose_name": "RFID Session Attempt",
                "verbose_name_plural": "RFID Session Attempts",
                "ordering": ["-attempted_at"],
            },
        ),
    ]
