# Generated by Django 4.2.11 on 2024-04-18 09:57

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('loans', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Pay',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Создана')),
                ('amount', models.DecimalField(decimal_places=0, max_digits=7, verbose_name='Сумма')),
                ('bank_card_id', models.PositiveIntegerField()),
                ('penalty', models.DecimalField(decimal_places=0, max_digits=7, verbose_name='Платеж по пени')),
                ('interests', models.DecimalField(decimal_places=0, max_digits=7, verbose_name='Платеж по процентам')),
                ('body', models.DecimalField(decimal_places=0, max_digits=7, verbose_name='Платеж по телу')),
                ('payment_id', models.PositiveIntegerField(help_text='Номер платежа в сервисе Payments', null=True)),
                ('comment', models.CharField(blank=True, max_length=1024)),
                ('loan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='loans.loan', verbose_name='Займ')),
            ],
            options={
                'verbose_name': 'Платежи',
                'verbose_name_plural': 'Платежи',
            },
        ),
        migrations.CreateModel(
            name='PayInterests',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Создана')),
                ('amount', models.DecimalField(decimal_places=0, max_digits=7, verbose_name='Сумма')),
                ('is_export', models.BooleanField(default=True, help_text='Не отправлять данные в 1С', verbose_name='Выгружать"')),
                ('comment', models.CharField(blank=True, max_length=1024, verbose_name='Комментарий')),
                ('loan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='loans.loan', verbose_name='Займ')),
                ('pay', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='operations.pay', verbose_name='Платеж')),
            ],
            options={
                'verbose_name': 'Погашенные проценты',
                'verbose_name_plural': 'Погашенные проценты',
            },
        ),
        migrations.CreateModel(
            name='PayBody',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Создана')),
                ('amount', models.DecimalField(decimal_places=0, max_digits=7, verbose_name='Сумма')),
                ('is_export', models.BooleanField(default=True, help_text='Не отправлять данные в 1С', verbose_name='Выгружать"')),
                ('comment', models.CharField(blank=True, max_length=1024, verbose_name='Комментарий')),
                ('loan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='loans.loan', verbose_name='Займ')),
                ('pay', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='operations.pay', verbose_name='Платеж')),
            ],
            options={
                'verbose_name': 'Погашенное тело',
                'verbose_name_plural': 'Погашенное тело',
            },
        ),
        migrations.CreateModel(
            name='ChargedInterests',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Создана')),
                ('amount', models.DecimalField(decimal_places=0, max_digits=7, verbose_name='Сумма')),
                ('is_export', models.BooleanField(default=True, help_text='Не отправлять данные в 1С', verbose_name='Выгружать"')),
                ('comment', models.CharField(blank=True, max_length=1024, verbose_name='Комментарий')),
                ('loan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='loans.loan', verbose_name='Займ')),
            ],
            options={
                'verbose_name': 'Начислен проценты',
                'verbose_name_plural': 'Начислен проценты',
            },
        ),
        migrations.CreateModel(
            name='BodyIssue',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Создана')),
                ('bank_card_id', models.PositiveIntegerField(blank=True, help_text='Карта для займа', null=True, verbose_name='Банковская карта')),
                ('amount', models.DecimalField(decimal_places=0, max_digits=7, verbose_name='Сумма')),
                ('payment_id', models.PositiveIntegerField(help_text='Если заполнено, значит деньги отправлены', null=True)),
                ('is_export', models.BooleanField(default=True, help_text='Не отправлять данные в 1С', verbose_name='Выгружать"')),
                ('comment', models.CharField(blank=True, max_length=1024)),
                ('loan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='loans.loan', verbose_name='Займ')),
            ],
            options={
                'verbose_name': 'Выдача займа',
                'verbose_name_plural': 'Выдача займа',
            },
        ),
    ]
