# Generated by Django 2.1.1 on 2018-09-29 18:12

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Offer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='Дата изменения')),
                ('rotation_started', models.DateTimeField(blank=True, null=True, verbose_name='Дата начала ротации')),
                ('rotation_ended', models.DateTimeField(blank=True, null=True, verbose_name='Дата окончания ротации')),
                ('offer_name', models.CharField(max_length=255, verbose_name='Название предложения')),
                ('offer_type', models.PositiveSmallIntegerField(choices=[(0, 'Customer'), (1, 'Mortgage'), (2, 'Car'), (3, 'Business')], default=0, verbose_name='Тип предложения')),
                ('score_min', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='Мин. скоринговый балл')),
                ('score_max', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='Макс. скоринговый балл')),
                ('bank', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Предложение по кредиту',
                'verbose_name_plural': 'Предложения по кредитам',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Questionnaire',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='Дата изменения')),
                ('name', models.CharField(max_length=255, verbose_name='ФИО')),
                ('birthday', models.DateField(blank=True, null=True, verbose_name='Дата рождения')),
                ('phone', models.CharField(blank=True, max_length=10, null=True, verbose_name='Телефон')),
                ('passport', models.CharField(blank=True, max_length=255, null=True, verbose_name='Паспорт')),
                ('score', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='Скоринговый балл')),
            ],
            options={
                'verbose_name': 'Анкета клиента',
                'verbose_name_plural': 'Анкеты клиентов',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('submitted', models.DateTimeField(blank=True, null=True, verbose_name='Дата отправки')),
                ('status', models.PositiveSmallIntegerField(choices=[(0, 'New'), (1, 'Sent'), (2, 'Received')], default=0, verbose_name='Статус заявки')),
                ('offer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='loans.Offer', verbose_name='Предложение')),
                ('questionnaire', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='loans.Questionnaire', verbose_name='Анкета')),
            ],
            options={
                'verbose_name': 'Заявка на кредит',
                'verbose_name_plural': 'Заявки на кредиты',
                'ordering': ('-created',),
            },
        ),
    ]
