# Generated by Django 5.0.3 on 2024-04-15 20:48

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('backup_data', '0006_routerbackup_backup_text_filename'),
        ('router_manager', '0016_router_port'),
    ]

    operations = [
        migrations.CreateModel(
            name='MessageChannel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('enabled', models.BooleanField(default=True)),
                ('channel_type', models.CharField(choices=[('callmebot', 'CallMeBot'), ('ntfy', 'ntfy'), ('telegram', 'telegram')], max_length=100)),
                ('destination', models.CharField(blank=True, max_length=100, null=True)),
                ('token', models.CharField(blank=True, max_length=100, null=True)),
                ('status_change_offline', models.BooleanField(default=True)),
                ('status_change_online', models.BooleanField(default=True)),
                ('backup_fail', models.BooleanField(default=True)),
                ('daily_status_report', models.BooleanField(default=True)),
                ('daily_backup_report', models.BooleanField(default=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='MessageSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='message_settings', max_length=16, unique=True)),
                ('max_length', models.IntegerField(default=2000)),
                ('max_retry', models.IntegerField(default=3)),
                ('retry_interval', models.IntegerField(default=60)),
                ('concatenate_status_change', models.BooleanField(default=True)),
                ('status_change_delay', models.IntegerField(default=120)),
                ('concatenate_backup_fails', models.BooleanField(default=True)),
                ('backup_fails_delay', models.IntegerField(default=600)),
                ('last_daily_status_report', models.DateTimeField(blank=True, null=True)),
                ('last_daily_backup_report', models.DateTimeField(blank=True, null=True)),
                ('daily_report_time', models.CharField(default='07:00', max_length=5)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.CharField(blank=True, max_length=100, null=True)),
                ('message', models.TextField()),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('sent', 'Sent'), ('failed', 'Failed')], default='pending', max_length=100)),
                ('retry_count', models.IntegerField(default=0)),
                ('error_message', models.TextField(blank=True, null=True)),
                ('completed', models.DateTimeField(blank=True, null=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('channel', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='message_center.messagechannel')),
            ],
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('notification_type', models.CharField(choices=[('status_online', 'Status change: Online'), ('status_offline', 'Status change: Offline'), ('backup_fail', 'Backup failed')], max_length=14)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('router', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='router_manager.router')),
                ('router_backup', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='backup_data.routerbackup')),
            ],
        ),
    ]
