Skip to content

Commit

Permalink
EY-3992 Hente trygdetid pesys AP og uførepensjon (#5586)
Browse files Browse the repository at this point in the history
* EY-3992 Hente trygdetid pesys AP og uførepensjon

* EY-3992 Legg til egn typer for trygdetidsperioder fra pesys

* Oppdater gamle tester med pesysklientmock

* Fikse type for trygdetidene fra trygdetid

* EY-3992 Oppdatere til lister av trygdetidsperioder

* Fjern kap20 da dette ikke er interessant

* Fom og tom er ikke nullable egentlig

* Eks
  • Loading branch information
sebassonav authored Aug 23, 2024
1 parent 9a9c2c4 commit ce6df61
Show file tree
Hide file tree
Showing 12 changed files with 389 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ interface PesysKlient {

class PesysKlientImpl(
config: Config,
pen: HttpClient,
httpClient: HttpClient,
) : PesysKlient {
private val logger = LoggerFactory.getLogger(this::class.java)
private val azureAdClient = AzureAdClient(config)
private val downstreamResourceClient = DownstreamResourceClient(azureAdClient, pen)
private val downstreamResourceClient = DownstreamResourceClient(azureAdClient, httpClient)

private val clientId = config.getString("pen.client.id")
private val resourceUrl = config.getString("pen.client.url")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
import { apiClient, ApiResponse } from '~shared/api/apiClient'
import { JaNei } from '~shared/types/ISvar'

export const hentTrygdetidUfoeretrygdOgAlderspensjon = async (
fnr: string
): Promise<ApiResponse<TrygdetidsperioderPesys>> =>
apiClient.post('trygdetid_v2/pesys/grunnlag', { foedselsnummer: fnr })

export interface TrygdetidsperioderPesys {
ufoeretrygd: TrygdetidsperiodeListe
alderspensjon: TrygdetidsperiodeListe
}

export interface TrygdetidsperiodeListe {
trygdetidsGrunnlagListe?: TrygdetidPeriodePesys[]
}

export interface TrygdetidPeriodePesys {
isoCountryCode: String // ISO 3166-1 alpha-3 code feks: "NOR" "SWE"
fra: String //TODO: eller date? kommer i steg 2 da vi dette skal brukes i frontend
til: String
poengInnAar?: Boolean
poengUtAar?: Boolean
prorata?: Boolean
kilde: {
tidspunkt: string
type: string
}
}

export const hentTrygdetider = async (behandlingId: string): Promise<ApiResponse<ITrygdetid[]>> =>
apiClient.get<ITrygdetid[]>(`/trygdetid_v2/${behandlingId}`)

Expand Down
5 changes: 5 additions & 0 deletions apps/etterlatte-trygdetid/.nais/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ spec:
value: http://etterlatte-grunnlag
- name: ETTERLATTE_GRUNNLAG_CLIENT_ID
value: dev-gcp.etterlatte.etterlatte-grunnlag
- name: PEN_URL
value: https://pensjon-pen-q2.dev-fss-pub.nais.io/pen/springapi
- name: PEN_CLIENT_ID
value: ddd52335-cfe8-4ee9-9e68-416a5ab26efa
envFrom:
- secret: my-application-unleash-api-token
accessPolicy:
Expand All @@ -97,3 +101,4 @@ spec:
- application: etterlatte-grunnlag
external:
- host: etterlatte-unleash-api.nav.cloud.nais.io
- host: pensjon-pen-q2.dev-fss-pub.nais.io
5 changes: 5 additions & 0 deletions apps/etterlatte-trygdetid/.nais/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ spec:
value: http://etterlatte-grunnlag
- name: ETTERLATTE_GRUNNLAG_CLIENT_ID
value: prod-gcp.etterlatte.etterlatte-grunnlag
- name: PEN_URL
value: https://pensjon-pen.prod-fss-pub.nais.io/pen/springapi
- name: PEN_CLIENT_ID
value: 53eaf67f-d7b2-46e9-8ffe-3da7cf0ac955
envFrom:
- secret: my-application-unleash-api-token
accessPolicy:
Expand All @@ -101,3 +105,4 @@ spec:
- application: etterlatte-grunnlag
external:
- host: etterlatte-unleash-api.nav.cloud.nais.io
- host: pensjon-pen.prod-fss-pub.nais.io
Loading

0 comments on commit ce6df61

Please sign in to comment.