# Generated by Django 2.2 on 2021-09-27 13:39

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import stdimage.models
import stdimage.validators
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('PaiementStripe', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Article',
            fields=[
                ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(blank=True, max_length=50, null=True)),
                ('prix', models.FloatField()),
                ('stock', models.SmallIntegerField(blank=True, null=True)),
                ('reservation_par_user_max', models.PositiveSmallIntegerField(default=10)),
                ('publish', models.BooleanField(default=False)),
                ('img', stdimage.models.StdImageField(blank=True, null=True, upload_to='images/', validators=[stdimage.validators.MaxSizeValidator(1920, 1920)], verbose_name='Image')),
                ('categorie_article', models.CharField(choices=[('B', 'Billet'), ('P', "Pack d'objets"), ('R', 'Recharge cashless'), ('T', 'Vetement'), ('M', 'Merchandasing'), ('A', 'Adhésion')], default='B', max_length=3, verbose_name="Type d'article")),
                ('id_product_stripe', models.CharField(blank=True, max_length=30, null=True)),
                ('id_price_stripe', models.CharField(blank=True, max_length=30, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Billet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=50, null=True)),
                ('prix', models.FloatField()),
                ('reservation_par_user_max', models.PositiveSmallIntegerField(default=6)),
            ],
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('short_description', models.CharField(max_length=250)),
                ('long_description', models.TextField(blank=True, null=True)),
                ('datetime', models.DateTimeField()),
                ('img', stdimage.models.StdImageField(blank=True, null=True, upload_to='images/', validators=[stdimage.validators.MaxSizeValidator(1920, 1920)])),
                ('reservations', models.PositiveSmallIntegerField(default=0)),
                ('articles', models.ManyToManyField(to='BaseBillet.Article')),
                ('billets', models.ManyToManyField(to='BaseBillet.Billet')),
            ],
            options={
                'verbose_name': 'Evenement',
                'verbose_name_plural': 'Evenements',
                'ordering': ('datetime',),
            },
        ),
        migrations.CreateModel(
            name='OptionGenerale',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('poids', models.PositiveSmallIntegerField(default=0, verbose_name='Poids')),
            ],
            options={
                'verbose_name': 'Options Generales',
                'verbose_name_plural': 'Options Generales',
                'ordering': ('poids',),
            },
        ),
        migrations.CreateModel(
            name='TarifsAdhesion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('tarif', models.FloatField()),
            ],
            options={
                'ordering': ('-tarif',),
            },
        ),
        migrations.CreateModel(
            name='VAT',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('percent', models.FloatField(verbose_name='Taux de TVA (%)')),
            ],
            options={
                'verbose_name': 'TVA',
                'verbose_name_plural': 'TVA',
            },
        ),
        migrations.CreateModel(
            name='Reservation',
            fields=[
                ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, primary_key=True, serialize=False)),
                ('status', models.CharField(choices=[('NAN', 'Annulée'), ('MNV', 'Email non validé'), ('NPA', 'Non payée'), ('VAL', 'Validée'), ('PAY', 'Payée')], default='NPA', max_length=3, verbose_name='Status de la réservation')),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='reservation', to='BaseBillet.Event')),
                ('options', models.ManyToManyField(to='BaseBillet.OptionGenerale')),
                ('user_commande', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='LigneArticle',
            fields=[
                ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, primary_key=True, serialize=False)),
                ('qty', models.SmallIntegerField()),
                ('reste', models.SmallIntegerField()),
                ('datetime', models.DateTimeField(auto_now=True)),
                ('article', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='BaseBillet.Article')),
                ('billet', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='BaseBillet.Billet')),
                ('paiement_stripe', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='PaiementStripe.Paiement_stripe')),
                ('reservation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='BaseBillet.Reservation')),
            ],
        ),
        migrations.CreateModel(
            name='Configuration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('organisation', models.CharField(max_length=50)),
                ('short_description', models.CharField(max_length=250)),
                ('adresse', models.CharField(max_length=250)),
                ('phone', models.CharField(max_length=20)),
                ('email', models.EmailField(max_length=254)),
                ('site_web', models.URLField(blank=True, null=True)),
                ('twitter', models.URLField(blank=True, null=True)),
                ('facebook', models.URLField(blank=True, null=True)),
                ('instagram', models.URLField(blank=True, null=True)),
                ('adhesion_obligatoire', models.BooleanField(default=False)),
                ('cadeau_adhesion', models.FloatField(default=0, help_text="Recharge cadeau a l'adhésion")),
                ('carte_restaurant', stdimage.models.StdImageField(blank=True, null=True, upload_to='images/', validators=[stdimage.validators.MaxSizeValidator(1920, 1920)], verbose_name='Carte du restaurant')),
                ('img', stdimage.models.StdImageField(blank=True, null=True, upload_to='images/', verbose_name='Background')),
                ('mollie_api_key', models.CharField(blank=True, max_length=50, null=True)),
                ('stripe_api_key', models.CharField(blank=True, max_length=110, null=True)),
                ('stripe_test_api_key', models.CharField(blank=True, max_length=110, null=True)),
                ('stripe_mode_test', models.BooleanField(default=True)),
                ('activer_billetterie', models.BooleanField(default=True)),
                ('jauge_max', models.PositiveSmallIntegerField(default=50)),
                ('server_cashless', models.URLField(blank=True, max_length=300, null=True, verbose_name='Adresse du serveur Cashless')),
                ('key_cashless', models.CharField(blank=True, max_length=41, null=True, verbose_name="Clé d'API du serveur cashless")),
                ('option_generale_checkbox', models.ManyToManyField(blank=True, related_name='checkbox', to='BaseBillet.OptionGenerale')),
                ('option_generale_radio', models.ManyToManyField(blank=True, related_name='radiobutton', to='BaseBillet.OptionGenerale')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='article',
            name='vat',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='BaseBillet.VAT', verbose_name='TVA'),
        ),
    ]
