Repeat Logs on the Same Date Break a Greenhouse Observation Streak
Level 2 · node · Data · Consecutive-day aggregation with repeated observation dates
Scenario
At a fictional greenhouse, observations can be logged more than once per day during shift handovers. The raw logs must all be kept, but the operations report displays each greenhouse's longest streak of calendar days with observations. A report has understated a streak even though there were no missing dates. Trace the flow from storing logs to returning the summary.
Requirements
Calculate the longest run of days with at least one observation for each greenhouse. Inputs are valid YYYY-MM-DD date strings. Do not delete raw log entries or rely on input order.
Acceptance criteria
- Return the correct streak even when dates are entered out of order.
- Multiple observations on the same date count as one day and do not interrupt the streak.
- A day without an observation separates two runs.
- Consecutive dates across month and year boundaries count as one run.
- Return zero days for a greenhouse without observations.
- Do not count observations from other greenhouses.