-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TB-71 Legg til mulighet for å legge ved hvem som er eier på en egenre…
…gistrering (#107) * TB-71 WIP * add Eier/RegistrertAv from registrering all the way to bygning out, wip * more consistent test naming * simplify registrant on egenregistrering in/out, fix bruksenhetregistreringer to also have metadata * don't use single line return this for ease of reading * use norwegian commons fodselsnummer validator instead of our own * fix formatting * create sealed class for registreringsaktoer for allowing registrertAv to be both a fødselsnummer and signature from matrikkelen * formatting and member import for readability * do not allow nullability for registrertAv response, it is never null --------- Co-authored-by: Henrik Wingerei <henrik.wingerei@kartverket.no>
- Loading branch information
1 parent
644044a
commit d7bd1c5
Showing
20 changed files
with
223 additions
and
96 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
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
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
19 changes: 19 additions & 0 deletions
19
src/main/kotlin/no/kartverket/matrikkel/bygning/models/RegistreringAktoer.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,19 @@ | ||
package no.kartverket.matrikkel.bygning.models | ||
|
||
import no.bekk.bekkopen.person.FodselsnummerValidator | ||
|
||
sealed class RegistreringAktoer { | ||
abstract val value: String | ||
|
||
data class Foedselsnummer(override val value: String) : RegistreringAktoer() { | ||
init { | ||
if (!FodselsnummerValidator.isValid(value)) { | ||
throw IllegalArgumentException("Fødselsnummer er ikke gyldig") | ||
} | ||
} | ||
|
||
fun getMaskedValue(): String = value.replace(Regex("\\d"), "*") | ||
} | ||
|
||
data class Signatur(override val value: String) : RegistreringAktoer() | ||
} |
Oops, something went wrong.