Skip to content

feat(#971): integrate forest cover history backend with frontend - #1027

Merged
Abradat merged 24 commits into
mainfrom
feat/971-develop-and-integrate-forest-cover-history
Oct 29, 2025
Merged

feat(#971): integrate forest cover history backend with frontend#1027
Abradat merged 24 commits into
mainfrom
feat/971-develop-and-integrate-forest-cover-history

Conversation

@Abradat

@Abradat Abradat commented Sep 16, 2025

Copy link
Copy Markdown
Collaborator

Description

This PR implements:

  • New forest cover history backend functionalities based on new design requirements
  • Implement frontend components for forest cover history
  • Integrate backend with frontend

Fixes #971

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Documentation update

How Has This Been Tested?

  • New unit tests
  • New integrated tests
  • New component tests
  • New end-to-end tests
  • New user flow tests
  • No new tests are required
  • Manual tests (description below)
  • Updated existing tests

Checklist

  • I have read the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have already been accepted and merged

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:

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.
@Abradat Abradat linked an issue Sep 16, 2025 that may be closed by this pull request
3 tasks
@craigyu
craigyu requested a review from Copilot September 16, 2025 22:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 isCurrentHistory to isCurrent across the codebase for improved naming consistency
  • Added isOldest boolean 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
Abradat marked this pull request as ready for review 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.
@Abradat
Abradat merged commit 6295392 into main Oct 29, 2025
25 of 26 checks passed
@Abradat
Abradat deleted the feat/971-develop-and-integrate-forest-cover-history branch October 29, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DEV TASK]: Develop and Integrate Forest Cover History Frontend with Backend

3 participants