# Generated by Django 4.2.27 on 2026-04-01 00:39

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("dingdan", "0020_dingdan_dispatch_type_dingdan_partner_club_id"),
    ]

    operations = [
        migrations.CreateModel(
            name="PreSettlement",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "dingdan_id",
                    models.CharField(
                        db_index=True,
                        max_length=32,
                        unique=True,
                        verbose_name="我方订单ID",
                    ),
                ),
                (
                    "partner_order_id",
                    models.CharField(
                        db_index=True, max_length=32, verbose_name="对方订单ID"
                    ),
                ),
                (
                    "partner_club_id",
                    models.CharField(
                        db_index=True, max_length=6, verbose_name="对方俱乐部ID"
                    ),
                ),
                (
                    "dashou_id",
                    models.CharField(
                        db_index=True, max_length=7, verbose_name="接单打手ID"
                    ),
                ),
                (
                    "amount",
                    models.DecimalField(
                        decimal_places=2, max_digits=10, verbose_name="打手应分金额"
                    ),
                ),
                (
                    "order_amount",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=10,
                        verbose_name="订单原金额",
                    ),
                ),
                (
                    "status",
                    models.SmallIntegerField(
                        choices=[(0, "待结算"), (1, "已结算"), (2, "已拒绝")],
                        default=0,
                        verbose_name="结算状态",
                    ),
                ),
                (
                    "process_time",
                    models.DateTimeField(
                        blank=True, null=True, verbose_name="处理时间"
                    ),
                ),
                (
                    "operator",
                    models.CharField(
                        blank=True, default="", max_length=32, 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": "pre_settlement",
                "indexes": [
                    models.Index(
                        fields=["dingdan_id"], name="pre_settlem_dingdan_4f3541_idx"
                    ),
                    models.Index(
                        fields=["partner_order_id"],
                        name="pre_settlem_partner_45b29e_idx",
                    ),
                    models.Index(
                        fields=["partner_club_id"],
                        name="pre_settlem_partner_d2c44c_idx",
                    ),
                    models.Index(
                        fields=["dashou_id"], name="pre_settlem_dashou__d5fe7c_idx"
                    ),
                    models.Index(
                        fields=["status"], name="pre_settlem_status_0aa711_idx"
                    ),
                ],
            },
        ),
        migrations.CreateModel(
            name="OrderDashouHistory",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "dingdan_id",
                    models.CharField(
                        db_index=True, max_length=32, verbose_name="订单ID"
                    ),
                ),
                (
                    "dashou_id",
                    models.CharField(
                        db_index=True, max_length=7, verbose_name="打手ID"
                    ),
                ),
                (
                    "times",
                    models.PositiveSmallIntegerField(
                        verbose_name="第几次接单（从1开始）"
                    ),
                ),
                (
                    "operator",
                    models.CharField(max_length=11, verbose_name="操作客服ID"),
                ),
                (
                    "create_time",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
            ],
            options={
                "verbose_name": "订单打手变更历史",
                "verbose_name_plural": "订单打手变更历史",
                "db_table": "order_dashou_history",
                "indexes": [
                    models.Index(
                        fields=["dingdan_id"], name="order_dasho_dingdan_1e79ab_idx"
                    ),
                    models.Index(
                        fields=["dashou_id"], name="order_dasho_dashou__0a637c_idx"
                    ),
                ],
            },
        ),
        migrations.CreateModel(
            name="CrossPlatformOrderData",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "dingdan_id",
                    models.CharField(
                        db_index=True,
                        max_length=32,
                        unique=True,
                        verbose_name="我方订单ID",
                    ),
                ),
                (
                    "partner_order_id",
                    models.CharField(
                        db_index=True, max_length=32, verbose_name="对方平台订单ID"
                    ),
                ),
                (
                    "partner_club_id",
                    models.CharField(
                        db_index=True, max_length=6, verbose_name="对方俱乐部ID"
                    ),
                ),
                (
                    "partner_order_status",
                    models.IntegerField(default=0, verbose_name="对方平台订单状态"),
                ),
                (
                    "partner_dashou_id",
                    models.CharField(
                        blank=True,
                        default="",
                        max_length=32,
                        verbose_name="对方平台接单打手ID",
                    ),
                ),
                (
                    "partner_amount",
                    models.DecimalField(
                        decimal_places=2,
                        default=0.0,
                        max_digits=10,
                        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": "cross_platform_order_data",
                "indexes": [
                    models.Index(
                        fields=["dingdan_id"], name="cross_platf_dingdan_498d08_idx"
                    ),
                    models.Index(
                        fields=["partner_order_id"],
                        name="cross_platf_partner_5d5615_idx",
                    ),
                    models.Index(
                        fields=["partner_club_id"],
                        name="cross_platf_partner_1054e1_idx",
                    ),
                ],
            },
        ),
    ]
