Skip to content

Commit

Permalink
u - oppdaterer med ny template for Fodselsnummer
Browse files Browse the repository at this point in the history
  • Loading branch information
MariamPervez committed Sep 14, 2023
1 parent 6d452e5 commit 42621f0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import java.time.temporal.ChronoUnit
class Fodselsnummer private constructor(@JsonValue val value: String) {
init {
require("""\d{11}""".toRegex().matches(value)) { "Ikke et gyldig fødselsnummer: $value" }
require(!fhNummer) { "Impelemntasjonen støtter ikke H-nummer og FH-nummer" }
require(!erFnr) { "Impelemntasjonen støtter ikke H-nummer og FH-nummer" }
require(gyldigeKontrollsiffer) { "Ugyldig kontrollnummer" }
}

Expand Down Expand Up @@ -61,7 +61,7 @@ class Fodselsnummer private constructor(@JsonValue val value: String) {
private val syntetiskFoedselsnummerFraSkatteetaten: Boolean
get() = value[2].toString().toInt() >= 8

private val fhNummer: Boolean
private val erFnr: Boolean
get() {
return when(value[0]) {
'8', '9' -> true
Expand Down

0 comments on commit 42621f0

Please sign in to comment.