Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBP-3625 Fix SwaggerHubErrors #336

Merged
merged 6 commits into from
Apr 29, 2020
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class GermplasmListResource {
@RequestMapping(value = "/crops/{crop}/germplasm-lists/tree", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<List<TreeNode>> getGermplasmListByParentFolderId(
@ApiParam("The crop type") @PathVariable final String crop,
@ApiParam(value = "The crop type", required = true) @PathVariable final String crop,
@ApiParam("The program UUID") @RequestParam(required = false) final String programUUID,
@ApiParam(value = "The id of the parent folder") @RequestParam(required = false) final String parentFolderId,
@ApiParam(value = "Only folders") @RequestParam(required = true) final Boolean onlyFolders) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public ResponseEntity<Integer> createLot(
@PathVariable final String cropName,
@ApiParam("Lot to be created")
@RequestBody final LotGeneratorInputDto lotGeneratorInputDto) {
return new ResponseEntity<>(lotService.saveLot(lotGeneratorInputDto), HttpStatus.CREATED);
return new ResponseEntity<>(this.lotService.saveLot(lotGeneratorInputDto), HttpStatus.CREATED);
}

@ApiOperation(value = "Update Lots", notes = "Update one or more Lots")
Expand All @@ -170,7 +170,7 @@ public ResponseEntity<Void> updateLots(

final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), Integer.class.getName());
this.inventoryCommonValidator.validateSearchCompositeDto(lotRequest.getSearchComposite(), errors);
final LotsSearchDto searchDTO = searchRequestDtoResolver.getLotsSearchDto(lotRequest.getSearchComposite());
final LotsSearchDto searchDTO = this.searchRequestDtoResolver.getLotsSearchDto(lotRequest.getSearchComposite());

final List<ExtendedLotDto> extendedLotDtos = this.lotService.searchLots(searchDTO, null);
if (lotRequest.getSearchComposite().getSearchRequestId() == null) {
Expand All @@ -184,10 +184,10 @@ public ResponseEntity<Void> updateLots(

@ApiOperation(value = "Create list of lots with an initial balance", notes = "Create list of lots with an initial balance")
@RequestMapping(
value = "/crops/{crop}/lot-lists",
value = "/crops/{cropName}/lot-lists",
method = RequestMethod.POST)
@PreAuthorize(HAS_MANAGE_LOTS + " or hasAnyAuthority('IMPORT_LOTS')")
public ResponseEntity<Void> importLotsWithInitialBalance(@PathVariable final String crop,
public ResponseEntity<Void> importLotsWithInitialBalance(@PathVariable final String cropName,
@RequestBody final LotImportRequestDto lotImportRequestDto) {
this.lotService.importLotsWithInitialTransaction(lotImportRequestDto);
return new ResponseEntity<>(HttpStatus.OK);
Expand All @@ -203,7 +203,7 @@ public ResponseEntity<FileSystemResource> getTemplate(@PathVariable final String
final VariableFilter variableFilter = new VariableFilter();
variableFilter.addPropertyId(TermId.INVENTORY_AMOUNT_PROPERTY.getId());
final List<VariableDetails> units = this.variableService.getVariablesByFilter(variableFilter);
final List<LocationDto> locations = locationService.getLocations(LotResource.STORAGE_LOCATION_TYPE, null, false, null);
final List<LocationDto> locations = this.locationService.getLocations(LotResource.STORAGE_LOCATION_TYPE, null, false, null);

final File file = this.lotTemplateExportServiceImpl.export(locations, units);
final HttpHeaders headers = new HttpHeaders();
Expand All @@ -223,14 +223,14 @@ public ResponseEntity<LotSearchMetadata> getLotSearchMetadata(@PathVariable fina

final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), Integer.class.getName());
this.inventoryCommonValidator.validateSearchCompositeDto(searchCompositeDto, errors);
final LotsSearchDto searchDTO = searchRequestDtoResolver.getLotsSearchDto(searchCompositeDto);
final LotsSearchDto searchDTO = this.searchRequestDtoResolver.getLotsSearchDto(searchCompositeDto);

if (searchCompositeDto.getSearchRequestId() == null) {
final List<ExtendedLotDto> extendedLotDtos = this.lotService.searchLots(searchDTO, null);
this.extendedLotListValidator.validateAllProvidedLotIdsExist(extendedLotDtos, searchCompositeDto.getItemIds());
}

return new ResponseEntity<>(lotService.getLotsSearchMetadata(searchDTO), HttpStatus.OK);
return new ResponseEntity<>(this.lotService.getLotsSearchMetadata(searchDTO), HttpStatus.OK);
}

@ApiOperation(value = "Close Lots", notes = "Close a collection of lots")
Expand All @@ -244,7 +244,7 @@ public ResponseEntity<Void> closeLots(

final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), LotService.class.getName());
this.inventoryCommonValidator.validateSearchCompositeDto(searchCompositeDto, errors);
final LotsSearchDto searchDTO = searchRequestDtoResolver.getLotsSearchDto(searchCompositeDto);
final LotsSearchDto searchDTO = this.searchRequestDtoResolver.getLotsSearchDto(searchCompositeDto);

if (searchCompositeDto.getSearchRequestId() == null) {
final List<ExtendedLotDto> extendedLotDtos = this.lotService.searchLots(searchDTO, null);
Expand Down