# Generated by Django 2.2.4 on 2020-03-09 09:56

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Booking',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('AWAITING_APPROVAL', 'Awaiting approval'), ('PENDING_PAYMENT', 'Pending payment'), ('APPROVED', 'Approved'), ('CANCELLED', 'Cancelled'), ('NO_SHOW', 'No-show'), ('COMPLETED', 'Completed')], default='AWAITING_APPROVAL', max_length=17, verbose_name='status')),
                ('hash_key', models.CharField(db_index=True, max_length=40, unique=True, verbose_name='hash key')),
                ('book_from', models.DateTimeField(blank=True, default=None, null=True, verbose_name='book from')),
                ('book_to', models.DateTimeField(blank=True, default=None, null=True, verbose_name='book to')),
                ('number_of_persons', models.PositiveSmallIntegerField(blank=True, default=None, null=True, verbose_name='number of persons')),
                ('price', models.DecimalField(blank=True, decimal_places=2, default=None, help_text='€', max_digits=10, null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='price')),
                ('message', models.TextField(blank=True, verbose_name='message')),
                ('person', models.CharField(blank=True, max_length=100, verbose_name='person')),
                ('phone', models.CharField(blank=True, max_length=40, verbose_name='phone')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')),
                ('listing', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='listings.Listing', verbose_name='listing')),
                ('traveler', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='traveler')),
            ],
            options={
                'verbose_name': 'booking',
                'verbose_name_plural': 'bookings',
                'ordering': ('created',),
            },
        ),
    ]
