# Generated by Django 5.2.9 on 2026-01-01

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='AssetConfigModel',
            fields=[
                ('display_name', models.CharField(max_length=100, verbose_name='显示名称')),
                ('ticker_symbol', models.CharField(help_text='如 000300.SH', max_length=20, verbose_name='交易代码')),
                ('data_source', models.CharField(default='tushare', max_length=20, verbose_name='数据源')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否启用')),
                ('description', models.TextField(blank=True, verbose_name='描述')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('asset_class', models.CharField(max_length=50, primary_key=True, serialize=False, unique=True, verbose_name='资产类别代码')),
                ('category', models.CharField(choices=[('equity', '股票'), ('bond', '债券'), ('commodity', '商品'), ('cash', '现金')], max_length=20, verbose_name='资产分类')),
            ],
            options={
                'verbose_name': '资产类别配置',
                'verbose_name_plural': '资产类别配置',
                'db_table': 'asset_config',
            },
        ),
        migrations.CreateModel(
            name='FilterParameterConfigModel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(help_text='如 hp_monthly, kalman_macro 等', max_length=100, unique=True, verbose_name='参数键')),
                ('name', models.CharField(max_length=100, verbose_name='参数名称')),
                ('filter_type', models.CharField(choices=[('hp', 'HP 滤波'), ('kalman', 'Kalman 滤波'), ('ma', '移动平均'), ('other', '其他')], max_length=20, verbose_name='滤波类型')),
                ('parameters', models.JSONField(help_text="如 {'lambda': 129600} 或 {'level_variance': 0.05}", verbose_name='滤波参数')),
                ('data_frequency', models.CharField(blank=True, help_text='D/W/M/Q/Y，留空表示不限', max_length=10, verbose_name='数据频率')),
                ('indicator_category', models.CharField(blank=True, help_text='growth/inflation/等', max_length=20, verbose_name='适用指标分类')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否启用')),
                ('description', models.TextField(blank=True, verbose_name='描述')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '滤波参数配置',
                'verbose_name_plural': '滤波参数配置',
                'db_table': 'filter_parameter_config',
            },
        ),
        migrations.CreateModel(
            name='IndicatorConfigModel',
            fields=[
                ('name', models.CharField(max_length=100, verbose_name='指标名称')),
                ('name_en', models.CharField(blank=True, max_length=100, verbose_name='英文名称')),
                ('unit', models.CharField(max_length=10, verbose_name='单位')),
                ('threshold_bullish', models.FloatField(blank=True, null=True, verbose_name='看涨阈值')),
                ('threshold_bearish', models.FloatField(blank=True, null=True, verbose_name='看跌阈值')),
                ('data_source', models.CharField(default='akshare', max_length=20, verbose_name='数据源')),
                ('fetch_frequency', models.CharField(default='M', help_text='D=日, W=周, M=月, Q=季, Y=年', max_length=10, verbose_name='采集频率')),
                ('publication_lag_days', models.IntegerField(default=0, verbose_name='发布延迟天数')),
                ('description', models.TextField(blank=True, 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='更新时间')),
                ('code', models.CharField(max_length=50, primary_key=True, serialize=False, unique=True, verbose_name='指标代码')),
                ('category', models.CharField(choices=[('growth', '增长指标'), ('inflation', '通胀指标'), ('monetary', '货币指标'), ('interest', '利率指标'), ('other', '其他')], max_length=20, verbose_name='指标分类')),
            ],
            options={
                'verbose_name': '宏观指标配置',
                'verbose_name_plural': '宏观指标配置',
                'db_table': 'indicator_config',
            },
        ),
        migrations.CreateModel(
            name='RegimeEligibilityConfigModel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('asset_class', models.CharField(max_length=50, verbose_name='资产类别')),
                ('regime', models.CharField(help_text='Recovery/Overheat/Stagflation/Deflation', max_length=20, verbose_name='Regime')),
                ('eligibility', models.CharField(choices=[('preferred', '优选'), ('neutral', '中性'), ('hostile', '敌对')], max_length=20, verbose_name='准入状态')),
                ('weight', models.FloatField(default=1.0, help_text='该资产在该 Regime 下的权重', verbose_name='权重')),
                ('adjustment_factor', models.FloatField(default=1.0, help_text='额外的权重调整系数', verbose_name='调整因子')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否启用')),
                ('notes', models.TextField(blank=True, verbose_name='备注')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': 'Regime 准入矩阵配置',
                'verbose_name_plural': 'Regime 准入矩阵配置',
                'db_table': 'regime_eligibility_config',
            },
        ),
        migrations.CreateModel(
            name='RiskParameterConfigModel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(help_text='如 position_p1, adjustment_recovery 等', max_length=100, unique=True, verbose_name='参数键')),
                ('name', models.CharField(max_length=100, verbose_name='参数名称')),
                ('parameter_type', models.CharField(choices=[('position_size', '仓位大小'), ('adjustment_factor', '调整因子'), ('stop_loss', '止损参数'), ('volatility', '波动率参数'), ('other', '其他')], max_length=20, verbose_name='参数类型')),
                ('value_float', models.FloatField(blank=True, null=True, verbose_name='数值')),
                ('value_string', models.CharField(blank=True, max_length=200, verbose_name='字符串值')),
                ('value_json', models.JSONField(blank=True, null=True, verbose_name='JSON 值')),
                ('policy_level', models.CharField(blank=True, help_text='如 P0, P1, P2, P3，留空表示全部适用', max_length=10, verbose_name='适用政策档位')),
                ('regime', models.CharField(blank=True, help_text='留空表示全部适用', max_length=20, verbose_name='适用 Regime')),
                ('asset_class', models.CharField(blank=True, help_text='留空表示全部适用', max_length=50, verbose_name='适用资产类别')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否启用')),
                ('description', models.TextField(blank=True, verbose_name='描述')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '风险参数配置',
                'verbose_name_plural': '风险参数配置',
                'db_table': 'risk_parameter_config',
            },
        ),
    ]
