# Generated by Django 5.2.11 on 2026-03-12 22:24

import django.db.models.deletion
import netbox.models.deletion
import taggit.managers
import utilities.json
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("dcim", "0226_modulebay_rebuild_tree"),
        ("extras", "0134_owner"),
        ("netbox_fms", "0006_rework_spliceplanentry"),
    ]

    operations = [
        migrations.CreateModel(
            name="ClosureCableEntry",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
                ("created", models.DateTimeField(auto_now_add=True, null=True)),
                ("last_updated", models.DateTimeField(auto_now=True, null=True)),
                (
                    "custom_field_data",
                    models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
                ),
                ("notes", models.TextField(blank=True)),
                (
                    "closure",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, related_name="cable_entries", to="dcim.device"
                    ),
                ),
                (
                    "entrance_port",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="closure_cable_entries",
                        to="dcim.rearport",
                    ),
                ),
                (
                    "fiber_cable",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="closure_entries",
                        to="netbox_fms.fibercable",
                    ),
                ),
                ("tags", taggit.managers.TaggableManager(through="extras.TaggedItem", to="extras.Tag")),
            ],
            options={
                "verbose_name": "closure cable entry",
                "verbose_name_plural": "closure cable entries",
                "ordering": ("closure", "entrance_port"),
                "unique_together": {("closure", "entrance_port")},
            },
            bases=(netbox.models.deletion.DeleteMixin, models.Model),
        ),
    ]
