# Generated by Django 4.1.7 on 2023-07-23 04:43

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import inventory.validators


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('humanresource', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Collection',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name': 'Collection',
                'verbose_name_plural': 'Collections',
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='Consumer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('business_nature', models.CharField(blank=True, max_length=255, null=True)),
                ('in_charge', models.CharField(blank=True, max_length=255, null=True)),
                ('phone_number', models.CharField(max_length=255)),
                ('email', models.EmailField(blank=True, max_length=254, null=True)),
                ('website', models.CharField(blank=True, max_length=255, null=True)),
                ('account_number', models.CharField(blank=True, max_length=255, null=True)),
                ('address', models.CharField(blank=True, max_length=255, null=True)),
            ],
            options={
                'verbose_name': 'Consumer',
                'verbose_name_plural': 'Consumers',
            },
        ),
        migrations.CreateModel(
            name='ConsumerAccount',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tx_date', models.DateField(auto_now=True)),
                ('tx_number', models.CharField(max_length=255, unique=True)),
                ('details', models.CharField(default='Details', max_length=255)),
                ('previous_balance', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('credit', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('debit', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('current_balance', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inventory.consumer')),
            ],
            options={
                'verbose_name': 'Consumer Account',
                'verbose_name_plural': 'Consumer Accounts',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('slug', models.SlugField()),
                ('abbreviation', models.CharField(max_length=10)),
                ('description', models.TextField(blank=True, null=True)),
                ('unit_price', models.DecimalField(decimal_places=2, max_digits=6, validators=[django.core.validators.MinValueValidator(1)])),
                ('inventory', models.IntegerField(validators=[django.core.validators.MinValueValidator(0)])),
                ('last_update', models.DateTimeField(auto_now=True)),
                ('packing_style', models.CharField(choices=[('Bottles', 'Bottles'), ('E', 'Each'), ('TAB', 'TABLET'), ('AMP', 'Ampoules'), ('Vials', 'Vials'), ('CAP', 'Capsule'), ('Sachet', 'Sachet'), ('CRM', 'Cream'), ('Blister', 'Blister')], default='Each', max_length=10)),
                ('collection', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='products', to='inventory.collection')),
                ('currency', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='humanresource.currency')),
            ],
            options={
                'verbose_name': 'Product',
                'verbose_name_plural': 'Products',
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='ProductImage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='inventory/product/images', validators=[inventory.validators.validate_file_size])),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='inventory.product')),
            ],
            options={
                'verbose_name': 'Products image',
                'verbose_name_plural': 'Products images',
            },
        ),
        migrations.CreateModel(
            name='Payment_From_Consumer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount_paid', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('remain_amount', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('remarks', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('consumer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inventory.consumeraccount')),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='consumer_payment_created', to=settings.AUTH_USER_MODEL)),
                ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='consumer_payment_updated', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Consumer Payment',
                'verbose_name_plural': 'Consumers Payment',
            },
        ),
        migrations.AddField(
            model_name='collection',
            name='featured_product',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='inventory.product'),
        ),
    ]
