<reponame>asandeep/pseudo-electronics<filename>inventory/migrations/0001_initial.py
# Generated by Django 3.1.7 on 2021-02-27 04:34

import datetime
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Distributor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=10)),
                ('name', models.CharField(max_length=100)),
                ('address', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('manufacturer', models.CharField(max_length=100)),
                ('price', models.PositiveIntegerField()),
                ('quantity', models.PositiveSmallIntegerField(editable=False, help_text='Latest available quantity of product in inventory.')),
            ],
        ),
        migrations.CreateModel(
            name='InventoryReceived',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.PositiveSmallIntegerField()),
                ('distributor_price', models.PositiveSmallIntegerField()),
                ('delivery_date', models.DateField(default=datetime.datetime.utcnow)),
                ('distributor', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='inventory.distributor')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='inventory.product')),
            ],
        ),
        migrations.CreateModel(
            name='DistributorContact',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('number', models.CharField(help_text='Distributor contact number.', max_length=10, validators=[django.core.validators.RegexValidator(regex='\\d{10}')], verbose_name='Mobile Number')),
                ('distributor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='contacts', to='inventory.distributor')),
            ],
        ),
    ]
