mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-06-05 16:56:19 +00:00
Add mib_reference field to Payment model and set default ordering by created_at
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 3m58s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 3m58s
This commit is contained in:
parent
f8d6e78f90
commit
85ff1fb67f
@ -5,7 +5,16 @@ from .models import Payment, BillFormula, Topup
|
||||
|
||||
|
||||
class PaymentAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "user", "amount", "paid", "paid_at", "method")
|
||||
list_display = (
|
||||
"id",
|
||||
"user",
|
||||
"amount",
|
||||
"paid",
|
||||
"paid_at",
|
||||
"method",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
|
||||
|
||||
admin.site.register(Payment, PaymentAdmin)
|
||||
|
@ -0,0 +1,21 @@
|
||||
# Generated by Django 5.2 on 2025-05-31 07:01
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("billing", "0004_alter_topup_id"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="payment",
|
||||
options={"ordering": ["-created_at"]},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="payment",
|
||||
name="mib_reference",
|
||||
field=models.CharField(blank=True, default="", null=True),
|
||||
),
|
||||
]
|
@ -16,6 +16,7 @@ class Payment(models.Model):
|
||||
("TRANSFER", "Transfer"),
|
||||
]
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
mib_reference = models.CharField(default="", null=True, blank=True)
|
||||
number_of_months = models.IntegerField()
|
||||
amount = models.FloatField()
|
||||
paid = models.BooleanField(default=False)
|
||||
@ -30,6 +31,9 @@ class Payment(models.Model):
|
||||
def __str__(self):
|
||||
return f"Payment by {self.user}"
|
||||
|
||||
class Meta:
|
||||
ordering = ["-created_at"]
|
||||
|
||||
|
||||
class BillFormula(models.Model):
|
||||
formula = models.CharField(max_length=255)
|
||||
|
Loading…
x
Reference in New Issue
Block a user