# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-10-15 09:13
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('wildlifecompliance', '0311_auto_20191011_1515'),
    ]

    operations = [
        migrations.CreateModel(
            name='LegalCase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=200, null=True)),
                ('status', models.CharField(choices=[('open', 'Open'), ('await_endorsement', 'Awaiting Endorsement'), ('discarded', 'Discarded'), ('closed', 'Closed'), ('pending_closure', 'Pending Closure')], default='open', max_length=100)),
                ('details', models.TextField(blank=True, null=True)),
                ('number', models.CharField(blank=True, max_length=50, null=True)),
                ('created_date', models.DateField(null=True)),
                ('created_time', models.TimeField(blank=True, null=True)),
                ('assigned_to', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='legal_case_assigned_to', to=settings.AUTH_USER_MODEL)),
                ('call_email', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='legal_case_call_email', to='wildlifecompliance.CallEmail')),
            ],
            options={
                'verbose_name': 'CM_LegalCase',
                'verbose_name_plural': 'CM_LegalCases',
            },
        ),
        migrations.CreateModel(
            name='LegalCaseCommsLogDocument',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=100, verbose_name='name')),
                ('description', models.TextField(blank=True, verbose_name='description')),
                ('uploaded_date', models.DateTimeField(auto_now_add=True)),
                ('_file', models.FileField(max_length=255, upload_to=b'')),
            ],
        ),
        migrations.CreateModel(
            name='LegalCaseCommsLogEntry',
            fields=[
                ('communicationslogentry_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wildlifecompliance.CommunicationsLogEntry')),
                ('legal_case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comms_logs', to='wildlifecompliance.LegalCase')),
            ],
            bases=('wildlifecompliance.communicationslogentry',),
        ),
        migrations.CreateModel(
            name='LegalCaseDocument',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=100, verbose_name='name')),
                ('description', models.TextField(blank=True, verbose_name='description')),
                ('uploaded_date', models.DateTimeField(auto_now_add=True)),
                ('_file', models.FileField(max_length=255, upload_to=b'')),
                ('input_name', models.CharField(blank=True, max_length=255, null=True)),
                ('can_delete', models.BooleanField(default=True)),
                ('version_comment', models.CharField(blank=True, max_length=255, null=True)),
                ('legal_case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='wildlifecompliance.LegalCase')),
            ],
        ),
        migrations.CreateModel(
            name='LegalCaseUserAction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('when', models.DateTimeField(auto_now_add=True)),
                ('what', models.TextField()),
                ('legal_case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='action_logs', to='wildlifecompliance.LegalCase')),
                ('who', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-when',),
            },
        ),
        migrations.AddField(
            model_name='legalcasecommslogdocument',
            name='log_entry',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='wildlifecompliance.LegalCaseCommsLogEntry'),
        ),
    ]
