[DEV-3834] Refactor case-histories API layer#2181
Open
Sebastiano-Bertolin wants to merge 9 commits intoDEV-3764-refactor-api-layer-for-product-apifrom
Open
[DEV-3834] Refactor case-histories API layer#2181Sebastiano-Bertolin wants to merge 9 commits intoDEV-3764-refactor-api-layer-for-product-apifrom
Sebastiano-Bertolin wants to merge 9 commits intoDEV-3764-refactor-api-layer-for-product-apifrom
Conversation
…834-refactor-api-layer-for-case-histories
- Updated import paths for apiDataList and apiDataListPages factories in tests to point to the new shared directory. - Created new test file for caseHistories with appropriate mappings and tests. - Added fetcher and mapper for caseHistories, including handling of various data scenarios. - Introduced shared media factory for consistent media object creation across tests. - Refactored existing tests to utilize the new shared media factory.
…ry for improved structure and maintainability
🦋 Changeset detectedLatest commit: be790b3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…834-refactor-api-layer-for-case-histories
Contributor
Jira Pull Request LinkThis Pull Request refers to the following Jira issue DEV-3834 |
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.
This pull request refactors the handling of case histories and SOAP API content URLs, aiming to improve code organization, modularity, and maintainability. The most significant changes are the migration of case histories logic to a new repository pattern, the extraction of SOAP API content URL logic into a dedicated helper, and the consolidation of shared test factories. These updates modernise the codebase and streamline data access patterns.
List of Changes
Case Histories Refactor:
CaseHistoriesRepositoryinapps/nextjs-website/src/lib/caseHistories/index.tsto encapsulate fetching and mapping logic for case histories, replacing the previous scattered approach.apps/nextjs-website/src/lib/caseHistories/fetcher.tsandapps/nextjs-website/src/lib/caseHistories/mapper.ts, respectively, and updated their interfaces for clarity and consistency. [1] [2] [3]apps/nextjs-website/src/lib/caseHistories/__tests__/mapper.tests.ts.apps/nextjs-website/src/lib/caseHistories/types.ts.SOAP API Content URL Handling:
getApiSoapContentUrlsinapps/nextjs-website/src/lib/apiDataList/helpers.ts, replacing the previous implementation and updating imports accordingly. [1] [2]Shared Test Factories Consolidation:
apps/nextjs-website/src/lib/shared/factories/mediaandapps/nextjs-website/src/lib/shared/factories/apiDataList, updating imports throughout the codebase for consistency. [1] [2] [3] [4] [5]API Usage Updates:
apps/nextjs-website/src/app/sitemap.tsandapps/nextjs-website/src/lib/api.ts. [1] [2] [3] [4] [5]apps/nextjs-website/src/lib/cmsApi.ts. [1] [2]Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: