Skip to content

Commit

Permalink
Merge pull request #509 from hmcts/ADOP-2567
Browse files Browse the repository at this point in the history
[ADOP-2567] Added TTLIncrement to CaseEvent
  • Loading branch information
hfilmore authored Nov 21, 2024
2 parents 0e75b17 + c414cb9 commit 664f577
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Event<T, R extends HasRole, S> {
private boolean showSummary;
private boolean showEventNotes;
private boolean publishToCamunda;
private Integer ttlIncrement;
private AboutToStart<T, S> aboutToStartCallback;
private AboutToSubmit<T, S> aboutToSubmitCallback;
private Submitted<T, S> submittedCallback;
Expand Down Expand Up @@ -128,6 +129,11 @@ public EventBuilder<T, R, S> publishToCamunda() {
return this;
}

public EventBuilder<T, R, S> ttlIncrement(Integer ttlIncrement) {
this.ttlIncrement = ttlIncrement;
return this;
}

// Do not inherit role permissions from states.
public EventBuilder<T, R, S> explicitGrants() {
this.explicitGrants = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ private List<Map<String, Object>> serialise(String caseTypeId, Event<T, R, S> ev
if (!Strings.isNullOrEmpty(event.getEndButtonLabel())) {
data.put("EndButtonLabel", event.getEndButtonLabel());
}
if (Objects.nonNull(event.getTtlIncrement())) {
data.put("TTLIncrement", event.getTtlIncrement());
}

if (!Strings.isNullOrEmpty(event.getShowCondition())) {
data.put("EventEnablingCondition", event.getShowCondition());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> builder) {
builder.event("addFamilyManCaseNumber")
.forAllStates()
.name("Add case number")
.ttlIncrement(100)
.grant(CRU, HMCTS_ADMIN)
.aboutToStartCallback(this::aboutToStart)
.aboutToSubmitCallback(this::aboutToSubmit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"SecurityClassification": "Public",
"Name": "Add case number",
"CallBackURLAboutToSubmitEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/callbacks/about-to-submit?eventId=addFamilyManCaseNumber",
"Publish": "N"
"Publish": "N",
"TTLIncrement": 100
}
]

0 comments on commit 664f577

Please sign in to comment.