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

Revert "feat: user recent openings backend" #477

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public class SilvaOracleConstants {
public static final String ORG_UNIT = "orgUnit";
public static final String CATEGORY = "category";
public static final String STATUS_LIST = "statusList";
public static final String OPENING_IDS = "openingIds";
public static final String MY_OPENINGS = "myOpenings";
public static final String SUBMITTED_TO_FRPA = "submittedToFrpa";
public static final String DISTURBANCE_DATE_START = "disturbanceDateStart";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class OpeningSearchFiltersDto {

@Setter
private String requestUserId;
private List<String> openingIds;

/** Creates an instance of the search opening filter dto. */
public OpeningSearchFiltersDto(
Expand Down Expand Up @@ -69,7 +68,6 @@ public OpeningSearchFiltersDto(
.toList());
}
this.statusList = new ArrayList<>();
this.openingIds = new ArrayList<>();
if (!Objects.isNull(statusList)) {
this.statusList.addAll(statusList.stream().map(s -> String.format("'%s'", s)).toList());
}
Expand All @@ -94,28 +92,6 @@ public OpeningSearchFiltersDto(
Objects.isNull(mainSearchTerm) ? null : mainSearchTerm.toUpperCase().trim();
}

// Create a constructor with only the List<String> openingIds
public OpeningSearchFiltersDto(
List<String> openingIds) {
this.orgUnit = new ArrayList<>();
this.category = new ArrayList<>();
this.statusList = new ArrayList<>();
this.openingIds = openingIds;
this.myOpenings = null;
this.submittedToFrpa = null;
this.disturbanceDateStart = null;
this.disturbanceDateEnd = null;
this.regenDelayDateStart = null;
this.regenDelayDateEnd = null;
this.freeGrowingDateStart = null;
this.freeGrowingDateEnd = null;
this.updateDateStart = null;
this.updateDateEnd = null;
this.cuttingPermitId = null;
this.cutBlockId = null;
this.timberMark = null;
this.mainSearchTerm = null;
}
/**
* Define if a property has value.
*
Expand All @@ -127,7 +103,6 @@ public boolean hasValue(String prop) {
case SilvaOracleConstants.ORG_UNIT -> !this.orgUnit.isEmpty();
case SilvaOracleConstants.CATEGORY -> !this.category.isEmpty();
case SilvaOracleConstants.STATUS_LIST -> !this.statusList.isEmpty();
case SilvaOracleConstants.OPENING_IDS -> !this.openingIds.isEmpty();
case SilvaOracleConstants.MY_OPENINGS -> !Objects.isNull(this.myOpenings);
case SilvaOracleConstants.SUBMITTED_TO_FRPA -> !Objects.isNull(this.submittedToFrpa);
case SilvaOracleConstants.DISTURBANCE_DATE_START ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ public class OpeningSearchResponseDto {
private Boolean submittedToFrpa;
private String forestFileId;
private Long silvaReliefAppId;
private LocalDateTime lastViewDate;
}
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,6 @@ private Query setQueryParameters(OpeningSearchFiltersDto filtersDto, String nati
log.info("Setting statusList filter values");
// No need to set value since the query already dit it. Didn't work set through named param
}
// similarly for openingIds
if (filtersDto.hasValue(SilvaOracleConstants.OPENING_IDS)) {
log.info("Setting openingIds filter values");
// No need to set value since the query already dit it. Didn't work set through
// named param
}
// 4. User entry id
if (filtersDto.hasValue(SilvaOracleConstants.MY_OPENINGS)) {
log.info("Setting myOpenings filter value");
Expand Down Expand Up @@ -396,12 +390,6 @@ private String createNativeSqlQuery(OpeningSearchFiltersDto filtersDto) {
builder.append("WHERE 1=1 ");

/* Filters */
// List of openings from the openingIds of the filterDto object for the recent openings
if (filtersDto.hasValue(SilvaOracleConstants.OPENING_IDS)) {
String openingIds = String.join(",", filtersDto.getOpeningIds());
log.info("Filter for openingIds detected! openingIds={}", openingIds);
builder.append(String.format("AND o.OPENING_ID IN (%s) ", openingIds));
}
// 0. Main number filter [opening_id, opening_number, timber_mark, file_id]
// if it's a number, filter by openingId or fileId, otherwise filter by timber mark and opening
// number
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading