# Generated by Django 3.2.15 on 2022-10-20 13:25

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


class Migration(migrations.Migration):
    dependencies = [
        ("order", "0014_shippingaddress_email"),
    ]

    replaces = [("order", "0014_carrier_tracking")]

    operations = [
        migrations.CreateModel(
            name="Carrier",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(max_length=255, verbose_name="Shipping carrier"),
                ),
                (
                    "code",
                    models.CharField(
                        help_text="Useful for when working with external market places, as they mostly require you to send the carrier code",
                        max_length=255,
                        verbose_name="Carrier code",
                    ),
                ),
            ],
            options={
                "verbose_name": "Shipping Carrier",
                "verbose_name_plural": "Shipping Carriers",
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Tracking",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "tracking_code",
                    models.CharField(
                        blank=True, max_length=255, verbose_name="Tracking code/number"
                    ),
                ),
                (
                    "tracking_url",
                    models.URLField(
                        blank=True, max_length=255, verbose_name="Tracking url"
                    ),
                ),
                (
                    "carrier",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="tracking",
                        to="order.carrier",
                        verbose_name="Shipping carrier",
                    ),
                ),
                (
                    "shipping_event",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="tracking",
                        to="order.shippingevent",
                        verbose_name="Shipping Event",
                    ),
                ),
            ],
            options={
                "verbose_name": "Shipping Tracking",
                "verbose_name_plural": "Shipping Trackings",
                "abstract": False,
            },
        ),
    ]
