updated config

This commit is contained in:
2026-03-13 22:47:09 +05:30
parent 728817a53e
commit b9dc68254c
3 changed files with 29 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
""" """
Main application entry point. Main application entry point.
Runs ACH file processing scheduler. Runs NEFT file processing scheduler.
""" """
import logging import logging

View File

@@ -43,6 +43,27 @@ class NEFTDataMapper:
@staticmethod
def pad_account_number(account_number: str) -> str:
"""
Pad account number with leading zeroes to make it 17 digits.
Args:
account_number: Account number string
Returns:
Account number padded to 17 digits with leading zeroes
"""
try:
if not account_number:
return '0' * 17
# Remove any existing spaces and pad to 17 digits
clean_account = account_number.strip()
return clean_account.zfill(17)
except Exception as e:
logger.error(f"Error padding account number '{account_number}': {e}")
return '0' * 17
@staticmethod @staticmethod
def convert_amount(amount_in: Any) -> Decimal: def convert_amount(amount_in: Any) -> Decimal:
@@ -85,8 +106,12 @@ class NEFTDataMapper:
txn_date_raw = parsed_txn.get('tran_date', '') or '' txn_date_raw = parsed_txn.get('tran_date', '') or ''
txn_date_ddmmyyyy = cls.convert_date(txn_date_raw) txn_date_ddmmyyyy = cls.convert_date(txn_date_raw)
#sender_acct = (parsed_txn.get('remitter_acct_no') or '').strip()
sender_account = parsed_txn.get('remitter_acct_no','') or ''
sender_acct = cls.pad_account_number(sender_account)
# Account numbers: NO padding, just trim # Account numbers: NO padding, just trim
sender_acct = (parsed_txn.get('remitter_acct_no') or '').strip()
recvr_acct = (parsed_txn.get('benef_acct_no') or '').strip() recvr_acct = (parsed_txn.get('benef_acct_no') or '').strip()

View File

@@ -18,7 +18,7 @@ logger = get_logger(__name__)
class FileProcessor: class FileProcessor:
"""Processes NEFT INWARD files end-to-end.""" """Processes NEFT OUTWARD files end-to-end."""
def __init__(self, repository: Repository = None, sftp_client: SFTPClient = None): def __init__(self, repository: Repository = None, sftp_client: SFTPClient = None):
""" """