# Generated by Django 6.0.3 on 2026-03-22 21:34

import django.db.models.deletion
import uuid
from decimal import Decimal
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='PaymentTransaction',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('is_active', models.BooleanField(db_index=True, default=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('provider', models.CharField(choices=[('razorpay', 'Razorpay')], default='razorpay', max_length=50)),
                ('provider_payment_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)),
                ('provider_order_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)),
                ('amount', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12)),
                ('currency', models.CharField(default='INR', max_length=10)),
                ('status', models.CharField(choices=[('created', 'Created'), ('pending', 'Pending'), ('success', 'Success'), ('failed', 'Failed'), ('refunded', 'Refunded')], db_index=True, default='created', max_length=20)),
                ('payment_method', models.CharField(blank=True, max_length=100, null=True)),
                ('completed_at', models.DateTimeField(blank=True, null=True)),
                ('tenant_id', models.CharField(blank=True, db_index=True, max_length=100, null=True)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='payments', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'indexes': [models.Index(fields=['provider_order_id'], name='payments_pa_provide_f4c945_idx'), models.Index(fields=['provider_payment_id'], name='payments_pa_provide_9107fc_idx'), models.Index(fields=['status'], name='payments_pa_status_b6726a_idx')],
            },
        ),
    ]
