# Generated by Django 5.1.5 on 2025-01-19 00:44

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('currencies', '0006_currency_exchange_currency'),
        ('transactions', '0028_transaction_internal_note'),
    ]

    operations = [
        migrations.CreateModel(
            name='ImportProfile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('yaml_config', models.TextField(help_text='YAML configuration')),
                ('version', models.IntegerField(choices=[(1, 'Version 1')], default=1, verbose_name='Version')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='ImportRun',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('QUEUED', 'Queued'), ('PROCESSING', 'Processing'), ('FAILED', 'Failed'), ('FINISHED', 'Finished')], default='QUEUED', max_length=10, verbose_name='Status')),
                ('file_name', models.CharField(help_text='File name', max_length=10000)),
                ('logs', models.TextField(blank=True)),
                ('processed_rows', models.IntegerField(default=0)),
                ('total_rows', models.IntegerField(default=0)),
                ('successful_rows', models.IntegerField(default=0)),
                ('skipped_rows', models.IntegerField(default=0)),
                ('failed_rows', models.IntegerField(default=0)),
                ('started_at', models.DateTimeField(null=True)),
                ('finished_at', models.DateTimeField(null=True)),
                ('categories', models.ManyToManyField(related_name='import_runs', to='transactions.transactioncategory')),
                ('currencies', models.ManyToManyField(related_name='import_runs', to='currencies.currency')),
                ('entities', models.ManyToManyField(related_name='import_runs', to='transactions.transactionentity')),
                ('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='import_app.importprofile')),
                ('tags', models.ManyToManyField(related_name='import_runs', to='transactions.transactiontag')),
                ('transactions', models.ManyToManyField(related_name='import_runs', to='transactions.transaction')),
            ],
        ),
    ]
