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

Commit

Permalink
AE-2014: Allow moving to käsittely with uudelleenkäsittele asia trans…
Browse files Browse the repository at this point in the history
…ition even if käsittely has already been done

- The process can be repeated multiple times so käsittely and the following toimenpiteet and their transitions need to be allowed even though they have already been done
  • Loading branch information
Juholei committed Dec 14, 2023
1 parent ca764e6 commit ff0eced
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions etp-backend/src/main/clj/solita/etp/service/asha.clj
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@
last))

(defn move-processing-action!
"Move the case to the next step, if the new action (wanted-processing-action parameter) is in Käsittely or Päätöksenteko
and the desired state is not already reached (not in processing-action-states).
"Move the case to the next step, if the new action (wanted-processing-action parameter) if the action is valid and
the case is not already in that state.
`processing-action-states` parameter is a map containing the processing actions that are already made and their states.
Expand All @@ -209,7 +209,9 @@

:else nil)]

(when (not (get processing-action-states wanted-processing-action))
;; If the action is already in the desired state, do nothing. It is allowed to move to a state that
;; has already been handled previously (state is READY).
(when-not (contains? #{"NEW" "UNFINISHED"} (get processing-action-states wanted-processing-action))
(proceed-operation! sender-id request-id case-number (:processing-action action) (:decision action)))))

(defn mark-processing-action-as-ready! [sender-id request-id case-number processing-action]
Expand Down
3 changes: 2 additions & 1 deletion etp-backend/src/test/clj/solita/etp/service/asha_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -323,5 +323,6 @@
{:response-body "Irrelevant"
:response-status 200
:request-received move-called}})]
(asha-service/move-processing-action! sender-id request-id case-number {"Tiedoksianto ja toimeenpano" "UNFINISHED"} "Käsittely")
(asha-service/move-processing-action! sender-id request-id case-number {"Tiedoksianto ja toimeenpano" "UNFINISHED"
"Käsittely" "FINISHED"} "Käsittely")
(t/is (= 1 @move-called))))))))

0 comments on commit ff0eced

Please sign in to comment.