-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refaktorert Kommuner2024 #3460
Conversation
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.
#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.
There was a problem hiding this 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)) { |
There was a problem hiding this comment.
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;
🤓
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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;
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.