# Generated by Django 5.2.8 on 2025-12-06 15:03

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Protocol",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("slug", models.SlugField(unique=True)),
                ("name", models.CharField(max_length=128)),
                ("version", models.CharField(max_length=32)),
                ("description", models.TextField(blank=True)),
            ],
            options={
                "ordering": ["slug"],
            },
        ),
        migrations.CreateModel(
            name="ProtocolCall",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=128)),
                (
                    "direction",
                    models.CharField(
                        choices=[
                            ("cp_to_csms", "Charge point to CSMS"),
                            ("csms_to_cp", "CSMS to charge point"),
                        ],
                        max_length=16,
                    ),
                ),
                (
                    "protocol",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="calls",
                        to="protocols.protocol",
                    ),
                ),
            ],
            options={
                "ordering": ["protocol__slug", "name"],
                "unique_together": {("protocol", "name", "direction")},
            },
        ),
    ]
