mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-07-07 06:06:31 +00:00
feat(models): add status field to Topup model with choices for Pending, Paid, and Cancelled ✨
This commit is contained in:
@ -25,6 +25,7 @@ class TopupAdmin(admin.ModelAdmin):
|
||||
"amount",
|
||||
"paid",
|
||||
"paid_at",
|
||||
"status",
|
||||
"created_at",
|
||||
"is_expired",
|
||||
"expires_at",
|
||||
|
25
billing/migrations/0011_topup_status.py
Normal file
25
billing/migrations/0011_topup_status.py
Normal file
@ -0,0 +1,25 @@
|
||||
# Generated by Django 5.2 on 2025-07-05 12:32
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("billing", "0010_add_expiry_notification_sent_to_topup"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="topup",
|
||||
name="status",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("PENDING", "Pending"),
|
||||
("PAID", "Paid"),
|
||||
("CANCELLED", "Cancelled"),
|
||||
],
|
||||
default="PENDING",
|
||||
max_length=20,
|
||||
),
|
||||
),
|
||||
]
|
@ -52,6 +52,15 @@ class Topup(models.Model):
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="topups")
|
||||
paid = models.BooleanField(default=False)
|
||||
paid_at = models.DateTimeField(null=True, blank=True)
|
||||
status = models.CharField(
|
||||
max_length=20,
|
||||
choices=[
|
||||
("PENDING", "Pending"),
|
||||
("PAID", "Paid"),
|
||||
("CANCELLED", "Cancelled"),
|
||||
],
|
||||
default="PENDING",
|
||||
)
|
||||
mib_reference = models.CharField(default="", null=True, blank=True)
|
||||
expires_at = models.DateTimeField(null=True, blank=True)
|
||||
expiry_notification_sent = models.BooleanField(default=False)
|
||||
|
Reference in New Issue
Block a user