# Generated by Django 3.2.3 on 2021-09-27 23:39

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('events', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('date', models.DateField(verbose_name='Fecha Pedido')),
                ('amount', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=8, null=True)),
                ('amount_paid', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=8, null=True)),
                ('quantity', models.IntegerField(default=0)),
                ('paid_out', models.BooleanField(default=False)),
                ('tip', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=8, null=True)),
                ('remaining', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=8, null=True)),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_event', to='events.event')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_user', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Orden',
                'verbose_name_plural': 'Orden',
            },
        ),
        migrations.CreateModel(
            name='OrderItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('product', models.CharField(max_length=100, verbose_name='Producto')),
                ('description', models.CharField(max_length=254, verbose_name='Descripcion')),
                ('price', models.DecimalField(decimal_places=2, max_digits=8)),
                ('quantity', models.IntegerField(default=1)),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='orders.order')),
            ],
        ),
    ]
