# Generated by Django 5.1.4 on 2024-12-09 09:30

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='APIConfiguration',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Название API')),
                ('url', models.URLField(verbose_name='URL API')),
                ('token', models.CharField(blank=True, max_length=255, null=True, verbose_name='Токен')),
                ('username', models.CharField(blank=True, max_length=255, null=True, verbose_name='Логин')),
                ('password', models.CharField(blank=True, max_length=255, null=True, verbose_name='Пароль')),
                ('last_updated', models.DateTimeField(auto_now=True, verbose_name='Дата последнего обновления')),
            ],
            options={
                'verbose_name': 'Конфигурация API',
                'verbose_name_plural': 'Конфигурации API',
            },
        ),
        migrations.CreateModel(
            name='FraudLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reservation_id', models.BigIntegerField(unique=True, verbose_name='ID бронирования')),
                ('guest_name', models.CharField(blank=True, max_length=255, null=True)),
                ('check_in_date', models.DateField()),
                ('detected_at', models.DateTimeField(auto_now_add=True)),
                ('message', models.TextField()),
            ],
            options={
                'verbose_name': 'Журнал мошенничества',
                'verbose_name_plural': 'Журналы мошенничества',
            },
        ),
        migrations.CreateModel(
            name='Guest',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Имя гостя')),
                ('birthdate', models.DateField(blank=True, null=True, verbose_name='Дата рождения')),
                ('phone', models.CharField(blank=True, max_length=50, null=True, verbose_name='Телефон')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, verbose_name='Email')),
            ],
            options={
                'verbose_name': 'Гость',
                'verbose_name_plural': 'Гости',
            },
        ),
        migrations.CreateModel(
            name='Reservation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reservation_id', models.BigIntegerField(unique=True, verbose_name='ID бронирования')),
                ('room_number', models.CharField(max_length=50, verbose_name='Номер комнаты')),
                ('room_type', models.CharField(max_length=255, verbose_name='Тип комнаты')),
                ('check_in', models.DateTimeField(verbose_name='Дата заезда')),
                ('check_out', models.DateTimeField(verbose_name='Дата выезда')),
                ('status', models.CharField(max_length=50, verbose_name='Статус')),
                ('price', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='Цена')),
                ('discount', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='Скидка')),
            ],
            options={
                'verbose_name': 'Бронирование',
                'verbose_name_plural': 'Бронирования',
            },
        ),
        migrations.CreateModel(
            name='UserHotel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'verbose_name': 'Пользователь отеля',
                'verbose_name_plural': 'Пользователи отелей',
            },
        ),
        migrations.CreateModel(
            name='APIRequestLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('request_time', models.DateTimeField(auto_now_add=True, verbose_name='Время запроса')),
                ('response_status', models.IntegerField(validators=[django.core.validators.MinValueValidator(100), django.core.validators.MaxValueValidator(599)], verbose_name='HTTP статус ответа')),
                ('response_data', models.JSONField(blank=True, null=True, verbose_name='Данные ответа')),
                ('api', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hotels.apiconfiguration', verbose_name='API')),
            ],
            options={
                'verbose_name': 'Журнал запросов API',
                'verbose_name_plural': 'Журналы запросов API',
            },
        ),
        migrations.CreateModel(
            name='Hotel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Название отеля')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Создан')),
                ('api', models.OneToOneField(blank=True, help_text='API, связанный с этим отелем.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='hotels.apiconfiguration', verbose_name='API')),
            ],
            options={
                'verbose_name': 'Отель',
                'verbose_name_plural': 'Отели',
            },
        ),
    ]
