# Generated by Django 3.2.6 on 2021-09-01 07:09

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('first_name', models.CharField(max_length=30)),
                ('last_name', models.CharField(max_length=30)),
                ('phone_number', models.IntegerField(null=True)),
                ('user_name', models.CharField(max_length=20, unique=True)),
                ('address', models.CharField(max_length=100)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=False)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
                ('phone_number', models.IntegerField()),
                ('email', models.EmailField(max_length=50, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50, unique=True)),
                ('description', models.TextField()),
                ('price', models.IntegerField(default=0)),
                ('stock_quantity', models.IntegerField()),
                ('unit_of_measurement', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='RawBatch',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('batch_name', models.CharField(max_length=50)),
                ('date_created', models.DateField(auto_now=True)),
                ('quantity', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='RawMaterial',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Requesition',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('Date', models.DateField(auto_now=True)),
                ('Control_Number', models.CharField(max_length=50)),
                ('Qty', models.IntegerField()),
                ('status', models.CharField(choices=[('A', 'PENDING'), ('B', 'ACCEPTED'), ('C', 'PARTIALLY DELIVERED'), ('D', 'DELIVERED')], default='A', max_length=2)),
                ('Item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.product')),
                ('Section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.section')),
                ('customer_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.customer')),
                ('requested_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ReqToRaw',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('quantity_needed', models.IntegerField()),
                ('raw', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.rawbatch')),
                ('req', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.requesition')),
            ],
        ),
        migrations.AddField(
            model_name='rawbatch',
            name='tp',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.rawmaterial'),
        ),
        migrations.AddField(
            model_name='employee',
            name='section',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='main.section'),
        ),
        migrations.AddField(
            model_name='employee',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
    ]
