Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
AE-1961: Require answer-commentary if recipient-answered is true in s…
Browse files Browse the repository at this point in the history
…akkopäätös / varsinainen päätös
  • Loading branch information
Juholei committed Nov 22, 2023
1 parent 0e083b9 commit 7c00254
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions etp-backend/src/main/clj/solita/etp/schema/valvonta_kaytto.clj
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,18 @@

(def SakkopaatosVarsinainenPaatosOsapuoliSpecificData
(schema/conditional
;; Osapuoli has a document so all fields are required to have values
;; answer-commentary fields are optional but if present, values are required
;; Osapuoli has a document and has answered to kuulemiskirje, so all fields are required
(every-pred toimenpide/osapuoli-has-document? toimenpide/recipient-answered?)
{:osapuoli OsapuoliSpecificDataOsapuoli
:hallinto-oikeus-id HallintoOikeusId
:document schema/Bool
:recipient-answered schema/Bool
:answer-commentary-fi schema/Str
:answer-commentary-sv schema/Str
:statement-fi schema/Str
:statement-sv schema/Str}

;; Osapuoli has document but has not answered to kuulemiskirje, so answer-commentary is optional
toimenpide/osapuoli-has-document?
{:osapuoli OsapuoliSpecificDataOsapuoli
:hallinto-oikeus-id HallintoOikeusId
Expand Down

0 comments on commit 7c00254

Please sign in to comment.