# Generated by Django 5.1.1 on 2025-01-07 20:25

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


class Migration(migrations.Migration):
    dependencies = [
        ("bloomerp", "0061_remove_documenttemplate_avatar_and_more"),
        ("contenttypes", "0002_remove_content_type_name"),
    ]

    operations = [
        migrations.AlterField(
            model_name="sqlqueryfilter",
            name="data_type",
            field=models.CharField(
                choices=[
                    ("STRING", "String"),
                    ("INTEGER", "Integer"),
                    ("FLOAT", "Float"),
                    ("DATE", "Date"),
                    ("DATETIME", "Datetime"),
                    ("BOOLEAN", "Boolean"),
                    ("MODEL", "Model"),
                    ("USER", "User"),
                ],
                default="STRING",
                help_text="Data type of the filter",
                max_length=255,
            ),
        ),
        migrations.CreateModel(
            name="Todo",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("datetime_created", models.DateTimeField(auto_now_add=True)),
                ("datetime_updated", models.DateTimeField(auto_now=True)),
                (
                    "avatar",
                    models.ImageField(blank=True, null=True, upload_to="avatars/"),
                ),
                (
                    "required_by",
                    models.DateTimeField(
                        help_text="The date by which the todo is required"
                    ),
                ),
                (
                    "priority",
                    models.CharField(
                        choices=[
                            ("LOW", "Low"),
                            ("MEDIUM", "Medium"),
                            ("HIGH", "High"),
                        ],
                        help_text="The priority of the todo",
                        max_length=255,
                    ),
                ),
                ("content", models.TextField()),
                ("is_completed", models.BooleanField(default=False)),
                ("datetime_completed", models.DateTimeField(blank=True, null=True)),
                ("object_id", models.PositiveIntegerField(blank=True, null=True)),
                (
                    "content_type",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="%(class)s_created",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "requested_by",
                    models.ForeignKey(
                        blank=True,
                        help_text="The user who requested the todo",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="requested_todos",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "updated_by",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="%(class)s_updated",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="todos",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "db_table": "bloomerp_todo",
                "abstract": False,
                "managed": True,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "bulk_change",
                    "bulk_delete",
                    "bulk_add",
                    "export",
                ),
            },
        ),
    ]
