# Generated by Django 5.2.8 on 2025-12-06 15:03

import django.core.validators
import django.db.models.deletion
from decimal import Decimal
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("groups", "0002_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="TaskCategory",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("name", models.CharField(max_length=200, verbose_name="Name")),
                (
                    "description",
                    models.TextField(
                        blank=True,
                        help_text="Optional details supporting Markdown formatting.",
                        verbose_name="Description",
                    ),
                ),
                (
                    "image",
                    models.ImageField(
                        blank=True,
                        upload_to="workgroup/task_categories/",
                        verbose_name="Image",
                    ),
                ),
                (
                    "cost",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        help_text="Estimated fulfillment cost in local currency.",
                        max_digits=10,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(Decimal("0"))
                        ],
                        verbose_name="Cost",
                    ),
                ),
                (
                    "default_duration",
                    models.DurationField(
                        blank=True,
                        help_text="Typical time expected to complete tasks in this category.",
                        null=True,
                        verbose_name="Default duration",
                    ),
                ),
                (
                    "availability",
                    models.CharField(
                        choices=[
                            ("none", "None"),
                            ("immediate", "Immediate"),
                            ("2_3_business_days", "2-3 business days"),
                            ("2_3_weeks", "2-3 weeks"),
                            ("unavailable", "Unavailable"),
                        ],
                        default="none",
                        help_text="Typical lead time for scheduling this work.",
                        max_length=32,
                        verbose_name="Availability",
                    ),
                ),
            ],
            options={
                "verbose_name": "Task Category",
                "verbose_name_plural": "Task Categories",
                "db_table": "core_taskcategory",
                "ordering": ("name",),
            },
        ),
        migrations.CreateModel(
            name="ManualTask",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                (
                    "description",
                    models.TextField(
                        help_text="Detailed summary of the work to perform.",
                        verbose_name="Requestor Comments",
                    ),
                ),
                (
                    "duration",
                    models.DurationField(
                        blank=True,
                        help_text="Estimated time to complete the task.",
                        null=True,
                        verbose_name="Expected duration",
                    ),
                ),
                (
                    "scheduled_start",
                    models.DateTimeField(
                        help_text="Planned start time for this work.",
                        verbose_name="Scheduled start",
                    ),
                ),
                (
                    "scheduled_end",
                    models.DateTimeField(
                        help_text="Planned completion time for this work.",
                        verbose_name="Scheduled end",
                    ),
                ),
                (
                    "enable_notifications",
                    models.BooleanField(
                        default=False,
                        help_text="Send reminder emails to the assigned contacts when Celery notifications are available.",
                        verbose_name="Enable notifications",
                    ),
                ),
                (
                    "assigned_group",
                    models.ForeignKey(
                        blank=True,
                        help_text="Security group containing users who can fulfill the task.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="assigned_manual_tasks",
                        to="groups.securitygroup",
                        verbose_name="Potential assignees",
                    ),
                ),
            ],
            options={
                "verbose_name": "Manual Task",
                "verbose_name_plural": "Manual Tasks",
                "db_table": "core_manualtask",
                "ordering": ("scheduled_start", "category__name"),
            },
        ),
    ]
