# Generated by Django 6.0.5 on 2026-05-25 19:56

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


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0002_devicetoken_notification_wallet_auditlog_otpcode'),
        ('escrow', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=15)),
                ('currency', models.CharField(default='TZS', max_length=3)),
                ('event_type', models.CharField(choices=[('deal_created', 'Deal Created'), ('payment_received', 'Payment Received'), ('fee_charged', 'Fee Charged'), ('payout_released', 'Payout Released'), ('refund_issued', 'Refund Issued')], db_index=True, max_length=32)),
                ('reference', models.CharField(max_length=120, unique=True)),
                ('metadata', models.JSONField(blank=True, default=dict)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('deal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transactions', to='escrow.deal')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transactions', to='core.user')),
            ],
            options={
                'db_table': 'transactions',
            },
        ),
    ]
