# Generated by Django 5.2.2 on 2025-06-16 10:30

import django.db.models.deletion
import django.utils.timezone
import recurrence.fields
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("birder", "0006_remove_monitor_config_store_monitor_configuration"),
    ]

    operations = [
        migrations.CreateModel(
            name="Deadline",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("title", models.CharField(max_length=100)),
                ("description", models.TextField(blank=True)),
                ("start", models.DateField(default=django.utils.timezone.now)),
                ("end", models.DateField(blank=True, null=True)),
                ("recurrences", recurrence.fields.RecurrenceField()),
                (
                    "warn_threshold",
                    models.IntegerField(default=7, help_text="How many days before the deadline should warn monitor"),
                ),
                (
                    "alarm_threshold",
                    models.IntegerField(default=1, help_text="How many days before the deadline should alarm monitor"),
                ),
                (
                    "monitor",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, related_name="deadlines", to="birder.monitor"
                    ),
                ),
            ],
            options={
                "ordering": ["-start"],
            },
        ),
    ]
