0.2.25: batch historical eNAV backfill + collapsible investor chart
Add POST /api/import/capital-accounts/batch: upload several of a fund's eNAV workbooks at once; each file's ALLOC SI roster is auto-matched to existing members (by fund-admin investor ID, else name/username) and their capital statement is saved at that file's own as-of date, building trend-lines without replacing the latest figures. Members not already in the portal are skipped and reported per file (never created). Capital statements only -- holdings/NAV are untouched. One bad file (wrong password, no ALLOC SI, unreadable date) is reported per-file and does not abort the rest. Import page gains a "Backfill historical capital" batch section (fund picker, multi-file .xlsx input, shared password, per-file results table). Investor portal "Capital over time" chart is now collapsed by default and expands per fund (first login opens clean); applies to InvestorHome and the admin Investor View via the shared component. Tests: backend/tests/test_capital_batch.py (2). Full suite 17 passed; frontend tsc clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
33776d42f4
commit
099459b2f3
@@ -320,6 +320,24 @@ class CapitalImportCommit(BaseModel):
|
||||
investors: list[ImportCommitInvestor]
|
||||
|
||||
|
||||
# --- Batch historical capital backfill (one eNAV file per quarter, auto-matched) ---
|
||||
|
||||
class BatchCapitalFileResult(BaseModel):
|
||||
filename: str
|
||||
as_of_date: date | None = None
|
||||
matched: int = 0 # existing members whose statement was written
|
||||
statements_written: int = 0 # created + updated
|
||||
updated: int = 0 # matched a statement already at this as-of date
|
||||
skipped: list[str] = [] # roster names with no existing member (not created)
|
||||
error: str | None = None # file-level failure (bad password, no ALLOC SI, etc.)
|
||||
|
||||
|
||||
class BatchCapitalImportResult(BaseModel):
|
||||
entity_id: int
|
||||
files: list[BatchCapitalFileResult]
|
||||
total_statements: int
|
||||
|
||||
|
||||
# --- Entity stakes (a GP/mgmt entity's interest in the funds it manages) ---
|
||||
|
||||
class EntityStakeCreate(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user