0.2.36: Investor View carries exit status + grey out fully-exited fund cards

The admin read-only Investor View built capital-account responses
without exited_on, so an exited position showed the active card with
$0s (the LP's own portal was correct). Extracted exit_dates() into
capital_account_router and stamp it in investor_view too; regression
test added. A fund card where every position is exited now renders
greyed (bg + title) so it reads as closed at a glance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jonathan Kirkwood
2026-07-03 09:35:03 -05:00
co-authored by Claude Opus 4.8
parent 2c87ab499a
commit 1deb6586b0
9 changed files with 65 additions and 18 deletions
+14
View File
@@ -61,6 +61,20 @@ def test_mark_exited_flows_to_partners_and_statements(auth_client, session):
assert resp.json()["exited_on"] is None
def test_investor_view_mirrors_exit(auth_client, session):
"""The admin's read-only Investor View must carry exited_on exactly like the LP's own
portal — it was missing there (the bug behind the 'active card despite exit' report)."""
entity, lp = _setup_fund(session)
assert auth_client.put(
f"/api/entities/{entity.id}/partners/{lp.id}/exited",
json={"exited_on": "2026-05-15"},
).status_code == 200
view = auth_client.get(f"/api/users/{lp.id}/investor-view").json()
assert view["capital_accounts"], "expected the LP's statements in the view"
assert all(c["exited_on"] == "2026-05-15" for c in view["capital_accounts"])
def test_exited_member_excluded_from_rollup_committed(auth_client, session):
entity, seller = _setup_fund(session)
# The buyer joins the roster with the same commitment (they bought the stake).