# Generated by Django 3.1.6 on 2021-03-22 16:20

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),
        ('membership', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Inventory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item_code', models.CharField(blank=True, max_length=10, unique=True)),
                ('item_name', models.CharField(blank=True, max_length=100)),
                ('item_desc', models.CharField(blank=True, max_length=200)),
                ('in_stock', models.IntegerField()),
                ('category', models.CharField(blank=True, choices=[('utensils', 'Utensils'), ('cookwares', 'Cookwares'), ('appliances', 'Appliances'), ('dishes', 'Dishes'), ('others', 'Others')], max_length=10)),
                ('price', models.IntegerField()),
                ('item_image', models.ImageField(blank=True, null=True, upload_to='inventory/')),
                ('stocked_date', models.DateTimeField(auto_now_add=True)),
                ('status', models.CharField(choices=[('C', 'Continue'), ('D', 'Discontinued')], default='C', max_length=1)),
                ('stocked_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Offers',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('offer_code', models.CharField(max_length=10)),
                ('discount_pct', models.IntegerField()),
                ('valid_from', models.DateTimeField()),
                ('valid_to', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Sales',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('total_price', models.IntegerField()),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('customer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='membership.customer')),
                ('offer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.offers')),
            ],
        ),
        migrations.CreateModel(
            name='SalesItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('purchase_unit', models.IntegerField()),
                ('line_total', models.IntegerField()),
                ('item', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.inventory')),
                ('sales', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.sales')),
            ],
        ),
    ]
