//TODO: Next step Direction name should be dynamic too.
public PostSubmitCallbackResponse handle(
        Callback<AsylumCase> callback
    ) {
        if (!canHandle(callback)) {
            throw new IllegalStateException("Cannot handle callback");
        }
        PostSubmitCallbackResponse postSubmitResponse =
            new PostSubmitCallbackResponse();
        AsylumCase asylumCase = callback.getCaseDetails().getCaseData();
        TimeExtensionDecision decision = getTimeExtensionDecision(asylumCase);
        String confirmationHeader = decision == GRANTED
            ? "# You have granted a time extension"
            : "# You have refused a time extension";
        postSubmitResponse.setConfirmationHeader(confirmationHeader);
        //TODO: Next step Direction name should be dynamic too.
        postSubmitResponse.setConfirmationBody(
            "#### What happens next\n\n"
            + "The appellant has been notified that their request has been "
            + decision.toString()
            + " and that they must submit their Appeal Reasons by the new due date.<br>"
            + "You will be notified when it is ready to review.\n"
        );
        return postSubmitResponse;
    }
: "# You have refused a time extension";
postSubmitResponse.setConfirmationHeader(confirmationHeader);
//TODO: Next step Direction name should be dynamic too.
postSubmitResponse.setConfirmationBody(
"#### What happens next\n\n"
throw new IllegalStateException("Cannot handle callback");
}
PostSubmitCallbackResponse postSubmitResponse =
new PostSubmitCallbackResponse();
AsylumCase asylumCase = callback.getCaseDetails().getCaseData();
TimeExtensionDecision decision = getTimeExtensionDecision(asylumCase);
String confirmationHeader = decision == GRANTED
? "# You have granted a time extension"
: "# You have refused a time extension";
postSubmitResponse.setConfirmationHeader(confirmationHeader);
//TODO: Next step Direction name should be dynamic too.
postSubmitResponse.setConfirmationBody(
"#### What happens next\n\n"
+ "The appellant has been notified that their request has been "
+ decision.toString()
+ " and that they must submit their Appeal Reasons by the new due date.<br>"
+ "You will be notified when it is ready to review.\n"
);
return postSubmitResponse;
}
public PostSubmitCallbackResponse handle(
Callback<AsylumCase> callback
) {
if (!canHandle(callback)) {
throw new IllegalStateException("Cannot handle callback");
}
PostSubmitCallbackResponse postSubmitResponse =
new PostSubmitCallbackResponse();
AsylumCase asylumCase = callback.getCaseDetails().getCaseData();
TimeExtensionDecision decision = getTimeExtensionDecision(asylumCase);
String confirmationHeader = decision == GRANTED
? "# You have granted a time extension"
: "# You have refused a time extension";
postSubmitResponse.setConfirmationHeader(confirmationHeader);
//TODO: Next step Direction name should be dynamic too.
postSubmitResponse.setConfirmationBody(
"#### What happens next\n\n"
+ "The appellant has been notified that their request has been "
+ decision.toString()
+ " and that they must submit their Appeal Reasons by the new due date.<br>"
+ "You will be notified when it is ready to review.\n"
);
return postSubmitResponse;
}