-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avslår periode for søker dersom det allerede er oppfylt for annen ple…
…ietrengende med høyere prio (#1013) * Løsning for søskensaker * Lagrer ned nytt felt * Fikser db-skript * Riktig håndtering av gradering mot eget tilsyn og nye avslagsårsaker * Legger til knekkpunktutledning for perioder fra eget uttak fra annen pleietrengende * Fjerner mulighet for samtidig uttak ved søskensaker og erstater med enten innvilget eller avslag * Test for regel * Fjernet logikk som ikkje lenger var i bruk * Resetter variabler
- Loading branch information
Showing
25 changed files
with
370 additions
and
60 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
40 changes: 40 additions & 0 deletions
40
...kotlin/no/nav/pleiepengerbarn/uttak/regler/delregler/TilsynForAndrePleietrengendeRegel.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,40 @@ | ||
package no.nav.pleiepengerbarn.uttak.regler.delregler | ||
|
||
import no.nav.pleiepengerbarn.uttak.kontrakter.LukketPeriode | ||
import no.nav.pleiepengerbarn.uttak.kontrakter.Årsak | ||
import no.nav.pleiepengerbarn.uttak.regler.UttaksplanMedBehandlingUuid | ||
import no.nav.pleiepengerbarn.uttak.regler.domene.RegelGrunnlag | ||
import no.nav.pleiepengerbarn.uttak.regler.kontrakter_ext.overlapperHelt | ||
|
||
internal class TilsynForAndrePleietrengendeRegel : PeriodeRegel { | ||
|
||
override fun kjør(periode: LukketPeriode, grunnlag: RegelGrunnlag): Regelutfall { | ||
if (grunnlag.finnesOppfyltPlanMedHøyerePrioritet(periode)) | ||
return IkkeOppfylt(årsaker = setOf(Årsak.ANNEN_PLEIETRENGENDE_MED_HØYERE_PRIO)) | ||
return TilBeregningAvGrad() | ||
} | ||
|
||
private fun RegelGrunnlag.finnesOppfyltPlanMedHøyerePrioritet(periode: LukketPeriode): Boolean { | ||
val kravprioritetPeriode = kravprioritetForEgneBehandlinger.keys.firstOrNull { it.overlapperHelt(periode) } | ||
?: return false | ||
|
||
val kravprioritetListe = kravprioritetForEgneBehandlinger[kravprioritetPeriode] ?: return false | ||
|
||
for (behandlingMedKrav in kravprioritetListe) { | ||
if (behandlingMedKrav == this.behandlingUUID) { | ||
return false | ||
} | ||
val uttaksplanMedKrav = egneUttaksplanerAllePleietrengendePerBehandling[behandlingMedKrav] | ||
if (uttaksplanMedKrav != null) { | ||
val erOppfylt = uttaksplanMedKrav.perioder.entries.any({ | ||
it.key.overlapperHelt(kravprioritetPeriode) && it.value.årsaker.all({ it.oppfylt }) | ||
}) | ||
if (erOppfylt) { | ||
return true | ||
} | ||
} | ||
} | ||
return false | ||
} | ||
|
||
} |
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
Oops, something went wrong.