# Generated by Django 2.2.8 on 2019-12-06 15:17

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]

    operations = [
        migrations.CreateModel(
            name="LegalReason",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "flag_text",
                    models.TextField(verbose_name="Testo da mostrare nella spunta"),
                ),
                (
                    "privacy_description",
                    models.TextField(
                        blank=True,
                        null=True,
                        verbose_name="Descrizione per pagina privacy",
                    ),
                ),
                (
                    "required",
                    models.BooleanField(default=False, verbose_name="Obbligatorio"),
                ),
                ("active", models.BooleanField(default=False, verbose_name="Attivo")),
            ],
            options={
                "verbose_name": "Ragione legale",
                "verbose_name_plural": "Ragioni legali",
            },
        ),
        migrations.CreateModel(
            name="PrivacyLog",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="Data creazione"
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="privacy",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Utente",
                    ),
                ),
            ],
            options={
                "verbose_name": "Privacy log",
                "verbose_name_plural": "Privacy logs",
            },
        ),
        migrations.CreateModel(
            name="PrivacyEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "accepted",
                    models.BooleanField(default=False, verbose_name="Accetata"),
                ),
                (
                    "legal_reason",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="event",
                        to="gdpr_helpers.LegalReason",
                        verbose_name="Ragione legale",
                    ),
                ),
                (
                    "privacy_log",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="event",
                        to="gdpr_helpers.PrivacyLog",
                        verbose_name="Privacy log",
                    ),
                ),
            ],
            options={
                "verbose_name": "Evento privacy",
                "verbose_name_plural": "Eventi privacy",
            },
        ),
    ]
