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

Hendelselogg for beslutter #1092

Closed
wants to merge 1 commit into from
Closed
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
Expand Up @@ -45,7 +45,11 @@ public List<Varsel> hentAlleVarslerForAvtale(
Avtalepart avtalepart = innloggingService.hentAvtalepart(innloggetPart);
Avtale avtale = avtaleRepository.findById(avtaleId).orElseThrow();
avtalepart.sjekkTilgang(avtale);
return varselRepository.findAllByAvtaleIdAndMottaker(avtaleId, innloggetPart);
if (innloggetPart == Avtalerolle.BESLUTTER) { //Henter hendelselogg i form av varsel for veileder til beslutter
return varselRepository.finnVarselForVeileder(avtaleId);
} else {
return varselRepository.findAllByAvtaleIdAndMottaker(avtaleId, innloggetPart);
}
}

@PostMapping("{varselId}/sett-til-lest")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import no.nav.tag.tiltaksgjennomforing.avtale.Avtalerolle;
import no.nav.tag.tiltaksgjennomforing.avtale.Identifikator;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Collection;
import java.util.List;
Expand All @@ -23,6 +24,10 @@ public interface VarselRepository extends JpaRepository<Varsel, UUID> {
@Timed(percentiles = { 0.5d, 0.75d, 0.9d, 0.99d, 0.999d })
List<Varsel> findAllByAvtaleIdAndMottaker(UUID avtaleId, Avtalerolle mottaker);

@Timed(percentiles = {0.5d, 0.75d, 0.9d, 0.99d, 0.999d})
@Query("select v from Varsel v where v.avtaleId = :avtaleId and v.mottaker = 'VEILEDER'")
List<Varsel> finnVarselForVeileder(UUID avtaleId);

@Timed(percentiles = { 0.5d, 0.75d, 0.9d, 0.99d, 0.999d })
List<Varsel> findAllByLestIsFalseAndBjelleIsTrueAndIdentifikatorIn(Collection<String> identifikator);

Expand Down