Skip to content

Commit

Permalink
Merge pull request #443 from navikt/dev
Browse files Browse the repository at this point in the history
Prodsette: manglende grunn til at oppfolging ikke kan avsluttes oppfølging
  • Loading branch information
dragutin-nav authored Oct 7, 2022
2 parents 6a99e85 + 7d0606d commit 897c89e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ public class AvslutningStatus {
public boolean harYtelser;
public boolean underKvp;
public LocalDate inaktiveringsDato;
public boolean erIserv;

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ public class AvslutningStatusData {
public final boolean harYtelser;
public final boolean underKvp;
public final LocalDate inaktiveringsDato;
public final boolean erIserv;
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import static java.util.stream.Collectors.toList;
import static no.nav.veilarboppfolging.config.ApplicationConfig.SYSTEM_USER_NAME;
import static no.nav.veilarboppfolging.utils.ArenaUtils.*;
import static no.nav.veilarboppfolging.utils.KvpUtils.sjekkTilgangGittKvp;

@Slf4j
@Service
Expand Down Expand Up @@ -392,9 +391,9 @@ private OppfolgingStatusData getOppfolgingStatusData(Fnr fnr) {
long kvpId = kvpRepository.gjeldendeKvp(aktorId);
boolean harSkrivetilgangTilBruker = !kvpService.erUnderKvp(kvpId)
|| authService.harTilgangTilEnhet(
kvpRepository.hentKvpPeriode(kvpId)
.orElseThrow()
.getEnhet()
kvpRepository.hentKvpPeriode(kvpId)
.orElseThrow()
.getEnhet()
);

Boolean erInaktivIArena = maybeArenaOppfolging.map(ao -> erIserv(ao.getFormidlingsgruppe())).orElse(null);
Expand Down Expand Up @@ -458,6 +457,7 @@ private AvslutningStatusData getAvslutningStatus(Fnr fnr) {
.harYtelser(ytelserOgAktiviteterService.harPagaendeYtelse(fnr))
.underKvp(kvpService.erUnderKvp(aktorId))
.inaktiveringsDato(inaktiveringsDato)
.erIserv(erIserv)
.build();
}

Expand Down
9 changes: 6 additions & 3 deletions src/main/java/no/nav/veilarboppfolging/utils/DtoMappers.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import no.nav.veilarboppfolging.controller.response.*;
import no.nav.veilarboppfolging.domain.AvslutningStatusData;
import no.nav.veilarboppfolging.domain.OppfolgingStatusData;
import no.nav.veilarboppfolging.repository.entity.*;
import no.nav.veilarboppfolging.repository.entity.KvpPeriodeEntity;
import no.nav.veilarboppfolging.repository.entity.MaalEntity;
import no.nav.veilarboppfolging.repository.entity.OppfolgingsperiodeEntity;
import no.nav.veilarboppfolging.repository.entity.VeilederTilordningEntity;

import java.util.Collections;
import java.util.Optional;

import static java.util.Optional.ofNullable;
import static java.util.stream.Collectors.toList;
Expand Down Expand Up @@ -45,7 +47,8 @@ public static AvslutningStatus tilDto(AvslutningStatusData avslutningStatusData)
avslutningStatusData.underOppfolging,
avslutningStatusData.harYtelser,
avslutningStatusData.underKvp,
avslutningStatusData.inaktiveringsDato
avslutningStatusData.inaktiveringsDato,
avslutningStatusData.erIserv
);
}

Expand Down

0 comments on commit 897c89e

Please sign in to comment.