# Generated by Django 2.0.4 on 2019-05-17 19:05

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BankAccountData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('document_number', models.CharField(help_text='CUIT del propietario de la cuenta', max_length=13, validators=[django.core.validators.RegexValidator('^(20|23|24|27|30|33|34)-[0-9]{8}-[0-9]$', 'El CUIT ingresado no es correcto')], verbose_name='CUIT')),
                ('bank_entity', models.CharField(help_text='nombre de la entiedad bancaria', max_length=317, verbose_name='entidad bancaria')),
                ('account_number', models.CharField(help_text='Número de cuenta', max_length=13, verbose_name='número de cuenta')),
                ('account_type', models.CharField(choices=[('CC', 'Cuenta corriente'), ('CA', 'Caja de ahorros')], max_length=3, verbose_name='tipo cuenta')),
                ('organization_name', models.CharField(help_text='razón social o nombre del propietario de la cuenta', max_length=317, verbose_name='razón social')),
                ('cbu', models.CharField(help_text='CBU de la cuenta', max_length=317, verbose_name='CBU')),
                ('changed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_bankaccountdata_changed_by', to=settings.AUTH_USER_MODEL)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_bankaccountdata_created_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=317, verbose_name='nombre')),
                ('commission', models.DecimalField(decimal_places=2, max_digits=5, validators=[django.core.validators.MaxValueValidator(100), django.core.validators.MinValueValidator(0)], verbose_name='comisión')),
                ('start_date', models.DateField(blank=True, null=True, verbose_name='fecha de incio')),
                ('place', models.CharField(blank=True, max_length=317, verbose_name='lugar')),
                ('category', models.CharField(blank=True, choices=[('PD', 'PyDay'), ('PCo', 'PyCon'), ('PCa', 'PyCamp'), ('Con', 'Conferencia')], max_length=3, verbose_name='tipo')),
                ('close', models.BooleanField(default=False, verbose_name='cerrado')),
                ('changed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_event_changed_by', to=settings.AUTH_USER_MODEL)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_event_created_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-start_date'],
                'permissions': (('view_event_organizers', 'puede ver organizadores del evento'),),
            },
        ),
        migrations.CreateModel(
            name='EventOrganizer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('changed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_eventorganizer_changed_by', to=settings.AUTH_USER_MODEL)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_eventorganizer_created_by', to=settings.AUTH_USER_MODEL)),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='event_organizers', to='events.Event')),
            ],
        ),
        migrations.CreateModel(
            name='Organizer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('first_name', models.CharField(max_length=317, verbose_name='nombre')),
                ('last_name', models.CharField(max_length=317, verbose_name='apellido')),
                ('account_data', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='events.BankAccountData', verbose_name='datos cuenta bancaria')),
                ('changed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_organizer_changed_by', to=settings.AUTH_USER_MODEL)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_organizer_created_by', to=settings.AUTH_USER_MODEL)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='usuario')),
            ],
            options={
                'ordering': ['-created'],
                'permissions': (('view_organizers', 'puede ver organizadores'),),
            },
        ),
        migrations.CreateModel(
            name='SponsorCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('name', models.CharField(max_length=317, verbose_name='nombre')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=18, verbose_name='monto')),
                ('changed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_sponsorcategory_changed_by', to=settings.AUTH_USER_MODEL)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_sponsorcategory_created_by', to=settings.AUTH_USER_MODEL)),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sponsors_categories', to='events.Event', verbose_name='Evento')),
            ],
        ),
        migrations.AddField(
            model_name='eventorganizer',
            name='organizer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organizer_events', to='events.Organizer'),
        ),
        migrations.AddField(
            model_name='event',
            name='organizers',
            field=models.ManyToManyField(related_name='events', through='events.EventOrganizer', to='events.Organizer', verbose_name='organizadores'),
        ),
        migrations.AlterUniqueTogether(
            name='sponsorcategory',
            unique_together={('event', 'name')},
        ),
        migrations.AlterUniqueTogether(
            name='eventorganizer',
            unique_together={('event', 'organizer')},
        ),
    ]
