config changes
This commit is contained in:
@@ -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 # Note: You use NEFTInwardRecord below
|
||||
from db.models import RTGSInwardRecord # Note: You use RTGSInwardRecord below
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
@@ -81,13 +81,13 @@ class RTGSDataMapper:
|
||||
# -------------------------
|
||||
|
||||
@classmethod
|
||||
def map_transaction(cls, parsed_txn: Dict[str, Any], bankcode: str) -> NEFTInwardRecord:
|
||||
def map_transaction(cls, parsed_txn: Dict[str, Any], bankcode: str) -> RTGSInwardRecord:
|
||||
"""
|
||||
Map a single parsed NEFT transaction (dict) to NEFTInwardRecord.
|
||||
Map a single parsed NEFT transaction (dict) to RTGSInwardRecord.
|
||||
|
||||
Args:
|
||||
parsed_txn: Dict emitted by SFTPUtrParser
|
||||
bankcode : Bank code for this transaction (mapped to NEFTInwardRecord.bank_code)
|
||||
bankcode : Bank code for this transaction (mapped to RTGSInwardRecord.bank_code)
|
||||
"""
|
||||
try:
|
||||
# Amount handling
|
||||
@@ -110,7 +110,7 @@ class RTGSDataMapper:
|
||||
# Receiver account name: best available proxy is beneficiary_details
|
||||
recvr_acct_name = (parsed_txn.get('beneficiary_details') or '').strip()
|
||||
|
||||
record = NEFTInwardRecord(
|
||||
record = RTGSInwardRecord(
|
||||
bank_code=bankcode,
|
||||
txnind=txnind,
|
||||
jrnl_id=(parsed_txn.get('journal_no') or '').strip(),
|
||||
@@ -139,7 +139,7 @@ class RTGSDataMapper:
|
||||
raise
|
||||
|
||||
@classmethod
|
||||
def map_transactions(cls, parsed_transactions: List[Dict[str, Any]], bankcode: str) -> List[NEFTInwardRecord]:
|
||||
def map_transactions(cls, parsed_transactions: List[Dict[str, Any]], bankcode: str) -> List[RTGSInwardRecord]:
|
||||
"""
|
||||
Map a list of parsed NEFT transactions to RTGSInwardRecord objects.
|
||||
|
||||
@@ -147,7 +147,7 @@ class RTGSDataMapper:
|
||||
parsed_transactions: List of dicts from SFTPUtrParser
|
||||
bankcode : Bank code to be applied to each record
|
||||
"""
|
||||
records: List[NEFTInwardRecord] = []
|
||||
records: List[RTGSInwardRecord] = []
|
||||
for txn in parsed_transactions:
|
||||
try:
|
||||
rec = cls.map_transaction(txn, bankcode)
|
||||
|
||||
Reference in New Issue
Block a user