fix(mapping): retain excluded mapping row identity while validating null target fields
davoodmehraban89 committed
Oct 31, 2026 at 09:37 UTC
3b40f298aa5c59a0360c57ea6821636c54e87e16
1 file changed
+8
-9
backend/src/aram_backend/reconciliation_review.py
+8
-9
@@ -212,15 +212,14 @@ def _validated_preview(content: bytes, preview: CoveragePreview) -> None:
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
- )
221
- if actual != expected:
222
- raise CoverageError("ACCOUNT_MAPPING_TRACE_MISMATCH")
223
- elif any(value is not None for value in actual):
215
+ expected = (
216
+ only.mapping_excel_row, only.mapping_id,
217
+ only.target_statement if only.included else None,
218
+ only.target_section if only.included else None,
219
+ only.target_note if only.included else None,
220
+ only.target_subnote if only.included else None,
221
+ )
222
+ if actual != expected:
223
raise CoverageError("ACCOUNT_MAPPING_TRACE_MISMATCH")
224
elif any(value is not None for value in (
225
account.mapping_excel_row, account.mapping_id,