feat(import): v0.16.0 - Fully implemented series 3 BW-ACH pipeline stablized. #19

Merged
serversdown merged 9 commits from ach-report-ingestion into main 2026-05-11 15:55:24 -04:00
Showing only changes of commit f83993ad1d - Show all commits
+27 -2
View File
@@ -1659,8 +1659,33 @@ async def db_import_blastware_file(
continue
if name.lower().endswith(".txt"):
# Strip the ".txt" suffix to get the binary's filename.
reports[name[:-4].lower()] = content
# Pair the report back to its binary. BW writes ASCII
# reports under two conventions:
#
# 1. ACH convention (Blastware's official Auto Call Home):
# binary: M529LK44.AB0
# report: M529LK44_AB0_ASCII.TXT
# (replaces the "." with "_", appends "_ASCII.TXT")
#
# 2. Manual-export convention (operator clicks Save As Text
# in BW's UI):
# binary: M529LK44.AB0
# report: M529LK44.AB0.TXT
# (literal binary filename + ".TXT" suffix)
#
# We register BOTH possible binary names as keys so the
# subsequent lookup matches whichever convention was used.
stripped = name[:-4] # remove ".TXT"
# ACH convention: strip "_ASCII" and convert the last "_"
# back to "." to recover the binary's filename.
if stripped.lower().endswith("_ascii"):
inner = stripped[:-6] # remove "_ASCII"
under = inner.rfind("_")
if under >= 0:
ach_binary = inner[:under] + "." + inner[under + 1 :]
reports[ach_binary.lower()] = content
# Legacy convention: the stripped name IS the binary's name.
reports[stripped.lower()] = content
else:
binaries.append((name, content))