# Generated by Django 2.2 on 2019-04-26 09:21

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ("applications", "0008_refactor_and_rename_reservations"),
    ]

    operations = [
        migrations.CreateModel(
            name="WinterStorageAreaChoice",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("priority", models.PositiveSmallIntegerField(verbose_name="priority")),
            ],
        ),
        migrations.AlterField(
            model_name="berthreservation",
            name="boat_type",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="resources.BoatType",
                verbose_name="boat type",
            ),
        ),
        migrations.CreateModel(
            name="WinterStorageReservation",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="created at"),
                ),
                (
                    "is_processed",
                    models.BooleanField(default=False, verbose_name="is processed"),
                ),
                (
                    "language",
                    models.CharField(
                        choices=[
                            ("fi", "Finnish"),
                            ("en", "English"),
                            ("sv", "Swedish"),
                        ],
                        default="fi",
                        max_length=10,
                        verbose_name="language",
                    ),
                ),
                (
                    "first_name",
                    models.CharField(
                        blank=True, max_length=40, verbose_name="first name"
                    ),
                ),
                (
                    "last_name",
                    models.CharField(
                        blank=True, max_length=150, verbose_name="last name"
                    ),
                ),
                (
                    "email",
                    models.EmailField(
                        blank=True, max_length=254, verbose_name="email address"
                    ),
                ),
                (
                    "phone_number",
                    models.CharField(
                        blank=True, max_length=64, verbose_name="phone number"
                    ),
                ),
                (
                    "address",
                    models.CharField(
                        blank=True, max_length=150, verbose_name="address"
                    ),
                ),
                (
                    "zip_code",
                    models.CharField(
                        blank=True, max_length=64, verbose_name="zip code"
                    ),
                ),
                (
                    "municipality",
                    models.CharField(
                        blank=True, max_length=64, verbose_name="municipality"
                    ),
                ),
                (
                    "company_name",
                    models.CharField(
                        blank=True, max_length=150, verbose_name="company name"
                    ),
                ),
                (
                    "business_id",
                    models.CharField(
                        blank=True, max_length=64, verbose_name="business ID"
                    ),
                ),
                (
                    "boat_registration_number",
                    models.CharField(
                        blank=True,
                        max_length=64,
                        verbose_name="boat registration number",
                    ),
                ),
                (
                    "boat_name",
                    models.CharField(
                        blank=True, max_length=64, verbose_name="boat name"
                    ),
                ),
                (
                    "boat_model",
                    models.CharField(
                        blank=True, max_length=64, verbose_name="boat model"
                    ),
                ),
                (
                    "boat_length",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=5,
                        null=True,
                        verbose_name="boat length",
                    ),
                ),
                (
                    "boat_width",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=5,
                        null=True,
                        verbose_name="boat width",
                    ),
                ),
                (
                    "accept_boating_newsletter",
                    models.BooleanField(
                        default=False, verbose_name="accept boating newsletter"
                    ),
                ),
                (
                    "accept_fitness_news",
                    models.BooleanField(
                        default=False, verbose_name="accept fitness news"
                    ),
                ),
                (
                    "accept_library_news",
                    models.BooleanField(
                        default=False, verbose_name="accept library news"
                    ),
                ),
                (
                    "accept_other_culture_news",
                    models.BooleanField(
                        default=False, verbose_name="accept other culture news"
                    ),
                ),
                (
                    "information_accuracy_confirmed",
                    models.BooleanField(
                        default=False, verbose_name="information accuracy confirmed"
                    ),
                ),
                (
                    "data",
                    django.contrib.postgres.fields.jsonb.JSONField(
                        blank=True, null=True
                    ),
                ),
                (
                    "application_code",
                    models.TextField(blank=True, verbose_name="application code"),
                ),
                (
                    "storage_method",
                    models.CharField(
                        choices=[
                            ("on_trestles", "On trestles"),
                            ("on_trailer", "On a trailer"),
                            ("under_tarp", "Under a tarp"),
                        ],
                        max_length=60,
                        verbose_name="Storage setup",
                    ),
                ),
                (
                    "trailer_registration_number",
                    models.CharField(
                        blank=True,
                        max_length=64,
                        verbose_name="trailer registration number",
                    ),
                ),
                (
                    "boat_type",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to="resources.BoatType",
                        verbose_name="boat type",
                    ),
                ),
                (
                    "chosen_areas",
                    models.ManyToManyField(
                        blank=True,
                        through="applications.WinterStorageAreaChoice",
                        to="resources.WinterStorageArea",
                        verbose_name="chosen winter storage areas",
                    ),
                ),
            ],
            options={"abstract": False},
        ),
        migrations.AddField(
            model_name="winterstorageareachoice",
            name="reservation",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to="applications.WinterStorageReservation",
            ),
        ),
        migrations.AddField(
            model_name="winterstorageareachoice",
            name="winter_storage_area",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to="resources.WinterStorageArea",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="winterstorageareachoice",
            unique_together={("reservation", "priority")},
        ),
    ]
