<?php
/**
 * Snapshot repository contract.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Repository;

use ScheduledChanges\Domain\Snapshot\SnapshotKind;
use ScheduledChanges\Domain\Snapshot\SnapshotRecord;

/**
 * Storage port retained for wpdb and deterministic test implementations.
 * Persists canonical provider state for execution and rollback. Reads return
 * empty results for not-found; write and integrity failures throw
 * `RepositoryException`.
 */
interface SnapshotRepository {
	public function create( SnapshotRecord $snapshot ): int;

	/**
	 * @return SnapshotRecord[]
	 */
	public function findForRun( int $run_id, string $kind ): array;

	public function deleteByRun( int $run_id ): int;
}
