<?php
/**
 * Schedule Center typed read-model facade.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Admin;

use ScheduledChanges\Repository\AdminDashboardRepository;

/** Exposes only the launch/calendar/target queries owned by Schedule Center. */
final class ScheduleCenterReadModel {
	private AdminDashboardRepository $dashboard;

	/** Creates the facade over the persisted admin read models. */
	public function __construct( AdminDashboardRepository $dashboard ) {
		$this->dashboard = $dashboard;
	}

	/** @return array<string,mixed> */
	public function summary(): array {
		return $this->dashboard->summary();
	}

	/** @return array<int,array<string,mixed>> */
	public function calendar( int $limit ): array {
		return $this->dashboard->calendarItems( $limit );
	}

	/** @return array<string,array<string,mixed>> */
	public function launchDetails( int $limit ): array {
		return $this->dashboard->launchDetails( $limit );
	}

	/** @return array<int,array<string,mixed>> */
	public function launches( int $limit ): array {
		return $this->dashboard->launches( $limit );
	}

	/** @return array<int,array<string,mixed>> */
	public function targets( int $limit ): array {
		return $this->dashboard->targetSummaries( $limit );
	}
}
