# Generated by Django 5.2.11 on 2026-05-03 07:15

import django.core.validators
import django.db.models.deletion
from decimal import Decimal
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('expat_life', '0030_platformfeesettings_affiliate_commission_percentage'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='RefundableDeposit',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('profile_type', models.CharField(choices=[('foreigner', 'Foreigner'), ('dating_partner', 'Dating Partner'), ('service_partner', 'Service Partner'), ('rental_owner', 'Rental Owner')], help_text='Which wallet type this deposit belongs to', max_length=30)),
                ('deposit_type', models.CharField(choices=[('rental_deposit', 'Rental Deposit'), ('furniture_deposit', 'Furniture Deposit')], max_length=30)),
                ('amount_usd', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])),
                ('status', models.CharField(choices=[('active', 'Active - Held'), ('partially_refunded', 'Partially Refunded'), ('fully_refunded', 'Fully Refunded'), ('settled_with_deductions', 'Settled with Deductions'), ('cancelled', 'Cancelled')], default='active', max_length=30)),
                ('paid_at', models.DateTimeField(auto_now_add=True)),
                ('reference_code', models.CharField(blank=True, max_length=120)),
                ('notes', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('related_payable_item', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='refundable_deposits', to='expat_life.userpayableitem')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='refundable_deposits', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'indexes': [models.Index(fields=['user', 'status'], name='expat_life__user_id_4a3f9c_idx'), models.Index(fields=['deposit_type', 'status'], name='expat_life__deposit_7dc3fc_idx')],
                'unique_together': {('user', 'profile_type', 'deposit_type')},
            },
        ),
    ]
