package com.cameleer.server.core.admin;

import java.time.Instant;
import java.util.Map;

public record AuditRecord(
        long id,
        Instant timestamp,
        String username,
        String action,
        AuditCategory category,
        String target,
        Map<String, Object> detail,
        AuditResult result,
        String ipAddress,
        String userAgent
) {
    /** Factory for creating new records (id and timestamp assigned by DB) */
    public static AuditRecord create(String username, String action, AuditCategory category,
                                      String target, Map<String, Object> detail, AuditResult result,
                                      String ipAddress, String userAgent) {
        return new AuditRecord(0, null, username, action, category, target, detail, result, ipAddress, userAgent);
    }
}
