Skip to content

Commit

Permalink
Revert "feat: user recent openings backend (#451)"
Browse files Browse the repository at this point in the history
This reverts commit 78336c9.
  • Loading branch information
DerekRoberts authored Nov 19, 2024
1 parent 5f3a165 commit 5a36da5
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 416 deletions.
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

0 comments on commit 5a36da5

Please sign in to comment.