mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-10-06 01:55:24 +00:00
feat(wallet): implement wallet transaction model, views, and serializers for fund management ✨
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m42s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m42s
This commit is contained in:
55
billing/migrations/0014_wallettransaction.py
Normal file
55
billing/migrations/0014_wallettransaction.py
Normal file
@@ -0,0 +1,55 @@
|
||||
# Generated by Django 5.2 on 2025-07-25 08:34
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
import uuid
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("billing", "0013_payment_expiry_notification_sent"),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="WalletTransaction",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.UUIDField(
|
||||
default=uuid.uuid4,
|
||||
editable=False,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
),
|
||||
),
|
||||
("amount", models.FloatField()),
|
||||
(
|
||||
"transaction_type",
|
||||
models.CharField(
|
||||
choices=[("TOPUP", "Topup"), ("DEBIT", "Debit")], max_length=10
|
||||
),
|
||||
),
|
||||
("description", models.TextField(blank=True, null=True)),
|
||||
(
|
||||
"reference_id",
|
||||
models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
("created_at", models.DateTimeField(default=django.utils.timezone.now)),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="wallet_transactions",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"ordering": ["-created_at"],
|
||||
},
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user