# Generated by Django 4.2.23 on 2025-09-03 03:13

import django.db.models.deletion
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations
from django.db import models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="SystemMessageType",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    django_extensions.db.fields.CreationDateTimeField(
                        auto_now_add=True, verbose_name="created"
                    ),
                ),
                (
                    "modified",
                    django_extensions.db.fields.ModificationDateTimeField(
                        auto_now=True, verbose_name="modified"
                    ),
                ),
                ("name", models.CharField(max_length=32, verbose_name="Name")),
                (
                    "icon",
                    models.CharField(
                        blank=True,
                        help_text="Icon Name von https://mdisearch.com/ ohne mdi-Prefix mit Bindestrich getrennt",
                        max_length=255,
                        null=True,
                        verbose_name="Icon",
                    ),
                ),
            ],
            options={
                "verbose_name": "Systemmeldungstyp",
                "verbose_name_plural": "Systemmeldungstypen",
                "ordering": ("name",),
            },
        ),
        migrations.CreateModel(
            name="SystemMessage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    django_extensions.db.fields.CreationDateTimeField(
                        auto_now_add=True, verbose_name="created"
                    ),
                ),
                (
                    "modified",
                    django_extensions.db.fields.ModificationDateTimeField(
                        auto_now=True, verbose_name="modified"
                    ),
                ),
                (
                    "background_color",
                    models.CharField(
                        default="#0000FF", max_length=7, verbose_name="Hintergrundfarbe"
                    ),
                ),
                ("begin", models.DateTimeField(verbose_name="Beginn")),
                (
                    "end",
                    models.DateTimeField(blank=True, null=True, verbose_name="Ende"),
                ),
                (
                    "order",
                    models.PositiveIntegerField(default=0, verbose_name="Reihenfolge"),
                ),
                ("text", models.TextField(blank=True, verbose_name="Nachricht")),
                (
                    "text_color",
                    models.CharField(
                        default="#000000", max_length=7, verbose_name="Textfarbe"
                    ),
                ),
                ("title", models.CharField(max_length=32, verbose_name="Titel")),
                (
                    "dismissed_users",
                    models.ManyToManyField(
                        related_name="dismissed_system_messages",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="system_messages",
                        to="system_message.systemmessagetype",
                        verbose_name="Typ",
                    ),
                ),
            ],
            options={
                "verbose_name": "Systemmeldung",
                "verbose_name_plural": "Systemmeldungen",
                "ordering": ("order", "end", "begin", "title"),
            },
        ),
    ]
