# Generated by Django 5.2.12 on 2026-03-24 03:08

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('deactivate', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('client_app', models.JSONField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Bank',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('deactivate', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('client_app', models.JSONField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='PaymentMethod',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='Nome')),
                ('tax', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=9, null=True)),
                ('deactivate', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('client_app', models.JSONField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Receipt',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('receipt_date', models.DateField()),
                ('receipt_value', models.DecimalField(decimal_places=2, max_digits=9)),
                ('description', models.TextField(verbose_name='Description')),
                ('document', models.TextField()),
                ('observation', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='AccountPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('employee', models.JSONField(blank=True, null=True)),
                ('deactivate', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('client_app', models.JSONField(blank=True, null=True)),
                ('account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='finance_sdk.account')),
            ],
        ),
        migrations.AddField(
            model_name='account',
            name='bank',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='finance_sdk.bank'),
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='Nome')),
                ('is_entry', models.BooleanField(default=True)),
                ('is_out', models.BooleanField(default=True)),
                ('deactivate', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('client_app', models.JSONField(blank=True, null=True)),
                ('principal_category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='finance_sdk.category')),
            ],
        ),
        migrations.CreateModel(
            name='Entry',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('due_date', models.DateField()),
                ('payment_date', models.DateField(blank=True, null=True)),
                ('description', models.TextField(verbose_name='Description')),
                ('value', models.DecimalField(decimal_places=2, max_digits=9)),
                ('received_value', models.DecimalField(blank=True, decimal_places=2, max_digits=9, null=True)),
                ('liquid_value', models.DecimalField(blank=True, decimal_places=2, max_digits=9, null=True)),
                ('registry_classification', models.CharField(blank=True, choices=[('variable', 'Variable'), ('fix', 'Fix'), ('investment', 'Investment')], default='variable', max_length=30)),
                ('number_of_payments', models.PositiveIntegerField(blank=True, null=True)),
                ('current_payment', models.PositiveIntegerField(default=1)),
                ('frequency', models.IntegerField(blank=True, choices=[(0, 'None'), (7, 'Week'), (15, 'Biweek'), (30, 'Month'), (365, 'Year')], default=0, null=True)),
                ('observation', models.TextField(blank=True, null=True)),
                ('cost_center', models.JSONField(blank=True, default=dict, null=True)),
                ('entry_type', models.CharField(choices=[('E', 'Entry'), ('O', 'Out'), ('AP', 'Automatic Payment'), ('PE', 'Paid entry')], max_length=2)),
                ('tax_bill', models.FileField(blank=True, null=True, upload_to='notas_fiscais/')),
                ('person', models.JSONField(blank=True, default=dict, null=True)),
                ('tag', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('client_app', models.JSONField(blank=True, default=dict, null=True)),
                ('account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='finance_sdk.account')),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='finance_sdk.category', verbose_name='Category')),
                ('reference_record', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='payments', to='finance_sdk.entry')),
                ('payment_method', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='finance_sdk.paymentmethod')),
            ],
        ),
        migrations.CreateModel(
            name='PaymentMethodTaxs',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('initial_payment', models.PositiveIntegerField()),
                ('final_payment', models.PositiveIntegerField()),
                ('tax', models.DecimalField(decimal_places=2, max_digits=5)),
                ('client_app', models.JSONField(blank=True, null=True)),
                ('payment_method', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='finance_sdk.paymentmethod')),
            ],
        ),
    ]
