# Generated by Django 5.1.4 on 2025-01-03 10:56

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('human_resource', '0001_initial'),
        ('system_administration', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category_name', models.CharField(default='', max_length=50)),
                ('category_description', models.CharField(blank=True, default='', max_length=500)),
                ('recycle_bin', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='category_created_by', to='human_resource.staffprofile')),
                ('last_updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='category_last_updated_by', to='human_resource.staffprofile')),
            ],
            options={
                'verbose_name': 'Category',
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.CreateModel(
            name='Inventory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.CharField(default='0', max_length=15)),
                ('minimum_stock_level', models.CharField(default='0', max_length=15)),
                ('inventory_description', models.CharField(blank=True, default='', max_length=500)),
                ('recycle_bin', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inventory_created_by', to='human_resource.staffprofile')),
                ('last_updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inventory_last_updated_by', to='human_resource.staffprofile')),
            ],
            options={
                'verbose_name': 'Inventory',
                'verbose_name_plural': 'Inventories',
            },
        ),
        migrations.CreateModel(
            name='InventoryFinancialYearOpening',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('financial_year', models.CharField(blank=True, default='', max_length=6)),
                ('opening_quantity', models.CharField(blank=True, default='0', max_length=20)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('inventory', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='inventory_financial_year_opening_values', to='warehouse_management.inventory')),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('product_name', models.CharField(default='', max_length=50)),
                ('stock_keeping_unit', models.CharField(default='', max_length=20, unique=True)),
                ('unit_of_measurement', models.CharField(choices=[('kilowatts', 'Kilowatts'), ('piece', 'Piece'), ('box', 'Box'), ('pallet', 'Pallet'), ('metre', 'Metre'), ('kg', 'Kg'), ('litre', 'Litre'), ('other', 'Other'), ('not_selected', 'Not Selected')], default='not_selected', max_length=20)),
                ('product_description', models.CharField(blank=True, default='', max_length=500)),
                ('recycle_bin', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
                ('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='category_products', to='warehouse_management.category')),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='product_created_by', to='human_resource.staffprofile')),
                ('last_updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='product_last_updated_by', to='human_resource.staffprofile')),
            ],
        ),
        migrations.AddField(
            model_name='inventory',
            name='product',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='product_inventories', to='warehouse_management.product'),
        ),
        migrations.CreateModel(
            name='PurchaseRequisition',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('purchase_requisition_number', models.CharField(default='', max_length=50, unique=True)),
                ('purchase_requisition_description', models.CharField(blank=True, default='', max_length=500)),
                ('purchase_requisition_approved', models.BooleanField(default=False)),
                ('recycle_bin', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='purchase_requisitions_created_by', to='human_resource.staffprofile')),
                ('last_updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='purchase_requisitions_last_updated_by', to='human_resource.staffprofile')),
            ],
            options={
                'verbose_name': 'Purchase Requisition',
                'verbose_name_plural': 'Purchase Requisitions',
            },
        ),
        migrations.CreateModel(
            name='PurchaseRequisitionInstance',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.CharField(default='0', max_length=15)),
                ('purchase_requisition_items_purchased', models.BooleanField(default=False)),
                ('recycle_bin', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='purchase_requisition_instances_created_by', to='human_resource.staffprofile')),
                ('last_updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='purchase_requisition_instances_last_updated_by', to='human_resource.staffprofile')),
                ('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='product_purchase_requisitions', to='warehouse_management.product')),
                ('purchase_requisition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='purchase_requisition_instances', to='warehouse_management.purchaserequisition')),
            ],
        ),
        migrations.CreateModel(
            name='StockRequisition',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('stock_requisition_number', models.CharField(default='', max_length=50, unique=True)),
                ('stock_requisition_description', models.CharField(blank=True, default='', max_length=500)),
                ('stock_requisition_approved', models.BooleanField(default=False)),
                ('recycle_bin', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stock_requisitions_created_by', to='human_resource.staffprofile')),
                ('last_updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stock_requisitions_last_updated_by', to='human_resource.staffprofile')),
            ],
        ),
        migrations.CreateModel(
            name='StockRequisitionInstance',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.CharField(default='0', max_length=15)),
                ('stock_requisition_items_delivered', models.BooleanField(default=False)),
                ('recycle_bin', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stock_requisition_instances_created_by', to='human_resource.staffprofile')),
                ('last_updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stock_requisition_instances_last_updated_by', to='human_resource.staffprofile')),
                ('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='product_stock_requisitions', to='warehouse_management.product')),
                ('stock_requisition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stock_requisition_instances', to='warehouse_management.stockrequisition')),
            ],
        ),
        migrations.CreateModel(
            name='StockTransaction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('stock_transaction_number', models.CharField(default='', max_length=50, unique=True)),
                ('transaction_type', models.CharField(choices=[('in_bound', 'Inbound'), ('out_bound', 'Outbound'), ('not_selected', 'Not Selected')], default='not_selected', max_length=20)),
                ('transaction_description', models.CharField(blank=True, default='', max_length=500)),
                ('stock_transaction_reference', models.CharField(blank=True, default='', max_length=50)),
                ('stock_transaction_added_to_inventory', models.BooleanField(default=False)),
                ('recycle_bin', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stock_transaction_created_by', to='human_resource.staffprofile')),
                ('last_updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stock_transaction_last_updated_by', to='human_resource.staffprofile')),
            ],
            options={
                'verbose_name': 'Stock Transaction',
                'verbose_name_plural': 'Stock Transactions',
            },
        ),
        migrations.CreateModel(
            name='StockTransactionInstance',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.CharField(default='0', max_length=15)),
                ('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='product_stock_transactions', to='warehouse_management.product')),
                ('stock_transaction', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='stock_transaction_instances', to='warehouse_management.stocktransaction')),
            ],
        ),
        migrations.CreateModel(
            name='Warehouse',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('warehouse_name', models.CharField(default='', max_length=50, unique=True)),
                ('warehouse_location', models.CharField(default='', max_length=50)),
                ('warehouse_capacity', models.CharField(default='0', max_length=12)),
                ('warehouse_contact_phone', models.CharField(default='', max_length=25)),
                ('warehouse_description', models.CharField(blank=True, default='', max_length=500)),
                ('recycle_bin', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('company_branch', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='branch_warehouses', to='system_administration.companybranch')),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='warehouse_created_by', to='human_resource.staffprofile')),
                ('last_updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='warehouse_last_updated_by', to='human_resource.staffprofile')),
            ],
        ),
        migrations.AddField(
            model_name='stocktransaction',
            name='recipient_warehouse',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='recipient_warehouse_stock_transactions', to='warehouse_management.warehouse'),
        ),
        migrations.AddField(
            model_name='stocktransaction',
            name='source_warehouse',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='source_warehouse_stock_transactions', to='warehouse_management.warehouse'),
        ),
        migrations.AddField(
            model_name='stockrequisition',
            name='warehouse',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='warehouse_stock_requisitions', to='warehouse_management.warehouse'),
        ),
        migrations.AddField(
            model_name='purchaserequisition',
            name='warehouse',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='warehouse_purchase_requisitions', to='warehouse_management.warehouse'),
        ),
        migrations.AddField(
            model_name='inventory',
            name='warehouse',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='warehouse_inventories', to='warehouse_management.warehouse'),
        ),
        migrations.CreateModel(
            name='Equipment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('equipment_name', models.CharField(default='', max_length=100)),
                ('equipment_serial_number', models.CharField(blank=True, default='', max_length=50)),
                ('equipment_description', models.CharField(blank=True, default='', max_length=500)),
                ('status', models.CharField(choices=[('operational', 'Operational'), ('under_maintenance', 'Under Maintenance'), ('decommisioned', 'Decommisioned'), ('not_selected', 'Not Selected')], default='not_selected', max_length=20)),
                ('recycle_bin', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_updated_on', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='equipment_created_by', to='human_resource.staffprofile')),
                ('last_updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='equipment_last_updated_by', to='human_resource.staffprofile')),
                ('warehouse', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='warehouse_equipment', to='warehouse_management.warehouse')),
            ],
        ),
    ]
