Skip to content

Commit

Permalink
[MODAUD-174] - Improved AuditDataAcquisitionImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
azizbekxm committed Nov 15, 2023
1 parent af27863 commit ec50fb3
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ public void getAuditDataAcquisitionOrderById(String orderId, String sortBy, Audi
orderAuditEventsService.getAuditEventsByOrderId(orderId, sortBy, sortOrder.name(), limit, offset, tenantId)
.map(GetAuditDataAcquisitionOrderByIdResponse::respond200WithApplicationJson)
.map(Response.class::cast)
.otherwise(this::mapExceptionToResponse)
.onComplete(asyncResultHandler);
} catch (Exception e) {
LOGGER.warn("Failed to get order audit events by order id: {}", orderId, e);
LOGGER.error("Failed to get order audit events by order id: {}", orderId, e);
asyncResultHandler.handle(Future.succeededFuture(mapExceptionToResponse(e)));
}
}
Expand All @@ -68,10 +67,9 @@ public void getAuditDataAcquisitionOrderLineById(String orderLineId, String sort
orderLineAuditEventsService.getAuditEventsByOrderLineId(orderLineId, sortBy, sortOrder.name(), limit, offset, tenantId)
.map(GetAuditDataAcquisitionOrderLineByIdResponse::respond200WithApplicationJson)
.map(Response.class::cast)
.otherwise(this::mapExceptionToResponse)
.onComplete(asyncResultHandler);
} catch (Exception e) {
LOGGER.warn("Failed to get order line audit events by order line id: {}", orderLineId, e);
LOGGER.error("Failed to get order line audit events by order line id: {}", orderLineId, e);
asyncResultHandler.handle(Future.succeededFuture(mapExceptionToResponse(e)));
}

Expand All @@ -87,7 +85,6 @@ public void getAuditDataAcquisitionPieceById(String pieceId, String sortBy, Audi
pieceAuditEventsService.getAuditEventsByPieceId(pieceId, sortBy, sortOrder.name(), limit, offset, tenantId)
.map(GetAuditDataAcquisitionPieceByIdResponse::respond200WithApplicationJson)
.map(Response.class::cast)
.otherwise(this::mapExceptionToResponse)
.onComplete(asyncResultHandler);
} catch (Exception e) {
LOGGER.error("Failed to get piece audit events by piece id: {}", pieceId, e);
Expand All @@ -107,10 +104,9 @@ public void getAuditDataAcquisitionPieceStatusChangeHistoryById(String pieceId,
pieceAuditEventsService.getAuditEventsWithStatusChangesByPieceId(pieceId, sortBy, sortOrder.name(), limit, offset, tenantId)
.map(GetAuditDataAcquisitionPieceByIdResponse::respond200WithApplicationJson)
.map(Response.class::cast)
.otherwise(this::mapExceptionToResponse)
.onComplete(asyncResultHandler);
} catch (Exception e) {
LOGGER.warn("Failed to get piece audit events with unique status change by piece id: {}", pieceId, e);
LOGGER.error("Failed to get piece audit events with unique status change by piece id: {}", pieceId, e);
asyncResultHandler.handle(Future.succeededFuture(mapExceptionToResponse(e)));
}
}
Expand Down

0 comments on commit ec50fb3

Please sign in to comment.