from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('basic_info', '0026_transportvehicle_and_capacity'),
        ('printing', '0037_printingjob_is_production_completed'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='PrintingOrderExternalSnapshotSyncAudit',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('external_order_id', models.CharField(db_index=True, max_length=100, verbose_name='外部订单编号')),
                ('before_snapshot', models.JSONField(blank=True, default=dict, verbose_name='同步前快照')),
                ('allow_reset_stateflow', models.BooleanField(default=False, verbose_name='允许撤销工序')),
                ('is_success', models.BooleanField(default=False, verbose_name='是否成功')),
                ('failure_reason', models.TextField(blank=True, default='', verbose_name='失败原因')),
                ('operator_employee', models.ForeignKey(blank=True, null=True, on_delete=models.SET_NULL, related_name='printing_order_external_snapshot_sync_audits', to='basic_info.employee', verbose_name='操作员工')),
                ('operator_user', models.ForeignKey(blank=True, null=True, on_delete=models.SET_NULL, related_name='printing_order_external_snapshot_sync_audits', to=settings.AUTH_USER_MODEL, verbose_name='操作者')),
                ('printing_order', models.ForeignKey(blank=True, null=True, on_delete=models.SET_NULL, related_name='external_snapshot_sync_audits', to='printing.printingorder', verbose_name='印染订单')),
            ],
            options={
                'verbose_name': '外部订单快照同步审计记录',
                'verbose_name_plural': '外部订单快照同步审计记录',
                'ordering': ['-created_at', '-id'],
            },
        ),
    ]