# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-04-20 10:32
from __future__ import unicode_literals

import datetime
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='EntityRelations',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=datetime.datetime.now, editable=False)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('entity', models.IntegerField(max_length=11)),
                ('parent_entity', models.IntegerField(max_length=11)),
                ('created_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='entityrelations_created_by', to=settings.AUTH_USER_MODEL)),
                ('updated_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='entityrelations_updated_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Inventory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=datetime.datetime.now, editable=False)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('sku', models.IntegerField(db_index=True)),
                ('entity', models.IntegerField(db_index=True)),
                ('quantity', models.DecimalField(decimal_places=2, default=0, max_digits=13)),
                ('status', models.SmallIntegerField(choices=[(1, 'Available'), (2, 'Out Of Stock'), (3, 'Not Available')], default=3)),
                ('stock_type', models.SmallIntegerField(choices=[(1, 'B2C'), (2, 'Horeca'), (3, 'Kirana')], default=1)),
                ('created_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='inventory_created_by', to=settings.AUTH_USER_MODEL)),
                ('updated_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='inventory_updated_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='InventoryReservation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=datetime.datetime.now, editable=False)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('reference', models.IntegerField(blank=True, db_index=True, null=True)),
                ('sku', models.IntegerField(db_index=True)),
                ('entity', models.IntegerField(db_index=True)),
                ('quantity', models.DecimalField(decimal_places=2, default=0, max_digits=13)),
                ('expiry_date', models.DateTimeField(blank=True, db_index=True, null=True)),
                ('status', models.SmallIntegerField(choices=[(1, 'Reserved'), (2, 'Unreserved')])),
                ('created_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='inventoryreservation_created_by', to=settings.AUTH_USER_MODEL)),
                ('updated_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='inventoryreservation_updated_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProductRelations',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(default=datetime.datetime.now, editable=False)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('sku', models.IntegerField(max_length=11)),
                ('child_sku', models.IntegerField(max_length=11)),
                ('created_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='productrelations_created_by', to=settings.AUTH_USER_MODEL)),
                ('updated_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='productrelations_updated_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
