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

TFP-3739 Mapper fritekst på avvist klage hvis finnes #2430

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
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
@@ -1,6 +1,7 @@
package no.nav.foreldrepenger.fpformidling.brevproduksjon.mapper;

import static no.nav.foreldrepenger.fpformidling.brevproduksjon.mapper.felles.BrevMapperUtil.opprettFellesBuilder;
import static no.nav.foreldrepenger.fpformidling.integrasjon.dokgen.dto.felles.FritekstDto.fra;
import static no.nav.foreldrepenger.fpformidling.typer.Dato.formaterDatoNorsk;

import java.util.Set;
Expand Down Expand Up @@ -49,10 +50,11 @@ public KlageAvvistDokumentdata mapTilDokumentdata(DokumentFelles dokumentFelles,
DokumentHendelse hendelse,
Behandling behandling,
boolean erUtkast) {
var klage = domeneobjektProvider.hentKlagebehandling(behandling);
var fellesBuilder = opprettFellesBuilder(dokumentFelles, hendelse, behandling, erUtkast);
fellesBuilder.medBrevDato(dokumentFelles.getDokumentDato() != null ? formaterDatoNorsk(dokumentFelles.getDokumentDato()) : null);
fra(hendelse, klage).ifPresent(fellesBuilder::medFritekst);

var klage = domeneobjektProvider.hentKlagebehandling(behandling);
var avvistGrunner = getAvvistGrunner(klage);

var dokumentdataBuilder = KlageAvvistDokumentdata.ny()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import java.time.LocalDate;
import java.util.List;

import no.nav.foreldrepenger.fpformidling.integrasjon.dokgen.dto.felles.FritekstDto;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down Expand Up @@ -48,6 +50,8 @@ class KlageAvvistDokumentdataMapperTest {

private KlageAvvistDokumentdataMapper dokumentdataMapper;

private static final String FRITEKST_TIL_BREV = "FRITEKST";

@BeforeEach
void before() {
dokumentData = lagStandardDokumentData(DokumentMalType.KLAGE_AVVIST);
Expand Down Expand Up @@ -78,6 +82,7 @@ void skal_mappe_felter_for_vanlig_behandling() {
assertThat(dokumentdata.getFelles().getYtelseType()).isEqualTo("FP");
assertThat(dokumentdata.getFelles().getBehandlesAvKA()).isFalse();
assertThat(dokumentdata.getFelles().getErUtkast()).isFalse();
assertThat(dokumentdata.getFelles().getFritekst()).isEqualTo(FritekstDto.fra(FRITEKST_TIL_BREV));

assertThat(dokumentdata.getGjelderTilbakekreving()).isFalse();
assertThat(dokumentdata.getLovhjemler()).isEqualTo("forvaltningsloven §§ 28 og 33");
Expand Down Expand Up @@ -109,7 +114,7 @@ void skal_mappe_felter_for_vanlig_behandling() {
}

private void mockKlage(Behandling behandling, BehandlingType behandlingType, List<KlageAvvistÅrsak> avvistÅrsaker) {
var klageVurderingResultat = new KlageVurderingResultat(null, "FRITEKST");
var klageVurderingResultat = new KlageVurderingResultat(null, FRITEKST_TIL_BREV);
var klageFormkravResultat = new KlageFormkravResultat(avvistÅrsaker);
var klage = Klage.ny()
.medPåklagdBehandlingType(behandlingType)
Expand Down