You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deals have no stage-entry timestamp, so "rotten" can only be approximated from updated_at #12
When a deal entered its current stage. Pipelines carry rotten_days ("days a Deal can sit in a stage before it's surfaced as stale", iblai-api-crm → references/schema.md), but no field records how long a deal has actually sat there.
Workaround in the code right now
components/crm/deals/deal-board.tsx:27-31 flags a card stale when Date.now() - deal.updated_at > rotten_days. updated_at moves on any write — editing the description, attaching a tag, changing the owner — so a deal stuck in Proposal for 90 days that someone re-tagged yesterday shows as fresh.
Also blocks
Time-in-stage and stage-velocity reporting. The only stage history is the audit Activity each move writes (type=note, title "Stage changed", from→to in free-text comment), which a client would have to fetch per deal and parse.
Proposal
Read-only stage_entered_at on Deal, stamped by move-stage/, won/, lost/, and ideally a structured stage-history read (GET /api/crm/deals/{id}/stage-history/ → [{from_stage, to_stage, at, by}]) instead of parsing note text.
Activity