# Generated by Django 4.2.27 on 2026-03-30 12:18

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("peizhi", "0008_tupianpeizhi_fangwen_cishu_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="OrderTypeMapping",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "partner_club_id",
                    models.CharField(
                        db_index=True, max_length=6, verbose_name="对方俱乐部ID"
                    ),
                ),
                (
                    "partner_type_id",
                    models.PositiveIntegerField(verbose_name="对方订单类型ID"),
                ),
                (
                    "partner_type_name",
                    models.CharField(max_length=100, verbose_name="对方订单类型名称"),
                ),
                (
                    "our_type_id",
                    models.PositiveIntegerField(verbose_name="我方订单类型ID"),
                ),
                (
                    "our_type_name",
                    models.CharField(max_length=100, verbose_name="我方订单类型名称"),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "update_time",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
            ],
            options={
                "verbose_name": "订单类型映射",
                "verbose_name_plural": "订单类型映射",
                "db_table": "order_type_mapping",
                "unique_together": {("partner_club_id", "partner_type_id")},
            },
        ),
        migrations.CreateModel(
            name="DailyDispatchStat",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("date", models.DateField(db_index=True, verbose_name="统计日期")),
                ("year", models.PositiveSmallIntegerField(verbose_name="年份")),
                ("month", models.PositiveSmallIntegerField(verbose_name="月份")),
                ("day", models.PositiveSmallIntegerField(verbose_name="日期")),
                (
                    "direction",
                    models.PositiveSmallIntegerField(
                        choices=[(1, "我方派单"), (2, "对方派单")],
                        verbose_name="派单方向",
                    ),
                ),
                (
                    "partner_club_id",
                    models.CharField(
                        db_index=True, max_length=6, verbose_name="对方俱乐部ID"
                    ),
                ),
                (
                    "dispatch_count",
                    models.PositiveIntegerField(default=0, verbose_name="派单数"),
                ),
                (
                    "dispatch_amount",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="派单总额",
                    ),
                ),
                (
                    "success_count",
                    models.PositiveIntegerField(default=0, verbose_name="成交订单数"),
                ),
                (
                    "success_amount",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=12,
                        verbose_name="成交总额",
                    ),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "update_time",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
            ],
            options={
                "verbose_name": "每日派单统计",
                "verbose_name_plural": "每日派单统计",
                "db_table": "daily_dispatch_stat",
                "indexes": [
                    models.Index(
                        fields=["year", "month", "day", "direction", "partner_club_id"],
                        name="daily_dispa_year_f98f91_idx",
                    ),
                    models.Index(fields=["date"], name="daily_dispa_date_9ac7fe_idx"),
                ],
            },
        ),
        migrations.CreateModel(
            name="Club",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "club_id",
                    models.CharField(
                        db_index=True, max_length=6, verbose_name="本俱乐部ID"
                    ),
                ),
                (
                    "partner_club_id",
                    models.CharField(
                        max_length=6, unique=True, verbose_name="对方俱乐部ID"
                    ),
                ),
                (
                    "is_interop_enabled",
                    models.BooleanField(default=False, verbose_name="是否开启平台互通"),
                ),
                (
                    "is_receive_enabled",
                    models.BooleanField(
                        default=False, verbose_name="是否同意接收对方订单"
                    ),
                ),
                (
                    "dashou_rate",
                    models.DecimalField(
                        decimal_places=4,
                        default=1.0,
                        max_digits=5,
                        verbose_name="打手分红费率",
                    ),
                ),
                (
                    "partner_domain",
                    models.URLField(blank=True, verbose_name="对方服务器域名"),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "update_time",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
            ],
            options={
                "verbose_name": "俱乐部",
                "verbose_name_plural": "俱乐部",
                "db_table": "club",
                "indexes": [
                    models.Index(fields=["club_id"], name="club_club_id_e75636_idx"),
                    models.Index(
                        fields=["partner_club_id"], name="club_partner_b76039_idx"
                    ),
                ],
            },
        ),
    ]
