in src/main/java/com/epam/digital/data/platform/restapi/core/audit/DatabaseAuditProcessor.java [88:108]
private Object prepareAndSendDbAudit(
ProceedingJoinPoint joinPoint, String action, JwtClaimsDto userClaims,
Set<String> fields, String entityId) throws Throwable {
String methodName = joinPoint.getSignature().getName();
log.debug("Sending {} event to Audit", action);
databaseEventsFacade
.sendDbAudit(methodName, null, action, userClaims, BEFORE, entityId, fields, null);
Object result = joinPoint.proceed();
if (action.equals(READ)) {
fields = ((Optional<?>) result).map(this::getFields).orElse(null);
}
log.debug("Sending {} completed event to Audit", action);
databaseEventsFacade
.sendDbAudit(methodName, null, action, userClaims, AFTER, entityId, fields, null);
return result;
}