-
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.
Bestillingsvisning alderspensjon, uforetrygd, afp-offentlig
- Loading branch information
1 parent
7e03236
commit 25ecd5e
Showing
7 changed files
with
256 additions
and
7 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
61 changes: 61 additions & 0 deletions
61
...ly-frontend/src/main/js/src/components/fagsystem/afpOffentlig/bestilling/AfpOffentlig.tsx
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,61 @@ | ||
import { isEmpty } from '@/components/fagsystem/pdlf/form/partials/utils' | ||
import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary' | ||
import { BestillingData, BestillingTitle } from '@/components/bestilling/sammendrag/Bestillingsdata' | ||
import { TitleValue } from '@/components/ui/titleValue/TitleValue' | ||
import { formatDate, showLabel } from '@/utils/DataFormatter' | ||
import { DollyFieldArray } from '@/components/ui/form/fieldArray/DollyFieldArray' | ||
import React from 'react' | ||
import { showTpNavn } from '@/components/fagsystem/afpOffentlig/visning/AfpOffentligVisning' | ||
import { | ||
AfpOffentligTypes, | ||
BeloepTypes, | ||
MocksvarTypes, | ||
} from '@/components/fagsystem/afpOffentlig/afpOffentligTypes' | ||
|
||
type AfpOffentligProps = { | ||
pensjon: AfpOffentligTypes | ||
} | ||
|
||
export const AfpOffentlig = ({ pensjon }: AfpOffentligProps) => { | ||
if (!pensjon || isEmpty(pensjon)) { | ||
return null | ||
} | ||
|
||
return ( | ||
<div className="person-visning"> | ||
<ErrorBoundary> | ||
<BestillingTitle>AFP offentlig</BestillingTitle> | ||
<BestillingData> | ||
<TitleValue | ||
title="Direktekall" | ||
value={pensjon.direktekall?.map((tpId) => showTpNavn(tpId))?.join(', ')} | ||
size="xlarge" | ||
/> | ||
<DollyFieldArray header="AFP offentlig" data={pensjon?.mocksvar}> | ||
{(afpOffentlig: MocksvarTypes, idx: number) => ( | ||
<React.Fragment key={idx}> | ||
<TitleValue title="TP-ordning" value={showTpNavn(afpOffentlig.tpId)} /> | ||
<TitleValue | ||
title="Status AFP" | ||
value={showLabel('statusAfp', afpOffentlig.statusAfp)} | ||
/> | ||
<TitleValue title="Virkningsdato" value={formatDate(afpOffentlig.virkningsDato)} /> | ||
<TitleValue title="Sist benyttet G" value={afpOffentlig.sistBenyttetG} /> | ||
{afpOffentlig.belopsListe?.length > 0 && ( | ||
<DollyFieldArray header="Beløp" data={afpOffentlig.belopsListe} nested> | ||
{(belop: BeloepTypes, idy: number) => ( | ||
<React.Fragment key={idy}> | ||
<TitleValue title="F.o.m. dato" value={formatDate(belop.fomDato)} /> | ||
<TitleValue title="Beløp" value={belop.belop} /> | ||
</React.Fragment> | ||
)} | ||
</DollyFieldArray> | ||
)} | ||
</React.Fragment> | ||
)} | ||
</DollyFieldArray> | ||
</BestillingData> | ||
</ErrorBoundary> | ||
</div> | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
.../dolly-frontend/src/main/js/src/components/fagsystem/alderspensjon/AlderspensjonTypes.tsx
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,12 @@ | ||
export type AlderspensjonTypes = { | ||
kravFremsattDato: string | ||
iverksettelsesdato: string | ||
saksbehandler: string | ||
attesterer: string | ||
uttaksgrad: number | ||
navEnhetId: string | ||
relasjoner?: Array<{ | ||
sumAvForvArbKapPenInntekt: string | ||
}> | ||
soknad: boolean | ||
} |
46 changes: 46 additions & 0 deletions
46
...-frontend/src/main/js/src/components/fagsystem/alderspensjon/bestilling/Alderspensjon.tsx
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,46 @@ | ||
import { isEmpty } from '@/components/fagsystem/pdlf/form/partials/utils' | ||
import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary' | ||
import { BestillingData, BestillingTitle } from '@/components/bestilling/sammendrag/Bestillingsdata' | ||
import { TitleValue } from '@/components/ui/titleValue/TitleValue' | ||
import { formatDate } from '@/utils/DataFormatter' | ||
import React from 'react' | ||
import { AlderspensjonTypes } from '@/components/fagsystem/alderspensjon/AlderspensjonTypes' | ||
import { useNavEnheter } from '@/utils/hooks/useNorg2' | ||
|
||
type AlderspensjonProps = { | ||
pensjon?: AlderspensjonTypes | ||
} | ||
|
||
export const Alderspensjon = ({ pensjon }: AlderspensjonProps) => { | ||
const { navEnheter } = useNavEnheter() | ||
|
||
if (!pensjon || isEmpty(pensjon)) { | ||
return null | ||
} | ||
|
||
const navEnhetLabel = navEnheter?.find( | ||
(enhet) => enhet.value === pensjon.navEnhetId?.toString(), | ||
)?.label | ||
|
||
return ( | ||
<div className="person-visning"> | ||
<ErrorBoundary> | ||
<BestillingTitle> | ||
{'Alderspensjon: ' + (pensjon?.soknad ? 'Søknad' : 'Vedtak')} | ||
</BestillingTitle> | ||
<BestillingData> | ||
<TitleValue title="Krav fremsatt dato" value={formatDate(pensjon?.kravFremsattDato)} /> | ||
<TitleValue title="Iverksettelsesdato" value={formatDate(pensjon?.iverksettelsesdato)} /> | ||
<TitleValue title="Saksbehandler" value={pensjon?.saksbehandler} /> | ||
<TitleValue title="Attesterer" value={pensjon?.attesterer} /> | ||
<TitleValue title="Uttaksgrad" value={`${pensjon?.uttaksgrad}%`} /> | ||
<TitleValue title="NAV-kontor" value={navEnhetLabel || pensjon?.navEnhetId} /> | ||
<TitleValue | ||
title="Ektefelle/partners inntekt" | ||
value={pensjon?.relasjoner?.[0]?.sumAvForvArbKapPenInntekt} | ||
/> | ||
</BestillingData> | ||
</ErrorBoundary> | ||
</div> | ||
) | ||
} |
26 changes: 26 additions & 0 deletions
26
apps/dolly-frontend/src/main/js/src/components/fagsystem/uforetrygd/UforetrygdTypes.tsx
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,26 @@ | ||
export type UforetrygdTypes = { | ||
uforetidspunkt: string | ||
kravFremsattDato: string | ||
onsketVirkningsDato: string | ||
inntektForUforhet: number | ||
inntektEtterUforhet: number | ||
uforegrad: number | ||
minimumInntektForUforhetType: string | ||
saksbehandler: string | ||
attesterer: string | ||
navEnhetId: string | ||
barnetilleggDetaljer: BarnetilleggDetaljer | ||
} | ||
|
||
export type BarnetilleggDetaljer = { | ||
barnetilleggType: string | ||
forventedeInntekterSoker: Array<ForventedeInntekterSokerOgEP> | ||
forventedeInntekterEP: Array<ForventedeInntekterSokerOgEP> | ||
} | ||
|
||
export type ForventedeInntekterSokerOgEP = { | ||
datoFom: string | ||
datoTom: string | ||
inntektType: string | ||
belop: number | ||
} |
103 changes: 103 additions & 0 deletions
103
.../dolly-frontend/src/main/js/src/components/fagsystem/uforetrygd/bestilling/Uforetrygd.tsx
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,103 @@ | ||
import { useNavEnheter } from '@/utils/hooks/useNorg2' | ||
import { isEmpty } from '@/components/fagsystem/pdlf/form/partials/utils' | ||
import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary' | ||
import { BestillingData, BestillingTitle } from '@/components/bestilling/sammendrag/Bestillingsdata' | ||
import { TitleValue } from '@/components/ui/titleValue/TitleValue' | ||
import { formatDate, oversettBoolean, showLabel } from '@/utils/DataFormatter' | ||
import React from 'react' | ||
import { DollyFieldArray } from '@/components/ui/form/fieldArray/DollyFieldArray' | ||
import { | ||
ForventedeInntekterSokerOgEP, | ||
UforetrygdTypes, | ||
} from '@/components/fagsystem/uforetrygd/UforetrygdTypes' | ||
|
||
type UforetrygdProps = { | ||
pensjon: UforetrygdTypes | ||
} | ||
|
||
export const Uforetrygd = ({ pensjon }: UforetrygdProps) => { | ||
const { navEnheter } = useNavEnheter() | ||
|
||
if (!pensjon || isEmpty(pensjon)) { | ||
return null | ||
} | ||
|
||
const navEnhetLabel = navEnheter?.find( | ||
(enhet) => enhet.value === pensjon.navEnhetId?.toString(), | ||
)?.label | ||
|
||
return ( | ||
<div className="person-visning"> | ||
<ErrorBoundary> | ||
<BestillingTitle>Uføretrygd</BestillingTitle> | ||
<BestillingData> | ||
<TitleValue title="Uføretidspunkt" value={formatDate(pensjon?.uforetidspunkt)} /> | ||
<TitleValue title="Krav fremsatt dato" value={formatDate(pensjon?.kravFremsattDato)} /> | ||
<TitleValue | ||
title="Ønsket virkningsdato" | ||
value={formatDate(pensjon?.onsketVirkningsDato)} | ||
/> | ||
<TitleValue title="Inntekt før uførhet" value={pensjon?.inntektForUforhet} /> | ||
<TitleValue title="Inntekt etter uførhet" value={pensjon?.inntektEtterUforhet} /> | ||
<TitleValue | ||
title="Sats for minimum IFU" | ||
value={showLabel('minimumInntektForUforhetType', pensjon?.minimumInntektForUforhetType)} | ||
/> | ||
<TitleValue | ||
title="Uføregrad" | ||
value={pensjon?.uforegrad ? `${pensjon?.uforegrad}%` : null} | ||
/> | ||
<TitleValue title="Saksbehandler" value={pensjon?.saksbehandler} /> | ||
<TitleValue title="Attesterer" value={pensjon?.attesterer} /> | ||
<TitleValue title="NAV-kontor" value={navEnhetLabel || pensjon?.navEnhetId} /> | ||
<TitleValue | ||
title="Har barnetillegg" | ||
value={oversettBoolean(pensjon?.barnetilleggDetaljer !== null)} | ||
/> | ||
<TitleValue | ||
title="Type barnetillegg" | ||
value={showLabel('barnetilleggType', pensjon?.barnetilleggDetaljer?.barnetilleggType)} | ||
/> | ||
{pensjon?.barnetilleggDetaljer?.forventedeInntekterSoker?.length > 0 && ( | ||
<DollyFieldArray | ||
header="Forventede inntekter for søker" | ||
data={pensjon?.barnetilleggDetaljer?.forventedeInntekterSoker} | ||
nested | ||
> | ||
{(inntekt: ForventedeInntekterSokerOgEP, idx: number) => ( | ||
<React.Fragment key={idx}> | ||
<TitleValue | ||
title="Type inntekt" | ||
value={showLabel('inntektType', inntekt?.inntektType)} | ||
/> | ||
<TitleValue title="Beløp" value={inntekt?.belop} /> | ||
<TitleValue title="Dato fra" value={formatDate(inntekt?.datoFom)} /> | ||
<TitleValue title="Dato til" value={formatDate(inntekt?.datoTom)} /> | ||
</React.Fragment> | ||
)} | ||
</DollyFieldArray> | ||
)} | ||
{pensjon?.barnetilleggDetaljer?.forventedeInntekterEP?.length > 0 && ( | ||
<DollyFieldArray | ||
header="Forventede inntekter for partner" | ||
data={pensjon?.barnetilleggDetaljer?.forventedeInntekterEP} | ||
nested | ||
> | ||
{(inntekt: ForventedeInntekterSokerOgEP, idx: number) => ( | ||
<React.Fragment key={idx}> | ||
<TitleValue | ||
title="Type inntekt" | ||
value={showLabel('inntektType', inntekt?.inntektType)} | ||
/> | ||
<TitleValue title="Beløp" value={inntekt?.belop} /> | ||
<TitleValue title="Dato fra" value={formatDate(inntekt?.datoFom)} /> | ||
<TitleValue title="Dato til" value={formatDate(inntekt?.datoTom)} /> | ||
</React.Fragment> | ||
)} | ||
</DollyFieldArray> | ||
)} | ||
</BestillingData> | ||
</ErrorBoundary> | ||
</div> | ||
) | ||
} |
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