from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('jituan', '0019_role_agreement_gates'),
    ]

    operations = [
        migrations.CreateModel(
            name='ClubOrderDealConfig',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('club_id', models.CharField(db_index=True, max_length=16, unique=True, verbose_name='俱乐部')),
                ('auto_settle_enabled', models.BooleanField(default=False, verbose_name='自动结算开关')),
                ('auto_settle_enabled_at', models.DateTimeField(blank=True, null=True, verbose_name='本次打开自动结算时间')),
                ('hours_platform', models.PositiveIntegerField(default=48, verbose_name='平台单超时小时')),
                ('hours_merchant', models.PositiveIntegerField(default=48, verbose_name='商家单超时小时')),
                ('stats_enabled', models.BooleanField(default=False, verbose_name='成交指标统计开关')),
                ('stats_since', models.DateTimeField(blank=True, null=True, verbose_name='指标统计起点')),
                ('updated_by', models.CharField(blank=True, default='', max_length=32)),
                ('CreateTime', models.DateTimeField(auto_now_add=True)),
                ('UpdateTime', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': '成交与自动结算配置',
                'db_table': 'club_order_deal_config',
            },
        ),
        migrations.CreateModel(
            name='MerchantDealStat',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('club_id', models.CharField(db_index=True, max_length=16)),
                ('merchant_uid', models.CharField(db_index=True, max_length=16, verbose_name='商家UserUID')),
                ('order_count', models.PositiveIntegerField(default=0)),
                ('completed_count', models.PositiveIntegerField(default=0)),
                ('refund_count', models.PositiveIntegerField(default=0)),
                ('fine_paid_count', models.PositiveIntegerField(default=0)),
                ('settle_duration_sum_seconds', models.BigIntegerField(default=0)),
                ('settle_duration_sample_count', models.PositiveIntegerField(default=0)),
                ('CreateTime', models.DateTimeField(auto_now_add=True)),
                ('UpdateTime', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': '商家成交指标',
                'db_table': 'merchant_deal_stat',
                'unique_together': {('club_id', 'merchant_uid')},
            },
        ),
        migrations.CreateModel(
            name='DashouDealStat',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('club_id', models.CharField(db_index=True, max_length=16)),
                ('dashou_uid', models.CharField(db_index=True, max_length=16, verbose_name='打手UserUID')),
                ('order_count', models.PositiveIntegerField(default=0)),
                ('completed_count', models.PositiveIntegerField(default=0)),
                ('fine_paid_count', models.PositiveIntegerField(default=0)),
                ('CreateTime', models.DateTimeField(auto_now_add=True)),
                ('UpdateTime', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': '打手成交指标',
                'db_table': 'dashou_deal_stat',
                'unique_together': {('club_id', 'dashou_uid')},
            },
        ),
        migrations.CreateModel(
            name='DealStatEvent',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('club_id', models.CharField(db_index=True, max_length=16)),
                ('event_key', models.CharField(db_index=True, max_length=96, unique=True)),
                ('event_type', models.CharField(db_index=True, max_length=32)),
                ('order_id', models.CharField(blank=True, db_index=True, default='', max_length=32)),
                ('subject_uid', models.CharField(blank=True, db_index=True, default='', max_length=16)),
                ('meta_json', models.JSONField(blank=True, default=dict)),
                ('CreateTime', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': '成交指标事件',
                'db_table': 'deal_stat_event',
            },
        ),
    ]
