# Generated by Django 3.0.5 on 2020-06-06 14:32

from django.conf import settings
import django.core.validators
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),
        ('software', '0009_auto_20200606_0230'),
    ]

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('kind', models.CharField(choices=[('org', 'Оригинальная разработка'), ('mod', 'Доработка'), ('buy', 'Покупка')], db_index=True, default='buy', max_length=3)),
                ('cost', models.FloatField(validators=[django.core.validators.MinValueValidator(0)], verbose_name='Стоимость')),
                ('note', models.TextField(blank=True, null=True, verbose_name='Примечание')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания договора')),
                ('starting_date', models.DateTimeField(blank=True, null=True, verbose_name='Дата начала')),
                ('ending_date', models.DateTimeField(blank=True, null=True, verbose_name='Дата окончания')),
                ('discount', models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Скидка')),
                ('date_of_delete', models.DateField(blank=True, db_index=True, null=True, verbose_name='Дата удаления')),
                ('visibility', models.BooleanField(db_index=True, default=True, verbose_name='Видимость на сайте')),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='order_client', to=settings.AUTH_USER_MODEL, verbose_name='Клиент')),
                ('manager', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='order_manager', to=settings.AUTH_USER_MODEL, verbose_name='Менеджер')),
                ('software', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='order_software', to='software.Software', verbose_name='ПО')),
            ],
            options={
                'verbose_name': 'Заказ',
                'verbose_name_plural': 'Заказы',
            },
        ),
    ]
