Skip to content

Commit

Permalink
Merge branch 'master' into feature/legge_synkronisering_mot_TPS
Browse files Browse the repository at this point in the history
  • Loading branch information
krharum committed Sep 14, 2023
2 parents 087b5ce + 8367076 commit 18b9b9e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import no.nav.dolly.bestilling.ClientFuture;
import no.nav.dolly.bestilling.ClientRegister;
import no.nav.dolly.bestilling.inntektsmelding.domain.InntektsmeldingRequest;
import no.nav.dolly.bestilling.inntektsmelding.domain.TransaksjonMappingDTO;
import no.nav.dolly.domain.jpa.BestillingProgress;
import no.nav.dolly.domain.jpa.TransaksjonMapping;
import no.nav.dolly.domain.resultset.RsDollyUtvidetBestilling;
Expand Down Expand Up @@ -96,7 +97,10 @@ private Flux<String> postInntektsmelding(boolean isSendMelding,
.map(dokument -> TransaksjonMapping.builder()
.ident(inntektsmeldingRequest.getArbeidstakerFnr())
.bestillingId(bestillingid)
.transaksjonId(toJson(dokument))
.transaksjonId(toJson(TransaksjonMappingDTO.builder()
.request(inntektsmeldingRequest)
.dokument(dokument)
.build()))
.datoEndret(LocalDateTime.now())
.miljoe(inntektsmeldingRequest.getMiljoe())
.system(INNTKMELD.name())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package no.nav.dolly.bestilling.inntektsmelding.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TransaksjonMappingDTO {

private InntektsmeldingRequest request;
private InntektsmeldingResponse.Dokument dokument;
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const ArenaVisning = ({ data, ident, bestillingIdListe, loading, tilgjeng
if (loading || tagsloading) {
return <Loading label="Laster arena-data" />
}
if (!data && !harArenasyntTag) {
if (!data) {
return null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ export const InntektsmeldingVisning = ({ liste, ident }: InntektsmeldingVisningP
const getDokumenter = (bestilling: TransaksjonId): Promise<Dokument[]> => {
return JoarkDokumentService.hentJournalpost(
bestilling.transaksjonId.journalpostId,
bestilling.miljoe
bestilling.miljoe,
).then((journalpost: Journalpost) => {
return Promise.all(
journalpost.dokumenter.map((document: Dokument) =>
JoarkDokumentService.hentDokument(
bestilling.transaksjonId.journalpostId,
document.dokumentInfoId,
bestilling.miljoe,
'ORIGINAL'
'ORIGINAL',
).then((dokument: string) => ({
journalpostId: bestilling.transaksjonId.journalpostId,
dokumentInfoId: document.dokumentInfoId,
dokument,
}))
)
})),
),
)
})
}
Expand Down Expand Up @@ -77,7 +77,7 @@ export const InntektsmeldingVisning = ({ liste, ident }: InntektsmeldingVisningP
render={(data: Array<Journalpost>) => {
if (data && data.length > 0) {
const gyldigeBestillinger = liste.filter((bestilling) =>
data.find((x) => (x && x.bestillingId ? x.bestillingId === bestilling.id : x))
data.find((x) => (x && x.bestillingId ? x.bestillingId === bestilling.id : x)),
)

if (gyldigeBestillinger && gyldigeBestillinger.length > 0) {
Expand Down Expand Up @@ -129,7 +129,7 @@ InntektsmeldingVisning.filterValues = (bestillinger: Array<Bestilling>, ident: s
(bestilling: any) =>
bestilling.data.inntektsmelding &&
!tomBestilling(bestilling.data.inntektsmelding.inntekter) &&
erGyldig(bestilling.id, 'INNTKMELD', ident)
erGyldig(bestilling.id, 'INNTKMELD', ident),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ const testHarArbeidsforhold = (val) => {
? detaljertSykemelding?.mottaker?.orgNr
: selected

const arbeidsgivere = values?.aareg?.map((arbforh) => arbforh?.arbeidsgiver?.orgnummer)
const arbeidsgivere = values?.aareg?.map((arbforh) => arbforh?.arbeidsgiver?.orgnummer) || []

values?.personFoerLeggTil?.aareg?.forEach((miljo) => {
miljo?.data?.forEach((arbforh) => {
const orgnr = arbforh?.arbeidsgiver?.organisasjonsnummer
if (orgnr && !arbeidsgivere?.includes(orgnr?.toString())) {
arbeidsgivere.push(orgnr)
}
})
})

if (!arbeidsgivere?.includes(valgtArbeidsgiver?.toString())) {
return this.createError({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,5 @@ export const erGyldig = (bestillingId: number, system: string, ident: string) =>
return response.data
}, [])

return (
finnBestilling.value &&
finnBestilling.value.length > 0 &&
finnBestilling.value[0].status === 'OK'
)
return finnBestilling.value && finnBestilling.value.length > 0
}

0 comments on commit 18b9b9e

Please sign in to comment.