# Generated by Django 5.2.10 on 2026-03-10 08:21

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


class Migration(migrations.Migration):

    dependencies = [
        ("account", "0018_accountprofilemodel_mcp_enabled_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="TradingCostConfigModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                (
                    "commission_rate",
                    models.FloatField(
                        default=0.00025, help_text="默认万2.5，如 0.00025", verbose_name="佣金率"
                    ),
                ),
                (
                    "min_commission",
                    models.FloatField(
                        default=5.0,
                        help_text="单笔佣金不足此金额按此收取",
                        verbose_name="最低佣金（元）",
                    ),
                ),
                (
                    "stamp_duty_rate",
                    models.FloatField(
                        default=0.001,
                        help_text="卖出时收取，默认千1，如 0.001",
                        verbose_name="印花税率",
                    ),
                ),
                (
                    "transfer_fee_rate",
                    models.FloatField(
                        default=2e-05,
                        help_text="沪市股票双向收取，默认万0.2，如 0.00002",
                        verbose_name="过户费率",
                    ),
                ),
                ("is_active", models.BooleanField(default=True, verbose_name="是否启用")),
                ("created_at", models.DateTimeField(auto_now_add=True, verbose_name="创建时间")),
                ("updated_at", models.DateTimeField(auto_now=True, verbose_name="更新时间")),
                (
                    "portfolio",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="trading_cost_config",
                        to="account.portfoliomodel",
                        verbose_name="投资组合",
                    ),
                ),
            ],
            options={
                "verbose_name": "交易费率配置",
                "verbose_name_plural": "交易费率配置",
                "db_table": "trading_cost_config",
            },
        ),
    ]
