from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ("bookings", "0001_initial"), ] operations = [ migrations.CreateModel( name="Payment", fields=[ ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), ( "provider", models.CharField( choices=[ ("hyperpay", "HyperPay"), ("paytabs", "PayTabs"), ("moyasar", "Moyasar"), ("tap", "Tap"), ("amazon_payment_services", "Amazon Payment Services"), ("checkout", "Checkout.com"), ("other", "Other"), ], max_length=50, ), ), ( "status", models.CharField( choices=[ ("created", "Created"), ("authorized", "Authorized"), ("captured", "Captured"), ("failed", "Failed"), ("refunded", "Refunded"), ], default="created", max_length=20, ), ), ("amount", models.DecimalField(decimal_places=2, max_digits=10)), ("currency", models.CharField(default="SAR", max_length=10)), ("external_id", models.CharField(blank=True, max_length=200)), ("metadata", models.JSONField(blank=True, default=dict)), ("created_at", models.DateTimeField(auto_now_add=True)), ( "booking", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name="payments", to="bookings.booking"), ), ], ), ]