# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-30 22:30
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Agent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('image', models.URLField()),
                ('optimised_for_mobile', models.BooleanField(default=True)),
            ],
            options={
                'verbose_name': 'Agent',
                'verbose_name_plural': 'Agents',
            },
        ),
        migrations.CreateModel(
            name='AgentType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
            options={
                'verbose_name': 'Agent Type',
                'verbose_name_plural': 'Agent Types',
            },
        ),
        migrations.CreateModel(
            name='Carrier',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=10)),
                ('display_code', models.CharField(max_length=10)),
                ('name', models.CharField(max_length=200)),
                ('image', models.URLField()),
            ],
            options={
                'verbose_name': 'Carrier',
                'verbose_name_plural': 'Carriers',
            },
        ),
        migrations.CreateModel(
            name='FlightSearch',
            fields=[
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('origin', models.CharField(max_length=30)),
                ('destination', models.CharField(max_length=30)),
                ('outbound', models.DateField()),
                ('inbound', models.DateField()),
                ('passengers', models.IntegerField(default=1)),
                ('status', models.CharField(max_length=200)),
                ('query', models.TextField()),
                ('session_key', models.CharField(max_length=200)),
            ],
            options={
                'verbose_name': 'Flight Search',
                'verbose_name_plural': 'Flight Searches',
            },
        ),
        migrations.CreateModel(
            name='Itinerary',
            fields=[
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('booking_details_link', models.TextField()),
                ('flight_search', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='skyscannerSDK.FlightSearch')),
            ],
            options={
                'verbose_name': 'Itinerary',
                'verbose_name_plural': 'Itineraries',
            },
        ),
        migrations.CreateModel(
            name='JourneyMode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
            options={
                'verbose_name': 'Journey Mode',
                'verbose_name_plural': 'Journey Modes',
            },
        ),
        migrations.CreateModel(
            name='Leg',
            fields=[
                ('id', models.SlugField(editable=False, primary_key=True, serialize=False)),
                ('departure', models.DateTimeField()),
                ('arrival', models.DateTimeField()),
                ('duration', models.IntegerField(default=0)),
                ('directionality', models.CharField(choices=[(b'Inbound', 'Inbound'), (b'Outbound', 'Outbound')], default=b'Outbound', max_length=30)),
            ],
            options={
                'verbose_name': 'Leg',
                'verbose_name_plural': 'Legs',
            },
        ),
        migrations.CreateModel(
            name='Place',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=10)),
                ('name', models.CharField(max_length=200)),
                ('parentId', models.IntegerField(default=1)),
            ],
            options={
                'verbose_name': 'Place',
                'verbose_name_plural': 'Places',
            },
        ),
        migrations.CreateModel(
            name='PlaceType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
            options={
                'verbose_name': 'Place Type',
                'verbose_name_plural': 'Place Types',
            },
        ),
        migrations.CreateModel(
            name='PricingOption',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.FloatField()),
                ('deeplink', models.URLField()),
                ('quote_age_in_min', models.IntegerField(default=1)),
                ('agents', models.ManyToManyField(to='skyscannerSDK.Agent')),
                ('itinerary', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='skyscannerSDK.Itinerary')),
            ],
            options={
                'verbose_name': 'Pricing Option',
                'verbose_name_plural': 'Pricing Options',
            },
        ),
        migrations.CreateModel(
            name='Segment',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('departure', models.DateTimeField()),
                ('arrival', models.DateTimeField()),
                ('flight_number', models.CharField(max_length=10)),
                ('duration', models.IntegerField(default=0)),
                ('directionality', models.CharField(choices=[(b'Inbound', 'Inbound'), (b'Outbound', 'Outbound')], default=b'Outbound', max_length=30)),
                ('arrival_place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='segment_arrival_place', to='skyscannerSDK.Place')),
                ('carrier', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='carrier', to='skyscannerSDK.Carrier')),
                ('departure_place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='segment_departure_place', to='skyscannerSDK.Place')),
                ('journey_mode', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='skyscannerSDK.JourneyMode')),
                ('operating_carrier', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='operating_carrier', to='skyscannerSDK.Carrier')),
            ],
            options={
                'verbose_name': 'Segment',
                'verbose_name_plural': 'Segments',
            },
        ),
        migrations.AddField(
            model_name='place',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='skyscannerSDK.PlaceType'),
        ),
        migrations.AddField(
            model_name='leg',
            name='arrival_place',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='arrival_place', to='skyscannerSDK.Place'),
        ),
        migrations.AddField(
            model_name='leg',
            name='carriers',
            field=models.ManyToManyField(related_name='carriers', to='skyscannerSDK.Carrier'),
        ),
        migrations.AddField(
            model_name='leg',
            name='departure_place',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='departure_place', to='skyscannerSDK.Place'),
        ),
        migrations.AddField(
            model_name='leg',
            name='journey_mode',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='skyscannerSDK.JourneyMode'),
        ),
        migrations.AddField(
            model_name='leg',
            name='operating_carriers',
            field=models.ManyToManyField(related_name='operating_carriers', to='skyscannerSDK.Carrier'),
        ),
        migrations.AddField(
            model_name='leg',
            name='segments',
            field=models.ManyToManyField(to='skyscannerSDK.Segment'),
        ),
        migrations.AddField(
            model_name='leg',
            name='stops',
            field=models.ManyToManyField(related_name='stops', to='skyscannerSDK.Place'),
        ),
        migrations.AddField(
            model_name='itinerary',
            name='inbound_leg',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='inbound', to='skyscannerSDK.Leg'),
        ),
        migrations.AddField(
            model_name='itinerary',
            name='outbound_leg',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='outbound', to='skyscannerSDK.Leg'),
        ),
        migrations.AddField(
            model_name='agent',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='skyscannerSDK.AgentType'),
        ),
    ]
