40 lines
1.8 KiB
Python
40 lines
1.8 KiB
Python
# Generated by Django 5.2.17 on 2026-09-15 09:29
|
|
|
|
import django.db.models.deletion
|
|
import uuid
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('orders', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Payment',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('amount', models.DecimalField(decimal_places=2, max_digits=18)),
|
|
('currency', models.CharField(default='IRR', max_length=8)),
|
|
('gateway', models.CharField(max_length=40)),
|
|
('transaction_id', models.CharField(max_length=120)),
|
|
('authority', models.CharField(blank=True, max_length=120)),
|
|
('status', models.CharField(choices=[('pending', 'Pending'), ('success', 'Success'), ('failed', 'Failed'), ('cancelled', 'Cancelled')], default='pending', max_length=12)),
|
|
('request_time', models.DateTimeField(blank=True, null=True)),
|
|
('callback_time', models.DateTimeField(blank=True, null=True)),
|
|
('verification_time', models.DateTimeField(blank=True, null=True)),
|
|
('error', models.TextField(blank=True)),
|
|
('order', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='payments', to='orders.processingorder')),
|
|
],
|
|
options={
|
|
'constraints': [models.UniqueConstraint(fields=('gateway', 'transaction_id'), name='uniq_gateway_transaction')],
|
|
},
|
|
),
|
|
]
|