Refactor UpdatePaymentSerializer to include only number_of_months field, add DeletePaymentView for payment deletion, and enhance VerifyPaymentView with payment_id lookup. Introduce pending_payment_id field in DeviceSerializer to track unpaid payments.
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 2m18s

This commit is contained in:
2025-04-08 21:38:43 +05:00
parent c3abdd8e34
commit 9595476569
4 changed files with 52 additions and 16 deletions

View File

@ -14,9 +14,6 @@ class PaymentSerializer(serializers.ModelSerializer):
class UpdatePaymentSerializer(serializers.ModelSerializer):
class Meta:
model = Payment
fields = ["paid", "paid_at", "method", "number_of_months"]
paid = serializers.BooleanField(required=True, allow_null=True)
paid_at = serializers.DateTimeField(required=True, allow_null=True)
method = serializers.ChoiceField(choices=Payment.PAYMENT_TYPES, required=True)
number_of_months = serializers.IntegerField(required=True, allow_null=True)
fields = [
"number_of_months",
]