updated config
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -41,8 +41,29 @@ class NEFTDataMapper:
|
|||||||
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
|
||||||
|
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()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user