# Generated by Django 4.1.9 on 2023-06-16 15:33

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields


class Migration(migrations.Migration):
    dependencies = [
        ("store", "0003_product_info_product_name_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="DocumentTemplate",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("name", models.CharField(max_length=255)),
                ("file", models.FileField(upload_to="documents")),
                (
                    "doc_type",
                    models.CharField(
                        choices=[("agreement", "Agreement"), ("receipt", "Receipt")], max_length=255, unique=True
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name="Order",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("sent", models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name="PaymentMethod",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("name", models.CharField(max_length=255)),
                ("description", models.TextField(blank=True)),
                ("active", models.BooleanField(default=True)),
            ],
        ),
        migrations.AddField(
            model_name="productauthor",
            name="city",
            field=models.CharField(blank=True, max_length=255),
        ),
        migrations.AddField(
            model_name="productauthor",
            name="country",
            field=models.CharField(blank=True, max_length=120),
        ),
        migrations.AddField(
            model_name="productauthor",
            name="display_name",
            field=models.CharField(blank=True, max_length=255, unique=True),
        ),
        migrations.AddField(
            model_name="productauthor",
            name="email",
            field=models.EmailField(blank=True, max_length=254),
        ),
        migrations.AddField(
            model_name="productauthor",
            name="phone",
            field=phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, region=None),
        ),
        migrations.AddField(
            model_name="productauthor",
            name="street",
            field=models.CharField(blank=True, max_length=255),
        ),
        migrations.AddField(
            model_name="productauthor",
            name="surname",
            field=models.CharField(blank=True, max_length=255),
        ),
        migrations.AddField(
            model_name="productauthor",
            name="zip_code",
            field=models.CharField(blank=True, max_length=120),
        ),
        migrations.AlterField(
            model_name="productauthor",
            name="name",
            field=models.CharField(blank=True, max_length=255),
        ),
        migrations.CreateModel(
            name="OrderProduct",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("quantity", models.IntegerField(validators=[django.core.validators.MinValueValidator(1)])),
                (
                    "order",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, related_name="products", to="store.order"
                    ),
                ),
                ("product", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="store.product")),
            ],
        ),
        migrations.CreateModel(
            name="OrderDocument",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("sent", models.BooleanField(default=False)),
                (
                    "order",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, related_name="documents", to="store.order"
                    ),
                ),
                (
                    "template",
                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="store.documenttemplate"),
                ),
            ],
        ),
        migrations.AddField(
            model_name="order",
            name="payment_method",
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="store.paymentmethod"),
        ),
    ]
