-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fjerner avhengighet til k9-sak kodeverk og kopierer over relevant kod…
…everk for å unngå å eksponere k9-intern kodeverk. Det kan også føre til sirkulære avhengigheter.
- Loading branch information
Showing
7 changed files
with
78 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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
41 changes: 0 additions & 41 deletions
41
innsyn/src/main/java/no/nav/k9/innsyn/TempObjectMapperKodeverdi.java
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package no.nav.k9.innsyn.sak; | ||
|
||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Pattern; | ||
import jakarta.validation.constraints.Size; | ||
|
||
public record AktørId( | ||
@JsonValue | ||
@NotNull | ||
@Size(max = 20) | ||
@Pattern(regexp = "^\\d+$", message = "AktørId [${validatedValue}] matcher ikke tillatt pattern [{regexp}]") | ||
String id | ||
) {} |
This file contains 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
44 changes: 44 additions & 0 deletions
44
innsyn/src/main/java/no/nav/k9/innsyn/sak/FagsakYtelseType.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package no.nav.k9.innsyn.sak; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
public enum FagsakYtelseType { | ||
|
||
PLEIEPENGER_SYKT_BARN("PSB", "Pleiepenger sykt barn"), | ||
PLEIEPENGER_NÆRSTÅENDE("PPN", "Pleiepenger livets sluttfase"), | ||
OMSORGSPENGER_KS("OMP_KS", "Ekstra omsorgsdager kronisk syk"), | ||
OMSORGSPENGER_MA("OMP_MA", "Ekstra omsorgsdager midlertidig alene"), | ||
OMSORGSPENGER_AO("OMP_AO", "Alene om omsorgen"), | ||
OPPLÆRINGSPENGER("OLP", "Opplæringspenger"); | ||
|
||
|
||
|
||
@JsonValue | ||
private final String kode; | ||
private final String navn; | ||
|
||
|
||
FagsakYtelseType(String kode, String navn) { | ||
this.kode = kode; | ||
this.navn = navn; | ||
} | ||
|
||
|
||
public String getKode() { | ||
return kode; | ||
} | ||
public String getNavn() { | ||
return navn; | ||
} | ||
|
||
public static FagsakYtelseType fraKode(String kode) { | ||
for (var v : values()) { | ||
if (v.kode.equals(kode)) { | ||
return v; | ||
} | ||
} | ||
throw new IllegalArgumentException("Ukjent FagsakYtelseType: " + kode); | ||
} | ||
} | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package no.nav.k9.innsyn.sak; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Pattern; | ||
|
||
public record Saksnummer( | ||
@JsonValue | ||
@NotNull | ||
@Pattern(regexp = "^\\p{Alnum}+$", message = "Saksnummer [${validatedValue}] matcher ikke tillatt pattern [{regexp}]") | ||
String verdi | ||
) {} |
This file contains 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