# Generated by Django 3.0.6 on 2020-05-23 19:35

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='Client',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone', models.CharField(max_length=14)),
            ],
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('company_type', models.CharField(choices=[('1', 'ИП'), ('2', 'ОАО'), ('3', 'ООО'), ('4', 'ЗАО'), ('5', 'ПТ'), ('6', 'ТНВ'), ('7', 'ГКП')], max_length=1)),
            ],
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position', models.CharField(choices=[('e', 'executor'), ('h', 'head')], default='e', max_length=1)),
                ('phone', models.CharField(max_length=14)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Service',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('service_type', models.CharField(choices=[('1', 'реклама в СМИ'), ('2', 'наружная реклама'), ('3', 'реклама на транспорте'), ('4', 'реклама на месте продаж'), ('5', 'сувенирка'), ('6', 'печатная реклама'), ('7', 'директ-реклама'), ('8', 'реклама в интернете'), ('9', 'ивент-реклама'), ('10', 'другое')], max_length=2)),
                ('price', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(max_length=280)),
                ('materials', models.CharField(max_length=280)),
                ('date', models.DateTimeField(auto_now_add=True, null=True)),
                ('status', models.CharField(choices=[('0', 'in progress'), ('1', 'completed')], default='0', max_length=1)),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='luchapp.Client')),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='luchapp.Employee')),
                ('service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='luchapp.Service')),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.IntegerField()),
                ('day_requested', models.DateTimeField()),
                ('day_paid', models.DateTimeField()),
                ('status', models.CharField(choices=[('0', 'unpaid'), ('1', 'paid')], default='0', max_length=1)),
                ('request', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='luchapp.Request')),
            ],
        ),
        migrations.AddField(
            model_name='client',
            name='company',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='luchapp.Company'),
        ),
        migrations.AddField(
            model_name='client',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
