# Generated by Django 3.2.7 on 2021-09-13 09:41

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Attendee',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=256, verbose_name='Prénom')),
                ('last_name', models.CharField(max_length=256, verbose_name='Nom')),
                ('dob', models.DateField(verbose_name='Date de naissance')),
                ('status', models.SmallIntegerField(choices=[(-1, 'Abandonné'), (0, 'Inscrit'), (1, 'Non sélectionné'), (2, 'Accepté'), (3, 'Confirmé')], verbose_name='Statut de la candidature')),
            ],
            options={
                'verbose_name': 'participant',
                'verbose_name_plural': 'participants',
            },
        ),
        migrations.CreateModel(
            name='AttendeeLabel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=120, verbose_name='Titre')),
            ],
            options={
                'verbose_name': 'label participant',
                'verbose_name_plural': 'labels participant',
                'ordering': ('title',),
            },
        ),
        migrations.CreateModel(
            name='Center',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120, verbose_name='Nom')),
                ('address', models.TextField(max_length=1000, verbose_name='Adresse')),
                ('lng', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True, verbose_name='Longitude')),
                ('lat', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True, verbose_name='Latitude')),
                ('private_notes', models.TextField(blank=True, max_length=2000, null=True, verbose_name='Notes privées')),
            ],
            options={
                'verbose_name': 'centre',
                'verbose_name_plural': 'centres',
            },
        ),
        migrations.CreateModel(
            name='Document',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('admin_name', models.CharField(help_text="Ce nom est uniquement utilisé pour l'admin django", max_length=260, unique=True, verbose_name='Nom du document')),
                ('file', models.FileField(upload_to=pathlib.PurePosixPath('eventsd/documents'), verbose_name='Fichier')),
            ],
            options={
                'verbose_name': 'document',
                'verbose_name_plural': 'documents',
            },
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256, verbose_name="Nom de l'évènement")),
                ('signup_start_date', models.DateTimeField(verbose_name="Date de début d'inscription")),
                ('signup_end_date', models.DateTimeField(verbose_name="Date de fin d'inscription")),
                ('start_date', models.DateTimeField(verbose_name='Date de début')),
                ('end_date', models.DateTimeField(verbose_name='Date de fin')),
                ('notes', models.TextField(blank=True, help_text="Ce texte, si défini est affiché lors de l'inscription à l'évènement (il peut éventuellement contenir des liens)", null=True, verbose_name='Notes')),
                ('description', models.TextField(help_text="Si ce champ n'est pas spécifié, la description du projet sera utilisée.", verbose_name="Description de l'évènement")),
                ('center', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='eventsd_events.center', verbose_name='Centre')),
            ],
            options={
                'verbose_name': 'évènement',
                'verbose_name_plural': 'évènements',
            },
        ),
        migrations.CreateModel(
            name='Form',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120, verbose_name='Nom')),
            ],
            options={
                'verbose_name': 'formulaire',
                'verbose_name_plural': 'formulaires',
            },
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.CharField(max_length=1000, verbose_name='Texte de la question')),
                ('type', models.CharField(choices=[('TITLE', 'Titre'), ('TEXT', 'Texte'), ('LONG_TEXT', 'Texte long'), ('CHOICE', 'Choix'), ('MULTIPLE_CHOICES', 'Choix multiple')], max_length=32, verbose_name='Type')),
                ('mandatory', models.BooleanField(verbose_name='Obligatoire')),
                ('answers', models.TextField(blank=True, help_text='Une réponse par ligne', max_length=500, null=True, verbose_name='Réponses possibles')),
                ('order', models.PositiveSmallIntegerField(verbose_name='Ordre')),
                ('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='questions', to='eventsd_events.form', verbose_name='Formulaire')),
            ],
            options={
                'verbose_name': 'question',
                'verbose_name_plural': 'questions',
                'ordering': ('order',),
            },
        ),
        migrations.CreateModel(
            name='FormAnswer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('answer', models.TextField(max_length=10000, verbose_name='Réponse')),
                ('attendee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='form_answers', to='eventsd_events.attendee', verbose_name='Participant')),
                ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='form_answers', to='eventsd_events.question', verbose_name='Question')),
            ],
            options={
                'verbose_name': 'réponse formulaire',
                'verbose_name_plural': 'réponses formulaire',
                'ordering': ('question__order',),
            },
        ),
        migrations.CreateModel(
            name='EventDocument',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('display_name', models.CharField(help_text='Le nom public du document qui sera affiché aux participants', max_length=260, verbose_name='Nom public du document')),
                ('visibility', models.IntegerField(choices=[(1, 'Public'), (2, 'Accepté ou confirmé'), (3, 'Confirmé seulement')], verbose_name='Visibilité')),
                ('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='eventsd_events.document', verbose_name='Document')),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='eventsd_events.event', verbose_name='Évènement')),
            ],
            options={
                'verbose_name': "document lié à l'évènement",
                'verbose_name_plural': "documents lié à l'évènement",
            },
        ),
        migrations.AddField(
            model_name='event',
            name='documents',
            field=models.ManyToManyField(blank=True, related_name='events', through='eventsd_events.EventDocument', to='eventsd_events.Document', verbose_name='Documents'),
        ),
        migrations.AddField(
            model_name='event',
            name='form',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.SET_DEFAULT, to='eventsd_events.form', verbose_name='Formulaire'),
        ),
        migrations.AddField(
            model_name='attendee',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='eventsd_events.event', verbose_name='Évènement'),
        ),
        migrations.AddField(
            model_name='attendee',
            name='labels',
            field=models.ManyToManyField(blank=True, to='eventsd_events.AttendeeLabel', verbose_name='Labels'),
        ),
    ]
