package de.effigenix.application.usermanagement;

import de.effigenix.shared.security.ActorId;

/**
 * Port for audit logging (HACCP/GoBD compliance).
 * Implementation will be in Infrastructure Layer (async database logging).
 *
 * All audit logs are immutable and retained for 10 years.
 */
public interface AuditLogger {

    /**
     * Logs an audit event with entity details.
     *
     * @param event Event type
     * @param entityId ID of the entity affected (e.g., RecipeId, BatchId, UserId)
     * @param performedBy Actor who performed the action
     */
    void log(AuditEvent event, String entityId, ActorId performedBy);

    /**
     * Logs an audit event with free-form details.
     *
     * @param event Event type
     * @param details Additional details (e.g., error messages, critical values)
     */
    void log(AuditEvent event, String details);

    /**
     * Logs an audit event with entity and additional details.
     *
     * @param event Event type
     * @param entityId ID of the entity affected (UUID, max 36 chars)
     * @param details Additional details (e.g., role name, reason)
     * @param performedBy Actor who performed the action
     */
    void log(AuditEvent event, String entityId, String details, ActorId performedBy);

    /**
     * Logs an audit event without entity (e.g., LOGIN_SUCCESS).
     *
     * @param event Event type
     * @param performedBy Actor who performed the action
     */
    void log(AuditEvent event, ActorId performedBy);
}
