A member who sold/transferred their stake showed a phantom -100% loss
($0 ending balance, no distribution through the fund). Now:
- entity_access.exited_on (migration e1f2a3b4c5d6), set/cleared from the
Partners tab (writer-only, inline date picker, audited)
- LP portal card shows a quiet "Exited <date>" badge, keeps documents,
hides balance/gain
- portfolio summary excludes exited positions ("Excludes N exited")
- fund committed totals (rollup + Partners tab) skip exited members so
seller + buyer are not double-counted
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
28 lines
751 B
Python
28 lines
751 B
Python
"""add entity_access.exited_on (member sold/transferred their stake)
|
|
|
|
Revision ID: e1f2a3b4c5d6
|
|
Revises: d0e1f2a3b4c5
|
|
Create Date: 2026-07-03 10:30:00.000000
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision: str = 'e1f2a3b4c5d6'
|
|
down_revision: Union[str, None] = 'd0e1f2a3b4c5'
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
with op.batch_alter_table('entity_access', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('exited_on', sa.Date(), nullable=True))
|
|
|
|
|
|
def downgrade() -> None:
|
|
with op.batch_alter_table('entity_access', schema=None) as batch_op:
|
|
batch_op.drop_column('exited_on')
|