# Generated by Django 2.2 on 2020-11-08 14:36

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='Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('customer', models.CharField(max_length=120)),
            ],
        ),
        migrations.CreateModel(
            name='Deal',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('request_date', models.DateField(auto_now_add=True)),
                ('product', models.CharField(choices=[('AUT', 'Автокредит'), ('CNS', 'Потребительский'), ('SCR', 'Залог'), ('MTG', 'Ипотека')], max_length=3)),
                ('phone', models.CharField(max_length=10)),
                ('resolution', models.CharField(blank=True, choices=[('APR', 'Одобрено'), ('REF', 'Отказ'), ('HLD', 'Временный отказ')], max_length=3)),
                ('comment', models.CharField(blank=True, max_length=255)),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.Customer')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deals', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='DealLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField()),
                ('change', models.CharField(max_length=50)),
                ('value', models.CharField(blank=True, max_length=255)),
                ('deal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.Deal')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='actions', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
