feat(#971): integrate forest cover history backend with frontend - #1027
Merged
Abradat merged 24 commits intoOct 29, 2025
Conversation
Refactored ForestCoverHistoryOverviewProjection interface and related usages to rename the method getIsCurrentHistory to getIsCurrent for clarity and consistency. Updated service and test files to use the new method name.
Introduces the isOldest property to DTOs, projections, and service logic to indicate the oldest forest cover history record. Updates SQL query and unit tests to support and verify the new flag.
3 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR integrates the forest cover history backend with the frontend by updating field names and adding a new boolean flag to identify the oldest history record. The changes rename isCurrentHistory to isCurrent for consistency and introduce an isOldest field to better support frontend functionality.
- Renamed
isCurrentHistorytoisCurrentacross the codebase for improved naming consistency - Added
isOldestboolean field to identify the oldest forest cover history record - Updated corresponding tests to validate the new field behavior
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ForestCoverHistoryOverviewProjection.java | Added getIsOldest() method and renamed getIsCurrentHistory() to getIsCurrent() |
| OpeningForestCoverHistoryOverviewDto.java | Added isOldest field and renamed isCurrentHistory to isCurrent |
| OpeningForestCoverHistoryService.java | Updated service to map new field names and removed unused imports |
| SilvaOracleQueryConstants.java | Added SQL logic to determine oldest history record using MIN date comparison |
| OpeningForestCoverHistoryServiceTest.java | Updated test assertions to validate both isCurrent and isOldest fields |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Renamed SQL result columns from IS_CURRENT_HISTORY to IS_CURRENT and IS_LATEST_HISTORY to IS_OLDEST in SilvaOracleQueryConstants for improved clarity and consistency.
Introduces an optional mainSearchTerm parameter to the forest cover history endpoint, enabling advanced filtering in the SQL query and propagating the parameter through service, repository, and test layers. Updates method signatures and query logic to support the new search functionality.
The getCoverHistory method in OpeningEndpointService now accepts an optional mainSearchTerm parameter, which is included in the query parameters for the API request to filter data.
Renamed 'isCurrentHistory' to 'isCurrent' and added new 'isOldest' field to the OpeningForestCoverHistoryOverviewDto type for improved clarity and functionality.
Introduces a modal and dropdown for viewing and selecting historical forest cover data in the OpeningForestCover component. Updates queries and UI to support switching between latest and historical data, and adds related table headers and styles.
ForestCoverExpandedRow now accepts isHistory and archiveDate props to fetch historical forest cover details when needed. OpeningForestCover passes these props based on whether the row is showing the latest history, enabling display of archived forest cover data.
Relocated the renderModalCellContant function further down in the OpeningForestCover component for improved code organization. No changes to logic or functionality.
Eliminated the itemToElement prop from the forest cover action dropdown as it was not being used, simplifying the component's code.
Introduces the isMidnight function in DateUtils to check if a timestamp is at midnight. Updates OpeningForestCover to format dates differently when the time is midnight, improving clarity in date displays.
Changed the default format in formatDateTime to include seconds (dd/MM/yyyy (hh:mm:ss a)) for more precise time representation.
Changed the date format for eventTimestamp from 'dd/MM/yyyy' to 'yyyy-MM-dd' to standardize date representation in OpeningStandardUnits component.
…tests Introduces new Locator properties for the forest cover history modal link, modal, and action dropdown in the OpeningDetailsPage class to support future e2e tests involving these UI elements.
Abradat
marked this pull request as ready for review
September 18, 2025 19:15
Abradat
requested review from
carolinemwood,
craigyu and
paulushcgcj
as code owners
September 18, 2025 19:15
Adds a check in getOpeningForestCoverHistoryOverviewList to throw NotFoundGenericException when the returned list is empty, ensuring that callers are notified when no data is found for the given opening ID.
Introduces comprehensive integration tests for the new forest cover history and overview endpoints in OpeningEndpointIntegrationTest. Tests cover empty and non-empty responses, filtering, missing parameters, and details retrieval, ensuring correct status codes and response structures.
…y endpoints Introduced NotFoundGenericException to forest cover history endpoint methods and added JavaDoc comments for improved clarity and error handling. This enhances API documentation and ensures proper exception propagation for not found scenarios.
Added tests to verify the Opening SSU history list and details endpoints for opening 1480130, including assertions for expected JSON structure and values. These tests ensure correct API responses for both the history list and detailed history retrieval.
…ponses Changed integration tests to use 'application/problem+json' as the expected content type for 404 Not Found and 400 Bad Request responses, aligning with API error response standards.
Added sorting to the list of OpeningForestCoverHistoryDto objects by coverId in the OpeningForestCoverHistoryService to ensure consistent ordering of results.
Updated OpeningEndpointIntegrationTest to assert detailed Problem Details JSON fields (type, title, status, detail, instance) for 404 and 400 error responses, improving test coverage and accuracy of API error handling.
Changed the expected 'update date' in the error message assertion from 2004-11-29 to 2020-01-01 in OpeningEndpointIntegrationTest to match updated test data.
craigyu
approved these changes
Oct 29, 2025
Abradat
deleted the
feat/971-develop-and-integrate-forest-cover-history
branch
October 29, 2025 16:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements:
Fixes #971
Type of change
How Has This Been Tested?
Checklist
Further comments
Thanks for the PR!
Deployments, as required, will be available below:
Please create PRs in draft mode. Mark as ready to enable:
After merge, new images are deployed in:
Thanks for the PR!
Deployments, as required, will be available below:
Please create PRs in draft mode. Mark as ready to enable:
After merge, new images are deployed in:
Thanks for the PR!
Deployments, as required, will be available below:
Please create PRs in draft mode. Mark as ready to enable:
After merge, new images are deployed in: