Skip to content

Commit

Permalink
Merge pull request #953 from navikt/aapne-opp-for-journalpost-notater
Browse files Browse the repository at this point in the history
Skal vise journalpostnotater på minside
  • Loading branch information
charliemidtlyng authored Feb 12, 2024
2 parents ee3a645 + b13dcd1 commit d3d33c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,9 @@ class JournalpostService(private val safClient: SafClient) {
fun hentJournalposterForBruker(): List<JournalpostDto> =
safClient.hentJournalposterForBruker(EksternBrukerUtils.hentFnrFraToken())
.efJournalposter()
.filter { it.harRelevanteDokumenter() && harRelevantJournalposttype(it) }
.filter { it.harRelevanteDokumenter()}
.map { it.tilDto() }

fun harRelevantJournalposttype(it: Journalpost) = when {
it.erInngåendeEllerUtgåendeJournalpost() -> true
else -> {
logger.warn("Filtrert vekk journalposttype N")
secureLogger.warn("Filtrert vekk journalposttype N for journalpost=${it.journalpostId}")
false
}
}

fun hentPdfDokument(
journalpostId: String,
dokumentInfoId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ internal class JournalpostControllerTest : OppslagSpringRunnerTest() {
assertThat(response.body?.isNotEmpty())
/**
* Totalt 6 journalposter - én blankett (N) og én som går til advokat (ikke tilgang)
* Disse to skal filtreres vekk
* Siste skal filtreres vekk
*/
assertThat(response.body?.size).isEqualTo(4)
assertThat(response.body?.size).isEqualTo(5)

val journalpostMedSladdetVariantformat = response.body?.find { it.journalpostId == "453853070" }
assertThat(journalpostMedSladdetVariantformat?.hovedDokument?.variantformat).isEqualTo(Variantformat.SLADDET)
Expand Down

0 comments on commit d3d33c9

Please sign in to comment.