fix: preserve multi-cause reconcile warnings and align slot blocking
Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
co-authored by
genichin
parent
e47bebacaf
commit
45a5e4157d
@@ -199,6 +199,22 @@ def test_sync_holding_qty_mismatch_updated():
|
||||
assert not ws_out.is_warned(str(slot.slot_id))
|
||||
|
||||
|
||||
def test_sync_clears_only_b_case_when_slot_has_multiple_warning_causes():
|
||||
slot = _make_slot(SlotState.HOLDING, qty=5.0)
|
||||
ws = InMemoryReconcileWarningStore()
|
||||
slot_id = str(slot.slot_id)
|
||||
ws.set_warned(slot_id, portfolio_id="pf-005930", case_code="B")
|
||||
ws.set_warned(slot_id, portfolio_id="pf-005930", case_code="C")
|
||||
|
||||
result, _repo, ws_out = _setup(slot, {"005930": 10}, warn_store=ws)
|
||||
|
||||
assert result["warning_cleared"] is True
|
||||
assert ws_out.is_warned(slot_id) is True
|
||||
info = ws_out.get_warning_info(slot_id)
|
||||
assert info is not None
|
||||
assert info["case_codes"] == ["C"]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# AC-4: WAC seed from cost_basis_port when available
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user