Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refaktorert Kommuner2024 #3460

Merged
merged 4 commits into from
Apr 10, 2024
Merged

Refaktorert Kommuner2024 #3460

merged 4 commits into from
Apr 10, 2024

Conversation

krharum
Copy link
Contributor

@krharum krharum commented Apr 5, 2024

The logic for filtering "kommune" codes based on the year 2024 has been shifted to the KodeverkConsumer class from the Kodeverk controller class. A utility function filterKommuner2024 has also been updated to work with KodeverkBetydningerResponse type instead of KodeverkDTO and KodeverkAdjustedDTO. This change improves the structure and organization of the code.

The logic for filtering "kommune" codes based on the year 2024 has been shifted to the KodeverkConsumer class from the Kodeverk controller class. A utility function filterKommuner2024 has also been updated to work with KodeverkBetydningerResponse type instead of KodeverkDTO and KodeverkAdjustedDTO. This change improves the structure and organization of the code.
@krharum krharum requested a review from a team as a code owner April 5, 2024 14:24
krharum added 3 commits April 5, 2024 16:48
#deploy-kodeverk-service

A new utility class, FilterUtility, has been added to handle the filtering logic previously handled by KommunerUtility and KodeverkConsumer. It includes methods for handling "Kommuner2024" filter and returning filtered KodeverkBetydningerResponse. This refactoring improves code structure and readability.
…loy-frontend #deploy-test-frontend

Updated the 'kommunenummer' in DollySelect component to use the new 'Kommunenummer2024' from the AdresseKodeverk. This ensures the component's addressing conforms to 2024 municipality numbers while continuing to maintain functionality and adaptability.
Updated the reference to 'kommunenummer' in Foedsel and Adresser form components to use the newer 'Kommunenummer2024' from the AdresseKodeverk. This change ensures these components adhere to the updated municipality numbers for 2024.
Copy link
Contributor

@stigus stigus left a comment

Choose a reason for hiding this comment

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

Ser flott ut 😄


public static String hentKodeverk(String kodeverk) {

if (KOMMUNER2024.equals(kodeverk)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Denne kan byttes med onelineren return KOMMUNER2024.equals(kodeverk) ? KOMMUNER : kodeverk; 🤓

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ja det kan den, og hele oneliner-en kunne ha vært lagt til i Konsumer, 😃
men hele poenget med FilterUtility var å introdusere en generisk måte å håndtere endringer og tillegg på, det ble ekstra tydelig, synes jeg, med den eksplisitte koden: her ber den om å få inn en endring til ... 😸


public static KodeverkBetydningerResponse filterKodeverk(String kodeverk, KodeverkBetydningerResponse response) {

if (KOMMUNER2024.equals(kodeverk)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Samme her: return KOMMUNER2024.equals(kodeverk) ? KommunerUtility.filterKommuner2024(response) : response;

@krharum krharum merged commit 41f0832 into master Apr 10, 2024
10 checks passed
@krharum krharum deleted the feature/refaktorere-Kommuner2024 branch April 10, 2024 08:35
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.

2 participants