-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logs and confirmation message after successful data changes
- Loading branch information
1 parent
ffe2eab
commit 6c314c3
Showing
4 changed files
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...k/gov/hmcts/reform/iacaseapi/domain/handlers/postsubmit/RevokeCaseAccessConfirmation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package uk.gov.hmcts.reform.iacaseapi.domain.handlers.postsubmit; | ||
|
||
import org.springframework.stereotype.Component; | ||
import uk.gov.hmcts.reform.iacaseapi.domain.entities.AsylumCase; | ||
import uk.gov.hmcts.reform.iacaseapi.domain.entities.ccd.Event; | ||
import uk.gov.hmcts.reform.iacaseapi.domain.entities.ccd.callback.Callback; | ||
import uk.gov.hmcts.reform.iacaseapi.domain.entities.ccd.callback.PostSubmitCallbackResponse; | ||
import uk.gov.hmcts.reform.iacaseapi.domain.handlers.PostSubmitCallbackHandler; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
@Component | ||
public class RevokeCaseAccessConfirmation implements PostSubmitCallbackHandler<AsylumCase> { | ||
|
||
public boolean canHandle( | ||
Callback<AsylumCase> callback | ||
) { | ||
requireNonNull(callback, "callback must not be null"); | ||
|
||
return callback.getEvent() == Event.REVOKE_CASE_ACCESS; | ||
} | ||
|
||
public PostSubmitCallbackResponse handle( | ||
Callback<AsylumCase> callback | ||
) { | ||
if (!canHandle(callback)) { | ||
throw new IllegalStateException("Cannot handle callback"); | ||
} | ||
|
||
PostSubmitCallbackResponse postSubmitResponse = | ||
new PostSubmitCallbackResponse(); | ||
|
||
postSubmitResponse.setConfirmationHeader("# You have revoke case access for the appeal"); | ||
|
||
return postSubmitResponse; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters