# Generated by Django 5.2.13 on 2026-06-06 02:34

import apps.transactions.models
import apps.transactions.storage
import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('transactions', '0048_recurringtransaction_keep_at_most'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='TransactionAttachment',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('file', models.FileField(storage=apps.transactions.storage.PrivateMediaStorage(), upload_to=apps.transactions.models.transaction_attachment_path, verbose_name='File')),
                ('original_name', models.CharField(max_length=255, verbose_name='Original Name')),
                ('content_type', models.CharField(blank=True, max_length=255, verbose_name='Content Type')),
                ('size', models.PositiveBigIntegerField(default=0, verbose_name='Size')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('transaction', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='transactions.transaction', verbose_name='Transaction')),
                ('uploaded_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='transaction_attachments', to=settings.AUTH_USER_MODEL, verbose_name='Uploaded By')),
            ],
            options={
                'verbose_name': 'Transaction Attachment',
                'verbose_name_plural': 'Transaction Attachments',
                'db_table': 'transaction_attachments',
                'ordering': ['-created_at', 'original_name'],
            },
        ),
    ]
