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

import apps.sigils.fields
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="OdooEmployee",
            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)),
                ("host", apps.sigils.fields.SigilShortAutoField(max_length=255)),
                ("database", apps.sigils.fields.SigilShortAutoField(max_length=255)),
                ("username", apps.sigils.fields.SigilShortAutoField(max_length=255)),
                ("password", apps.sigils.fields.SigilShortAutoField(max_length=255)),
                ("verified_on", models.DateTimeField(blank=True, null=True)),
                (
                    "odoo_uid",
                    models.PositiveIntegerField(blank=True, editable=False, null=True),
                ),
                ("name", models.CharField(blank=True, editable=False, max_length=255)),
                (
                    "email",
                    models.EmailField(blank=True, editable=False, max_length=254),
                ),
                (
                    "partner_id",
                    models.PositiveIntegerField(blank=True, editable=False, null=True),
                ),
            ],
            options={
                "verbose_name": "Odoo Employee",
                "verbose_name_plural": "Odoo Employees",
                "db_table": "core_odooemployee",
            },
        ),
        migrations.CreateModel(
            name="OdooProduct",
            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=100)),
                ("description", models.TextField(blank=True)),
                (
                    "renewal_period",
                    models.PositiveIntegerField(help_text="Renewal period in days"),
                ),
                (
                    "odoo_product",
                    models.JSONField(
                        blank=True,
                        help_text="Selected product from Odoo (id and name)",
                        null=True,
                    ),
                ),
            ],
            options={
                "verbose_name": "Odoo Product",
                "verbose_name_plural": "Odoo Products",
                "db_table": "core_odoo_product",
            },
        ),
        migrations.CreateModel(
            name="OdooChatBridge",
            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)),
                (
                    "is_enabled",
                    models.BooleanField(
                        default=True,
                        help_text="Disable to stop forwarding chat messages to this bridge.",
                    ),
                ),
                (
                    "is_default",
                    models.BooleanField(
                        default=False,
                        help_text="Use as the fallback bridge when no site-specific configuration is defined.",
                    ),
                ),
                (
                    "channel_id",
                    models.PositiveIntegerField(
                        help_text="Identifier of the Odoo mail.channel that should receive forwarded messages.",
                        verbose_name="Channel ID",
                    ),
                ),
                (
                    "channel_uuid",
                    models.CharField(
                        blank=True,
                        help_text="Optional UUID of the Odoo mail.channel for reference.",
                        max_length=64,
                        verbose_name="Channel UUID",
                    ),
                ),
                (
                    "notify_partner_ids",
                    models.JSONField(
                        blank=True,
                        default=list,
                        help_text="Additional Odoo partner IDs to notify when posting messages. Provide a JSON array of integers.",
                    ),
                ),
                (
                    "avatars",
                    models.ManyToManyField(
                        blank=True,
                        help_text="Avatars allowed to use this bridge.",
                        related_name="%(app_label)s_%(class)s_bridges",
                        to="chats.chatavatar",
                    ),
                ),
            ],
            options={
                "verbose_name": "Odoo Chat Bridge",
                "verbose_name_plural": "Odoo Chat Bridges",
                "db_table": "pages_odoochatbridge",
                "ordering": ["site__domain", "pk"],
            },
        ),
    ]
