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


class Migration(migrations.Migration):

    dependencies = [
        ("shipment", "0014_shipmentdelivery_operator"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name="shipmentdelivery",
            name="cancelled_at",
            field=models.DateTimeField(blank=True, null=True, verbose_name="取消时间"),
        ),
        migrations.AddField(
            model_name="shipmentdelivery",
            name="cancelled_by",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="cancelled_shipment_deliveries",
                to=settings.AUTH_USER_MODEL,
                verbose_name="取消人",
            ),
        ),
        migrations.AlterField(
            model_name="shipmentdelivery",
            name="status",
            field=models.IntegerField(
                choices=[(1, "待送货"), (2, "送货中"), (3, "已送达"), (4, "已取消")],
                db_index=True,
                default=1,
                verbose_name="状态",
            ),
        ),
        migrations.AlterModelOptions(
            name="shipmentdelivery",
            options={
                "ordering": ["-created_at", "-id"],
                "permissions": [("cancel_shipmentdelivery", "Can cancel shipment delivery")],
                "verbose_name": "送货单",
                "verbose_name_plural": "送货单",
            },
        ),
    ]
