-
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.
Merge pull request #1496 from navikt/frioppslag-skatt-med-journalføring
Frioppslag skatt med journalføring
- Loading branch information
Showing
25 changed files
with
645 additions
and
92 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
2 changes: 1 addition & 1 deletion
2
client/src/test/kotlin/no/nav/su/se/bakover/client/dokarkiv/JournalpostSkattTest.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
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
54 changes: 52 additions & 2 deletions
54
domain/src/main/kotlin/no/nav/su/se/bakover/domain/journalpost/JournalpostSkatt.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 |
---|---|---|
@@ -1,27 +1,77 @@ | ||
package no.nav.su.se.bakover.domain.journalpost | ||
|
||
import arrow.core.Either | ||
import arrow.core.getOrElse | ||
import arrow.core.left | ||
import arrow.core.right | ||
import dokument.domain.Dokument | ||
import no.nav.su.se.bakover.common.domain.Saksnummer | ||
import no.nav.su.se.bakover.common.person.Fnr | ||
import no.nav.su.se.bakover.domain.sak.SakInfo | ||
import no.nav.su.se.bakover.domain.sak.Sakstype | ||
import no.nav.su.se.bakover.domain.skatt.Skattedokument | ||
import org.jetbrains.annotations.TestOnly | ||
import java.lang.IllegalArgumentException | ||
|
||
/** | ||
* kan brukes som mal for 'Notat' poster i Joark. | ||
*/ | ||
data class JournalpostSkatt( | ||
data class JournalpostSkattForSak( | ||
override val saksnummer: Saksnummer, | ||
override val sakstype: Sakstype, | ||
override val fnr: Fnr, | ||
val dokument: Skattedokument, | ||
) : JournalpostForSakCommand { | ||
|
||
companion object { | ||
fun Skattedokument.lagJournalpost(sakInfo: SakInfo): JournalpostSkatt = JournalpostSkatt( | ||
fun Skattedokument.lagJournalpost(sakInfo: SakInfo): JournalpostSkattForSak = JournalpostSkattForSak( | ||
saksnummer = sakInfo.saksnummer, | ||
sakstype = sakInfo.type, | ||
dokument = this, | ||
fnr = sakInfo.fnr, | ||
) | ||
} | ||
} | ||
|
||
data class JournalpostSkattUtenforSak private constructor( | ||
override val fnr: Fnr, | ||
override val sakstype: Sakstype, | ||
/** | ||
* i contexten av skatt, er det mulig at fagsystemId'en er en sak vi har i systemet. Må sees sammen med sakstype. | ||
*/ | ||
override val fagsystemId: String, | ||
val dokument: Dokument.UtenMetadata, | ||
) : JournalpostUtenforSakCommand { | ||
|
||
companion object { | ||
@TestOnly | ||
fun create( | ||
fnr: Fnr, | ||
sakstype: Sakstype, | ||
fagsystemId: String, | ||
dokument: Dokument.UtenMetadata, | ||
): JournalpostSkattUtenforSak { | ||
return tryCreate(fnr, sakstype, fagsystemId, dokument).getOrElse { | ||
throw IllegalArgumentException("Valideringsfeil i JournalpostSkattUtenforSak - ") | ||
} | ||
} | ||
|
||
fun tryCreate( | ||
fnr: Fnr, | ||
sakstype: Sakstype, | ||
fagsystemId: String, | ||
dokument: Dokument.UtenMetadata, | ||
): Either<KunneIkkeLageJournalpostUtenforSak, JournalpostSkattUtenforSak> { | ||
if (fagsystemId.isBlank()) { | ||
return KunneIkkeLageJournalpostUtenforSak.FagsystemIdErTom.left() | ||
} | ||
|
||
return JournalpostSkattUtenforSak( | ||
fnr, | ||
sakstype, | ||
fagsystemId, | ||
dokument, | ||
).right() | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...main/kotlin/no/nav/su/se/bakover/domain/journalpost/KunneIkkeLageJournalpostUtenforSak.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,5 @@ | ||
package no.nav.su.se.bakover.domain.journalpost | ||
|
||
sealed interface KunneIkkeLageJournalpostUtenforSak { | ||
data object FagsystemIdErTom : KunneIkkeLageJournalpostUtenforSak | ||
} |
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
25 changes: 25 additions & 0 deletions
25
service/src/main/kotlin/no/nav/su/se/bakover/service/skatt/FrioppslagRequests.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,25 @@ | ||
package no.nav.su.se.bakover.service.skatt | ||
|
||
import no.nav.su.se.bakover.common.ident.NavIdentBruker | ||
import no.nav.su.se.bakover.common.person.Fnr | ||
import no.nav.su.se.bakover.domain.sak.Sakstype | ||
import no.nav.su.se.bakover.domain.skatt.Skattegrunnlag | ||
import java.time.Year | ||
|
||
data class FrioppslagSkattRequest( | ||
val fnr: Fnr, | ||
val epsFnr: Fnr?, | ||
val år: Year, | ||
val begrunnelse: String, | ||
val saksbehandler: NavIdentBruker.Saksbehandler, | ||
val sakstype: Sakstype, | ||
val fagsystemId: String, | ||
) | ||
|
||
data class GenererSkattPdfRequest( | ||
val skattegrunnlagSøkers: Skattegrunnlag, | ||
val skattegrunnlagEps: Skattegrunnlag?, | ||
val begrunnelse: String, | ||
val sakstype: Sakstype, | ||
val fagsystemId: String, | ||
) |
12 changes: 0 additions & 12 deletions
12
service/src/main/kotlin/no/nav/su/se/bakover/service/skatt/FrioppslagSkattRequest.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.