# Generated by Django 4.2.16 on 2026-11-06 13:26 from decimal import Decimal from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('orders', '0001_initial'), ] operations = [ migrations.CreateModel( name='Payment', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('method', models.CharField(choices=[('card', 'Банковская карта'), ('sbp', 'СБП'), ('mir_pay', 'МИР Pay'), ('cash', 'Наличные при получении'), ('installment', 'Рассрочка'), ('split', 'Оплата частями')], max_length=20)), ('status', models.CharField(choices=[('pending', 'Ожидает'), ('succeeded', 'Успешно'), ('failed', 'Ошибка'), ('refunded', 'Возвращён'), ('cancelled', 'Отменён')], default='pending', max_length=20)), ('amount', models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=12)), ('provider', models.CharField(default='yookassa', max_length=32)), ('provider_payment_id', models.CharField(blank=True, db_index=True, max_length=128)), ('idempotency_key', models.CharField(blank=True, max_length=128, null=True, unique=True)), ('payload', models.JSONField(blank=True, default=dict)), ('paid_at', models.DateTimeField(blank=True, null=True)), ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='orders.order')), ], options={ 'verbose_name': 'платёж', 'verbose_name_plural': 'платежи', 'db_table': 'payments_payment', 'ordering': ['-created_at'], }, ), ]