# Generated by Django 3.0.2 on 2020-01-25 22:40

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='Produto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo_de_barras', models.CharField(max_length=13)),
                ('descricao', models.CharField(max_length=200)),
                ('valor_de_venda', models.DecimalField(decimal_places=2, max_digits=7, validators=[django.core.validators.MinValueValidator(0)])),
                ('valor_de_compra', models.DecimalField(decimal_places=2, max_digits=7, validators=[django.core.validators.MinValueValidator(0)])),
                ('quantidade_em_estoque', models.IntegerField(validators=[django.core.validators.MinValueValidator(0)])),
            ],
        ),
        migrations.CreateModel(
            name='Venda',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('data_e_hora', models.DateTimeField(auto_now=True)),
                ('valor_total', models.DecimalField(decimal_places=2, max_digits=7, validators=[django.core.validators.MinValueValidator(0)])),
                ('forma_de_pagamento', models.CharField(choices=[('CR', 'Crédito'), ('DE', 'Débito'), ('DI', 'Dinheiro')], max_length=2)),
            ],
        ),
        migrations.CreateModel(
            name='ProdutoVendido',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo_de_barras', models.CharField(max_length=13)),
                ('descricao', models.CharField(max_length=200)),
                ('valor_de_venda', models.DecimalField(decimal_places=2, max_digits=7, validators=[django.core.validators.MinValueValidator(0)])),
                ('valor_de_compra', models.DecimalField(decimal_places=2, max_digits=7, validators=[django.core.validators.MinValueValidator(0)])),
                ('quantidade_vendida', models.IntegerField(validators=[django.core.validators.MinValueValidator(0)])),
                ('venda', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sistema.Venda')),
            ],
        ),
        migrations.CreateModel(
            name='Pack',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantidade_do_pack', models.IntegerField(validators=[django.core.validators.MinValueValidator(1, 'Digite um valor maior que 1')])),
                ('produto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sistema.Produto')),
            ],
        ),
    ]
