added validation to consider only ipks mirror account numbers

This commit is contained in:
2026-02-03 15:25:54 +05:30
parent c548f21b68
commit 8ac16da503
2 changed files with 52 additions and 11 deletions

View File

@@ -93,8 +93,8 @@ class FileProcessor:
mapped_records = DataMapper.map_transactions(transactions, bankcode)
logger.info(f"Mapped {len(mapped_records)} transactions")
# Step 5: Insert to database
inserted_count = self.repository.bulk_insert_transactions(mapped_records)
# Step 5: Insert to database (with account validation)
inserted_count, skipped_count = self.repository.bulk_insert_transactions(mapped_records)
# Step 6: Mark file as processed
processed_file = ProcessedFile(
@@ -106,7 +106,7 @@ class FileProcessor:
)
self.repository.mark_file_processed(processed_file)
logger.info(f"Successfully processed {filename}: {inserted_count} transactions inserted")
logger.info(f"Successfully processed {filename}: {inserted_count} inserted, {skipped_count} skipped (invalid accounts)")
return True
except Exception as e: