# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-11-09 10:04
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('ot_webservice_api', '0003_ot_config_active'),
    ]

    operations = [
        migrations.CreateModel(
            name='Agent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('login', models.CharField(max_length=200)),
                ('displayname', models.CharField(max_length=200)),
                ('first_name', models.CharField(max_length=200)),
                ('last_name', models.CharField(max_length=200)),
                ('is_helpdesk', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=False)),
                ('phone', models.CharField(max_length=200)),
                ('ot_id', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Call',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ucid', models.CharField(max_length=200)),
                ('state', models.CharField(max_length=200)),
                ('origin', models.CharField(max_length=200)),
                ('destination', models.CharField(max_length=200)),
                ('call_type', models.CharField(max_length=200)),
                ('start', models.DateTimeField(max_length=200)),
                ('wnd', models.DateTimeField(max_length=200)),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ot_webservice_api.Agent')),
            ],
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ucid', models.CharField(max_length=200)),
                ('state', models.CharField(max_length=200)),
                ('origin', models.CharField(max_length=200)),
                ('destination', models.CharField(max_length=200)),
                ('start', models.DateTimeField(max_length=200)),
                ('end', models.DateTimeField(max_length=200)),
                ('ot_id', models.CharField(max_length=200)),
                ('applicant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='event_applicant', to='ot_webservice_api.Agent')),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ot_webservice_api.Call')),
                ('responsible', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='event_responsible', to='ot_webservice_api.Agent')),
            ],
        ),
        migrations.CreateModel(
            name='Ticket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('number', models.CharField(max_length=200)),
                ('description', models.CharField(max_length=200)),
                ('state', models.CharField(max_length=200)),
                ('ot_id', models.CharField(max_length=200)),
                ('applicant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_applicant', to='ot_webservice_api.Agent')),
                ('responsible', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_responsible', to='ot_webservice_api.Agent')),
            ],
        ),
        migrations.RemoveField(
            model_name='ot_field',
            name='fields',
        ),
        migrations.RemoveField(
            model_name='ot_field',
            name='type',
        ),
        migrations.DeleteModel(
            name='Ot_field',
        ),
        migrations.DeleteModel(
            name='Ot_fieldtype',
        ),
        migrations.DeleteModel(
            name='Ot_object',
        ),
        migrations.AddField(
            model_name='event',
            name='ticket',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ot_webservice_api.Ticket'),
        ),
    ]
