-
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.
Nye enum-verdier og objekter til bruk ifbm Bisys grunnlagskonvertering (
#134)
- Loading branch information
1 parent
26a8c66
commit 14d52b7
Showing
7 changed files
with
60 additions
and
3 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
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
22 changes: 22 additions & 0 deletions
22
bidrag-domene/src/main/kotlin/no/nav/bidrag/domene/enums/person/Unntakskode.kt
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,22 @@ | ||
package no.nav.bidrag.domene.enums.person | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
@Schema(enumAsRef = true) | ||
enum class Unntakskode(val legacyKode: String) { | ||
ENSLIG_ADOPTANT("EAD"), | ||
EN_FORELDRE_DØD("EFD"), | ||
FARSKAP_IKKE_FASTSLÅTT("FIF"), | ||
HJEMMEL_SATT_MANUELT("MAN"), | ||
; | ||
|
||
companion object { | ||
fun fraLegacyKode(legacyKode: String): Unntakskode? { | ||
return try { | ||
enumValues<Unntakskode>().find { it.legacyKode == legacyKode } ?: Unntakskode.valueOf(legacyKode) | ||
} catch (e: Exception) { | ||
null | ||
} | ||
} | ||
} | ||
} |
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
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
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
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