diff --git a/src/main/java/uk/gov/crowncommercial/dts/scale/cat/controller/EventsController.java b/src/main/java/uk/gov/crowncommercial/dts/scale/cat/controller/EventsController.java index 821d72ae..8a8030cb 100644 --- a/src/main/java/uk/gov/crowncommercial/dts/scale/cat/controller/EventsController.java +++ b/src/main/java/uk/gov/crowncommercial/dts/scale/cat/controller/EventsController.java @@ -115,6 +115,16 @@ public EventDetail getEvent(@PathVariable("procID") final Integer procId, return procurementEventService.getEvent(procId, eventId); } + @GetMapping("/{eventID}/review") + @TrackExecutionTime + public EventDetail getEventReview(@PathVariable("procID") final Integer procId, @PathVariable("eventID") final String eventId, final JwtAuthenticationToken authentication) { + String principal = getPrincipalFromJwt(authentication); + log.info("getEventReview invoked on behalf of principal: {}", principal); + + // Fetch the event review model + return procurementEventService.getEventReview(procId, eventId); + } + @PutMapping("/{eventID}") @TrackExecutionTime public EventSummary updateProcurementEvent(@PathVariable("procID") final Integer procId, diff --git a/src/main/java/uk/gov/crowncommercial/dts/scale/cat/service/ProcurementEventService.java b/src/main/java/uk/gov/crowncommercial/dts/scale/cat/service/ProcurementEventService.java index 7d145824..30786d66 100644 --- a/src/main/java/uk/gov/crowncommercial/dts/scale/cat/service/ProcurementEventService.java +++ b/src/main/java/uk/gov/crowncommercial/dts/scale/cat/service/ProcurementEventService.java @@ -80,13 +80,9 @@ public class ProcurementEventService implements EventService { public static final String ERR_MSG_FMT_DOCUMENT_NOT_FOUND = "Document upload record for ID [%s] not found"; - public static final String ERR_MSG_ALL_DIMENSION_WEIGHTINGS = - "All dimensions must have 100% weightings prior to the supplier(s) can be added to the event"; public static final Set RESPONSE_STATES = Set.of("Not Replied"); private static final String ERR_MSG_FMT_NO_SUPPLIER_RESPONSES_FOUND = "No Supplier Responses found for the given event '%s' "; - private static final String ERR_MSG_SUPPLIER_NOT_FOUND_CONCLAVE = - "Supplier [%s] not found in Conclave"; private static final String ERR_MSG_RFX_NOT_FOUND = "Rfx [%s] not found in Jaggaer"; private static final String JAGGAER_USER_NOT_FOUND = "Jaggaer user not found"; @@ -490,6 +486,22 @@ public EventDetail getEvent(final Integer projectId, final String eventId) { : Collections.emptySet()); } + /** + * Retrieve a single event's review information based on the ID + * + * @param projectId + * @param eventId + * @return the converted Tender object + */ + public EventDetail getEventReview(final Integer projectId, final String eventId) { + // Grab the event as its core RFX format + ProcurementEvent event = validationService.validateProjectAndEventIds(projectId, eventId); + ExportRfxResponse exportRfxResponse = jaggaerService.getSingleRfx(event.getExternalEventId()); + + // The main difference between this and getEvent is that we always want it to provide us with the eval criteria - it shouldn't be suppressed based on event type + return tendersAPIModelUtils.buildEventDetail(exportRfxResponse.getRfxSetting(), event, criteriaService.getEvalCriteria(projectId, eventId, true)); + } + /** * Update Event. If no values are set the method does not carry out updates and no errors are * thrown.