-
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.
Legger til automatisering av gradering hvor uttaksprosenten er større…
… enn mors stillingsprosent
- Loading branch information
1 parent
d68dd54
commit a850198
Showing
9 changed files
with
77 additions
and
45 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
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.