1 Commits

Author SHA1 Message Date
VivianDee 03478c8dbd Update rac_check.py 2025-06-12 15:24:38 +01:00
6 changed files with 5 additions and 55 deletions
+1 -9
View File
@@ -2,7 +2,7 @@ from marshmallow import Schema, fields
class DisbursementSchema(Schema): class DisbursementSchema(Schema):
transactionId = fields.Str(required=False, allow_none=True) transactionId = fields.Str(required=False, allow_none=True)
fbnTransactionId = fields.Str(required=False, allow_none=True) FbnTransactionId = fields.Str(required=False, allow_none=True)
debtId = fields.Str(required=False, allow_none=True) debtId = fields.Str(required=False, allow_none=True)
customerId = fields.Str(required=False, allow_none=True) customerId = fields.Str(required=False, allow_none=True)
accountId = fields.Str(required=False, allow_none=True) accountId = fields.Str(required=False, allow_none=True)
@@ -16,7 +16,6 @@ class DisbursementSchema(Schema):
comment = fields.Str(required=False, allow_none=True) comment = fields.Str(required=False, allow_none=True)
class DisburseLoanResponseSchema(Schema): class DisburseLoanResponseSchema(Schema):
transactionId = fields.Str(allow_none=True) transactionId = fields.Str(allow_none=True)
fbnTransactionId = fields.Str(allow_none=True) fbnTransactionId = fields.Str(allow_none=True)
@@ -32,12 +31,5 @@ class DisburseLoanResponseSchema(Schema):
countryId = fields.Str(allow_none=True) countryId = fields.Str(allow_none=True)
responseCode = fields.Str(allow_none=True) responseCode = fields.Str(allow_none=True)
responseMessage = fields.Str(allow_none=True) responseMessage = fields.Str(allow_none=True)
disburseMessage = fields.Str(allow_none=True)
disburseDate = fields.Str(allow_none=True)
disburseVerify = fields.Str(allow_none=True)
disburseDescription = fields.Str(allow_none=True)
verifyResult = fields.Str(allow_none=True)
verifyDescription = fields.Str(allow_none=True)
-4
View File
@@ -19,7 +19,3 @@ class TransactionVerifyResponseSchema(Schema):
collectedAmount = fields.Float(required=True) collectedAmount = fields.Float(required=True)
transactionId = fields.Str(allow_none=True) transactionId = fields.Str(allow_none=True)
transactionType = fields.Str(allow_none=True) transactionType = fields.Str(allow_none=True)
disburseVerify = fields.Str(allow_none=True)
verifyDescription = fields.Str(allow_none=True)
verifyResult = fields.Str(allow_none=True)
+2 -6
View File
@@ -2,7 +2,6 @@ from flask import request, jsonify
from marshmallow import ValidationError from marshmallow import ValidationError
from app.utils.logger import logger from app.utils.logger import logger
from app.api.schemas.disbursement import DisbursementSchema, DisburseLoanResponseSchema from app.api.schemas.disbursement import DisbursementSchema, DisburseLoanResponseSchema
import datetime
class DisbursementService: class DisbursementService:
@staticmethod @staticmethod
@@ -27,7 +26,7 @@ class DisbursementService:
# For demo purposes, we simulate a response using the validated data # For demo purposes, we simulate a response using the validated data
response_data = { response_data = {
"transactionId": validated_data.get("transactionId"), "transactionId": validated_data.get("transactionId"),
"fbnTransactionId": validated_data.get("fbnTransactionId"), # Example or generated value "FbnTransactionId": validated_data.get("FbnTransactionId"), # Example or generated value
"debtId": validated_data.get("debtId"), "debtId": validated_data.get("debtId"),
"customerId": validated_data.get("customerId"), "customerId": validated_data.get("customerId"),
"accountId": validated_data.get("accountId"), "accountId": validated_data.get("accountId"),
@@ -39,10 +38,7 @@ class DisbursementService:
"collectAmountVAT": validated_data.get("collectAmountVAT"), "collectAmountVAT": validated_data.get("collectAmountVAT"),
"countryId": validated_data.get("countryId"), "countryId": validated_data.get("countryId"),
"responseCode": "00", # success code example "responseCode": "00", # success code example
"responseMessage": "Loan Request Completed Successfully!", "responseMessage": "Loan Request Completed Successfully!"
"disburseDate": datetime.datetime.now().isoformat(),
"disburseResult": "00",
"disburseDescription": "Loan Request Completed Successfully!",
} }
# Serialize response # Serialize response
+1 -5
View File
@@ -6,7 +6,6 @@ from app.api.schemas.transaction_verify import (
TransactionVerifySchema, TransactionVerifySchema,
TransactionVerifyResponseSchema TransactionVerifyResponseSchema
) )
import datetime
class TransactionVerifyService: class TransactionVerifyService:
@@ -38,10 +37,7 @@ class TransactionVerifyService:
"providedAmount": 0.0, "providedAmount": 0.0,
"collectedAmount": 7.50, "collectedAmount": 7.50,
"transactionId": validated_data.get("transactionId"), "transactionId": validated_data.get("transactionId"),
"transactionType": validated_data.get("transactionType"), "transactionType": validated_data.get("transactionType")
"disburseVerify": datetime.datetime.now().isoformat(),
"verifyResult": "00",
"verifyDescription": "Collect Status retrieved successfully.",
} }
# Validate and serialize response with TransactionVerifyResponseSchema # Validate and serialize response with TransactionVerifyResponseSchema
@@ -70,22 +70,6 @@
"type": "string", "type": "string",
"example": "Loan Request Completed Successfully!", "example": "Loan Request Completed Successfully!",
"nullable": true "nullable": true
},
"disburseDate": {
"type": "string",
"format": "date-time",
"example": "2023-10-01T12:00:00Z",
"nullable": true
},
"disburseResult": {
"type": "string",
"example": "00",
"nullable": true
},
"disburseDescription": {
"type": "string",
"example": "Loan Request Completed Successfully!",
"nullable": true
} }
}, },
"required": [ "required": [
@@ -38,20 +38,6 @@
"transactionType": { "transactionType": {
"type": "string", "type": "string",
"example": "Disbursement" "example": "Disbursement"
},
"disburseVerify":{
"type": "string",
"format": "date-time",
"example": "2023-10-01T12:00:00Z",
"nullable": true
},
"verifyResult": {
"type": "string",
"example": "Success"
},
"verifyDescription": {
"type": "string",
"example": "Disbursement was verified and collection completed."
} }
}, },
"required": [ "required": [