<?php

declare(strict_types=1);

namespace App\Framework\Notification\Templates;

/**
 * Template Registry Interface
 *
 * Manages notification templates
 */
interface TemplateRegistry
{
    /**
     * Register a template
     *
     * @param NotificationTemplate $template Template to register
     * @return void
     */
    public function register(NotificationTemplate $template): void;

    /**
     * Get template by name
     *
     * @param string $name Template name
     * @return NotificationTemplate|null Template or null if not found
     */
    public function get(string $name): ?NotificationTemplate;

    /**
     * Get template by ID
     *
     * @param TemplateId $id Template ID
     * @return NotificationTemplate|null Template or null if not found
     */
    public function getById(TemplateId $id): ?NotificationTemplate;

    /**
     * Check if template exists
     *
     * @param string $name Template name
     * @return bool True if template exists
     */
    public function has(string $name): bool;

    /**
     * Get all registered templates
     *
     * @return array<string, NotificationTemplate> All templates indexed by name
     */
    public function all(): array;

    /**
     * Remove template by name
     *
     * @param string $name Template name
     * @return void
     */
    public function remove(string $name): void;
}
