# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2020-10-12 12:41
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),
        ('dataentry', '0156_irfcommon_signs_fake_documentation'),
    ]

    operations = [
        migrations.CreateModel(
            name='LegalCase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(default='pending', max_length=20, verbose_name='Status')),
                ('date_time_entered_into_system', models.DateTimeField(auto_now_add=True)),
                ('date_time_last_updated', models.DateTimeField(auto_now=True)),
                ('legal_case_number', models.CharField(max_length=20, unique=True, verbose_name='LC #:')),
                ('police_case', models.CharField(max_length=255, null=True)),
                ('court_case', models.CharField(max_length=255, null=True)),
                ('charge_sheet_date', models.DateField(null=True)),
                ('case_type', models.CharField(max_length=255, null=True)),
                ('date_last_contacted', models.DateField(null=True)),
                ('comment', models.TextField(blank=True)),
                ('appealed', models.BooleanField(default=False)),
                ('lawyer_name', models.CharField(max_length=255, null=True)),
                ('lawyer_phone', models.CharField(max_length=255, null=True)),
                ('form_entered_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='legalcase_entered_by', to=settings.AUTH_USER_MODEL)),
                ('station', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dataentry.BorderStation')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LegalCaseAttachment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('attachment_number', models.PositiveIntegerField(blank=True, null=True)),
                ('description', models.CharField(max_length=126, null=True)),
                ('attachment', models.FileField(upload_to='scanned_irf_forms', verbose_name='Attach scanned copy of form (pdf or image)')),
                ('private_card', models.BooleanField(default=True)),
                ('option', models.CharField(max_length=126, null=True)),
                ('legal_case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dataentry.LegalCase')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LegalCaseSuspect',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('named_on_charge_sheet', models.BooleanField(default=False)),
                ('arrest_date', models.DateField(null=True)),
                ('arrest_status', models.CharField(max_length=255, null=True)),
                ('verdict', models.CharField(max_length=255, null=True)),
                ('verdict_date', models.DateField(null=True)),
                ('imprisonment_years', models.PositiveIntegerField(blank=True, null=True)),
                ('imprisonment_months', models.PositiveIntegerField(blank=True, null=True)),
                ('imprisonment_days', models.PositiveIntegerField(blank=True, null=True)),
                ('imprisonment_total_days', models.PositiveIntegerField(blank=True, null=True)),
                ('fine_amount', models.CharField(max_length=255, null=True)),
                ('legal_case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dataentry.LegalCase')),
                ('person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dataentry.Person')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LegalCaseVictim',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('alternate_phone', models.CharField(max_length=255, null=True)),
                ('last_contact_date', models.DateField(null=True)),
                ('last_attempted_contact_date', models.DateField(null=True)),
                ('victim_status', models.CharField(max_length=255, null=True)),
                ('legal_case', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dataentry.LegalCase')),
                ('person', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='dataentry.Person')),
            ],
            options={
                'abstract': False,
            },
        ),
        
        migrations.RunSQL("insert into dataentry_permission (permission_group, action, min_level)  values ('LEGAL_CASE','VIEW','COUNTRY')"),
        migrations.RunSQL("insert into dataentry_permission (permission_group, action, min_level)  values ('LEGAL_CASE','EDIT','COUNTRY')"),
        migrations.RunSQL("insert into dataentry_permission (permission_group, action, min_level)  values ('LEGAL_CASE','ADD','COUNTRY')"),
        migrations.RunSQL("insert into dataentry_permission (permission_group, action, min_level)  values ('LEGAL_CASE','DELETE','COUNTRY')"),
    ]
