Mirrored from https://github.com/davoodmehraban89/Aram.git
Synced Dec 3, 20:45 UTC
fix(mapping): reject stale account trace fields for excluded single mappings
davoodmehraban89 committed
Oct 31, 2026 at 09:36 UTC
c267b6ba96db2a4e28291289e74e42022853eb28
1 file changed
+7
-5
backend/src/aram_backend/reconciliation_review.py
+7
-5
@@ -207,19 +207,21 @@ def _validated_preview(content: bytes, preview: CoveragePreview) -> None:
207
raise CoverageError("ACCOUNT_MAPPING_ELIGIBILITY_MISMATCH")
208
if account.mapping_count == 1:
209
only = rows[0]
210
+ actual = (
211
+ account.mapping_excel_row, account.mapping_id,
212
+ account.target_statement, account.target_section,
213
+ account.target_note, account.target_subnote,
214
+ )
215
if only.included:
216
expected = (
217
only.mapping_excel_row, only.mapping_id,
218
only.target_statement, only.target_section,
219
only.target_note, only.target_subnote,
220
)
216
- actual = (
217
- account.mapping_excel_row, account.mapping_id,
218
- account.target_statement, account.target_section,
219
- account.target_note, account.target_subnote,
220
- )
221
if actual != expected:
222
raise CoverageError("ACCOUNT_MAPPING_TRACE_MISMATCH")
223
+ elif any(value is not None for value in actual):
224
+ raise CoverageError("ACCOUNT_MAPPING_TRACE_MISMATCH")
225
elif any(value is not None for value in (
226
account.mapping_excel_row, account.mapping_id,
227
account.target_statement, account.target_section,