Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix redigering av vurdering 9013 (utvidet rett) kronisk sykt barn #5415

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ const formatereLosAksjonspunktObjektForKroniskSyk = (
fraDato: string,
vilkar: Vilkar,
avslagsårsakKode: string,
soknad: UtvidetRettSoknad,
) => {
const angittBarn = soknad.angittePersoner.find(person => person.rolle === 'BARN');
const barnetsFodselsdato = new Date(angittBarn.fødselsdato);
const åretBarnetFyller18 = `${barnetsFodselsdato.getFullYear() + 18}-12-31`;

const losAksjonspunktObjekt = {
kode: aksjonspunktKode,
begrunnelse,
Expand All @@ -36,9 +41,9 @@ const formatereLosAksjonspunktObjektForKroniskSyk = (
periode: {
fom: fraDato,
tom:
typeof vilkar.perioder[0]?.periode.tom !== 'undefined' && vilkar.perioder[0]?.periode.tom !== null
typeof vilkar.perioder[0]?.periode.tom && vilkar.perioder[0]?.periode.tom !== '9999-12-31'
? vilkar.perioder[0]?.periode.tom
: '',
: åretBarnetFyller18,
},
};

Expand Down Expand Up @@ -98,6 +103,7 @@ const KroniskSykObjektTilMikrofrontend = ({
fraDato || soknad.soknadsdato,
vilkar,
avslagsårsakKode,
soknad,
),
]);
},
Expand Down
Loading