namespace ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services;

public interface IAuditService
{
    /// <summary>
    /// Appends an audit log entry recording a user action on an entity.
    /// </summary>
    /// <param name="user">The authenticated username performing the action.</param>
    /// <param name="action">The action performed (e.g., "Create", "Update", "Delete").</param>
    /// <param name="entityType">The type name of the affected entity.</param>
    /// <param name="entityId">The string representation of the entity's primary key.</param>
    /// <param name="entityName">The display name of the affected entity.</param>
    /// <param name="afterState">The entity state after the action; may be null for deletes.</param>
    /// <param name="cancellationToken">Cancellation token for the log write.</param>
    /// <returns>A task that represents the asynchronous operation.</returns>
    Task LogAsync(string user, string action, string entityType, string entityId, string entityName, object? afterState, CancellationToken cancellationToken = default);
}
