, * places: array, * scheduler: array{healthy: bool, last_run_at: string|null}, * database: DatabaseSummary, * data_version: int, * now: string|null * } */ final class StatusReport { public function __construct( private ScanStateStore $scan_state_store, private SettingsStore $settings_store, private ScanProgress $scan_progress, private LinkCounts $link_counts, private SchedulerHealth $scheduler_health, private DatabaseReport $database_report, private DataVersion $data_version, private IsoTime $iso_time, private Clock $clock ) { } /** @return StatusSummary */ public function build(): array { $state = $this->scan_state_store->load(); $settings = $this->settings_store->load(); $now = $this->clock->now(); $scan = $this->scan_progress->describe( $state, $settings, $now ); return array( 'first_run' => $state->first_run, 'scan' => $scan, 'counts' => $this->link_counts->counts(), 'places' => $this->link_counts->places(), 'scheduler' => $this->scheduler_health->describe( $now ), 'database' => $this->database_report->describe( $settings ), 'data_version' => $this->data_version->current(), 'now' => $this->iso_time->from_timestamp( $now ), ); } }