-
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.
TFP-5185: Fase 2, del 2 - Automatisering av tilfeller hvor uttakspros…
…ent ved gradering er større enn mors stillingsprosent (#364) * TFP-5185: Fase 2, del 2 - Automatisering av tilfeller hvor uttaksprosent ved gradering er større enn mors stillingsprosent * Rydder
- Loading branch information
1 parent
717991b
commit 5391faf
Showing
8 changed files
with
129 additions
and
77 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
34 changes: 34 additions & 0 deletions
34
...ode/betingelser/aktkrav/SjekkOmSøktUttaksprosentErStørreEllerLikMorsStillingsprosent.java
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,34 @@ | ||
package no.nav.foreldrepenger.regler.uttak.fastsetteperiode.betingelser.aktkrav; | ||
|
||
import java.math.BigDecimal; | ||
|
||
import no.nav.foreldrepenger.regler.uttak.fastsetteperiode.FastsettePeriodeGrunnlag; | ||
import no.nav.foreldrepenger.regler.uttak.fastsetteperiode.grunnlag.OppgittPeriode; | ||
import no.nav.fpsak.nare.doc.RuleDocumentation; | ||
import no.nav.fpsak.nare.evaluation.Evaluation; | ||
import no.nav.fpsak.nare.specification.LeafSpecification; | ||
|
||
@RuleDocumentation(SjekkOmSøktUttaksprosentErStørreEllerLikMorsStillingsprosent.ID) | ||
public class SjekkOmSøktUttaksprosentErStørreEllerLikMorsStillingsprosent extends LeafSpecification<FastsettePeriodeGrunnlag> { | ||
|
||
public static final String ID = "AKT_ARBEID_2"; | ||
public static final String BESKRIVELSE = "Er gradert uttaksprosenten større eller lik mors stillingsprosent?"; | ||
|
||
public SjekkOmSøktUttaksprosentErStørreEllerLikMorsStillingsprosent() { | ||
super(ID); | ||
} | ||
|
||
@Override | ||
public Evaluation evaluate(FastsettePeriodeGrunnlag grunnlag) { | ||
var aktuellPeriode = grunnlag.getAktuellPeriode(); | ||
if (gradertUttaksprosentStørreEllerLikMorsStillingsprosent(aktuellPeriode)) { | ||
return ja(); | ||
} | ||
return nei(); | ||
} | ||
|
||
private static boolean gradertUttaksprosentStørreEllerLikMorsStillingsprosent(OppgittPeriode aktuellPeriode) { | ||
var gradertUttaksprosent = BigDecimal.valueOf(100).subtract(aktuellPeriode.getArbeidsprosent()); | ||
return gradertUttaksprosent.compareTo(aktuellPeriode.getMorsStillingsprosent().decimalValue()) >= 0; | ||
} | ||
} |
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.