# Generated by Django 5.2.7 on 2025-10-21 08:14

import cesnet_service_path_plugin.models.segment_financial_info
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 = [
        ("cesnet_service_path_plugin", "0026_segment_segment_type_segment_type_specific_data"),
        ("extras", "0133_make_cf_minmax_decimal"),
    ]

    operations = [
        migrations.CreateModel(
            name="SegmentFinancialInfo",
            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),
                ),
                ("monthly_charge", models.DecimalField(decimal_places=2, max_digits=10)),
                (
                    "charge_currency",
                    models.CharField(
                        default=cesnet_service_path_plugin.models.segment_financial_info.get_default_currency,
                        max_length=3,
                    ),
                ),
                ("non_recurring_charge", models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ("commitment_period_months", models.PositiveIntegerField(blank=True, null=True)),
                ("notes", models.TextField(blank=True)),
                (
                    "segment",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="financial_info",
                        to="cesnet_service_path_plugin.segment",
                    ),
                ),
                ("tags", taggit.managers.TaggableManager(through="extras.TaggedItem", to="extras.Tag")),
            ],
            options={
                "abstract": False,
            },
            bases=(netbox.models.deletion.DeleteMixin, models.Model),
        ),
    ]
