Skip to content

Commit

Permalink
feat: fix merge package lock and failing submitted filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Campos committed Aug 23, 2024
1 parent b1854b9 commit 0fa2a77
Show file tree
Hide file tree
Showing 3 changed files with 4,639 additions and 7,394 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ public PaginatedResult<OpeningSearchResponseDto> openingSearch(
name = "submittedToFrpa",
in = ParameterIn.QUERY,
description = "Submitted to FRPA Section 108, true or false.",
required = false,
example = "submittedToFrpa")
required = false)
Boolean submittedToFrpa,
@RequestParam(value = "disturbanceDateStart", required = false)
@Parameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,11 @@ private List<OpeningSearchResponseDto> buildResultListDto(List<?> result) {

if (row.length > 17) {
BigDecimal silvaReliefAppId = getValue(BigDecimal.class, row[17], "submittedToFrpa108");
searchOpeningDto.setSubmittedToFrpa(silvaReliefAppId.compareTo(BigDecimal.ZERO) > 0);
searchOpeningDto.setSilvaReliefAppId(silvaReliefAppId.longValue());
boolean submittedApp = silvaReliefAppId.compareTo(BigDecimal.ZERO) > 0;
searchOpeningDto.setSubmittedToFrpa(submittedApp);
if (submittedApp) {
searchOpeningDto.setSilvaReliefAppId(silvaReliefAppId.longValue());
}
}

// fetch from forestClient API
Expand Down Expand Up @@ -370,8 +373,16 @@ private String createNativeSqlQuery(OpeningSearchFiltersDto filtersDto) {
}
// 5. Submitted to FRPA
if (filtersDto.hasValue(OpeningSearchFiltersDto.SUBMITTED_TO_FRPA)) {
log.info("Filter submitted to FRPA detected! submitted={}", filtersDto.getSubmittedToFrpa());
builder.append("AND sra.SILV_RELIEF_APPLICATION_ID IS NOT NULL ");
Boolean value = filtersDto.getSubmittedToFrpa();
if (Boolean.FALSE.equals(value)) {
log.info(
"Filter submitted to FRPA detected! submitted={}", filtersDto.getSubmittedToFrpa());
builder.append("AND sra.SILV_RELIEF_APPLICATION_ID IS NULL ");
} else {
log.info(
"Filter submitted to FRPA detected! submitted={}", filtersDto.getSubmittedToFrpa());
builder.append("AND sra.SILV_RELIEF_APPLICATION_ID IS NOT NULL ");
}
}
// 6. Disturbance start date
if (filtersDto.hasValue(OpeningSearchFiltersDto.DISTURBANCE_DATE_START)) {
Expand Down
Loading

0 comments on commit 0fa2a77

Please sign in to comment.