Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIV-15646 coo dashboard notification #5865

Open
wants to merge 22 commits into
base: CIV-15640-COO_notify
Choose a base branch
from
Open
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
69ce7d7
Merge branch 'master' into CIV-15646-COO_Dashboard
laarmada Dec 2, 2024
70615b0
add COO dashboard notifications
laarmada Dec 2, 2024
be2e254
Merge branch 'CIV-15640-COO_notify' into CIV-15646-COO_Dashboard
laarmada Dec 2, 2024
600903c
fix sql wrong dates.
laarmada Dec 2, 2024
a0f69d7
fix test
laarmada Dec 2, 2024
4389dae
fix checkstyle
laarmada Dec 2, 2024
1d1ceb8
DTSCCI-0000: Allow colon in PR title (#5894)
nigeldunne Dec 10, 2024
e71aad7
Update dependency com.networknt:json-schema-validator to v1.5.4 (#5893)
renovate[bot] Dec 10, 2024
4be1f98
Update dependency io.swagger.core.v3:swagger-annotations to v2.2.26 (…
renovate[bot] Dec 11, 2024
2af9970
CIV-15995 changes (#5877)
kalachandrasekar1 Dec 11, 2024
a7a6ac4
Merge branch 'master' of https://github.com/hmcts/civil-service into …
m-meulendijks-v1 Dec 11, 2024
f42a19b
CIV-15646 - court officer order
m-meulendijks-v1 Dec 11, 2024
8fbec13
CIV-15646 - set migrations scripts to later
m-meulendijks-v1 Dec 11, 2024
5a361b1
Merge branch 'CIV-15640-COO_notify' into CIV-15646-COO_Dashboard
m-meulendijks-v1 Dec 11, 2024
c3c91c6
CIV-15646 - rename another migration file
m-meulendijks-v1 Dec 11, 2024
fdffc40
CIV-15646 - replace comma with semi-colon
m-meulendijks-v1 Dec 11, 2024
43b302d
CIV-15646 - Update dashboard handlers
m-meulendijks-v1 Dec 12, 2024
739d450
CIV-15646 - court officer order
m-meulendijks-v1 Dec 12, 2024
ff096d2
CIV-15646 - add array values to scripts
m-meulendijks-v1 Dec 12, 2024
624a22c
CIV-15646 - fix scripts
m-meulendijks-v1 Dec 12, 2024
b2c230b
CIV-15646 - Add delete messages to other script
m-meulendijks-v1 Dec 12, 2024
b80fb13
CIV-15646 - remove unnecessary file chanes + update script names
m-meulendijks-v1 Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -14,6 +14,6 @@ jobs:
steps:
- uses: deepakputhraya/action-pr-title@master
with:
regex: '^(CIV-[0-9]{3,5} [a-zA-Z0-9._\- ]+)|(CIV-TASK [a-zA-Z0-9._\- ]+)|(\[Snyk\].+)|(DTSCCI-[0-9]{3,5} [a-zA-Z0-9._\- ]+)$' # Regex the title should match.
regex: '^(CIV-[0-9]{3,5} [a-zA-Z0-9._\- ]+)|(CIV-TASK [a-zA-Z0-9._\- ]+)|(\[Snyk\].+)|(DTSCCI-[0-9]{3,5}:* [a-zA-Z0-9._\- ]+)$' # Regex the title should match.
allowed_prefixes: 'CIV-,DTSCCI-,[Snyk]' # title should start with the given prefix
prefix_case_sensitive: true # title prefix are case insensitive:
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -406,7 +406,7 @@ dependencies {
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '9.0.96'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: '10.1.31'
implementation group: 'org.elasticsearch', name: 'elasticsearch', version: '7.17.25'
implementation group: 'com.networknt', name: 'json-schema-validator', version: '1.5.2'
implementation group: 'com.networknt', name: 'json-schema-validator', version: '1.5.4'

implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: versions.jackson
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: versions.jackson
2 changes: 1 addition & 1 deletion dashboard-notifications/build.gradle
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '2.7.18'
implementation group: 'com.vladmihalcea', name: 'hibernate-types-52', version: '2.21.1'
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.12.0'
implementation group: 'io.swagger.core.v3', name: 'swagger-annotations', version: '2.2.25'
implementation group: 'io.swagger.core.v3', name: 'swagger-annotations', version: '2.2.26'
implementation group: 'com.github.hmcts', name: 'idam-java-client', version: '2.1.1'

runtimeOnly 'org.postgresql:postgresql:42.7.4'
Original file line number Diff line number Diff line change
@@ -8464,20 +8464,10 @@ void validateRespondent2IntentionType() {
@Test
void shouldGenerateRPA_WhenClaimPayImmediately() {
LocalDate whenWillPay = LocalDate.now().plusDays(5);

CCJPaymentDetails ccjPaymentDetails = CCJPaymentDetails.builder()
.ccjPaymentPaidSomeOption(NO)
.ccjJudgmentAmountClaimAmount(BigDecimal.valueOf(1500))
.ccjJudgmentFixedCostAmount(BigDecimal.valueOf(40))
.ccjJudgmentAmountClaimFee(BigDecimal.valueOf(40))
.ccjPaymentPaidSomeAmountInPounds(ZERO)
.ccjJudgmentLipInterest(ZERO)
.build();

CCJPaymentDetails ccjPaymentDetails = buildCcjPaymentDetails();
RespondToClaimAdmitPartLRspec paymentDetails = RespondToClaimAdmitPartLRspec.builder()
.whenWillThisAmountBePaid(whenWillPay)
.build();

CaseData caseData = CaseDataBuilder.builder()
.setClaimTypeToSpecClaim()
.atStateSpec1v1ClaimSubmitted()
@@ -8487,9 +8477,6 @@ void shouldGenerateRPA_WhenClaimPayImmediately() {
.respondToClaimAdmitPartLRspec(paymentDetails)
.totalInterest(BigDecimal.ZERO)
.applicant1ResponseDate(LocalDateTime.now())
.respondent1Represented(YesOrNo.NO)
.specRespondent1Represented(YesOrNo.NO)
.applicant1Represented(YesOrNo.NO)
.ccdState(CaseState.All_FINAL_ORDERS_ISSUED)
.build();
when(featureToggleService.isJOLiveFeedActive()).thenReturn(true);
@@ -8506,5 +8493,74 @@ void shouldGenerateRPA_WhenClaimPayImmediately() {
assertThat(eventHistory).extracting("miscellaneous").asList()
.extracting("eventDetailsText").asString().contains(RPA_RECORD_JUDGMENT);
}

@Test
public void shouldGenerateRPA_ForFullAdmit_WhenLipClaimAgreedRepaymentPlan_BySetDate_JoLiveFeed() {
LocalDate whenWillPay = LocalDate.now().plusDays(5);
CCJPaymentDetails ccjPaymentDetails = buildCcjPaymentDetails();
RespondToClaimAdmitPartLRspec paymentDetails = RespondToClaimAdmitPartLRspec.builder()
.whenWillThisAmountBePaid(whenWillPay)
.build();
CaseData caseData = CaseDataBuilder.builder()
.setClaimTypeToSpecClaim()
.atStateSpec1v1ClaimSubmitted()
.atStateRespondent1v1FullAdmissionSpec().build().toBuilder()
.ccjPaymentDetails(ccjPaymentDetails)
.defenceAdmitPartPaymentTimeRouteRequired(RespondentResponsePartAdmissionPaymentTimeLRspec.BY_SET_DATE)
.respondToClaimAdmitPartLRspec(paymentDetails)
.applicant1ResponseDate(LocalDateTime.now())
.totalInterest(BigDecimal.ZERO)
.build();
given(featureToggleService.isJOLiveFeedActive()).willReturn(true);
var eventHistory = mapper.buildEvents(caseData, BEARER_TOKEN);
assertThat(eventHistory).isNotNull();
assertThat(eventHistory).extracting("judgmentByAdmission").isNotNull();
assertThat(eventHistory).extracting("judgmentByAdmission").asList()
.extracting("eventCode").asString().contains("240");
assertThat(eventHistory).extracting("miscellaneous").asList()
.extracting("eventCode").asString().contains("999");
assertThat(eventHistory).extracting("miscellaneous").asList()
.extracting("eventDetailsText").asString().contains(RPA_RECORD_JUDGMENT);
}

@Test
public void shouldGenerateRPA_ForFullAdmit_WhenLipClaimAgreedRepaymentPlan_JoLiveFeed() {
LocalDate whenWillPay = LocalDate.now().plusDays(5);
CCJPaymentDetails ccjPaymentDetails = buildCcjPaymentDetails();
RepaymentPlanLRspec respondent1RepaymentPlan = RepaymentPlanLRspec.builder()
.firstRepaymentDate(whenWillPay)
.paymentAmount(BigDecimal.valueOf(10000))
.repaymentFrequency(PaymentFrequencyLRspec.ONCE_ONE_MONTH)
.build();
CaseData caseData = CaseDataBuilder.builder()
.setClaimTypeToSpecClaim()
.atStateSpec1v1ClaimSubmitted()
.atStateRespondent1v1FullAdmissionSpec().build().toBuilder()
.ccjPaymentDetails(ccjPaymentDetails)
.defenceAdmitPartPaymentTimeRouteRequired(RespondentResponsePartAdmissionPaymentTimeLRspec.SUGGESTION_OF_REPAYMENT_PLAN)
.respondent1RepaymentPlan(respondent1RepaymentPlan)
.totalInterest(BigDecimal.ZERO)
.build();
given(featureToggleService.isJOLiveFeedActive()).willReturn(true);
var eventHistory = mapper.buildEvents(caseData, BEARER_TOKEN);
assertThat(eventHistory).isNotNull();
assertThat(eventHistory).extracting("judgmentByAdmission").isNotNull();
assertThat(eventHistory).extracting("judgmentByAdmission").asList()
.extracting("eventCode").asString().contains("240");
assertThat(eventHistory).extracting("miscellaneous").asList()
.extracting("eventCode").asString().contains("999");
assertThat(eventHistory).extracting("miscellaneous").asList()
.extracting("eventDetailsText").asString().contains(RPA_RECORD_JUDGMENT);
}

private CCJPaymentDetails buildCcjPaymentDetails() {
return CCJPaymentDetails.builder()
.ccjPaymentPaidSomeOption(NO)
.ccjJudgmentAmountClaimAmount(BigDecimal.valueOf(1500))
.ccjJudgmentFixedCostAmount(BigDecimal.valueOf(40))
.ccjJudgmentAmountClaimFee(BigDecimal.valueOf(40))
.ccjPaymentPaidSomeAmountInPounds(ZERO)
.build();
}
}
}