config updation
This commit is contained in:
@@ -10,7 +10,7 @@ from decimal import Decimal
|
|||||||
from typing import Dict, Any, List
|
from typing import Dict, Any, List
|
||||||
|
|
||||||
from logging_config import get_logger
|
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__)
|
logger = get_logger(__name__)
|
||||||
|
|
||||||
@@ -41,24 +41,23 @@ class RTGSDataMapper:
|
|||||||
logger.error(f"Error converting date '{date_str}': {e}")
|
logger.error(f"Error converting date '{date_str}': {e}")
|
||||||
return datetime.now().strftime("%d%m%Y")
|
return datetime.now().strftime("%d%m%Y")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def process_status(status: str) -> str:
|
def process_status(status: str) -> str:
|
||||||
|
"""
|
||||||
try:
|
Normalize status codes.
|
||||||
if not status:
|
"""
|
||||||
return ''
|
if not status:
|
||||||
s = status.strip()
|
return ''
|
||||||
if s == 'PROS':
|
s = status.strip()
|
||||||
return 'PROCESSED'
|
if s == 'PROS':
|
||||||
if s == 'SUSP':
|
return 'PROCESSED'
|
||||||
return 'SUSPENDED'
|
if s == 'SUSP':
|
||||||
if s == 'FAIL':
|
return 'SUSPENDED'
|
||||||
return 'FAILED'
|
if s == 'FAIL':
|
||||||
if s == 'RVRS':
|
return 'FAILED'
|
||||||
return 'REVERSED'
|
if s == 'RVRS':
|
||||||
return s
|
return 'REVERSED'
|
||||||
|
return s
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def convert_amount(amount_in: Any) -> Decimal:
|
def convert_amount(amount_in: Any) -> Decimal:
|
||||||
@@ -95,7 +94,7 @@ class RTGSDataMapper:
|
|||||||
amount_in = parsed_txn.get('amount', '0')
|
amount_in = parsed_txn.get('amount', '0')
|
||||||
txn_amt = cls.convert_amount(amount_in)
|
txn_amt = cls.convert_amount(amount_in)
|
||||||
txnind = "CR"
|
txnind = "CR"
|
||||||
creditor_amt=parsed_txn.get('amount', '0')
|
creditor_amt = parsed_txn.get('amount', '0')
|
||||||
|
|
||||||
# Date handling
|
# Date handling
|
||||||
txn_date_raw = parsed_txn.get('tran_date', '') or ''
|
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()
|
recvr_acct_name = (parsed_txn.get('beneficiary_details') or '').strip()
|
||||||
|
|
||||||
record = NEFTInwardRecord(
|
record = NEFTInwardRecord(
|
||||||
|
|
||||||
bank_code=bankcode,
|
bank_code=bankcode,
|
||||||
txnind=txnind,
|
txnind=txnind,
|
||||||
jrnl_id=(parsed_txn.get('journal_no') or '').strip(),
|
jrnl_id=(parsed_txn.get('journal_no') or '').strip(),
|
||||||
|
|||||||
Reference in New Issue
Block a user