<?php

declare(strict_types=1);

namespace App\Framework\EventSourcing\Sagas;

/**
 * Saga Repository Interface
 *
 * Persistence layer for saga instances
 */
interface SagaRepository
{
    /**
     * Save saga instance
     */
    public function save(SagaInterface $saga): void;

    /**
     * Find saga by ID
     */
    public function find(SagaId $sagaId): ?SagaInterface;

    /**
     * Find sagas by saga class
     *
     * @return array<SagaInterface>
     */
    public function findBySagaClass(string $sagaClass): array;

    /**
     * Find sagas by status
     *
     * @return array<SagaInterface>
     */
    public function findByStatus(SagaStatus $status): array;

    /**
     * Delete saga
     */
    public function delete(SagaId $sagaId): void;

    /**
     * Get all sagas
     *
     * @return array<SagaInterface>
     */
    public function findAll(): array;
}
