# Generated by Django 5.1.1 on 2024-10-09 20:49

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


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

    operations = [
        migrations.RemoveField(
            model_name="userappdashboard",
            name="layout",
        ),
        migrations.RemoveField(
            model_name="userdashboardview",
            name="layout",
        ),
        migrations.AddField(
            model_name="userappdashboard",
            name="content_layout",
            field=models.JSONField(default=dict),
        ),
        migrations.AddField(
            model_name="userdashboardview",
            name="content_layout",
            field=models.JSONField(default=dict),
        ),
        migrations.AlterField(
            model_name="userdashboardview",
            name="kpis",
            field=models.ManyToManyField(
                help_text="The KPIs to be displayed on the dashboard", to="bloomerp.kpi"
            ),
        ),
        migrations.CreateModel(
            name="Link",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                (
                    "url",
                    models.CharField(
                        help_text="The name of the URL pattern for the link. Can either be a Django URL name or a full URL (absolute).",
                        max_length=255,
                    ),
                ),
                ("level", models.CharField(max_length=255)),
                (
                    "is_absolute_url",
                    models.BooleanField(
                        default=True,
                        help_text="Signifies whether the URL is a normal (absolute) URL or a Django URL name. Set to True when using a normal URL.",
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, help_text="Description of the link", null=True
                    ),
                ),
                (
                    "content_type",
                    models.ForeignKey(
                        blank=True,
                        help_text="The content type for the link. Required for detail and list levels.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "db_table": "bloomerp_link",
                "managed": True,
            },
        ),
        migrations.AddField(
            model_name="userappdashboard",
            name="links",
            field=models.ManyToManyField(
                blank=True,
                help_text="The links to be displayed on the dashboard",
                to="bloomerp.link",
            ),
        ),
    ]
