Class ProgressProjector
The lookback window adapts to how much history is actually available, capped at 90 days, with
a 7-day floor below which no projection is produced at all: a fast-moving team can generate a lot
of signal quickly, and a low-confidence estimate with a visible disclaimer is more useful than
months of silence. Confidence reflects how much of that window was actually available and
is meant to drive free-text disclaimer wording in the dashboard - it is never part of the CSS
contract.
The projected date itself is workday-aware: daysToCompletion is treated as a count of
business days (Monday-Friday) of remaining work, not calendar days, and is converted to a calendar
date by skipping over any Saturdays and Sundays it spans - so a projection of "7 days to go" lands
9 calendar days out, not 7, since it implicitly crosses one weekend. Nobody's plan should read as
expecting weekend work.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionproject(List<LifecycleRecord> records, String finalStage, int totalCount, Instant now) Projects whenrecordswill collectively reachtotalCountitems atfinalStage.
-
Constructor Details
-
ProgressProjector
public ProgressProjector()Creates a newProgressProjector.
-
-
Method Details
-
project
public Optional<Projection> project(List<LifecycleRecord> records, String finalStage, int totalCount, Instant now) Projects whenrecordswill collectively reachtotalCountitems atfinalStage.- Parameters:
records- the tracker's current recordsfinalStage- the stage that marks an item as completetotalCount- total number of items the tracker is tracking - the caller's own active-only count, e.g.TrackerViewFactory'stotalCountnow- the instant to project from- Returns:
- the projection, or
Optional.empty()when fewer than 7 days of lookback history is available, or when the resulting velocity is zero or negative
-