# Generated by Django 5.2.7 on 2026-02-06 07:19

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


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0002_cryptocurrency_alter_account_options_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='account',
            name='credit_score',
            field=models.IntegerField(default=80, verbose_name='信用分'),
        ),
        migrations.AddField(
            model_name='account',
            name='kyc_status',
            field=models.CharField(choices=[('UNVERIFIED', '未认证'), ('PENDING', '审核中'), ('VERIFIED', '已认证'), ('REJECTED', '已拒绝')], default='UNVERIFIED', max_length=20, verbose_name='实名认证状态'),
        ),
        migrations.AddField(
            model_name='account',
            name='language',
            field=models.CharField(default='en', max_length=10, verbose_name='语言偏好'),
        ),
        migrations.AddField(
            model_name='order',
            name='close_price',
            field=models.DecimalField(blank=True, decimal_places=8, max_digits=30, null=True, verbose_name='平仓价格'),
        ),
        migrations.AddField(
            model_name='order',
            name='entry_price',
            field=models.DecimalField(blank=True, decimal_places=8, max_digits=30, null=True, verbose_name='入场价格'),
        ),
        migrations.AddField(
            model_name='order',
            name='leverage',
            field=models.IntegerField(default=1, verbose_name='杠杆倍数'),
        ),
        migrations.AddField(
            model_name='order',
            name='profit_loss',
            field=models.DecimalField(decimal_places=8, default=0, max_digits=30, verbose_name='盈亏'),
        ),
        migrations.AddField(
            model_name='order',
            name='trade_type',
            field=models.CharField(choices=[('SPOT', '现货'), ('CONTRACT', '合约')], default='SPOT', max_length=20, verbose_name='交易类型'),
        ),
        migrations.AlterField(
            model_name='account',
            name='uid',
            field=models.CharField(default=core.models.generate_uid, max_length=6, unique=True, verbose_name='UID'),
        ),
        migrations.AlterField(
            model_name='order',
            name='price',
            field=models.DecimalField(blank=True, decimal_places=8, max_digits=30, null=True, verbose_name='委托价格'),
        ),
        migrations.AlterField(
            model_name='order',
            name='side',
            field=models.CharField(choices=[('BUY', '买入/做多'), ('SELL', '卖出/做空')], max_length=10, verbose_name='方向'),
        ),
        migrations.AlterField(
            model_name='order',
            name='status',
            field=models.CharField(choices=[('LIVE', '进行中'), ('PARTIALLY_FILLED', '部分成交'), ('FILLED', '已成交'), ('CANCELED', '已撤销'), ('CLOSED', '已平仓')], default='LIVE', max_length=20, verbose_name='状态'),
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tx_type', models.CharField(choices=[('DEPOSIT', '充值'), ('WITHDRAW', '提现')], max_length=20, verbose_name='类型')),
                ('currency', models.CharField(default='USDT', max_length=10, verbose_name='币种')),
                ('amount', models.DecimalField(decimal_places=8, max_digits=30, verbose_name='金额')),
                ('address', models.CharField(blank=True, max_length=255, null=True, verbose_name='地址/流水')),
                ('status', models.CharField(choices=[('PENDING', '待处理'), ('SUCCESS', '成功'), ('FAILED', '失败')], default='PENDING', max_length=20, verbose_name='状态')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transactions', to='core.account')),
            ],
            options={
                'verbose_name': '充提记录',
                'verbose_name_plural': '充提管理',
            },
        ),
    ]
