Bug/ulitp 5394#240
Open
grahammcvea-defra wants to merge 13 commits into
Open
Conversation
Refactored representative holding selection to prioritize SAM Holdings over Common Land using a new SelectRepresentativeHolding method. Updated EnrichWithCommonLandDataAsync to merge LocalAuthorityName and deduplicate AssociatedMainHoldings across all silver holdings. Adjusted FindAndUpdateMainSiteIfExists to use CPH string. Updated SamHoldingMapper to use new selection logic. Added unit tests for merging and selection behavior. Enhanced FakeDataBridgeClient test data for completeness.
Refactored site data assignment into ApplySiteData to reduce duplication in SamHoldingMapper. Updated site creation and update methods to use this helper. Added a unit test to ensure active Common Land holdings are correctly selected as representative.
Removed the unused SiteDocument? capturedFilter variable from SamHoldingImportGoldMappingStepTests to clean up the test code. No functional changes were made.
Applied .Distinct() to ProductionUsageCodeList to remove duplicate production usage codes after trimming, ensuring only unique codes are included in the mapped result.
Refactored SAM holding mapping by introducing ResolveLocationPartsAsync to handle address and communication extraction as a tuple. Replaced duplicate logic in creation and update flows, and cached IsPermanentLandHolding() result for clarity and efficiency.
Refactored SelectRepresentativeHolding from SamHoldingImportGoldMappingStep to SamHoldingMapper as an internal method. Updated references to use the new location. No changes to method logic.
SamCommonLandMapper.ToSilver is now async and supports country resolution for enriched address data. Address mapping uses resolved country identifiers and codes. SamHoldingMapper gains SelectAddressSource to prioritize common land addresses when mapping to gold. Site creation and update logic now use the prioritized address source. Unit tests updated and expanded for new async and address selection logic.
Add Common Land scenario and expected output to SAM-to-Gold mapping. Improve handling of site type code fallback, null CphTypeIdentifier, and null search codes in CountryData. Update tests to verify Common Land mapping and set HoldingType to null.
|
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.



Support mapping and testing of Common Land holdings
Add Common Land scenario and expected output to SAM-to-Gold mapping. Improve handling of site type code fallback, null CphTypeIdentifier, and null search codes in CountryData. Update tests to verify Common Land mapping and set HoldingType to null.