feat(#972): develop and integrate standard unit history frontend with backend - #1012
Merged
craigyu merged 23 commits intoSep 12, 2025
Conversation
Renamed DTOs, projections, and service methods from 'OpeningStandardUnitHistory' to 'OpeningStockingHistoryWithComparison' to better reflect their purpose. Updated query constants, repository methods, endpoint signatures, and tests to use the new naming. This improves clarity and prepares for enhanced comparison features in stocking history retrieval.
…ties Updated method names in OpeningRepository and related service and test classes to clarify that returned history details include comparison data. This improves code readability and consistency.
Introduced three new SQL query constants to fetch stocking standard unit, species, and layer data from archive tables. These queries support retrieval of historical stocking standard information for a given opening and event history.
Implemented new stocking standard history DTOs to be compatible with non history stocking DTOs. This would streamline the frontend implementation.
Introduces three new repository methods to fetch stocking history details, species, and layer archives by opening and event history IDs. This supports retrieval of archived stocking history data for openings.
Introduced getOpeningStockingHistoryDetails to OpeningDetailsService and implemented getOpeningStockingHistoryList in OpeningStandardUnitHistoryService to fetch detailed stocking history, including layers, species, and comments. Updated constructor and test setup to include SilvicultureCommentRepository dependency.
Renamed 'historyId' to 'eventHistoryId' in the SSU history details endpoint and updated the return type from OpeningStockingHistoryWithComparisonDto to OpeningStockingHistoryDto. The service method called was also changed to getOpeningStockingHistoryDetails for consistency with the new DTO.
3 tasks
…-history-frontend-with-backend
…iew DTO Introduces isLatest and isOldest boolean fields to OpeningStockingHistoryOverviewDto to indicate the newest and oldest history records. Updates OpeningStandardUnitHistoryService to set these flags based on event timestamps and adds corresponding test assertions.
Replaces OpeningStandardUnitHistory* models and references with OpeningStockingHistory* equivalents throughout the OpenApi service. Updates type imports, endpoint parameters, and model definitions to reflect the new naming and structure. Also fixes type definitions for averageHeight fields.
Modified the LEFT JOIN between STOCKING_LAYER_ARCHIVE and STOCKING_LAYER_SPECIES_ARCHIVE to include STOCKING_EVENT_HISTORY_ID in the join condition to prevent duplicate species values.
Introduces a new formatDateTime function to format ISO date strings using a customizable format. Returns '--' for invalid or empty input.
Introduces a modal to view standard units history overview, adds dropdown to select historical stocking data, and updates components and styles to support displaying historical and latest standard unit data. Refactors logic to handle both current and historical stocking units and improves UI for history selection.
Introduces a comprehensive unit test to verify that getOpeningStockingHistoryList returns the correct stocking history list, including details, layers, species, and comments. This improves test coverage and ensures the method's correctness.
Replaces the use of codeDescriptionToDisplayText with direct access to the auditAction description, ensuring the correct text is shown or a placeholder if missing.
Remove opening-standard-units-history-modal-content class which has never been used
Introduces data-testid attributes to key elements in the OpeningStandardUnits history modal and related components to improve testability. Updates the e2e page object to reference these new test IDs for more robust automated testing.
Abradat
marked this pull request as ready for review
September 9, 2025 23:17
Abradat
requested review from
carolinemwood,
craigyu and
paulushcgcj
as code owners
September 9, 2025 23:17
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a new stocking standard unit history frontend and backend system based on updated design requirements. The implementation provides comprehensive history functionality for opening stocking standards with UI components for viewing historical data and comparison features.
- Frontend components for displaying stocking standard unit history with dropdown selection and modal overview
- Backend services for retrieving historical stocking data with comparison capabilities
- Updated API models and endpoints to support the new history features
Reviewed Changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/utils/DateUtils.ts | Adds datetime formatting utility function |
| frontend/src/services/OpenApi/services/OpeningEndpointService.ts | Updates service method signatures for new history endpoints |
| frontend/src/services/OpenApi/models/* | Refactors model names from "StandardUnit" to "Stocking" pattern and adds new history DTOs |
| frontend/src/components/OpeningDetails/OpeningStandardUnits/index.tsx | Implements history dropdown, modal overview, and historical data display |
| backend/src/main/java/ca/bc/gov/restapi/results/oracle/service/opening/history/OpeningStandardUnitHistoryService.java | Adds new service methods for retrieving stocking history with comparison features |
| backend/src/main/java/ca/bc/gov/restapi/results/oracle/endpoint/OpeningEndpoint.java | Updates endpoint parameter names and return types |
| backend/src/main/java/ca/bc/gov/restapi/results/oracle/dto/opening/history/* | Creates new DTOs for stocking history data structures |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…ojection Renamed OpeningStockingHistoryLayerSpeciesWithComaprisonProjection to OpeningStockingHistoryLayerSpeciesWithComparisonProjection across entity, repository, service, and test files to correct spelling and ensure consistency.
…-history-frontend-with-backend
…-history-frontend-with-backend
…-history-frontend-with-backend
craigyu
enabled auto-merge (squash)
September 12, 2025 16:59
craigyu
deleted the
feat/972-develop-and-integrate-standard-unit-history-frontend-with-backend
branch
September 12, 2025 17:12
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 #972
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: