generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
871 additions
and
76 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/functionalTest/resources/scenarios/DIAC-528-upload-hearing-recording-details.json
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,23 @@ | ||
{ | ||
"description": "Upload hearing recording confirmation", | ||
"request": { | ||
"uri": "/bail/ccdSubmitted", | ||
"credentials": "AdminOfficer", | ||
"input": { | ||
"id": 1111, | ||
"eventId": "uploadHearingRecording", | ||
"state": "decisionDecided", | ||
"caseData": { | ||
"template": "minimal-application-submitted.json" | ||
} | ||
} | ||
}, | ||
"expectation": { | ||
"status": 200, | ||
"errors": [], | ||
"confirmation": { | ||
"header": "# You’ve uploaded the hearing recording", | ||
"body": "#### What happens next\nThis file is now available in the Documents tab and the Hearing and appointment tab." | ||
} | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
src/main/java/uk/gov/hmcts/reform/bailcaseapi/domain/entities/HearingRecordingDocument.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,17 @@ | ||
package uk.gov.hmcts.reform.bailcaseapi.domain.entities; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Value; | ||
import lombok.extern.jackson.Jacksonized; | ||
import uk.gov.hmcts.reform.bailcaseapi.domain.entities.ccd.field.Document; | ||
import uk.gov.hmcts.reform.bailcaseapi.domain.entities.ccd.field.HasDocument; | ||
|
||
@Value | ||
@Builder | ||
@Jacksonized | ||
@AllArgsConstructor | ||
public class HearingRecordingDocument implements HasDocument { | ||
Document document; | ||
String description; | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...va/uk/gov/hmcts/reform/bailcaseapi/domain/entities/ccd/field/PreviousDecisionDetails.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,17 @@ | ||
package uk.gov.hmcts.reform.bailcaseapi.domain.entities.ccd.field; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PreviousDecisionDetails { | ||
|
||
private String decisionDetailsDate; | ||
private String recordDecisionType; | ||
private Document uploadSignedDecisionNoticeDocument; | ||
} |
20 changes: 20 additions & 0 deletions
20
...ava/uk/gov/hmcts/reform/bailcaseapi/domain/entities/ccd/field/PreviousListingDetails.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,20 @@ | ||
package uk.gov.hmcts.reform.bailcaseapi.domain.entities.ccd.field; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import uk.gov.hmcts.reform.bailcaseapi.domain.entities.ListingEvent; | ||
import uk.gov.hmcts.reform.bailcaseapi.domain.entities.ListingHearingCentre; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PreviousListingDetails { | ||
|
||
private ListingEvent listingEvent; | ||
private ListingHearingCentre listingLocation; | ||
private String listingHearingDate; | ||
private String listingHearingDuration; | ||
} |
42 changes: 42 additions & 0 deletions
42
...cts/reform/bailcaseapi/domain/handlers/postsubmit/UploadHearingRecordingConfirmation.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,42 @@ | ||
package uk.gov.hmcts.reform.bailcaseapi.domain.handlers.postsubmit; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
import org.springframework.stereotype.Component; | ||
import uk.gov.hmcts.reform.bailcaseapi.domain.entities.BailCase; | ||
import uk.gov.hmcts.reform.bailcaseapi.domain.entities.ccd.Event; | ||
import uk.gov.hmcts.reform.bailcaseapi.domain.entities.ccd.callback.Callback; | ||
import uk.gov.hmcts.reform.bailcaseapi.domain.entities.ccd.callback.PostSubmitCallbackResponse; | ||
import uk.gov.hmcts.reform.bailcaseapi.domain.handlers.PostSubmitCallbackHandler; | ||
|
||
@Component | ||
public class UploadHearingRecordingConfirmation implements PostSubmitCallbackHandler<BailCase> { | ||
|
||
public boolean canHandle( | ||
Callback<BailCase> callback | ||
) { | ||
requireNonNull(callback, "callback must not be null"); | ||
|
||
return callback.getEvent() == Event.UPLOAD_HEARING_RECORDING; | ||
} | ||
|
||
public PostSubmitCallbackResponse handle( | ||
Callback<BailCase> callback | ||
) { | ||
if (!canHandle(callback)) { | ||
throw new IllegalStateException("Cannot handle callback"); | ||
} | ||
|
||
PostSubmitCallbackResponse postSubmitResponse = | ||
new PostSubmitCallbackResponse(); | ||
|
||
postSubmitResponse.setConfirmationHeader( | ||
""" | ||
# You’ve uploaded the hearing recording"""); | ||
postSubmitResponse.setConfirmationBody(""" | ||
#### What happens next | ||
This file is now available in the Documents tab and the Hearing and appointment tab."""); | ||
|
||
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
Oops, something went wrong.