# Generated by Django 5.2.10 on 2026-02-01 03:30

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


class Migration(migrations.Migration):

    dependencies = [
        ("locale", "0001_initial"),
        ("ocpp", "0001_squashed_0013_alter_deviceinventoryitem_options_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="PublicConnectorPage",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "slug",
                    models.UUIDField(default=uuid.uuid4, editable=False, unique=True),
                ),
                ("enabled", models.BooleanField(default=True)),
                ("title", models.CharField(blank=True, max_length=200)),
                ("instructions_markdown", models.TextField(blank=True)),
                ("rules_markdown", models.TextField(blank=True)),
                ("support_phone", models.CharField(blank=True, max_length=50)),
                ("support_whatsapp", models.CharField(blank=True, max_length=50)),
                ("support_email", models.EmailField(blank=True, max_length=254)),
                ("support_url", models.URLField(blank=True)),
                ("qr_svg", models.TextField(blank=True)),
                (
                    "qr_png",
                    models.ImageField(blank=True, upload_to="ocpp/public_pages/qr/"),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "charger",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="public_page",
                        to="ocpp.charger",
                        verbose_name="Charge Point",
                    ),
                ),
                (
                    "language",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="public_connector_pages",
                        to="locale.language",
                    ),
                ),
            ],
            options={
                "verbose_name": "Public Connector Page",
                "verbose_name_plural": "Public Connector Pages",
            },
        ),
        migrations.CreateModel(
            name="PublicScanEvent",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("user_agent", models.CharField(blank=True, max_length=255)),
                ("referrer", models.URLField(blank=True)),
                ("ip_hash", models.CharField(blank=True, max_length=64)),
                (
                    "page",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="scan_events",
                        to="ocpp.publicconnectorpage",
                        verbose_name="Public connector page",
                    ),
                ),
            ],
            options={
                "verbose_name": "Public Scan Event",
                "verbose_name_plural": "Public Scan Events",
            },
        ),
    ]
