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

namespace ScheduledChanges\Repository;

use ScheduledChanges\Domain\Audit\AuditEvent;
use ScheduledChanges\Domain\Shared\Uuid;

/**
 * Storage port retained for wpdb and deterministic test implementations.
 * Stores append-only audit events. Reads return empty results when no rows
 * exist; persistence failures throw `RepositoryException`.
 */
interface AuditRepository {
	/**
	 * Records an event and returns its internal ID.
	 *
	 * @param AuditEvent $event Event to record.
	 * @throws \RuntimeException When audit persistence fails.
	 */
	public function record( AuditEvent $event ): int;

	/**
	 * Deletes a fixture event by UUID.
	 *
	 * @param Uuid $uuid Event UUID.
	 * @throws \RuntimeException When audit deletion fails.
	 */
	public function deleteByUuid( Uuid $uuid ): bool;
}
