Skip to content

Commit

Permalink
Validate past date.
Browse files Browse the repository at this point in the history
Avoid wrong request from SAF.
  • Loading branch information
oyvind-wedoe committed Jan 8, 2024
1 parent 3076d2f commit 16ab92a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ class DokumentUnderArbeidService(
throw DokumentValidationException("Kan ikke sette dato mottatt på et dokument som er ferdigstilt")
}

if (datoMottatt.isAfter(LocalDate.now())) {
throw DokumentValidationException("Kan ikke sette dato mottatt i fremtiden")
}

if (dokumentUnderArbeid.dokumentType != DokumentType.KJENNELSE_FRA_TRYGDERETTEN) {
throw DokumentValidationException("Kan bare sette dato mottatt på inngående dokument.")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package no.nav.klage.oppgave.clients.saf.graphql

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import java.time.LocalDate
import java.time.LocalDateTime

data class DokumentoversiktBrukerResponse(val data: DokumentoversiktBrukerDataWrapper?, val errors: List<Error>?)
Expand Down Expand Up @@ -32,7 +31,6 @@ data class Journalpost(
val opprettetAvNavn: String?,
val skjerming: String?,
val datoOpprettet: LocalDateTime,
val datoMottatt: LocalDate?,
val dokumenter: List<DokumentInfo>?,
val relevanteDatoer: List<RelevantDato>?,
val kanal: String,
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/saf/journalpostProperties.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ kanal
kanalnavn
skjerming
datoOpprettet
datoMottatt
relevanteDatoer {
dato
datotype
Expand Down

0 comments on commit 16ab92a

Please sign in to comment.