# Generated by Django 5.2.15 on 2026-06-10 10:37

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("opcalendar", "0027_eventmember_comment_eventmember_status_usersettings"),
    ]

    operations = [
        migrations.AlterModelOptions(
            name="general",
            options={
                "default_permissions": (),
                "managed": False,
                "permissions": (
                    (
                        "basic_access",
                        "Can access this app and see operations based on visibility rules",
                    ),
                    ("create_event", "Can create and edit own events"),
                    ("see_signups", "Can see all signups for event"),
                    ("manage_event", "Can delete and manage own events"),
                    ("manage_all_events", "Can edit and delete all events"),
                    (
                        "add_ingame_calendar_owner",
                        "Can add ingame calendar feeds for their corporation",
                    ),
                ),
            },
        ),
        migrations.AddField(
            model_name="event",
            name="important",
            field=models.BooleanField(
                default=False,
                help_text="Mark this operation as important. Important operations show a blinking red indicator on the calendar so members notice them at a glance.",
            ),
        ),
        migrations.AddField(
            model_name="event",
            name="notification_custom_date",
            field=models.DateTimeField(
                blank=True,
                help_text="Custom date and time to send the Discord ping. Only used when 'Custom date and time' is selected above.",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="event",
            name="notification_timings",
            field=models.JSONField(
                blank=True,
                default=list,
                help_text="When to ping this event on Discord. Select any combination of now, a relative time before fleet start, or a custom date and time.",
            ),
        ),
        migrations.AddField(
            model_name="event",
            name="notifications_sent",
            field=models.JSONField(
                blank=True,
                default=list,
                editable=False,
                help_text="Tracks which notification timings have already been sent",
            ),
        ),
        migrations.AddField(
            model_name="event",
            name="repeat_group_id",
            field=models.UUIDField(
                blank=True,
                db_index=True,
                help_text="Links all events created as part of the same repeat chain",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="event",
            name="repeat_interval",
            field=models.PositiveIntegerField(
                blank=True,
                default=1,
                help_text="Repeat every X of the selected interval (e.g. 2 = every 2 weeks)",
                null=True,
            ),
        ),
        migrations.AddField(
            model_name="eventcategory",
            name="icon",
            field=models.CharField(
                blank=True,
                default="",
                help_text="Optional FontAwesome icon classes to display on the calendar for this category, e.g. 'fas fa-rocket' or 'far fa-clock' or 'fab fa-discord'. Enter the full set of classes exactly as you would in HTML — any icon style available in your AllianceAuth installation's bundled FontAwesome version works. The icon will be tinted using the color set above.",
                max_length=100,
            ),
        ),
        migrations.AlterField(
            model_name="event",
            name="repeat_event",
            field=models.CharField(
                blank=True,
                choices=[
                    ("DD", "Daily"),
                    ("WE", "Weekly"),
                    ("BW", "Every 2 weeks"),
                    ("MM", "Monthly"),
                    ("YY", "Yearly"),
                ],
                default=False,
                help_text="Select if you want to repeat this event in the future",
                max_length=32,
                null=True,
            ),
        ),
        migrations.CreateModel(
            name="EventChannel",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        help_text="A label to help you tell channels apart in the admin.",
                        max_length=150,
                    ),
                ),
                (
                    "channel_id",
                    models.BigIntegerField(
                        help_text="The Discord channel ID events should be posted to.",
                        unique=True,
                    ),
                ),
                (
                    "summary_message_id",
                    models.BigIntegerField(
                        blank=True,
                        help_text="Internal: ID of the pinned message showing the sorted schedule overview.",
                        null=True,
                    ),
                ),
                (
                    "enabled",
                    models.BooleanField(
                        default=True,
                        help_text="Whether this channel should currently receive event posts.",
                    ),
                ),
                (
                    "event_visibility",
                    models.ManyToManyField(
                        blank=True,
                        help_text="Events with any of these visibilities will be posted to this channel. Visibility (who can see the channel) is managed in Discord directly — this only controls which events get sent here.",
                        related_name="event_channels",
                        to="opcalendar.eventvisibility",
                    ),
                ),
            ],
            options={
                "verbose_name": "Event Channel",
                "verbose_name_plural": "Event Channels",
            },
        ),
    ]
