config updation

This commit is contained in:
2026-03-15 16:24:12 +05:30
parent 642c523570
commit eccd596dc0

View File

@@ -10,7 +10,7 @@ from decimal import Decimal
from typing import Dict, Any, List
from logging_config import get_logger
from db.models import RTGSInwardRecord
from db.models import RTGSInwardRecord # Note: You use NEFTInwardRecord below
logger = get_logger(__name__)
@@ -41,24 +41,23 @@ class RTGSDataMapper:
logger.error(f"Error converting date '{date_str}': {e}")
return datetime.now().strftime("%d%m%Y")
@staticmethod
def process_status(status: str) -> str:
try:
if not status:
return ''
s = status.strip()
if s == 'PROS':
return 'PROCESSED'
if s == 'SUSP':
return 'SUSPENDED'
if s == 'FAIL':
return 'FAILED'
if s == 'RVRS':
return 'REVERSED'
return s
"""
Normalize status codes.
"""
if not status:
return ''
s = status.strip()
if s == 'PROS':
return 'PROCESSED'
if s == 'SUSP':
return 'SUSPENDED'
if s == 'FAIL':
return 'FAILED'
if s == 'RVRS':
return 'REVERSED'
return s
@staticmethod
def convert_amount(amount_in: Any) -> Decimal:
@@ -95,7 +94,7 @@ class RTGSDataMapper:
amount_in = parsed_txn.get('amount', '0')
txn_amt = cls.convert_amount(amount_in)
txnind = "CR"
creditor_amt=parsed_txn.get('amount', '0')
creditor_amt = parsed_txn.get('amount', '0')
# Date handling
txn_date_raw = parsed_txn.get('tran_date', '') or ''
@@ -112,7 +111,6 @@ class RTGSDataMapper:
recvr_acct_name = (parsed_txn.get('beneficiary_details') or '').strip()
record = NEFTInwardRecord(
bank_code=bankcode,
txnind=txnind,
jrnl_id=(parsed_txn.get('journal_no') or '').strip(),