Skip to content

Commit

Permalink
Refactor Enums in skattekortservice DTOs
Browse files Browse the repository at this point in the history
#deploy-skattekort-service

Enums in skattekortservice data transfer objects have been refactored using Lombok library. Added @Getter and @requiredargsconstructor annotations to simplify the code and enhance readability. The inbuilt Lombok functionalities are now eliminating the need for manually defining constructors and getter methods for the value field.
  • Loading branch information
krharum committed Jun 12, 2024
1 parent 8ca907c commit f1ffc79
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
package no.nav.testnav.libs.dto.skattekortservice.v1;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum Resultatstatus {

IKKE_SKATTEKORT("ikkeSkattekort"),
VURDER_ARBEIDSTILLATELSE("vurderArbeidstillatelse"),
IKKE_TREKKPLIKT("ikkeTrekkplikt"),
Expand All @@ -10,12 +16,4 @@ public enum Resultatstatus {
UTGAATT_DNUMMER_SKATTEKORT_FOR_FOEDSELSNUMMER_ER_LEVERT("utgaattDnummerSkattekortForFoedselsnummerErLevert");

private final String value;

Resultatstatus(String v) {
this.value = v;
}

public String value() {
return this.value;
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package no.nav.testnav.libs.dto.skattekortservice.v1;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum Tabelltype {

TREKKTABELL_FOR_PENSJON("trekktabellForPensjon"),
TREKKTABELL_FOR_LOENN("trekktabellForLoenn");
private final String value;

Tabelltype(String v) {
value = v;
}

public String value() {
return value;
}
private final String value;
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package no.nav.testnav.libs.dto.skattekortservice.v1;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum Tilleggsopplysning {

OPPHOLD_PAA_SVALBARD("oppholdPaaSvalbard"),
KILDESKATTPENSJONIST("kildeskattpensjonist"),
OPPHOLD_I_TILTAKSSONE("oppholdITiltakssone"),
KILDESKATT_PAA_LOENN("kildeskattPaaLoenn");
private final String value;

Tilleggsopplysning(String v) {
value = v;
}

public String value() {
return value;
}
private final String value;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
package no.nav.testnav.libs.dto.skattekortservice.v1;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum Trekkode {

LOENN_FRA_HOVEDARBEIDSGIVER("loennFraHovedarbeidsgiver"),
LOENN_FRA_BIARBEIDSGIVER("loennFraBiarbeidsgiver"),
LOENN_FRA_NAV("loennFraNAV"),
Expand All @@ -14,13 +20,5 @@ public enum Trekkode {
INTRODUKSJONSSTOENAD("introduksjonsstoenad");

private final String value;

Trekkode(String v) {
this.value = v;
}

public String value() {
return this.value;
}
}

0 comments on commit f1ffc79

Please sign in to comment.