# Generated by Django 4.2.23 on 2026-01-03 19:42

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

class Migration(migrations.Migration):

    dependencies = [
        ('aa_bb', '0100_tickettoolconfig_use_forum_threads'),
    ]

    operations = [
        migrations.AddField(
            model_name='userstatus',
            name='compliance_forum_thread_id',
            field=models.BigIntegerField(blank=True, null=True),
        ),
        migrations.AlterModelOptions(
            name='general',
            options={'default_permissions': (), 'managed': False,
                     'permissions': (('basic_access', 'Can access Big Brother'),
                                     ('full_access', 'Can view all main characters in Big Brother'),
                                     ('recruiter_access',
                                      'Can view main characters in Guest state only in Big Brother'),
                                     ('basic_access_cb', 'Can access Corp Brother'),
                                     ('full_access_cb', 'Can view all corps in Corp Brother'),
                                     ('recruiter_access_cb', "Can view guest's corps only in Corp Brother"),
                                     ('can_blacklist_characters', 'Can add characters to blacklist'),
                                     ('can_access_loa', 'Can access and submit a Leave Of Absence request'),
                                     ('can_view_all_loa', 'Can view all Leave Of Absence requests'),
                                     ('can_manage_loa', 'Can manage Leave Of Absence requests'),
                                     ('can_access_paps', 'Can access PAP Stats'),
                                     ('can_generate_paps', 'Can generate PAP Stats'),
                                     ('ticket_manager', 'Can manage compliance tickets'))},
        ),
        migrations.CreateModel(
            name='ComplianceTicketComment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comment', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('ticket', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments',
                                             to='aa_bb.complianceticket')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL,
                                           to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Ticket Comment',
                'verbose_name_plural': 'Ticket Comments',
                'ordering': ['created_at'],
            },
        ),
        migrations.AddField(
            model_name='tickettoolconfig',
            name='Forum_Channel_ID',
            field=models.PositiveBigIntegerField(blank=True, default=0,
                                                 help_text='Channel ID to create threads in (for Bot-managed threads)',
                                                 null=True, verbose_name='Forum/Thread Channel ID'),
        ),
        migrations.AddField(
            model_name='tickettoolconfig',
            name='ticket_type',
            field=models.CharField(
                choices=[('private_channel', 'Private Channels (Bot)'), ('private_thread', 'Private Threads (Bot)'),
                         ('forum_thread', 'Public Forum Threads (Webhook)'), ('auth_only', 'Auth Only (No Discord)')],
                default='private_channel',
                help_text="Choose how compliance tickets are created. 'Private Threads' requires aadiscordbot.",
                max_length=20, verbose_name='Ticket Type'),
        ),
        migrations.AlterField(
            model_name='complianceticket',
            name='reason',
            field=models.CharField(choices=[('corp_check', 'Corp Compliance'), ('paps_check', 'PAP Requirements'),
                                            ('afk_check', 'Inactivity'), ('discord_check', 'User is not on discord'),
                                            ('char_removed', 'Character removed'), ('awox_kill', 'AWOX kill found')],
                                   max_length=20),
        ),
        migrations.CreateModel(
            name='ComplianceThread',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reason', models.CharField(max_length=20)),
                ('thread_id', models.BigIntegerField()),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='compliance_threads',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Compliance Thread',
                'verbose_name_plural': 'Compliance Threads',
                'unique_together': {('user', 'reason')},
            },
        ),
        migrations.AlterField(
            model_name='complianceticket',
            name='discord_channel_id',
            field=models.BigIntegerField(blank=True, db_index=True, null=True),
        ),
        migrations.AddField(
            model_name='tickettoolconfig',
            name='awox_kill_reason',
            field=models.TextField(blank=True,
                                   default='<@&{role}>,<@{namee}> detection indicates your involvement in an AWOX kill, please explain:\n{details}',
                                   help_text='Message to send with {role}, {namee} and {details} variables', null=True),
        ),
        migrations.AddField(
            model_name='tickettoolconfig',
            name='char_removed_reason',
            field=models.TextField(blank=True,
                                   default='<@&{role}>,<@{namee}> Auth lost access to your character {details}, please fix it ASAP.',
                                   help_text='Message to send with {role}, {namee} and {details} variables', null=True),
        ),
    ]
