Skip to content

Commit

Permalink
Merge pull request #1726 from Crown-Commercial-Service/feature/CAS-23…
Browse files Browse the repository at this point in the history
…88_Review_Endpoint

Add Review Endpoint For UI to Consume
  • Loading branch information
NToppingCCS committed May 22, 2024
2 parents 5064236 + 9e05f3f commit aaede83
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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";
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit aaede83

Please sign in to comment.