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

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('aa_bb', '0078_tickettoolconfig_awox_monitor_enabled'),
    ]

    operations = [
        migrations.CreateModel(
            name='BigBrotherRedditMessage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('used_in_cycle', models.BooleanField(default=False, help_text='Automatically toggled once the message is used in a cycle.')),
                ('title', models.CharField(help_text='Title that will be used for the reddit submission.', max_length=300)),
                ('content', models.TextField(help_text='Markdown body shared to reddit.')),
                ('created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Reddit recruitment message',
                'verbose_name_plural': 'Reddit recruitment messages',
                'ordering': ['-created'],
            },
        ),
        migrations.CreateModel(
            name='BigBrotherRedditSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enabled', models.BooleanField(default=False, help_text='Toggle after configuration to allow reddit automation to run.')),
                ('reddit_client_id', models.CharField(blank=True, help_text='Application client ID from reddit.', max_length=128)),
                ('reddit_client_secret', models.CharField(blank=True, help_text='Application secret from reddit.', max_length=255)),
                ('reddit_user_agent', models.CharField(blank=True, default='aa-bb-scheduler/1.0', help_text='Custom user agent that will appear in reddit API calls.', max_length=255)),
                ('reddit_scope', models.CharField(default='identity submit read', help_text='Space separated scopes requested during Reddit OAuth.', max_length=255)),
                ('reddit_redirect_override', models.URLField(blank=True, help_text='Optional custom redirect URI if auto-detected URI is unsuitable.', null=True)),
                ('reddit_subreddit', models.CharField(default='evejobs', help_text='Name of the subreddit to post to.', max_length=64)),
                ('post_interval_days', models.PositiveIntegerField(default=8, help_text='Minimum delay in days between reddit posts.')),
                ('reddit_webhook', models.URLField(blank=True, help_text='Discord webhook where post confirmations should be sent.', null=True)),
                ('reddit_webhook_message', models.TextField(blank=True, default='New reddit post published: {title}\n{url}', help_text='Template for Discord notifications. Supports {title}, {url}, {subreddit}.')),
                ('reply_message_template', models.TextField(blank=True, default='New reply by {author}: {url}', help_text='Template used when alerting about new replies on reddit.')),
                ('reddit_access_token', models.TextField(blank=True, editable=False, help_text='Stored Reddit OAuth access token (hidden in admin).')),
                ('reddit_refresh_token', models.TextField(blank=True, editable=False, help_text='Stored Reddit OAuth refresh token (hidden in admin).')),
                ('reddit_token_type', models.CharField(blank=True, editable=False, help_text='Token type returned by Reddit OAuth (hidden in admin).', max_length=32)),
                ('reddit_token_obtained', models.DateTimeField(blank=True, editable=False, help_text='Timestamp when the Reddit token was stored.', null=True)),
                ('reddit_account_name', models.CharField(blank=True, editable=False, help_text='Reddit account authorized via OAuth (hidden in admin).', max_length=64)),
                ('last_submission_id', models.CharField(blank=True, editable=False, help_text='Most recent reddit submission id (hidden in admin).', max_length=32)),
                ('last_submission_permalink', models.URLField(blank=True, editable=False, help_text='Link to the most recent reddit submission (hidden in admin).', null=True)),
                ('last_submission_at', models.DateTimeField(blank=True, editable=False, help_text='When the most recent post was created.', null=True)),
                ('last_reply_checked_at', models.DateTimeField(blank=True, editable=False, help_text='When reddit replies were last scanned.', null=True)),
            ],
            options={
                'verbose_name': 'BigBrother reddit settings',
            },
        ),
    ]
