# Generated by Django 2.2.4 on 2019-10-14 09:19

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('customer', '0001_initial'),
        ('company', '0001_initial'),
        ('warehouse', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='Нэр')),
                ('flag', models.IntegerField(verbose_name='Флаг')),
                ('is_active', models.BooleanField(default=True, verbose_name='Идэвхитэй')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Үүссэн огноо')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Зассан огноо')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='categories', to='product.Category', verbose_name='Ангилал')),
            ],
            options={
                'verbose_name': 'Ангилал',
                'verbose_name_plural': 'Ангиллууд',
                'ordering': ['-updated_at', 'id'],
            },
        ),
        migrations.CreateModel(
            name='Form',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('flag', models.IntegerField()),
                ('is_active', models.BooleanField(default=True, verbose_name='Идэвхитэй')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Үүссэн огноо')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Зассан огноо')),
            ],
            options={
                'verbose_name': 'Бүтээгдэхүүний хэлбэр',
                'verbose_name_plural': 'Бүтээгдэхүүний хэлбэрүүд',
                'ordering': ['-updated_at', 'id'],
            },
        ),
        migrations.CreateModel(
            name='MeasuringType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, verbose_name='Нэр')),
                ('factor', models.FloatField()),
                ('flag', models.IntegerField()),
                ('is_active', models.BooleanField(default=True, verbose_name='Идэвхитэй')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Үүссэн огноо')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Зассан огноо')),
            ],
            options={
                'verbose_name': 'Хэмжих нэгж',
                'verbose_name_plural': 'Хэмжих нэгжүүд',
                'ordering': ['-updated_at', 'id'],
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256, verbose_name='Нэр')),
                ('eng_name', models.CharField(blank=True, max_length=256, null=True, verbose_name='Англи нэр')),
                ('generic_name', models.CharField(blank=True, max_length=256, null=True, verbose_name='Олон улсын нэршил')),
                ('internal_code', models.CharField(blank=True, max_length=64, null=True, verbose_name='Дотоод код')),
                ('barcode', models.CharField(blank=True, max_length=64, null=True, verbose_name='Баркод')),
                ('image', models.ImageField(blank=True, null=True, upload_to='product/', verbose_name='Зураг')),
                ('volume', models.CharField(blank=True, max_length=256, null=True, verbose_name='Эзлэхүүн')),
                ('is_exclusive', models.BooleanField(default=False, verbose_name='Is exclusive')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Тайлбар')),
                ('ingredients', models.TextField(blank=True, max_length=512, null=True, verbose_name='Орц')),
                ('instruction', models.TextField(blank=True, null=True, verbose_name='Заавар')),
                ('warning', models.TextField(blank=True, null=True, verbose_name='Анхааруулга')),
                ('flag', models.IntegerField(verbose_name='Флаг')),
                ('is_active', models.BooleanField(default=True, verbose_name='Идэвхитэй')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Үүссэн огноо')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Зассан огноо')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='product.Category', verbose_name='Ангилал')),
                ('form', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.Form', verbose_name='Хэлбэр')),
                ('manufacturer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='manufacturer_products', to='customer.Customer', verbose_name='Үйлдвэрлэгч')),
                ('measuring_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.MeasuringType', verbose_name='Хэмжих нэгж')),
                ('seller', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='seller_products', to='customer.Customer', verbose_name='Борлуулагч')),
            ],
            options={
                'verbose_name': 'Бүтээгдэхүүн',
                'verbose_name_plural': 'Бүтээгдэхүүнүүд',
                'ordering': ['-updated_at', 'id'],
            },
        ),
        migrations.CreateModel(
            name='Stock',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('in_stock', models.IntegerField(verbose_name='Барааны тоо хэмжээ')),
                ('lot_name', models.CharField(blank=True, max_length=128, null=True, verbose_name='Цувралын дугаар')),
                ('expiration_date', models.DateTimeField(blank=True, null=True, verbose_name='Дуусах хугацаа')),
                ('flag', models.IntegerField(verbose_name='Флаг')),
                ('is_active', models.BooleanField(default=True, verbose_name='Идэвхитэй')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Үүссэн огноо')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Зассан огноо')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stocks', to='product.Product', verbose_name='Бүтээгдэхүүн')),
                ('warehouse', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stocks', to='warehouse.Warehouse', verbose_name='Агуулах')),
            ],
            options={
                'verbose_name': 'Бүтээгдэхүүн нөөц',
                'verbose_name_plural': 'Бүтээгдэхүүн нөөцүүд',
                'ordering': ['-updated_at', 'id'],
            },
        ),
        migrations.CreateModel(
            name='Price',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.FloatField(verbose_name='Үнэ')),
                ('cost', models.FloatField(blank=True, null=True, verbose_name='Өртөг')),
                ('is_active', models.BooleanField(default=True, verbose_name='Идэвхитэй')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Үүссэн огноо')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Зассан огноо')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='prices', to='company.Company', verbose_name='Компани')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='prices', to='product.Product', verbose_name='Бүтээгдэхүүн')),
                ('warehouse', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='prices', to='warehouse.Warehouse', verbose_name='Агуулах')),
            ],
            options={
                'verbose_name': 'Бүтээгдэхүүний үнэ',
                'verbose_name_plural': 'Бүтээгдэхүүний үнүүд',
                'ordering': ['-updated_at', 'id'],
            },
        ),
    ]
