# Generated by Django 5.1.7 on 2026-06-08 16:29

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Categoria',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name_plural': 'Categorías',
                'ordering': ['nombre'],
            },
        ),
        migrations.CreateModel(
            name='Jornada',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha', models.DateField(default=django.utils.timezone.now)),
                ('base', models.DecimalField(decimal_places=0, default=0, max_digits=12)),
                ('cerrada', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['-fecha'],
            },
        ),
        migrations.CreateModel(
            name='Variacion',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100, unique=True)),
                ('precio', models.DecimalField(decimal_places=0, max_digits=10)),
                ('activo', models.BooleanField(default=True)),
            ],
            options={
                'verbose_name_plural': 'Variaciones',
                'ordering': ['precio', 'nombre'],
            },
        ),
        migrations.CreateModel(
            name='Producto',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=200)),
                ('precio', models.DecimalField(blank=True, decimal_places=0, max_digits=10, null=True)),
                ('activo', models.BooleanField(default=True)),
                ('categoria', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='productos', to='ventas.categoria')),
            ],
            options={
                'ordering': ['nombre'],
            },
        ),
        migrations.CreateModel(
            name='Venta',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mesa', models.CharField(blank=True, default='', max_length=100)),
                ('cantidad', models.PositiveIntegerField(default=1)),
                ('valor', models.DecimalField(decimal_places=0, max_digits=12)),
                ('metodo_pago', models.CharField(choices=[('Efectivo', 'Efectivo'), ('Nequi', 'Nequi'), ('Bold', 'Bold'), ('Promocion', 'Promoción'), ('Sin Pagar', 'Sin Pagar')], default='Efectivo', max_length=20)),
                ('creado', models.DateTimeField(auto_now_add=True)),
                ('jornada', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ventas', to='ventas.jornada')),
                ('producto', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='ventas', to='ventas.producto')),
                ('variacion', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ventas', to='ventas.variacion')),
            ],
            options={
                'ordering': ['-creado'],
            },
        ),
        migrations.CreateModel(
            name='InventarioItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('inicial', models.IntegerField(default=0)),
                ('compras', models.IntegerField(default=0)),
                ('faltan', models.IntegerField(default=0)),
                ('sobran', models.IntegerField(default=0)),
                ('jornada', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='inventario', to='ventas.jornada')),
            ],
            options={
                'verbose_name_plural': 'Items de inventario',
                'ordering': ['nombre'],
                'unique_together': {('jornada', 'nombre')},
            },
        ),
    ]
