# Generated by Django 3.1.3 on 2020-11-05 01:07

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='updated at')),
                ('name', models.CharField(max_length=255, verbose_name='name')),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='Table',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='updated at')),
                ('number', models.PositiveSmallIntegerField(verbose_name='number')),
            ],
            options={
                'ordering': ('number',),
            },
        ),
        migrations.CreateModel(
            name='Zone',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='updated at')),
                ('name', models.CharField(max_length=255, verbose_name='name')),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='Sale',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='updated at')),
                ('external_id', models.CharField(max_length=255, unique=True, verbose_name='external id')),
                ('date_closed', models.DateTimeField(verbose_name='date closed')),
                ('waiter', models.CharField(max_length=255, verbose_name='waiter')),
                ('cashier', models.CharField(max_length=255, verbose_name='cashier')),
                ('diners', models.PositiveSmallIntegerField(verbose_name='dinners')),
                ('date_opened', models.DateTimeField(verbose_name='date opened')),
                ('total', models.DecimalField(decimal_places=2, max_digits=20, verbose_name='total')),
                ('table', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sales', to='sales.table', verbose_name='table')),
                ('zone', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sales', to='sales.zone', verbose_name='zone')),
            ],
            options={
                'ordering': ('created_at',),
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='updated at')),
                ('name', models.CharField(max_length=255, verbose_name='name')),
                ('price', models.DecimalField(decimal_places=2, max_digits=20, verbose_name='price')),
                ('quantity', models.PositiveSmallIntegerField(verbose_name='quantity')),
                ('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='products', to='sales.category', verbose_name='category')),
                ('sale', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='sales.sale', verbose_name='sale')),
            ],
            options={
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='updated at')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=20, verbose_name='amount')),
                ('kind', models.CharField(choices=[('CASH', 'Cash'), ('CREDIT_CARD', 'Credit card'), ('DEBIT_CARD', 'Debit card')], max_length=50, verbose_name='kind')),
                ('sale', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='sales.sale', verbose_name='sale')),
            ],
            options={
                'ordering': ('created_at',),
            },
        ),
    ]
