Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
e7962d2
[autocommit] bumping build number
rob-ouser-bi Apr 23, 2026
cd343a1
Merge branch 'feature/BI-2825' into develop
nickpalladino Apr 23, 2026
70efa00
[autocommit] bumping build number
rob-ouser-bi Apr 23, 2026
2bf7ca0
BI-2789: Updated code to add custom validations for breeding method a…
humsika Apr 26, 2026
896f6d5
Merge remote-tracking branch 'origin/develop' into feature/BI-2789
humsika Apr 26, 2026
a0e65f4
[BI-2820] modified error message
Apr 28, 2026
18fbef7
Pulled the changes from the Bug-2801 and pushing them to develop branch.
humsika Apr 28, 2026
8d42e9d
[autocommit] bumping build number
rob-ouser-bi Apr 28, 2026
ae77ecc
codex first pass
nickpalladino Apr 29, 2026
fe913ec
[BI-2820] remove commented-out code
Apr 30, 2026
de1fbe3
BI-2789: Addressed comments and also cleaned up some existing code to…
humsika Apr 30, 2026
0c6a047
Merge branch 'develop' into feature/BI-2839
nickpalladino May 1, 2026
441f3cf
Merge branch 'develop' into feature/BI-2820
humsika May 1, 2026
ee7f4cd
Merge pull request #514 from Breeding-Insight/feature/BI-2820
humsika May 1, 2026
0a36660
[autocommit] bumping build number
rob-ouser-bi May 1, 2026
6f0dd36
Merge branch 'develop' into feature/BI-2789
davedrp May 4, 2026
a84dc18
Merge pull request #513 from Breeding-Insight/feature/BI-2789
davedrp May 4, 2026
08d9bce
[autocommit] bumping build number
rob-ouser-bi May 4, 2026
88ffab8
Clean up tests
nickpalladino May 5, 2026
2d10f92
Merge branch 'develop' into feature/BI-2839
nickpalladino May 5, 2026
ad04f83
Merge pull request #515 from Breeding-Insight/feature/BI-2839
HMS17 May 12, 2026
109b6ef
[autocommit] bumping build number
rob-ouser-bi May 12, 2026
4f00c4b
Merge branch 'bug/BI-2860-v1.3' into develop
nickpalladino May 13, 2026
4431aed
[autocommit] bumping build number
rob-ouser-bi May 13, 2026
c81a0e4
Update version
nickpalladino May 13, 2026
3f52ad4
[autocommit] bumping build number
rob-ouser-bi May 13, 2026
8d1a567
[BI-2841] WIP
May 20, 2026
1d1c976
wip
nickpalladino May 22, 2026
4dedef6
[BI-2841] WIP
May 26, 2026
f0bc1d4
BI-2887: Added null safe checks for Breeding method and Source values.
humsika May 27, 2026
b79f79c
BI-2887: Added test cases.
humsika May 28, 2026
c5566e5
BI-2887: Updated the test case.
humsika May 29, 2026
1a4143c
Merge pull request #520 from Breeding-Insight/bug/BI-2887
nickpalladino May 29, 2026
47f808a
[autocommit] bumping build number
rob-ouser-bi May 29, 2026
3fd0f8f
Test fixes
nickpalladino Jun 1, 2026
eb8dcba
[BI-2841] Clean-up code
Jun 2, 2026
c9cca74
[BI-2841] removed TODO comment
Jun 2, 2026
821250d
[autocommit] bumping build number
rob-ouser-bi Jun 3, 2026
5187eca
Merge branch 'develop' into feature/BI-2841
jloux-brapi Jun 4, 2026
9f8b35e
BI-2848: Committing initial code changes.
humsika Jun 5, 2026
f145612
BI-2848: Committing additional code changes and test cases.
humsika Jun 7, 2026
f01a8e1
Merge remote-tracking branch 'origin/develop' into feature/BI-2848
humsika Jun 7, 2026
5dfc36e
[BI-2878] WIP
Jun 8, 2026
a2fbc40
BI-2848: Committing latest code changes.
humsika Jun 8, 2026
7b4a53f
Update src/main/java/org/breedinginsight/utilities/BrAPIDAOUtil.java
jloux-brapi Jun 8, 2026
0ca3bec
Merge pull request #522 from Breeding-Insight/feature/BI-2841
jloux-brapi Jun 8, 2026
21a61fb
[autocommit] bumping build number
rob-ouser-bi Jun 8, 2026
9b23ee9
Merge remote-tracking branch 'origin/develop' into feature/BI-2848
humsika Jun 8, 2026
3a80ca7
Merge branch 'develop' into feature/BI-2878
jloux-brapi Jun 11, 2026
55af89a
[BI-2883] - Add pedigree column to germplasm download files
HMS17 Jun 11, 2026
3347b1b
Merge branch 'develop' into feature/BI-2883
HMS17 Jun 11, 2026
1c226db
Added null handling
HMS17 Jun 11, 2026
1a98b7e
Update settings to fetch mvn central snapshots
jloux-brapi Jun 11, 2026
f7a0814
Merge pull request #524 from Breeding-Insight/feature/BI-2878
jloux-brapi Jun 11, 2026
f33bb78
[autocommit] bumping build number
rob-ouser-bi Jun 11, 2026
00b1d08
Merge branch 'develop' into feature/BI-2848
nickpalladino Jun 12, 2026
65060e2
Unit test fix
HMS17 Jun 12, 2026
f28dfc6
Merge branch 'develop' into feature/BI-2883
HMS17 Jun 12, 2026
e0d3d37
BI-2848: Addressing PR comments.
humsika Jun 14, 2026
1345723
Merge branch 'develop' into feature/BI-2782
nickpalladino Jun 15, 2026
0f27a21
Merge pull request #526 from Breeding-Insight/feature/BI-2782
nickpalladino Jun 15, 2026
aa37807
[autocommit] bumping build number
rob-ouser-bi Jun 15, 2026
a67ff51
Merge branch 'develop' into feature/BI-2848
nickpalladino Jun 15, 2026
a88a712
BI-2848: Added GenotypeImportDAO and also Rebased with develop branch…
humsika Jun 15, 2026
70fe3ea
Merge branch 'develop' into feature/BI-2883
HMS17 Jun 15, 2026
f05b5d9
Merge pull request #523 from Breeding-Insight/feature/BI-2848
nickpalladino Jun 15, 2026
35c2aa8
[autocommit] bumping build number
rob-ouser-bi Jun 15, 2026
5c00699
Unit test coverage
HMS17 Jun 16, 2026
9d8bc1c
Merge remote-tracking branch 'origin/feature/BI-2883' into feature/BI…
HMS17 Jun 16, 2026
c715dc3
Merge branch 'develop' into feature/BI-2883
HMS17 Jun 16, 2026
9cd4f01
BI-2901: Made changes required to this story.
humsika Jun 18, 2026
b501aeb
Merge pull request #525 from Breeding-Insight/feature/BI-2883
jloux-brapi Jun 22, 2026
a107857
[autocommit] bumping build number
rob-ouser-bi Jun 22, 2026
38e5e69
Merge branch 'develop' into feature/BI-2901
nickpalladino Jun 24, 2026
3ed6bfe
Merge pull request #528 from Breeding-Insight/feature/BI-2901
nickpalladino Jun 25, 2026
f2e8fcf
[autocommit] bumping build number
rob-ouser-bi Jun 25, 2026
db60fcb
BI-2941: Updating the file size limit to accept larger files upto 800MB.
humsika Jul 1, 2026
31e04a8
Merge pull request #529 from Breeding-Insight/feature/BI-2941
nickpalladino Jul 7, 2026
67604fd
[autocommit] bumping build number
rob-ouser-bi Jul 7, 2026
2360449
BI-2959: Updated the latest changes for Germplasm External UID Refere…
humsika Jul 12, 2026
32cde44
[autocommit] bumping build number
rob-ouser-bi Jul 14, 2026
1850c82
Merge remote-tracking branch 'origin/develop' into develop
humsika Jul 15, 2026
a3c9987
Prevent deletion of sample submissions with genotype data
nickpalladino Jul 17, 2026
aeea33c
Add error msg constants and fix test failure
nickpalladino Jul 17, 2026
d0d52c9
Merge pull request #535 from Breeding-Insight/feature/BI-2936
humsika Jul 20, 2026
c3d90d0
[autocommit] bumping build number
rob-ouser-bi Jul 20, 2026
2fbbfb6
Merge branch 'develop' into feature/BI-2959
HMS17 Jul 20, 2026
1507ea6
Merge pull request #534 from Breeding-Insight/feature/BI-2959
HMS17 Jul 20, 2026
30e91dc
[autocommit] bumping build number
rob-ouser-bi Jul 20, 2026
9963397
Merge remote-tracking branch 'origin/develop' into develop
humsika Jul 21, 2026
3f2fbbf
BI-2973: Committing initial changes.
humsika Jul 28, 2026
5b1cebd
[BI-2949] - Update docker-compose to ensure localstack bucket persists
HMS17 Jul 29, 2026
e6d4c43
BI-2973: Committing latest changes.
humsika Aug 3, 2026
6cd9b14
BI-2973: Committing latest changes.
humsika Aug 3, 2026
4a14453
Merge pull request #539 from Breeding-Insight/feature/BI-2949
jloux-brapi Aug 3, 2026
5320c31
[autocommit] bumping build number
rob-ouser-bi Aug 3, 2026
7cb3bfc
Merge branch 'develop' into feature/BI-2973
HMS17 Aug 5, 2026
5387c64
Merge pull request #540 from Breeding-Insight/feature/BI-2973
HMS17 Aug 5, 2026
71c8eef
[autocommit] bumping build number
rob-ouser-bi Aug 5, 2026
4c515a5
[autocommit] bumping build number
rob-ouser-bi Aug 10, 2026
0178fbe
[BI-3033] Deprecate Genotypic Data Visualization
HMS17 Sep 1, 2026
20efa41
Merge pull request #552 from Breeding-Insight/bug/BI-3033
jloux-brapi Sep 2, 2026
1919de9
[autocommit] bumping build number
rob-ouser-bi Sep 2, 2026
d72c2f8
Merge branch 'main' into release/1.4
nickpalladino Sep 9, 2026
5aee819
[autocommit] bumping build number
rob-ouser-bi Sep 9, 2026
444c882
Update brapi client to v2.2.1
nickpalladino Sep 10, 2026
2c40699
[autocommit] bumping build number
rob-ouser-bi Sep 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ services:
- localstack
environment:
- LOCALSTACK_HOST=localstack
- PERSISTENCE=1
volumes:
- localstack_data:/var/lib/localstack

networks:
backend:
Expand All @@ -187,3 +190,5 @@ volumes:
name: ${GIGWA_CONTAINER_NAME:-gigwa}_data
gigwa_mongo_data:
name: ${GIGWA_CONTAINER_NAME:-gigwa}_mongo_data
localstack_data:
name: localstack_data
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<guava.version>31.0.1-jre</guava.version>
<okhttp.version>4.9.3</okhttp.version>
<mockito.version>4.3.1</mockito.version>
<brapi-java-client.version>2.2.0</brapi-java-client.version>
<brapi-java-client.version>2.2.1</brapi-java-client.version>
<commons-io.version>2.11.0</commons-io.version>
<tika-app.version>2.2.1</tika-app.version>
<!-- Version of apache-poi depends on version of tika. Tika uses these. -->
Expand Down Expand Up @@ -464,6 +464,11 @@
<artifactId>micronaut-amazon-awssdk-s3</artifactId>
<version>2.0.5-micronaut-2.0</version>
</dependency>
<dependency>
<groupId>com.github.samtools</groupId>
<artifactId>htsjdk</artifactId>
<version>2.24.1</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
6 changes: 6 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>central-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>github-fannypack</id>
<name>FannyPack github repository</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.breedinginsight.api.model.v1.request.query;

import io.micronaut.core.annotation.Introspected;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

@Getter
@Introspected
public class GenotypeImportQuery extends QueryParams {

private String sampleSubmissionId;
private String projectNameForSampleSubmission;
private String sampleSubmissionCreatedBy;
private String genotypingFileName;
private String genotypingImportDate;
private String genotypingImportBy;

public SearchRequest constructSearchRequest() {
List<FilterRequest> filters = new ArrayList<>();

if (!StringUtils.isBlank(getSampleSubmissionId())) {
filters.add(constructFilterRequest("sampleSubmissionId", getSampleSubmissionId()));
}
if (!StringUtils.isBlank(getProjectNameForSampleSubmission())) {
filters.add(constructFilterRequest("projectNameForSampleSubmission", getProjectNameForSampleSubmission()));
}
if (!StringUtils.isBlank(getSampleSubmissionCreatedBy())) {
filters.add(constructFilterRequest("sampleSubmissionCreatedBy", getSampleSubmissionCreatedBy()));
}
if (!StringUtils.isBlank(getGenotypingFileName())) {
filters.add(constructFilterRequest("genotypingFileName", getGenotypingFileName()));
}
if (!StringUtils.isBlank(getGenotypingImportDate())) {
filters.add(constructFilterRequest("genotypingImportDate", getGenotypingImportDate()));
}
if (!StringUtils.isBlank(getGenotypingImportBy())) {
filters.add(constructFilterRequest("genotypingImportBy", getGenotypingImportBy()));
}

return new SearchRequest(filters);
}

private FilterRequest constructFilterRequest(String field, String value) {
return FilterRequest.builder()
.field(field)
.value(value)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -1,46 +1,126 @@
/*
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.breedinginsight.api.v1.controller.geno;

import io.micronaut.http.HttpHeaders;
import io.micronaut.http.HttpResponse;
import io.micronaut.http.HttpStatus;
import io.micronaut.http.MediaType;
import io.micronaut.http.annotation.*;
import io.micronaut.http.multipart.CompletedFileUpload;
import io.micronaut.http.server.types.files.StreamedFile;
import lombok.extern.slf4j.Slf4j;
import org.brapi.client.v2.model.exceptions.ApiException;
import org.breedinginsight.api.auth.AuthenticatedUser;
import org.breedinginsight.api.auth.ProgramSecured;
import org.breedinginsight.api.auth.ProgramSecuredRole;
import org.breedinginsight.api.auth.SecurityService;
import org.breedinginsight.api.auth.*;
import org.breedinginsight.api.model.v1.request.query.GenotypeImportQuery;
import org.breedinginsight.api.model.v1.request.query.SearchRequest;
import org.breedinginsight.api.model.v1.response.DataResponse;
import org.breedinginsight.api.model.v1.response.Response;
import org.breedinginsight.api.model.v1.validators.QueryValid;
import org.breedinginsight.api.v1.controller.metadata.AddMetadata;
import org.breedinginsight.brapps.importer.model.response.ImportResponse;
import org.breedinginsight.model.DownloadFile;
import org.breedinginsight.model.GenotypeImportDetails;
import org.breedinginsight.model.Program;
import org.breedinginsight.services.ProgramService;
import org.breedinginsight.services.exceptions.AuthorizationException;
import org.breedinginsight.services.exceptions.DoesNotExistException;
import org.breedinginsight.services.geno.GenotypeService;
import org.breedinginsight.utilities.response.ResponseUtils;
import org.breedinginsight.utilities.response.mappers.GenotypeImportQueryMapper;

import javax.inject.Inject;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Optional;
import java.util.UUID;

@Slf4j
@Controller("/${micronaut.bi.api.version}")
public class GenotypeDataUploadController {
private final GenotypeService genoService;
private final SecurityService securityService;
private final ProgramService programService;
private final GenotypeImportQueryMapper genotypeImportQueryMapper;

@Inject
public GenotypeDataUploadController(GenotypeService genoService, SecurityService securityService) {
public GenotypeDataUploadController(GenotypeService genoService, SecurityService securityService,
ProgramService programService, GenotypeImportQueryMapper genotypeImportQueryMapper) {
this.genoService = genoService;
this.securityService = securityService;
this.programService = programService;
this.genotypeImportQueryMapper = genotypeImportQueryMapper;
}

@Post("programs/{programId}/experiments/{experimentId}/geno/import")
@Get("programs/{programId}/geno/imports{?genotypeImportQuery*}")
@Produces(MediaType.APPLICATION_JSON)
@ProgramSecured(roleGroups = ProgramSecuredRoleGroup.PROGRAM_SCOPED_ROLES)
public HttpResponse<Response<DataResponse<GenotypeImportDetails>>> getGenotypeImports(
@PathVariable UUID programId,
@QueryValue @QueryValid(using = GenotypeImportQueryMapper.class) @Valid GenotypeImportQuery genotypeImportQuery) {
Optional<Program> program = programService.getById(programId);
if (program.isEmpty()) {
log.info("programId not found: {}", programId.toString());
return HttpResponse.notFound();
}

SearchRequest searchRequest = genotypeImportQuery.constructSearchRequest();

return ResponseUtils.getQueryResponse(
genoService.getGenotypeImports(programId),
genotypeImportQueryMapper,
searchRequest,
genotypeImportQuery
);
}

@Get("programs/{programId}/geno/imports/{genotypeImportId}/download")
@ProgramSecured(roleGroups = ProgramSecuredRoleGroup.PROGRAM_SCOPED_ROLES)
@Produces(value = {"application/octet-stream"})
public HttpResponse<StreamedFile> downloadGenotypeImport(@PathVariable UUID programId, @PathVariable UUID genotypeImportId) {
Optional<Program> program = programService.getById(programId);
if (program.isEmpty()) {
log.info("programId not found: {}", programId.toString());
return HttpResponse.notFound();
}

try {
Optional<DownloadFile> downloadFile = genoService.downloadGenotypeImport(programId, genotypeImportId);
if (downloadFile.isEmpty()) {
return HttpResponse.notFound();
}

return HttpResponse.ok(downloadFile.get().getStreamedFile())
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + downloadFile.get().getFileName());
} catch (IOException e) {
log.error("Error downloading genotype import", e);
return HttpResponse.status(HttpStatus.INTERNAL_SERVER_ERROR, "Error downloading genotype import");
}
}

@Post("programs/{programId}/submissions/{submissionId}/geno/import")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@AddMetadata
@ProgramSecured(roles = {ProgramSecuredRole.PROGRAM_ADMIN})
public HttpResponse<Response<ImportResponse>> uploadData(@PathVariable UUID programId, @PathVariable UUID experimentId, @Part("file") CompletedFileUpload upload) {
public HttpResponse<Response<ImportResponse>> uploadData(@PathVariable UUID programId, @PathVariable UUID submissionId, @Part("file") CompletedFileUpload upload) {
AuthenticatedUser actingUser = securityService.getUser();
try {
ImportResponse result = genoService.submitGenotypeData(actingUser.getId(), programId, experimentId, upload);
ImportResponse result = genoService.submitGenotypeData(actingUser.getId(), programId, submissionId, upload);
Response<ImportResponse> response = new Response<>(result);
return HttpResponse.ok(response);
} catch (DoesNotExistException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
@Secured(SecurityRule.IS_AUTHENTICATED)
public class SampleSubmissionController {

public static final String DELETE_STATUS_NOT_ALLOWED_ERROR_MESSAGE =
"Sample submission cannot be deleted because status is submitted or completed";
public static final String DELETE_GENOTYPE_DATA_NOT_ALLOWED_ERROR_MESSAGE =
"Sample submission cannot be deleted because associated genotype data exists";

private final boolean brapiSubmissionEnabled;
private final SampleSubmissionService sampleSubmissionService;
private final ProgramService programService;
Expand Down Expand Up @@ -303,20 +308,20 @@ public HttpResponse deleteSubmissionById(@PathVariable UUID programId, @PathVari
return HttpResponse.notFound();
}

// sample status validation
Optional<SampleSubmission> submissionOpt = sampleSubmissionService.getSampleSubmission(program.get(), submissionId, false);

if(submissionOpt.isEmpty()) {
return HttpResponse.notFound();
}
SampleSubmission submission = submissionOpt.get();
if (!submission.isDeletable()) {
return HttpResponse.notAllowed();
SampleSubmissionService.DeleteResult result = sampleSubmissionService.deleteSampleSubmission(program.get(), submissionId);
switch (result) {
case NOT_FOUND:
return HttpResponse.notFound();
case STATUS_NOT_ALLOWED:
return HttpResponse.notAllowed()
.body(DELETE_STATUS_NOT_ALLOWED_ERROR_MESSAGE);
case GENOTYPE_DATA_NOT_ALLOWED:
return HttpResponse.notAllowed()
.body(DELETE_GENOTYPE_DATA_NOT_ALLOWED_ERROR_MESSAGE);
case DELETED:
default:
return HttpResponse.ok();
}

sampleSubmissionService.deleteSampleSubmission(program.get(), submissionId);

return HttpResponse.ok();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ public HttpResponse<Response<GermplasmGenotype>> getGermplasmGenotype(@PathVaria

try {
BrAPIGermplasm germplasm = germplasmDAO.getGermplasmByUUID(germplasmId, programId);
GermplasmGenotype germplasmGenotype = genoService.retrieveGenotypeData(programId, germplasm);

GermplasmGenotype germplasmGenotype = genoService.retrieveGenotypeData(programId, UUID.fromString(germplasmId));

Response<GermplasmGenotype> response = new Response(germplasmGenotype);
return HttpResponse.ok(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ private Map<String,BrAPIGermplasm> processGermplasmForDisplay(List<BrAPIGermplas
germplasm.setAdditionalInfo(additionalInfo);
}

// TODO: BI-1883 to cleanup this workaround for the pedigree string
String pedigree = processBreedbasePedigree(germplasm.getPedigree());
String pedigree = germplasm.getPedigree();
additionalInfo.addProperty(BrAPIAdditionalInfoFields.GERMPLASM_RAW_PEDIGREE, pedigree);

String gidPedigreeString = "";
Expand Down Expand Up @@ -281,34 +280,6 @@ private Map<String,BrAPIGermplasm> processGermplasmForDisplay(List<BrAPIGermplas
return programGermplasmMap;
}

// TODO: hack for now, probably should update breedbase
// Made a JIRA card BI-1883 for this
// Breedbase will return NA/NA for no pedigree or NA/father, mother/NA
// strip NAs before saving RAW_PEDIGREE, if there was a germplasm with name NA it would be in format NA [program key]
// so that case should be ok if we just strip NA/NA, NA/, or /NA<\0>
private String processBreedbasePedigree(String pedigree) {

if (pedigree != null) {
if (pedigree.equals("NA/NA")) {
return "";
}

// Technically processGermplasmForDisplay should handle ok without stripping these NAs but will strip anyways
// for consistency.
// We only allow the /NA case for single parent as we require a female parent in the pedigree
// keep the leading slash, will be handled by processGermplasmForDisplay
if (pedigree.endsWith("/NA")) {
return pedigree.substring(0, pedigree.length()-2);
}

// shouldn't have this case in our data but just in case
if (pedigree.startsWith("NA/")) {
return pedigree.substring(2);
}
}
return pedigree;
}

public List<BrAPIGermplasm> createBrAPIGermplasm(List<BrAPIGermplasm> postBrAPIGermplasmList, UUID programId, ImportUpload upload) {
GermplasmApi api = brAPIEndpointProvider.get(programDAO.getCoreClient(programId), GermplasmApi.class);
var program = programDAO.fetchOneById(programId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class GermplasmQuery extends BrapiQuery {
private String femaleParentGID;
private String maleParentGID;
private String createdDate;
private String externalUID;
private String createdByUserName;
private String synonym;
// This is a meta-parameter, it describes the display format of any date fields.
Expand Down Expand Up @@ -56,9 +57,15 @@ public SearchRequest constructSearchRequest() {
if (!StringUtils.isBlank(getMaleParentGID())) {
filters.add(constructFilterRequest("maleParentGID", getMaleParentGID()));
}

if (!StringUtils.isBlank(getCreatedDate())) {
filters.add(constructFilterRequest("createdDate", getCreatedDate()));
}

if (!StringUtils.isBlank(getExternalUID())) {
filters.add(constructFilterRequest("externalUID", getExternalUID()));
}

if (!StringUtils.isBlank(getCreatedByUserName())) {
filters.add(constructFilterRequest("createdByUserName", getCreatedByUserName()));
}
Expand Down
Loading
Loading