# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-29 07:32
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(db_index=True, max_length=255, unique=True, verbose_name='Username')),
                ('email', models.EmailField(blank=True, db_index=True, max_length=254, null=True, unique=True, verbose_name='Email')),
                ('full_name', models.CharField(blank=True, max_length=128, null=True)),
                ('is_staff', models.BooleanField(db_index=True, default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='Staff Status')),
                ('is_active', models.BooleanField(db_index=True, default=True, help_text='Designates whether this user should be treated as active. Deselect this instead of deleting accounts.', verbose_name='Active')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Created Date')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='Modified Date')),
                ('phone', models.CharField(blank=True, max_length=15, null=True, verbose_name='Phone Number')),
                ('date_of_birth', models.DateField(blank=True, null=True, verbose_name='Date of Birth')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'User',
                'verbose_name_plural': 'Users',
            },
            managers=[
                ('objects', bankapp.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='AddressType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address_type', models.CharField(max_length=128, verbose_name='Address Type')),
            ],
        ),
        migrations.CreateModel(
            name='Branch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, verbose_name='Branch Name')),
                ('address', models.TextField(blank=True, max_length=255, null=True, verbose_name='Address')),
                ('city', models.CharField(max_length=128, verbose_name='City')),
                ('district', models.CharField(max_length=128, verbose_name='District')),
                ('pincode', models.CharField(max_length=6, verbose_name='Pincode')),
                ('ifsc_code', models.CharField(max_length=12, verbose_name='IFSC code')),
            ],
            options={
                'verbose_name': 'Branch',
                'verbose_name_plural': 'Branches',
            },
        ),
        migrations.CreateModel(
            name='Document',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('document_type', models.IntegerField(choices=[(0, 'Select'), (1, 'Pancard'), (2, 'UID-Aadhar'), (3, 'Passport'), (4, 'Voters ID'), (5, 'Driving License'), (6, 'SSLC'), (7, 'Other ID')], db_index=True, default=0, verbose_name='Document type')),
                ('name', models.CharField(blank=True, max_length=255, null=True, verbose_name='Document details')),
                ('document', models.FileField(upload_to='documents/')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Created Date')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='Modified Date')),
            ],
        ),
        migrations.CreateModel(
            name='LoanDetail',
            fields=[
                ('job_no', models.AutoField(primary_key=True, serialize=False, verbose_name='Job No')),
                ('loan_account_no', models.CharField(blank=True, max_length=128, verbose_name='Loan account No')),
                ('job_status', models.IntegerField(choices=[(1, 'Pending'), (2, 'Approved'), (3, 'Completed')], db_index=True, default=1, verbose_name='Job Status')),
                ('applicant_type', models.IntegerField(choices=[(1, 'Pending'), (2, 'Approved'), (3, 'Completed')], db_index=True, default=1, verbose_name='Applicant type')),
                ('customer_name', models.CharField(max_length=128, verbose_name='Customer Name')),
                ('father_name', models.CharField(max_length=128, verbose_name='Father Name')),
                ('mother_name', models.CharField(max_length=128, verbose_name='Mother Name')),
                ('spouse_name', models.CharField(max_length=128, verbose_name='Spouse Name')),
                ('martial_status', models.IntegerField(choices=[(1, 'Married'), (2, 'UnMarried'), (3, 'divorce')], db_index=True, default=1, verbose_name='Martial Status')),
                ('nationality', models.IntegerField(choices=[(1, 'Indian')], db_index=True, default=1, verbose_name='Nationality')),
                ('resident', models.CharField(max_length=128, verbose_name='Resident')),
                ('dob', models.DateField(null=True, verbose_name='Date of birth')),
                ('sex', models.IntegerField(choices=[(1, 'Male'), (2, 'Female')], db_index=True, default=1, verbose_name='Sex')),
                ('kyc_status', models.IntegerField(choices=[(1, 'Approved'), (2, 'Pending'), (3, 'Rejected')], db_index=True, default=1, verbose_name='KYC Status')),
                ('job_type', models.IntegerField(choices=[(1, 'Govt employee'), (2, 'Private'), (3, 'Self employed')], db_index=True, default=1, verbose_name='Job type')),
                ('gross_annual_income', models.IntegerField(choices=[(1, 'Below 1 lakh'), (2, 'Above 1 lakh'), (3, 'Above 5 lakh')], db_index=True, default=1, verbose_name='Job type')),
                ('political_influence', models.CharField(blank=True, max_length=600, null=True, verbose_name='Political Influenze')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Created Date')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='Modified Date')),
                ('branch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bankapp.Branch')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Loan Detail',
                'verbose_name_plural': 'Loan Details',
            },
        ),
        migrations.CreateModel(
            name='LoanType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('loan_type', models.CharField(max_length=128, verbose_name='Loan Type')),
            ],
            options={
                'verbose_name': 'Loan type',
                'verbose_name_plural': 'Loan Types',
            },
        ),
        migrations.CreateModel(
            name='LoanUserAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('house_name', models.CharField(max_length=128, verbose_name='House/Flat/Name')),
                ('street', models.CharField(max_length=128, verbose_name='Street')),
                ('area', models.CharField(max_length=128, verbose_name='Area/Location')),
                ('landmark', models.CharField(blank=True, max_length=128, verbose_name='Landmark')),
                ('city', models.CharField(max_length=128, verbose_name='city')),
                ('state', models.CharField(max_length=128, verbose_name='State')),
                ('village', models.CharField(blank=True, max_length=128, verbose_name='Village')),
                ('thaluk', models.CharField(blank=True, max_length=128, verbose_name='Thaluk')),
                ('survey_no', models.CharField(blank=True, max_length=128, verbose_name='Survey Number')),
                ('latitude', models.CharField(blank=True, max_length=128, verbose_name='Latitude')),
                ('longitude', models.CharField(blank=True, max_length=128, verbose_name='Longitude')),
                ('mark_borders', models.CharField(blank=True, max_length=600, verbose_name='Mark borders')),
                ('telephone', models.CharField(max_length=128, verbose_name='Telephone')),
                ('mobile_primary', models.CharField(max_length=128, verbose_name='Mobile Primary')),
                ('mobile_secondary', models.CharField(blank=True, max_length=128, verbose_name='Mobile Secondary')),
                ('email', models.CharField(blank=True, max_length=128, verbose_name='Email')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Created Date')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='Modified Date')),
                ('verified', models.BooleanField(db_index=True, default=False, verbose_name='Verified')),
                ('address_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bankapp.AddressType')),
                ('address_verifier', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='loanuseraddress', to=settings.AUTH_USER_MODEL)),
                ('loan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bankapp.LoanDetail')),
            ],
            options={
                'verbose_name': 'Address',
                'verbose_name_plural': 'Addresses',
            },
        ),
        migrations.CreateModel(
            name='Pincode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('pincode', models.CharField(max_length=10, verbose_name='Pincode')),
                ('name', models.CharField(max_length=128, verbose_name='Place')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reviews', models.TextField(blank=True, max_length=255, verbose_name='Reviews')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Created Date')),
                ('modified_date', models.DateTimeField(auto_now=True, verbose_name='Modified Date')),
                ('loan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bankapp.LoanDetail')),
            ],
        ),
        migrations.AddField(
            model_name='loanuseraddress',
            name='pincode',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bankapp.Pincode'),
        ),
        migrations.AddField(
            model_name='loandetail',
            name='loan_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bankapp.LoanType'),
        ),
        migrations.AddField(
            model_name='document',
            name='loan',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bankapp.LoanDetail'),
        ),
    ]
