Class AuditUtil

java.lang.Object
com.ssgllc.fish.service.util.published.AuditUtil

@Component public class AuditUtil extends Object
Publishes application-defined audit events from a script.
  • Field Details

    • applicationEventPublisherService

      public com.ssgllc.fish.security.jwt.ApplicationEventPublisherService applicationEventPublisherService
  • Constructor Details

    • AuditUtil

      public AuditUtil(com.ssgllc.fish.security.jwt.ApplicationEventPublisherService applicationEventPublisherService)
  • Method Details

    • publishCustomEvent

      public void publishCustomEvent(String eventType, Map<String,Object> data)
      Publishes a custom audit event, recording it alongside the platform's own audit entries. Use it to leave a durable trace of something the platform does not audit by itself - an external call, a business decision taken in a script, a manual override.
      Parameters:
      eventType - the event type to record; pick a stable name, since reports and audit queries filter on it
      data - values to record with the event

      Groovy example:
      auditUtil.publishCustomEvent("ORDER_OVERRIDE", ['orderId': entity.id, 'reason': 'manual approval'])

      Returns:
      nothing; the event is written to the audit log