<?php

declare(strict_types=1);

namespace App\Framework\Audit;

use App\Framework\Audit\ValueObjects\AuditEntry;
use App\Framework\Audit\ValueObjects\AuditId;
use App\Framework\Audit\ValueObjects\AuditQuery;

/**
 * Audit logger interface
 */
interface AuditLogger
{
    /**
     * Log an audit entry
     */
    public function log(AuditEntry $entry): void;

    /**
     * Retrieve an audit entry by ID
     */
    public function find(AuditId $id): ?AuditEntry;

    /**
     * Query audit entries with type-safe filters
     *
     * @return array<AuditEntry>
     */
    public function query(AuditQuery $query): array;

    /**
     * Count audit entries matching query
     */
    public function count(AuditQuery $query): int;

    /**
     * Delete audit entries older than specified date
     */
    public function purgeOlderThan(\DateTimeImmutable $date): int;
}
