# Generated by Django 3.1.3 on 2020-11-24 15:10

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('members', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='Name')),
                ('description', models.TextField(blank=True, default='-', verbose_name='Description')),
                ('price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='Price')),
                ('stock', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000)], verbose_name='Stock')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('changed', models.DateTimeField(auto_now=True, verbose_name='Changed')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Purchase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='date purchased')),
            ],
        ),
        migrations.CreateModel(
            name='Sales',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='date sale')),
                ('total', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='Price Total')),
                ('hawker', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='members.hawker')),
            ],
        ),
        migrations.CreateModel(
            name='SalesProduct',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sold', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000)], verbose_name='Sold')),
                ('price_per_product', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='Price per Product')),
                ('total', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='Price Total')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tugaspi.product')),
                ('sales', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tugaspi.sales')),
            ],
        ),
        migrations.CreateModel(
            name='HawkerProduct',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('stock', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000)], verbose_name='Stock')),
                ('hawker', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='members.hawker')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tugaspi.product')),
            ],
        ),
        migrations.CreateModel(
            name='Bon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hawker_stock', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000)], verbose_name='Hawker Stock')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('changed', models.DateTimeField(auto_now=True, verbose_name='Changed')),
                ('hawker', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='members.hawker')),
            ],
        ),
    ]
