# Generated by Django 4.2.23 on 2025-11-25 19:25

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


class Migration(migrations.Migration):

    dependencies = [
        ('django_celery_beat', '0019_alter_periodictasks_options'),
        ('authentication', '0024_alter_userprofile_language'),
        ('aa_bb', '0085_bigbrotherconfig_awox_notify_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='bigbrotherconfig',
            name='are_recurring_stats_active',
            field=models.BooleanField(default=False, help_text='Are recurring stats posts activated/deactivated?'),
        ),
        migrations.AddField(
            model_name='bigbrotherconfig',
            name='stats_schedule',
            field=models.ForeignKey(blank=True, help_text='Schedule for recurring stats posts.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='bigbrother_stats_schedule', to='django_celery_beat.crontabschedule'),
        ),
        migrations.AddField(
            model_name='bigbrotherconfig',
            name='stats_webhook',
            field=models.URLField(blank=True, help_text='Discord webhook for posting recurring stats.', null=True),
        ),
        migrations.CreateModel(
            name='RecurringStatsConfig',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enabled', models.BooleanField(default=True, help_text='Master toggle for recurring stats generation.')),
                ('include_auth_users', models.BooleanField(default=True, help_text='Include total users in auth and per-state breakdown.')),
                ('include_discord_users', models.BooleanField(default=True, help_text='Include Discord users totals and per-state breakdown (if Discord service is installed).')),
                ('include_mumble_users', models.BooleanField(default=True, help_text='Include Mumble users totals and per-state breakdown (if Mumble service is installed).')),
                ('include_characters', models.BooleanField(default=True, help_text='Include total number of known characters.')),
                ('include_corporations', models.BooleanField(default=True, help_text='Include total number of known corporations.')),
                ('include_alliances', models.BooleanField(default=True, help_text='Include total number of known alliances.')),
                ('include_tokens', models.BooleanField(default=True, help_text='Include total number of ESI tokens.')),
                ('include_unique_tokens', models.BooleanField(default=True, help_text='Include number of unique token owners.')),
                ('include_character_audits', models.BooleanField(default=True, help_text='Include total number of Character Audits (from corptools).')),
                ('include_corporation_audits', models.BooleanField(default=True, help_text='Include total number of Corporation Audits (from corptools).')),
                ('last_run_at', models.DateTimeField(blank=True, help_text='When recurring stats were last posted.', null=True)),
                ('last_snapshot', models.JSONField(blank=True, default=dict, help_text='Previous stats snapshot for delta calculations.')),
                ('states', models.ManyToManyField(blank=True, help_text='States to break out in the recurring stats (e.g. Member, Blue, Alumni).', to='authentication.state')),
            ],
            options={
                'verbose_name': 'Recurring Stats Configuration',
            },
        ),
    ]
