# Generated by Django 3.0.2 on 2020-05-17 17:05

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('borrowers', '0001_initial'),
        ('company', '0001_initial'),
        ('accounts', '0002_auto_20200517_1005'),
        ('minmarkets', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Collateral',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=300, null=True)),
                ('registered_date', models.DateTimeField(blank=True, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('status', models.CharField(blank=True, choices=[('Deposited In Branch', 'Deposited In Branch'), ('Collateral With Borrower', 'Collateral With Borrower'), ('Returned To Borrower', 'Returned To Borrower'), ('Sold', 'Sold'), ('Lost', 'Lost')], default='OPEN', max_length=40, null=True)),
                ('value', models.CharField(blank=True, help_text='Object Worth', max_length=300, null=True)),
                ('condition', models.TextField(blank=True, help_text='Describe status of object', null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('image', cloudinary.models.CloudinaryField(blank=True, max_length=255, null=True, verbose_name=accounts.models.upload_image_path)),
            ],
            options={
                'verbose_name': 'Collateral',
                'verbose_name_plural': 'Collateral',
            },
        ),
        migrations.CreateModel(
            name='CollateralFiles',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', cloudinary.models.CloudinaryField(blank=True, max_length=255, null=True, verbose_name=accounts.models.upload_image_path)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Collateral File',
                'verbose_name_plural': 'Collateral Files',
            },
        ),
        migrations.CreateModel(
            name='CollateralType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=300, null=True)),
                ('description', models.TextField()),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Collateral Type',
                'verbose_name_plural': 'Collateral Type',
            },
        ),
        migrations.CreateModel(
            name='Penalty',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=300, null=True)),
                ('describe', models.TextField()),
                ('punishment_fee', models.CharField(blank=True, max_length=300, null=True)),
                ('re_occuring', models.BooleanField(default=False)),
                ('value_on_period', models.IntegerField(blank=True, default=7, null=True)),
                ('period', models.CharField(blank=True, choices=[('Per Year', 'Per Year'), ('Per Month', 'Per Month'), ('Per Week', 'Per Week'), ('Per Day', 'Per Day')], default='Per Month', max_length=20, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.Company')),
            ],
            options={
                'verbose_name': 'Penalty',
                'verbose_name_plural': 'Penalties',
            },
        ),
        migrations.CreateModel(
            name='ModeOfRepayments',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('bought_by', models.ManyToManyField(to='accounts.Profile')),
                ('package', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='minmarkets.LoanPackage')),
            ],
            options={
                'verbose_name': 'Mode Of Repayment',
                'verbose_name_plural': 'Mode Of Repayments',
            },
        ),
        migrations.CreateModel(
            name='LoanType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('bought_by', models.ManyToManyField(to='accounts.Profile')),
                ('package', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='minmarkets.LoanPackage')),
            ],
            options={
                'verbose_name': 'Loan Type',
                'verbose_name_plural': 'Loan Type',
            },
        ),
        migrations.CreateModel(
            name='LoanTerms',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=300, null=True)),
                ('content', models.TextField(blank=True, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.Company')),
                ('package', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='minmarkets.LoanPackage')),
            ],
            options={
                'verbose_name': 'Loan Terms',
                'verbose_name_plural': 'Loan Terms',
            },
        ),
        migrations.CreateModel(
            name='Loan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('loan_key', models.CharField(blank=True, max_length=300, null=True)),
                ('principal_amount', models.CharField(blank=True, max_length=300, null=True)),
                ('balance_due', models.CharField(blank=True, max_length=300, null=True)),
                ('interest', models.PositiveIntegerField(blank=True, null=True)),
                ('interest_period', models.CharField(blank=True, choices=[('Per Year', 'Per Year'), ('Per Month', 'Per Month'), ('Per Week', 'Per Week'), ('Per Day', 'Per Day')], default='Per Month', max_length=20, null=True)),
                ('loan_duration_circle', models.CharField(blank=True, choices=[('Years', 'Years'), ('Months', 'Months'), ('Weeks', 'Weeks'), ('Days', 'Days')], default='Months', max_length=20, null=True)),
                ('loan_duration_circle_figure', models.IntegerField(default=1)),
                ('repayment_circle', models.CharField(blank=True, choices=[('Yearly', 'Yearly'), ('Monthly', 'Monthly'), ('Weekly', 'Weekly'), ('Daily', 'Daily')], default='Monthly', max_length=20, null=True)),
                ('number_repayments', models.CharField(blank=True, max_length=300, null=True)),
                ('release_date', models.DateTimeField(help_text='Loan Paid To Customer On:')),
                ('collection_date', models.DateTimeField(blank=True, help_text='Each Date Loan Balance Is Been Paid Back', null=True)),
                ('end_date', models.DateTimeField(blank=True, help_text='Maturity Date', null=True)),
                ('processing_fee', models.CharField(blank=True, max_length=300, null=True)),
                ('grace_period', models.IntegerField(default=1, help_text='Counts In Days')),
                ('insurance', models.CharField(blank=True, max_length=300, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('loan_file_upload', cloudinary.models.CloudinaryField(blank=True, max_length=255, null=True, verbose_name=accounts.models.upload_image_path)),
                ('active', models.BooleanField(default=True)),
                ('loan_status', models.CharField(blank=True, choices=[('OPEN', 'OPEN'), ('PARTIAL', 'PARTIAL'), ('CLOSED', 'CLOSED'), ('COMPLETED', 'COMPLETED'), ('OVERDUE/EXPIRED', 'OVERDUE/EXPIRED')], default='OPEN', max_length=20, null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('account_officer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='accounts.Profile')),
                ('borrower', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='borrowers.Borrower')),
                ('collateral', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.Collateral')),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.Company')),
                ('loan_terms', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.LoanTerms')),
                ('loan_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.LoanType')),
                ('mode_of_repayments', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.ModeOfRepayments')),
                ('penalty', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.Penalty')),
            ],
            options={
                'verbose_name': 'loan',
                'verbose_name_plural': 'loans',
                'db_table': 'loan',
                'ordering': ('-timestamp',),
            },
        ),
        migrations.AddField(
            model_name='collateral',
            name='collateral_files',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.CollateralFiles'),
        ),
        migrations.AddField(
            model_name='collateral',
            name='collateral_type',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.CollateralType'),
        ),
    ]

# Generated by Django 3.0.2 on 2020-05-17 17:05

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('borrowers', '0001_initial'),
        ('company', '0001_initial'),
        ('accounts', '0002_auto_20200517_1005'),
        ('minmarkets', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Collateral',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=300, null=True)),
                ('registered_date', models.DateTimeField(blank=True, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('status', models.CharField(blank=True, choices=[('Deposited In Branch', 'Deposited In Branch'), ('Collateral With Borrower', 'Collateral With Borrower'), ('Returned To Borrower', 'Returned To Borrower'), ('Sold', 'Sold'), ('Lost', 'Lost')], default='OPEN', max_length=40, null=True)),
                ('value', models.CharField(blank=True, help_text='Object Worth', max_length=300, null=True)),
                ('condition', models.TextField(blank=True, help_text='Describe status of object', null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('image', cloudinary.models.CloudinaryField(blank=True, max_length=255, null=True, verbose_name=accounts.models.upload_image_path)),
            ],
            options={
                'verbose_name': 'Collateral',
                'verbose_name_plural': 'Collateral',
            },
        ),
        migrations.CreateModel(
            name='CollateralFiles',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', cloudinary.models.CloudinaryField(blank=True, max_length=255, null=True, verbose_name=accounts.models.upload_image_path)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Collateral File',
                'verbose_name_plural': 'Collateral Files',
            },
        ),
        migrations.CreateModel(
            name='CollateralType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=300, null=True)),
                ('description', models.TextField()),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Collateral Type',
                'verbose_name_plural': 'Collateral Type',
            },
        ),
        migrations.CreateModel(
            name='Penalty',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=300, null=True)),
                ('describe', models.TextField()),
                ('punishment_fee', models.CharField(blank=True, max_length=300, null=True)),
                ('re_occuring', models.BooleanField(default=False)),
                ('value_on_period', models.IntegerField(blank=True, default=7, null=True)),
                ('period', models.CharField(blank=True, choices=[('Per Year', 'Per Year'), ('Per Month', 'Per Month'), ('Per Week', 'Per Week'), ('Per Day', 'Per Day')], default='Per Month', max_length=20, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.Company')),
            ],
            options={
                'verbose_name': 'Penalty',
                'verbose_name_plural': 'Penalties',
            },
        ),
        migrations.CreateModel(
            name='ModeOfRepayments',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('bought_by', models.ManyToManyField(to='accounts.Profile')),
                ('package', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='minmarkets.LoanPackage')),
            ],
            options={
                'verbose_name': 'Mode Of Repayment',
                'verbose_name_plural': 'Mode Of Repayments',
            },
        ),
        migrations.CreateModel(
            name='LoanType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('bought_by', models.ManyToManyField(to='accounts.Profile')),
                ('package', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='minmarkets.LoanPackage')),
            ],
            options={
                'verbose_name': 'Loan Type',
                'verbose_name_plural': 'Loan Type',
            },
        ),
        migrations.CreateModel(
            name='LoanTerms',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=300, null=True)),
                ('content', models.TextField(blank=True, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.Company')),
                ('package', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='minmarkets.LoanPackage')),
            ],
            options={
                'verbose_name': 'Loan Terms',
                'verbose_name_plural': 'Loan Terms',
            },
        ),
        migrations.CreateModel(
            name='Loan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('loan_key', models.CharField(blank=True, max_length=300, null=True)),
                ('principal_amount', models.CharField(blank=True, max_length=300, null=True)),
                ('balance_due', models.CharField(blank=True, max_length=300, null=True)),
                ('interest', models.PositiveIntegerField(blank=True, null=True)),
                ('interest_period', models.CharField(blank=True, choices=[('Per Year', 'Per Year'), ('Per Month', 'Per Month'), ('Per Week', 'Per Week'), ('Per Day', 'Per Day')], default='Per Month', max_length=20, null=True)),
                ('loan_duration_circle', models.CharField(blank=True, choices=[('Years', 'Years'), ('Months', 'Months'), ('Weeks', 'Weeks'), ('Days', 'Days')], default='Months', max_length=20, null=True)),
                ('loan_duration_circle_figure', models.IntegerField(default=1)),
                ('repayment_circle', models.CharField(blank=True, choices=[('Yearly', 'Yearly'), ('Monthly', 'Monthly'), ('Weekly', 'Weekly'), ('Daily', 'Daily')], default='Monthly', max_length=20, null=True)),
                ('number_repayments', models.CharField(blank=True, max_length=300, null=True)),
                ('release_date', models.DateTimeField(help_text='Loan Paid To Customer On:')),
                ('collection_date', models.DateTimeField(blank=True, help_text='Each Date Loan Balance Is Been Paid Back', null=True)),
                ('end_date', models.DateTimeField(blank=True, help_text='Maturity Date', null=True)),
                ('processing_fee', models.CharField(blank=True, max_length=300, null=True)),
                ('grace_period', models.IntegerField(default=1, help_text='Counts In Days')),
                ('insurance', models.CharField(blank=True, max_length=300, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('loan_file_upload', cloudinary.models.CloudinaryField(blank=True, max_length=255, null=True, verbose_name=accounts.models.upload_image_path)),
                ('active', models.BooleanField(default=True)),
                ('loan_status', models.CharField(blank=True, choices=[('OPEN', 'OPEN'), ('PARTIAL', 'PARTIAL'), ('CLOSED', 'CLOSED'), ('COMPLETED', 'COMPLETED'), ('OVERDUE/EXPIRED', 'OVERDUE/EXPIRED')], default='OPEN', max_length=20, null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('account_officer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='accounts.Profile')),
                ('borrower', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='borrowers.Borrower')),
                ('collateral', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.Collateral')),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.Company')),
                ('loan_terms', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.LoanTerms')),
                ('loan_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.LoanType')),
                ('mode_of_repayments', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.ModeOfRepayments')),
                ('penalty', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.Penalty')),
            ],
            options={
                'verbose_name': 'loan',
                'verbose_name_plural': 'loans',
                'db_table': 'loan',
                'ordering': ('-timestamp',),
            },
        ),
        migrations.AddField(
            model_name='collateral',
            name='collateral_files',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.CollateralFiles'),
        ),
        migrations.AddField(
            model_name='collateral',
            name='collateral_type',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='loans.CollateralType'),
        ),
    ]

# Generated by Django 3.0.2 on 2020-05-17 17:05