From a4fbe72f230f069d8db2bfd442cf1ed291c3a6ba Mon Sep 17 00:00:00 2001 From: kalachandrasekar1 Date: Wed, 30 Oct 2024 17:32:45 +0000 Subject: [PATCH 1/8] CIV-15654 changes --- .../generalApplication/applicationResponse.ts | 2 + .../generalApplication/applicationType.ts | 2 +- src/main/modules/i18n/locales/cy.json | 3 +- src/main/modules/i18n/locales/en.json | 3 +- .../checkAnswers/addCheckAnswersRows.ts | 2 +- .../viewApplication/addViewApplicationRows.ts | 38 ++++++++ .../viewApplication/viewApplicationService.ts | 38 +++++--- .../generalApplication/ccdTranslation.ts | 2 +- .../viewApplicationService.test.ts | 89 +++++++++++++++++++ 9 files changed, 161 insertions(+), 18 deletions(-) diff --git a/src/main/common/models/generalApplication/applicationResponse.ts b/src/main/common/models/generalApplication/applicationResponse.ts index aaa08d1ae0d..b6f81fde596 100644 --- a/src/main/common/models/generalApplication/applicationResponse.ts +++ b/src/main/common/models/generalApplication/applicationResponse.ts @@ -29,6 +29,7 @@ import { CcdGeneralApplicationRespondentResponse } from '../ccdGeneralApplicatio import { DateTime } from 'luxon'; import {CcdGARequestWrittenRepDocument} from 'models/ccdGeneralApplication/ccdGARequestWrittenRepDocument'; import {GeneralAppUrgencyRequirement} from 'models/generalApplication/response/urgencyRequirement'; +import {CcdGeneralApplicationCertOfSC} from "models/ccdGeneralApplication/ccdGeneralApplicationCertOfSC"; export class ApplicationResponse { id: string; @@ -85,6 +86,7 @@ export interface CCDApplication extends ApplicationUpdate { applicationIsUncloakedOnce?: YesNoUpperCamelCase; generalAppUrgencyRequirement?: GeneralAppUrgencyRequirement; generalAppNotificationDeadlineDate?: string; + certOfSC?: CcdGeneralApplicationCertOfSC; } export interface JudicialRequestMoreInfo { diff --git a/src/main/common/models/generalApplication/applicationType.ts b/src/main/common/models/generalApplication/applicationType.ts index 4db294a6752..1c45690486c 100644 --- a/src/main/common/models/generalApplication/applicationType.ts +++ b/src/main/common/models/generalApplication/applicationType.ts @@ -82,5 +82,5 @@ export const selectedApplicationTypeByOptions: Partial<{ [key in ApplicationType [ApplicationTypeOption.UNLESS_ORDER]: ['PAGES.GENERAL_APPLICATION.SELECTED_APPLICATION_TYPE.IMPOSE_SANCTION', 'PAGES.GENERAL_APPLICATION.SELECT_TYPE.ASK_IMPOSE_SANCTION_DESCRIPTION', 'Unless order'], [ApplicationTypeOption.VARY_ORDER]: ['PAGES.GENERAL_APPLICATION.SELECTED_APPLICATION_TYPE.RECONSIDER', 'PAGES.GENERAL_APPLICATION.SELECT_TYPE.ASK_RECONSIDER_DESCRIPTION', 'Vary order'], [ApplicationTypeOption.VARY_PAYMENT_TERMS_OF_JUDGMENT]: ['PAGES.GENERAL_APPLICATION.SELECTED_APPLICATION_TYPE.VARY_JUDGMENT', 'PAGES.GENERAL_APPLICATION.SELECT_TYPE.ASK_VARY_JUDGMENT_DESCRIPTION', 'Vary payment terms of judgment'], - [ApplicationTypeOption.CONFIRM_CCJ_DEBT_PAID]: ['PAGES.GENERAL_APPLICATION.SELECTED_APPLICATION_TYPE.CONFIRM_YOU_PAID_CCJ', 'PAGES.GENERAL_APPLICATION.SELECT_TYPE.CONFIRM_YOU_PAID_DESCRIPTION', 'Confirm CCJ debt paid'], + [ApplicationTypeOption.CONFIRM_CCJ_DEBT_PAID]: ['PAGES.GENERAL_APPLICATION.SELECTED_APPLICATION_TYPE.CONFIRM_YOU_PAID_CCJ', 'PAGES.GENERAL_APPLICATION.SELECT_TYPE.CONFIRM_YOU_PAID_DESCRIPTION', 'Confirm you\'ve paid a judgment debt'], }; diff --git a/src/main/modules/i18n/locales/cy.json b/src/main/modules/i18n/locales/cy.json index a91a406297f..729e647175b 100644 --- a/src/main/modules/i18n/locales/cy.json +++ b/src/main/modules/i18n/locales/cy.json @@ -2937,7 +2937,8 @@ "SUMMARY_JUDGMENT": "Dyfarniad Diannod", "UNLESS_ORDER": "Gorchymyn Oni fydd", "VARY_ORDER": "Amrywio gorchymyn", - "VARY_PAYMENT_TERMS_OF_JUDGMENT": "Amrywio telerau talu dyfarniad" + "VARY_PAYMENT_TERMS_OF_JUDGMENT": "Amrywio telerau talu dyfarniad", + "CONFIRM_YOU_PAID_CCJ": "Cadarnhewch eich bod wedi talu dyled dyfarniad" }, "COMPLETE": "Cwblhawyd", "DETAILS": "Manylion", diff --git a/src/main/modules/i18n/locales/en.json b/src/main/modules/i18n/locales/en.json index 24aea73c213..6d80fb60da3 100644 --- a/src/main/modules/i18n/locales/en.json +++ b/src/main/modules/i18n/locales/en.json @@ -2937,7 +2937,8 @@ "SUMMARY_JUDGMENT": "Summary judgment", "UNLESS_ORDER": "Unless order", "VARY_ORDER": "Vary order", - "VARY_PAYMENT_TERMS_OF_JUDGMENT": "Vary payment terms of judgment" + "VARY_PAYMENT_TERMS_OF_JUDGMENT": "Vary payment terms of judgment", + "CONFIRM_CCJ_DEBT_PAID": "Confirm you've paid a judgment debt" }, "COMPLETE": "Complete", "DETAILS": "Details", diff --git a/src/main/services/features/generalApplication/checkAnswers/addCheckAnswersRows.ts b/src/main/services/features/generalApplication/checkAnswers/addCheckAnswersRows.ts index 517fd6131f1..b7a330fb49e 100644 --- a/src/main/services/features/generalApplication/checkAnswers/addCheckAnswersRows.ts +++ b/src/main/services/features/generalApplication/checkAnswers/addCheckAnswersRows.ts @@ -323,7 +323,7 @@ export const addHasEvidenceOfDebtPaymentRow = (claimId: string, claim: Claim, la return rows; }; -function getEvidencePaymentOption(evidenceOption: string) : string { +export function getEvidencePaymentOption(evidenceOption: string) : string { switch(evidenceOption) { case debtPaymentOptions.UPLOAD_EVIDENCE_DEBT_PAID_IN_FULL : return 'PAGES.GENERAL_APPLICATION.CHECK_YOUR_ANSWER.COSC.UPLOAD_EVIDENCE_PAID_IN_FULL'; diff --git a/src/main/services/features/generalApplication/viewApplication/addViewApplicationRows.ts b/src/main/services/features/generalApplication/viewApplication/addViewApplicationRows.ts index 0fe61b98859..1fa0181968c 100644 --- a/src/main/services/features/generalApplication/viewApplication/addViewApplicationRows.ts +++ b/src/main/services/features/generalApplication/viewApplication/addViewApplicationRows.ts @@ -7,6 +7,8 @@ import {HearingTypeOptions} from 'models/generalApplication/hearingArrangement'; import {CcdHearingType} from 'models/ccdGeneralApplication/ccdGeneralApplicationHearingDetails'; import {formatDateToFullDate} from 'common/utils/dateUtils'; import {CcdSupportRequirement} from 'models/ccdGeneralApplication/ccdSupportRequirement'; +import {debtPaymentOptions} from 'models/generalApplication/debtPaymentOptions'; +import {getEvidencePaymentOption} from 'services/features/generalApplication/checkAnswers/addCheckAnswersRows'; import {CASE_DOCUMENT_VIEW_URL} from 'routes/urls'; import {documentIdExtractor} from 'common/utils/stringUtils'; @@ -254,6 +256,42 @@ export const addHearingSupportRows = (application: ApplicationResponse, lang: st return rows; }; +export const addFinalPaymentDateDetails = (application: ApplicationResponse, lang: string): SummaryRow[] => { + const lng = getLng(lang); + const rows: SummaryRow[] = []; + if (application.case_data.certOfSC) { + const finalPaymentDate = formatDateToFullDate(application.case_data.certOfSC.defendantFinalPaymentDate, lang); + rows.push( + summaryRow(t('PAGES.GENERAL_APPLICATION.FINAL_DEFENDANT_PAYMENT_DATE.FORM_HEADER_1', {lng}), finalPaymentDate), + ); + } + return rows; +}; + +export const addEvidenceOfDebtPaymentRow = (application: ApplicationResponse, lang: string): SummaryRow[] => { + const lng = getLng(lang); + let rowValue: string; + const rows: SummaryRow[] = []; + if (application.case_data.certOfSC) { + const evidenceOption = application.case_data.certOfSC.debtPaymentEvidence.debtPaymentOption; + if (evidenceOption === debtPaymentOptions.UNABLE_TO_PROVIDE_EVIDENCE_OF_FULL_PAYMENT) { + rowValue = `

+ ${t('PAGES.GENERAL_APPLICATION.CHECK_YOUR_ANSWER.COSC.UPLOAD_EVIDENCE_PAID_IN_FULL_NO', {lng})}

`; + + rowValue += `

+ ${application.case_data.certOfSC.debtPaymentEvidence.provideDetails}

`; + rows.push( + summaryRow(t('PAGES.GENERAL_APPLICATION.DEBT_PAYMENT.DO_YOU_WANT_PROVIDE_EVIDENCE', {lng}), t(rowValue, {lng}))); + } else { + const evidenceDetails = getEvidencePaymentOption(application.case_data.certOfSC.debtPaymentEvidence.debtPaymentOption); + rows.push( + summaryRow(t('PAGES.GENERAL_APPLICATION.DEBT_PAYMENT.DO_YOU_WANT_PROVIDE_EVIDENCE', {lng}), t(evidenceDetails, {lng})), + ); + } + return rows; + } +}; + const toCUIHearingPreferencesPreferredType = (hearingTypeOption: CcdHearingType): HearingTypeOptions => { switch (hearingTypeOption) { case CcdHearingType.IN_PERSON: diff --git a/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts b/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts index e14d873c64e..f46e809d371 100644 --- a/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts +++ b/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts @@ -3,6 +3,8 @@ import { addApplicationTypesAndDescriptionRows, addApplicationTypesRows, addDocumentUploadRow, + addEvidenceOfDebtPaymentRow, + addFinalPaymentDateDetails, addHearingArrangementsRows, addHearingContactDetailsRows, addHearingSupportRows, @@ -29,6 +31,7 @@ import {documentIdExtractor} from 'common/utils/stringUtils'; import { buildResponseFromCourtSection } from './responseFromCourtService'; import { CourtResponseSummaryList } from 'common/models/generalApplication/CourtResponseSummary'; import {CASE_DOCUMENT_VIEW_URL} from 'routes/urls'; +import {displayToEnumKey} from 'services/translation/convertToCUI/cuiTranslation'; export type ViewApplicationSummaries = { summaryRows: SummaryRow[], @@ -36,19 +39,28 @@ export type ViewApplicationSummaries = { } const buildApplicationSections = (application: ApplicationResponse, lang: string ): SummaryRow[] => { - return [ - ...addApplicationStatus(application, lang), - ...addApplicationTypesRows(application, lang), - ...addOtherPartiesAgreedRow(application, lang), - ...addInformOtherPartiesRow(application, lang), - ...addOrderJudgeRows(application, lang), - ...addRequestingReasonRows(application, lang), - ...addDocumentUploadRow(application, lang), - ...addHearingArrangementsRows(application, lang), - ...addHearingContactDetailsRows(application, lang), - ...addUnavailableDatesRows(application, lang), - ...addHearingSupportRows(application, lang), - ]; + if (displayToEnumKey(application.case_data.applicationTypes) === 'CONFIRM_CCJ_DEBT_PAID') { + return [ + ...addApplicationStatus(application, lang), + ...addApplicationTypesRows(application, lang), + ...addFinalPaymentDateDetails(application, lang), + ...addEvidenceOfDebtPaymentRow(application, lang), + ]; + } else { + return [ + ...addApplicationStatus(application, lang), + ...addApplicationTypesRows(application, lang), + ...addOtherPartiesAgreedRow(application, lang), + ...addInformOtherPartiesRow(application, lang), + ...addOrderJudgeRows(application, lang), + ...addRequestingReasonRows(application, lang), + ...addDocumentUploadRow(application, lang), + ...addHearingArrangementsRows(application, lang), + ...addHearingContactDetailsRows(application, lang), + ...addUnavailableDatesRows(application, lang), + ...addHearingSupportRows(application, lang), + ]; + } }; const buildViewApplicationToRespondentSections = (application: ApplicationResponse, lang: string): SummaryRow[] => { diff --git a/src/main/services/translation/generalApplication/ccdTranslation.ts b/src/main/services/translation/generalApplication/ccdTranslation.ts index 7225d07479f..9256b985480 100644 --- a/src/main/services/translation/generalApplication/ccdTranslation.ts +++ b/src/main/services/translation/generalApplication/ccdTranslation.ts @@ -277,7 +277,7 @@ export const translateCoScApplicationToCCD = ( }; }; -const toCCDCoScEvidenceDocuments = (evidenceOption: string, uploadDocuments: UploadGAFiles[]): CcdGeneralApplicationEvidenceDocument[] => { +const toCCDCoScEvidenceDocuments = (evidenceOption?: string, uploadDocuments?: UploadGAFiles[]): CcdGeneralApplicationEvidenceDocument[] => { return (evidenceOption == debtPaymentOptions.UPLOAD_EVIDENCE_DEBT_PAID_IN_FULL || evidenceOption == debtPaymentOptions.MADE_FULL_PAYMENT_TO_COURT) ? uploadDocuments?.map(uploadDocument => { return { diff --git a/src/test/unit/services/features/generalApplication/viewApplication/viewApplicationService.test.ts b/src/test/unit/services/features/generalApplication/viewApplication/viewApplicationService.test.ts index 2aa1cd5563f..d980e25eeba 100644 --- a/src/test/unit/services/features/generalApplication/viewApplication/viewApplicationService.test.ts +++ b/src/test/unit/services/features/generalApplication/viewApplication/viewApplicationService.test.ts @@ -27,6 +27,8 @@ import { import {getClaimById} from 'modules/utilityService'; import { CcdGAMakeWithNoticeDocument } from 'common/models/ccdGeneralApplication/ccdGAMakeWithNoticeDocument'; import {CcdGeneralApplicationHearingDetails} from 'models/ccdGeneralApplication/ccdGeneralApplicationHearingDetails'; +import {ApplicationTypeOption} from 'models/generalApplication/applicationType'; +import {formatDateToFullDate} from 'common/utils/dateUtils'; jest.mock('../../../../../../main/modules/i18n'); jest.mock('../../../../../../main/app/client/gaServiceClient'); @@ -544,4 +546,91 @@ describe('View Application service', () => { expect(result[0].rows[2].value.html).toContain('Application_Hearing_Notice_2024-08-01 12:15:34.pdf'); }); }); + + describe('View application content for CoSc general application', () => { + let application: ApplicationResponse; + const date = new Date(Date.now()); + const claim = new Claim(); + beforeEach(() => { + application = Object.assign(new ApplicationResponse(), mockApplication); + application.case_data.parentClaimantIsApplicant = YesNoUpperCamelCase.NO; + application.case_data.generalAppType.types =[ApplicationTypeOption.CONFIRM_CCJ_DEBT_PAID]; + jest.spyOn(GaServiceClient.prototype, 'getApplication').mockResolvedValueOnce(application); + claim.caseRole = CaseRole.DEFENDANT; + mockGetClaimById.mockResolvedValueOnce(claim); + const caseData = application.case_data; + caseData.applicationTypes = 'Confirm you\'ve paid a judgment debt'; + }); + + it('view cosc application with not able to provide evidence of full payment - applicant', async () => { + const certOfSC = { + debtPaymentEvidence: { + provideDetails: 'unable to provide evidence', + debtPaymentOption: 'UNABLE_TO_PROVIDE_EVIDENCE_OF_FULL_PAYMENT', + }, + defendantFinalPaymentDate: date, + }; + application.case_data.certOfSC = certOfSC; + mockGetApplication.mockResolvedValueOnce(application); + const result = (await getApplicationSections(mockedAppRequest, '1718105701455431', 'en')).summaryRows; + + expect(result).toHaveLength(4); + expect(result[0].key.text).toEqual('PAGES.GENERAL_APPLICATION.VIEW_APPLICATION.STATUS.TITLE'); + expect(result[0].value.html).toEqual('PAGES.GENERAL_APPLICATION.VIEW_APPLICATION.STATUS.AWAITING_RESPONSE'); + expect(result[1].key.text).toEqual('PAGES.GENERAL_APPLICATION.CHECK_YOUR_ANSWER.APPLICATION_TYPE'); + expect(result[1].value.html).toEqual('PAGES.GENERAL_APPLICATION.SELECTED_APPLICATION_TYPE.CONFIRM_YOU_PAID_CCJ'); + expect(result[2].key.text).toEqual('PAGES.GENERAL_APPLICATION.FINAL_DEFENDANT_PAYMENT_DATE.FORM_HEADER_1'); + expect(result[2].value.html).toEqual(formatDateToFullDate(date)); + expect(result[3].key.text).toEqual('PAGES.GENERAL_APPLICATION.DEBT_PAYMENT.DO_YOU_WANT_PROVIDE_EVIDENCE'); + expect(result[3].value.html).toContain('PAGES.GENERAL_APPLICATION.CHECK_YOUR_ANSWER.COSC.UPLOAD_EVIDENCE_PAID_IN_FULL_NO'); + }); + + it('view cosc application content - want to upload evidence that debt has been paid in full - applicant', async () => { + const certOfSC = { + proofOfDebtDoc: [{ + value: { + document_url: 'http://dm-store:8080/documents/d4559b', + document_binary_url: 'http://dm-store:8080/documents/d4559b/binary', + document_filename: 'test.doc', + category_id: '231', + }, + }], + debtPaymentEvidence: { + debtPaymentOption: 'UPLOAD_EVIDENCE_DEBT_PAID_IN_FULL', + }, + defendantFinalPaymentDate: date, + }; + application.case_data.certOfSC = certOfSC; + mockGetApplication.mockResolvedValueOnce(application); + const result = (await getApplicationSections(mockedAppRequest, '1718105701455431', 'en')).summaryRows; + + expect(result).toHaveLength(4); + expect(result[3].key.text).toEqual('PAGES.GENERAL_APPLICATION.DEBT_PAYMENT.DO_YOU_WANT_PROVIDE_EVIDENCE'); + expect(result[3].value.html).toContain('PAGES.GENERAL_APPLICATION.CHECK_YOUR_ANSWER.COSC.UPLOAD_EVIDENCE_PAID_IN_FULL'); + }); + + it('view cosc application content - made full payment to the court - applicant', async () => { + const certOfSC = { + proofOfDebtDoc: [{ + value: { + document_url: 'http://dm-store:8080/documents/d4559b', + document_binary_url: 'http://dm-store:8080/documents/d4559b/binary', + document_filename: 'test.doc', + category_id: '231', + }, + }], + debtPaymentEvidence: { + debtPaymentOption: 'MADE_FULL_PAYMENT_TO_COURT', + }, + defendantFinalPaymentDate: date, + }; + application.case_data.certOfSC = certOfSC; + mockGetApplication.mockResolvedValueOnce(application); + const result = (await getApplicationSections(mockedAppRequest, '1718105701455431', 'en')).summaryRows; + + expect(result).toHaveLength(4); + expect(result[3].key.text).toEqual('PAGES.GENERAL_APPLICATION.DEBT_PAYMENT.DO_YOU_WANT_PROVIDE_EVIDENCE'); + expect(result[3].value.html).toContain('PAGES.GENERAL_APPLICATION.CHECK_YOUR_ANSWER.COSC.HAS_DEBT_BEEN_PAID_TO_COURT'); + }); + }); }); From 49ac5454bae20ac6835a427c9472f4f617af7d94 Mon Sep 17 00:00:00 2001 From: kalachandrasekar1 <114995593+kalachandrasekar1@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:39:05 +0000 Subject: [PATCH 2/8] checkstyle fix --- .../common/models/generalApplication/applicationResponse.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/common/models/generalApplication/applicationResponse.ts b/src/main/common/models/generalApplication/applicationResponse.ts index b6f81fde596..ff713f93ad0 100644 --- a/src/main/common/models/generalApplication/applicationResponse.ts +++ b/src/main/common/models/generalApplication/applicationResponse.ts @@ -29,7 +29,7 @@ import { CcdGeneralApplicationRespondentResponse } from '../ccdGeneralApplicatio import { DateTime } from 'luxon'; import {CcdGARequestWrittenRepDocument} from 'models/ccdGeneralApplication/ccdGARequestWrittenRepDocument'; import {GeneralAppUrgencyRequirement} from 'models/generalApplication/response/urgencyRequirement'; -import {CcdGeneralApplicationCertOfSC} from "models/ccdGeneralApplication/ccdGeneralApplicationCertOfSC"; +import {CcdGeneralApplicationCertOfSC} from 'models/ccdGeneralApplication/ccdGeneralApplicationCertOfSC'; export class ApplicationResponse { id: string; From e254694e96adffac4aee2c92253429a7bb427a15 Mon Sep 17 00:00:00 2001 From: Sherlyn Khaw Date: Thu, 31 Oct 2024 09:14:23 +0000 Subject: [PATCH 3/8] test --- charts/civil-citizen-ui/values.preview.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/civil-citizen-ui/values.preview.template.yaml b/charts/civil-citizen-ui/values.preview.template.yaml index c118377de5e..e48e9d58976 100644 --- a/charts/civil-citizen-ui/values.preview.template.yaml +++ b/charts/civil-citizen-ui/values.preview.template.yaml @@ -203,7 +203,7 @@ civil-wa: civil-general-applications: enabled: true java: - image: 'hmctspublic.azurecr.io/civil/general-applications:latest' + image: 'hmctspublic.azurecr.io/civil/general-applications:pr-1547' releaseNameOverride: ${SERVICE_NAME}-general-applications ingressHost: ${SERVICE_NAME}-general-applications.preview.platform.hmcts.net imagePullPolicy: Always From 43f779cd75087a5e6605abdfb78a1b18358a9e07 Mon Sep 17 00:00:00 2001 From: kalachandrasekar1 Date: Thu, 31 Oct 2024 11:20:58 +0000 Subject: [PATCH 4/8] CIV-15654 testcase updated --- .../viewApplicationService.test.ts | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/test/unit/services/features/generalApplication/viewApplication/viewApplicationService.test.ts b/src/test/unit/services/features/generalApplication/viewApplication/viewApplicationService.test.ts index d980e25eeba..919c0408e2e 100644 --- a/src/test/unit/services/features/generalApplication/viewApplication/viewApplicationService.test.ts +++ b/src/test/unit/services/features/generalApplication/viewApplication/viewApplicationService.test.ts @@ -185,6 +185,10 @@ function setMockRequestForInformationDocument(): CcdGAMakeWithNoticeDocument[] { describe('View Application service', () => { const mockGetApplication = jest.spyOn(GaServiceClient.prototype, 'getApplication'); const mockGetClaimById = jest.spyOn(utilityService, 'getClaimById'); + beforeEach(() => { + jest.resetAllMocks(); + }); + describe('Build view application content for general application', () => { it('view application content test for applicant', async () => { @@ -548,21 +552,20 @@ describe('View Application service', () => { }); describe('View application content for CoSc general application', () => { - let application: ApplicationResponse; + let application : ApplicationResponse; const date = new Date(Date.now()); - const claim = new Claim(); beforeEach(() => { application = Object.assign(new ApplicationResponse(), mockApplication); application.case_data.parentClaimantIsApplicant = YesNoUpperCamelCase.NO; application.case_data.generalAppType.types =[ApplicationTypeOption.CONFIRM_CCJ_DEBT_PAID]; - jest.spyOn(GaServiceClient.prototype, 'getApplication').mockResolvedValueOnce(application); + application.case_data.applicationTypes = 'Confirm you\'ve paid a judgment debt'; + const claim = new Claim(); claim.caseRole = CaseRole.DEFENDANT; mockGetClaimById.mockResolvedValueOnce(claim); - const caseData = application.case_data; - caseData.applicationTypes = 'Confirm you\'ve paid a judgment debt'; }); it('view cosc application with not able to provide evidence of full payment - applicant', async () => { + //given const certOfSC = { debtPaymentEvidence: { provideDetails: 'unable to provide evidence', @@ -571,9 +574,10 @@ describe('View Application service', () => { defendantFinalPaymentDate: date, }; application.case_data.certOfSC = certOfSC; - mockGetApplication.mockResolvedValueOnce(application); - const result = (await getApplicationSections(mockedAppRequest, '1718105701455431', 'en')).summaryRows; - + mockGetApplication.mockResolvedValue(application); + //when + const result = (await getApplicationSections(mockedAppRequest, '1718105701451856', 'en')).summaryRows; + //then expect(result).toHaveLength(4); expect(result[0].key.text).toEqual('PAGES.GENERAL_APPLICATION.VIEW_APPLICATION.STATUS.TITLE'); expect(result[0].value.html).toEqual('PAGES.GENERAL_APPLICATION.VIEW_APPLICATION.STATUS.AWAITING_RESPONSE'); @@ -586,6 +590,7 @@ describe('View Application service', () => { }); it('view cosc application content - want to upload evidence that debt has been paid in full - applicant', async () => { + //given const certOfSC = { proofOfDebtDoc: [{ value: { @@ -601,15 +606,17 @@ describe('View Application service', () => { defendantFinalPaymentDate: date, }; application.case_data.certOfSC = certOfSC; - mockGetApplication.mockResolvedValueOnce(application); - const result = (await getApplicationSections(mockedAppRequest, '1718105701455431', 'en')).summaryRows; - + mockGetApplication.mockResolvedValue(application); + //when + const result = (await getApplicationSections(mockedAppRequest, '1718105701451856', 'en')).summaryRows; + //then expect(result).toHaveLength(4); expect(result[3].key.text).toEqual('PAGES.GENERAL_APPLICATION.DEBT_PAYMENT.DO_YOU_WANT_PROVIDE_EVIDENCE'); expect(result[3].value.html).toContain('PAGES.GENERAL_APPLICATION.CHECK_YOUR_ANSWER.COSC.UPLOAD_EVIDENCE_PAID_IN_FULL'); }); it('view cosc application content - made full payment to the court - applicant', async () => { + //given const certOfSC = { proofOfDebtDoc: [{ value: { @@ -625,9 +632,10 @@ describe('View Application service', () => { defendantFinalPaymentDate: date, }; application.case_data.certOfSC = certOfSC; - mockGetApplication.mockResolvedValueOnce(application); - const result = (await getApplicationSections(mockedAppRequest, '1718105701455431', 'en')).summaryRows; - + mockGetApplication.mockResolvedValue(application); + //when + const result = (await getApplicationSections(mockedAppRequest, '1718105701451856', 'en')).summaryRows; + //then expect(result).toHaveLength(4); expect(result[3].key.text).toEqual('PAGES.GENERAL_APPLICATION.DEBT_PAYMENT.DO_YOU_WANT_PROVIDE_EVIDENCE'); expect(result[3].value.html).toContain('PAGES.GENERAL_APPLICATION.CHECK_YOUR_ANSWER.COSC.HAS_DEBT_BEEN_PAID_TO_COURT'); From b2f033ec3794d6249f79fab4fdaf6feec8ac0d9e Mon Sep 17 00:00:00 2001 From: kalachandrasekar1 <114995593+kalachandrasekar1@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:35:14 +0000 Subject: [PATCH 5/8] Update cy.json --- src/main/modules/i18n/locales/cy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/modules/i18n/locales/cy.json b/src/main/modules/i18n/locales/cy.json index 729e647175b..982d0d573b6 100644 --- a/src/main/modules/i18n/locales/cy.json +++ b/src/main/modules/i18n/locales/cy.json @@ -2938,7 +2938,7 @@ "UNLESS_ORDER": "Gorchymyn Oni fydd", "VARY_ORDER": "Amrywio gorchymyn", "VARY_PAYMENT_TERMS_OF_JUDGMENT": "Amrywio telerau talu dyfarniad", - "CONFIRM_YOU_PAID_CCJ": "Cadarnhewch eich bod wedi talu dyled dyfarniad" + "CONFIRM_CCJ_DEBT_PAID": "Cadarnhewch eich bod wedi talu dyled dyfarniad" }, "COMPLETE": "Cwblhawyd", "DETAILS": "Manylion", From 60d3e8237d0d0a75da0f1baf64433f7625521193 Mon Sep 17 00:00:00 2001 From: Sherlyn Khaw Date: Thu, 31 Oct 2024 13:37:29 +0000 Subject: [PATCH 6/8] test --- .../civil-citizen-ui/values.elasticsearch.preview.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/civil-citizen-ui/values.elasticsearch.preview.template.yaml b/charts/civil-citizen-ui/values.elasticsearch.preview.template.yaml index 3f3ce8d8f06..c7c4bc16c33 100644 --- a/charts/civil-citizen-ui/values.elasticsearch.preview.template.yaml +++ b/charts/civil-citizen-ui/values.elasticsearch.preview.template.yaml @@ -76,7 +76,7 @@ civil-service: java: applicationPort: 4000 releaseNameOverride: ${SERVICE_NAME}-civil-service - image: 'hmctspublic.azurecr.io/civil/service:latest' + image: 'hmctspublic.azurecr.io/civil/service:pr-5750' imagePullPolicy: Always ingressHost: ${SERVICE_NAME}-civil-service.preview.platform.hmcts.net devcpuRequests: 500m From bfbabefb62b236085625691655e3d478bc6fc419 Mon Sep 17 00:00:00 2001 From: Sherlyn Khaw Date: Thu, 31 Oct 2024 14:38:39 +0000 Subject: [PATCH 7/8] test --- .../generalApplication/viewApplication/viewApplicationService.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts b/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts index f46e809d371..d132ce13926 100644 --- a/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts +++ b/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts @@ -44,7 +44,6 @@ const buildApplicationSections = (application: ApplicationResponse, lang: string ...addApplicationStatus(application, lang), ...addApplicationTypesRows(application, lang), ...addFinalPaymentDateDetails(application, lang), - ...addEvidenceOfDebtPaymentRow(application, lang), ]; } else { return [ From 39204ea02b672178ad6b58e54d16dd3e6518253e Mon Sep 17 00:00:00 2001 From: Sherlyn Khaw Date: Thu, 31 Oct 2024 14:54:10 +0000 Subject: [PATCH 8/8] test --- .../generalApplication/viewApplication/viewApplicationService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts b/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts index d132ce13926..f46e809d371 100644 --- a/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts +++ b/src/main/services/features/generalApplication/viewApplication/viewApplicationService.ts @@ -44,6 +44,7 @@ const buildApplicationSections = (application: ApplicationResponse, lang: string ...addApplicationStatus(application, lang), ...addApplicationTypesRows(application, lang), ...addFinalPaymentDateDetails(application, lang), + ...addEvidenceOfDebtPaymentRow(application, lang), ]; } else { return [