Skip to content

Commit

Permalink
Merge branch 'master' into feat/CIV-14440
Browse files Browse the repository at this point in the history
  • Loading branch information
kalachandrasekar1 authored Jul 24, 2024
2 parents 7df84c5 + 26845d3 commit 4491ace
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,24 @@
"CRUD": "R"
}
]
},
{
"CaseTypeID": "CIVIL",
"CaseEventID": "SEND_SETTLE_CLAIM_PAID_IN_FULL_LETTER_TO_LIP_DEFENDANT1",
"AccessControl": [
{
"UserRoles": [
"caseworker-civil-systemupdate"
],
"CRUD": "CRU"
},
{
"UserRoles": [
"caseworker-civil-admin",
"caseworker-civil-staff"
],
"CRUD": "R"
}
]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"CaseTypeID": "CIVIL",
"ID": "SEND_SETTLE_CLAIM_PAID_IN_FULL_LETTER_TO_LIP_DEFENDANT1",
"Name": "Settle claim paid full letter",
"Description": "Send Settle claim mark paid in full Letter to LiP Defendant 1",
"PreConditionState(s)": "*",
"PostConditionState": "*",
"SecurityClassification": "Public",
"CallBackURLAboutToSubmitEvent": "${CCD_DEF_CASE_SERVICE_BASE_URL}/cases/callbacks/about-to-submit",
"ShowSummary": "N",
"ShowEventNotes": "N",
"RetriesTimeoutURLAboutToSubmitEvent": 0
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -278,5 +278,19 @@
"DisplayContext": "MANDATORY",
"ShowSummaryChangeOption":"Y",
"FieldShowCondition":"typeOfDiscontinuance=\"PART_DISCONTINUANCE\""
},
{
"CaseTypeID": "CIVIL",
"CaseEventID": "DISCONTINUE_CLAIM_CLAIMANT",
"CaseFieldID": "hearingDate",
"PageID": "DiscontinuanceType",
"PageLabel": "Type of Discontinuance",
"PageDisplayOrder": 6,
"PageFieldDisplayOrder":2,
"PageColumnNumber": 1,
"DisplayContext": "READONLY",
"ShowSummaryChangeOption": "N",
"FieldShowCondition":"typeOfDiscontinuance=\"DO NOT SHOW ON UI\"",
"Publish": "Y"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,35 @@
"PageID": "WorkAllocationIntegrationFields",
"PageDisplayOrder": 2,
"Publish": "Y"
},
{
"CaseTypeID": "CIVIL",
"CaseEventID": "UPDATE_CLAIMANT_INTENTION_CLAIM_STATE",
"CaseFieldID": "respondent1DQVulnerabilityQuestions",
"PageFieldDisplayOrder": 22,
"DisplayContext": "READONLY",
"PageID": "WorkAllocationIntegrationFields",
"PageDisplayOrder": 2,
"Publish": "Y"
},
{
"CaseTypeID": "CIVIL",
"CaseEventID": "UPDATE_CLAIMANT_INTENTION_CLAIM_STATE",
"CaseFieldID": "respondent1DQLanguage",
"PageFieldDisplayOrder": 23,
"DisplayContext": "READONLY",
"PageID": "WorkAllocationIntegrationFields",
"PageDisplayOrder": 2,
"Publish": "Y"
},
{
"CaseTypeID": "CIVIL",
"CaseEventID": "UPDATE_CLAIMANT_INTENTION_CLAIM_STATE",
"CaseFieldID": "respondent1DQHearingSupport",
"PageFieldDisplayOrder": 24,
"DisplayContext": "READONLY",
"PageID": "WorkAllocationIntegrationFields",
"PageDisplayOrder": 2,
"Publish": "Y"
}
]
4 changes: 2 additions & 2 deletions e2e/api/steps_LRspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const mediationUnsuccessful = require('../fixtures/events/cui/unsuccessfulMediat
const evidenceUploadApplicant = require('../fixtures/events/evidenceUploadApplicant');
const evidenceUploadRespondent = require('../fixtures/events/evidenceUploadRespondent');
const settleClaim1v1Spec = require('../fixtures/events/settleClaim1v1Spec');
const discontinueClaim2v1Spec = require('../fixtures/events/discontinueClaim2v1Spec');
const discontinueClaimSpec = require('../fixtures/events/discontinueClaimSpec');
const validateDiscontinueClaimClaimantSpec = require('../fixtures/events/validateDiscontinueClaimClaimantSpec');
const {cloneDeep} = require('lodash');
const {adjustCaseSubmittedDateForMinti, getMintiTrackByClaimAmount, assertTrackAfterClaimCreation} = require('../helpers/mintiHelper');
Expand Down Expand Up @@ -85,7 +85,7 @@ const data = {
REFER_JUDGE_DEFENCE_RECEIVED: () => judgmentOnline1v1Spec.referJudgeDefenceReceived(),
SETTLE_CLAIM_MARK_PAID_FULL: (addApplicant2) => settleClaim1v1Spec.settleClaim(addApplicant2),
SETTLE_CLAIM_MARK_PAID_FULL_SELECT_CLAIMANT: (addApplicant2) => settleClaim1v1Spec.claimantDetails(addApplicant2),
DISCONTINUE_CLAIM: (mpScenario) => discontinueClaim2v1Spec.discontinueClaim(mpScenario),
DISCONTINUE_CLAIM: (mpScenario) => discontinueClaimSpec.discontinueClaim(mpScenario),
VALIDATE_DISCONTINUE_CLAIM_CLAIMANT: (permission) => validateDiscontinueClaimClaimantSpec.validateDiscontinueClaimClaimant(permission),
};

Expand Down
45 changes: 44 additions & 1 deletion e2e/api/steps_LRspecCui.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const {PBAv3} = require('../fixtures/featureKeys');
const {adjustCaseSubmittedDateForCarm} = require('../helpers/carmHelper');
const {fetchCaseDetails} = require('./apiRequest');
const lipClaimantResponse = require('../fixtures/events/cui/lipClaimantResponse');
const discontinueClaimSpec = require('../fixtures/events/discontinueClaimSpec');

let caseId, eventName;
let caseData = {};
Expand All @@ -36,7 +37,8 @@ const data = {
CLAIMANT_RESPONSE: (mpScenario, citizenDefendantResponse, freeMediation, carmEnabled) => require('../fixtures/events/claimantResponseSpecCui.js').claimantResponse(mpScenario, citizenDefendantResponse, freeMediation, carmEnabled),
REQUEST_JUDGEMENT: (mpScenario) => require('../fixtures/events/requestJudgementSpecCui.js').response(mpScenario),
INFORM_AGREED_EXTENSION_DATE: () => require('../fixtures/events/informAgreeExtensionDateSpec.js'),
EXTEND_RESPONSE_DEADLINE_DATE: () => require('../fixtures/events/extendResponseDeadline.js')
EXTEND_RESPONSE_DEADLINE_DATE: () => require('../fixtures/events/extendResponseDeadline.js'),
DISCONTINUE_CLAIM: (mpScenario) => discontinueClaimSpec.discontinueClaim(mpScenario),
};

const eventData = {
Expand Down Expand Up @@ -282,6 +284,41 @@ module.exports = {
await waitForFinishedBusinessProcess(caseId);
},

discontinueClaim: async (user, mpScenario) => {
console.log('discontinueClaim for case id ' + caseId);
await apiRequest.setupTokens(user);
eventName = 'DISCONTINUE_CLAIM_CLAIMANT';

let returnedCaseData = await apiRequest.startEvent(eventName, caseId);
delete returnedCaseData['SearchCriteria'];
caseData = returnedCaseData;

assertContainsPopulatedFields(returnedCaseData);

let disposalData = data.DISCONTINUE_CLAIM(mpScenario);
for (let pageId of Object.keys(disposalData.userInput)) {
await assertValidData(disposalData, pageId);
}

if (mpScenario === 'TWO_V_ONE') {
await assertSubmittedEvent('AWAITING_RESPONDENT_ACKNOWLEDGEMENT', {
header: '# We have noted your claim has been partly discontinued and your claim has been updated',
body: ''
}, true);
} else if (mpScenario === 'ONE_V_TWO' || mpScenario === 'ONE_V_ONE_NO_P_NEEDED' ) {
await assertSubmittedEvent('CASE_DISCONTINUED', {
header: '# Your claim has been discontinued',
body: ''
}, true);
} else {
await assertSubmittedEvent('AWAITING_RESPONDENT_ACKNOWLEDGEMENT', {
header: '# Your request is being reviewed',
body: ''
}, true);
}
await waitForFinishedBusinessProcess(caseId);
},

checkUserCaseAccess: async (user, shouldHaveAccess) => {
console.log(`Checking ${user.email} ${shouldHaveAccess ? 'has' : 'does not have'} access to the case.`);
const expectedStatus = shouldHaveAccess ? 200 : 403;
Expand Down Expand Up @@ -473,6 +510,12 @@ const deleteCaseFields = (...caseFields) => {
caseFields.forEach(caseField => delete caseData[caseField]);
};

const assertContainsPopulatedFields = returnedCaseData => {
for (let populatedCaseField of Object.keys(caseData)) {
assert.property(returnedCaseData, populatedCaseField);
}
};

const assertCorrectEventsAreAvailableToUser = async (user, state) => {
console.log(`Asserting user ${user.type} in env ${config.runningEnv} has correct permissions`);
const caseForDisplay = await apiRequest.fetchCaseForDisplay(user, caseId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,27 @@ module.exports = {
};
}
break;
case 'ONE_V_ONE_NO_P_NEEDED': {
data.userInput = {
courtPermission: {
courtPermissionNeeded: 'NO',
courtPermissionNeededChecked: [
'CourtPermissionNeededChecked'
]
},
PermissionGranted: {
isPermissionGranted:'YES',
permissionGrantedComplex:{
permissionGrantedJudge:'test',
permissionGrantedDate:'2023-02-01'
}
},
DiscontinuanceType: {
typeOfDiscontinuance:'FULL_DISCONTINUANCE'
}
};
}
break;
}
return data;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* eslint-disable no-unused-vars */

const config = require('../../../config.js');
const {createAccount, deleteAccount} = require('../../../api/idamHelper');

const claimType = 'SmallClaims';
let caseId;

Feature('CCD 1v1 API test @api-spec-cui @api-nonprod @api-settle-discont');

Before(async () => {
await createAccount(config.defendantCitizenUser2.email, config.defendantCitizenUser2.password);
});

async function prepareClaimLRvLiPExui(api_spec_cui, carmEnabled) {
let expectedEndState = carmEnabled ? 'IN_MEDIATION' : 'JUDICIAL_REFERRAL';
caseId = await api_spec_cui.createSpecifiedClaimWithUnrepresentedRespondent(config.applicantSolicitorUser, 'ONE_V_ONE', claimType, carmEnabled);
await api_spec_cui.performCitizenDefendantResponse(config.defendantCitizenUser2, caseId, claimType, carmEnabled);
await api_spec_cui.claimantResponse(config.applicantSolicitorUser, 'FULL_DEFENCE_CITIZEN_DEFENDANT', 'ONE_V_ONE', 'No', expectedEndState, carmEnabled);
}
Scenario.only('Discontinue claim 1v1 LR v LiP defendant and claimant response - claim created from exui - CARM not enabled', async ({api_spec_cui}) => {
if (['preview', 'demo'].includes(config.runningEnv)) {
let mpScenario = 'ONE_V_ONE_NO_P_NEEDED';
await prepareClaimLRvLiPExui(api_spec_cui, false);
await api_spec_cui.discontinueClaim(config.applicantSolicitorUser, mpScenario);
}
});

AfterSuite(async ({api_spec_cui}) => {
await api_spec_cui.cleanUp();
await deleteAccount(config.defendantCitizenUser2.email);
});

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const config = require('../../../config.js');
const legalAdvUser = config.tribunalCaseworkerWithRegionId4;
// To use on local because the idam images are different
const judgeUserReg2 = config.judgeUser2WithRegionId2;
const judgeUserReg1 = config.judgeUserWithRegionId1;
const judgeUserForFastClaim = config.testEarlyAdopterCourts ? config.judgeUser2WithRegionId2 : config.judgeUserWithRegionId1;

async function prepareClaimSpec(api_spec_small) {
Expand Down Expand Up @@ -35,14 +36,14 @@ Scenario('1v1 spec request for reconsideration for create general order', async
await api_spec_small.judgeDecisionOnReconsiderationRequest(judgeUserReg2, 'CREATE_GENERAL_ORDER');
});

Scenario.skip('1v2 spec request for reconsideration by defendant2 for create general order', async ({api_spec_small}) => {
Scenario('1v2 spec request for reconsideration by defendant2 for create general order', async ({api_spec_small}) => {
await api_spec_small.createClaimWithRepresentedRespondent(config.applicantSolicitorUser, 'ONE_V_TWO');
await api_spec_small.defendantResponse(config.defendantSolicitorUser, 'FULL_DEFENCE1', 'ONE_V_TWO_DIF_SOL',true);
await api_spec_small.defendantResponse(config.secondDefendantSolicitorUser, 'FULL_DEFENCE2', 'ONE_V_TWO_DIF_SOL',true);
await api_spec_small.claimantResponse(config.applicantSolicitorUser, true);
await api_spec_small.createSDO(legalAdvUser, 'CREATE_SMALL_NO_SUM');
await api_spec_small.requestForReconsideration(config.secondDefendantSolicitorUser,'Respondent2');
await api_spec_small.judgeDecisionOnReconsiderationRequest(judgeUserReg2, 'CREATE_GENERAL_ORDER');
await api_spec_small.judgeDecisionOnReconsiderationRequest(judgeUserReg1, 'CREATE_GENERAL_ORDER');
}).tag('@api-prod');

Scenario.skip('1v1 spec request for reconsideration when claim amount is greater than 1000', async ({api_spec}) => {
Expand Down

0 comments on commit 4491ace

Please sign in to comment.