From 8d595a4d71b691b0341c522f57475ba61bfcf5de Mon Sep 17 00:00:00 2001 From: AnumehaSrivastava05 Date: Wed, 26 Oct 2022 12:03:56 -0600 Subject: [PATCH 1/4] 5271:R51 UI and API implementation --- .../controller/MaintenanceController.java | 32 ++++ .../converter/rapid/RPBSPAG0Converter.java | 34 ++++ .../ca/bc/gov/hlth/hnweb/model/rapid/AG0.java | 47 +++++ .../gov/hlth/hnweb/model/rapid/RPBSPAG0.java | 4 +- .../maintenance/ExtendCancelDateRequest.java | 78 ++++++++ .../maintenance/ExtendCancelDateResponse.java | 21 +++ .../hnweb/service/MaintenanceService.java | 32 ++++ .../src/components/template/TheNavBar.vue | 3 +- frontend/src/router/index.js | 10 + frontend/src/services/BaseService.js | 3 +- frontend/src/services/MaintenanceService.js | 4 +- .../maintenance/CoverageMaintenanceHome.vue | 1 + .../coverage/maintenance/ExtendCancelDate.vue | 178 ++++++++++++++++++ 13 files changed, 443 insertions(+), 4 deletions(-) create mode 100644 backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rest/maintenance/ExtendCancelDateRequest.java create mode 100644 backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rest/maintenance/ExtendCancelDateResponse.java create mode 100644 frontend/src/views/coverage/maintenance/ExtendCancelDate.vue diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceController.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceController.java index 08bbdee7..8121e279 100644 --- a/backend/src/main/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceController.java +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceController.java @@ -29,6 +29,8 @@ import ca.bc.gov.hlth.hnweb.model.rest.groupmember.ChangeEffectiveDateResponse; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ChangeCancelDateRequest; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ChangeCancelDateResponse; +import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ExtendCancelDateRequest; +import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ExtendCancelDateResponse; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ReinstateOverAgeDependentRequest; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ReinstateOverAgeDependentResponse; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.RenewCancelledGroupCoverageRequest; @@ -118,7 +120,37 @@ public ResponseEntity changeCancelDate( return null; } } + /** + * Extend the premium cancellation date of an employee. + * Maps to the legacy R51 (z25). + * + * @param extendCancelDateRequest + * @return The result of the operation. + */ + @PostMapping("/extend-cancel-date") + public ResponseEntity extendCancelDate( + @Valid @RequestBody ExtendCancelDateRequest extendCancelDateRequest, HttpServletRequest request) { + + Transaction transaction = auditChangeCancelDateStart(extendCancelDateRequest.getPhn(), request); + + try { + RPBSPAG0Converter converter = new RPBSPAG0Converter(); + RPBSPAG0 rpbspag0Request = converter.convertRequest(extendCancelDateRequest); + RPBSPAG0 rpbspag0Response = maintenanceService.extendCancelDate(rpbspag0Request, transaction); + ExtendCancelDateResponse extendCancelDateResponse = converter.convertExtendCancelDateResponse(rpbspag0Response); + + ResponseEntity response = ResponseEntity.ok(extendCancelDateResponse); + logger.info("extendCancelDateResponse response: {} ", extendCancelDateResponse); + + auditChangeCancelDateComplete(transaction, extendCancelDateResponse.getPhn()); + + return response; + } catch (Exception e) { + handleException(transaction, e); + return null; + } + } /** * Reinstates coverage for an overage dependent. Maps to the legacy R43. * diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/converter/rapid/RPBSPAG0Converter.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/converter/rapid/RPBSPAG0Converter.java index c666755d..f3a40b0c 100644 --- a/backend/src/main/java/ca/bc/gov/hlth/hnweb/converter/rapid/RPBSPAG0Converter.java +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/converter/rapid/RPBSPAG0Converter.java @@ -5,6 +5,8 @@ import ca.bc.gov.hlth.hnweb.model.rapid.RPBSPAG0; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ChangeCancelDateRequest; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ChangeCancelDateResponse; +import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ExtendCancelDateRequest; +import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ExtendCancelDateResponse; public class RPBSPAG0Converter extends BaseRapidConverter { private static final String TRAN_CODE = "RPBSPAG0"; @@ -31,6 +33,28 @@ public RPBSPAG0 convertRequest(ChangeCancelDateRequest request) { return rpbspag0; } + public RPBSPAG0 convertRequest(ExtendCancelDateRequest request) { + RPBSHeader rpbsHeader = new RPBSHeader(); + rpbsHeader.setOrganization(userInfo.getOrganization()); + rpbsHeader.setTranCode(getTranCode()); + + AG0 ag0 = new AG0(); + ag0.setGroupNumber(request.getGroupNumber()); + ag0.setPhn(request.getPhn()); + ag0.setExistingCancellationDate(formatDate(request.getExistingCancellationDate())); + ag0.setNewCancellationDate(formatDate(request.getNewCancellationDate())); + ag0.setImmigrationCode(request.getImmigrationCode()); + ag0.setPermitIssueDate(formatDate(request.getPermitIssueDate())); + ag0.setPermitExpiryDate(formatDate(request.getPermitExpiryDate())); + + + RPBSPAG0 rpbspag0 = new RPBSPAG0(); + rpbspag0.setRpbsHeader(rpbsHeader); + rpbspag0.setAg0(ag0); + + return rpbspag0; + } + public ChangeCancelDateResponse convertResponse(RPBSPAG0 rpbspag0) { ChangeCancelDateResponse response = new ChangeCancelDateResponse(); RPBSHeader header = rpbspag0.getRpbsHeader(); @@ -40,6 +64,16 @@ public ChangeCancelDateResponse convertResponse(RPBSPAG0 rpbspag0) { return response; } + + public ExtendCancelDateResponse convertExtendCancelDateResponse(RPBSPAG0 rpbspag0) { + ExtendCancelDateResponse response = new ExtendCancelDateResponse(); + RPBSHeader header = rpbspag0.getRpbsHeader(); + + handleStatus(header, response); + response.setPhn(rpbspag0.getAg0().getPhn()); + + return response; + } @Override public String getTranCode() { diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rapid/AG0.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rapid/AG0.java index 059d856d..a1ac8225 100644 --- a/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rapid/AG0.java +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rapid/AG0.java @@ -12,6 +12,13 @@ public class AG0 { private String existingCancellationDate; /** 4 NewCancellationDate RPBSDate No 0...10 .. */ private String newCancellationDate; + /** 5 ImmigrationCode String No 0...1 .. */ + private String immigrationCode; + /** 6 PermitIssueDate RPBSDate No 0...10 .. */ + private String permitIssueDate; + /** 6 PermitExpiryDate RPBSDate No 0...10 .. */ + private String permitExpiryDate; + public AG0() { super(); @@ -23,6 +30,9 @@ public AG0(String message) { phn = StringUtils.substring(message, 7, 17); existingCancellationDate = StringUtils.substring(message, 17, 27); newCancellationDate = StringUtils.substring(message, 27, 37); + immigrationCode = StringUtils.substring(message, 37, 38); + permitIssueDate = StringUtils.substring(message, 38, 48); + permitExpiryDate = StringUtils.substring(message, 48, 58); } @@ -37,6 +47,19 @@ public String serialize() { return sb.toString(); } + + public String serializeECD() { + // Serialize is only used in when creating the request + StringBuilder sb = new StringBuilder(); + sb.append(StringUtils.rightPad(groupNumber, 7)); + sb.append(StringUtils.rightPad(phn, 10)); + sb.append(StringUtils.rightPad(existingCancellationDate, 10)); + sb.append(StringUtils.rightPad(newCancellationDate, 10)); + sb.append(StringUtils.rightPad(immigrationCode, 1)); + sb.append(StringUtils.rightPad(permitIssueDate, 10)); + sb.append(StringUtils.rightPad(permitExpiryDate, 10)); + return sb.toString(); + } public String getGroupNumber() { return groupNumber; @@ -70,4 +93,28 @@ public void setNewCancellationDate(String newCancellationDate) { this.newCancellationDate = newCancellationDate; } + public String getImmigrationCode() { + return immigrationCode; + } + + public void setImmigrationCode(String immigrationCode) { + this.immigrationCode = immigrationCode; + } + + public String getPermitIssueDate() { + return permitIssueDate; + } + + public void setPermitIssueDate(String permitIssueDate) { + this.permitIssueDate = permitIssueDate; + } + + public String getPermitExpiryDate() { + return permitExpiryDate; + } + + public void setPermitExpiryDate(String permitExpiryDate) { + this.permitExpiryDate = permitExpiryDate; + } + } diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rapid/RPBSPAG0.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rapid/RPBSPAG0.java index 4873aefe..df90984a 100644 --- a/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rapid/RPBSPAG0.java +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rapid/RPBSPAG0.java @@ -38,5 +38,7 @@ public void setRpbsHeader(RPBSHeader rpbsHeader) { public String serialize() { return rpbsHeader.serialize() + ag0.serialize(); } - + public String serializeECD() { + return rpbsHeader.serialize() + ag0.serializeECD(); + } } diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rest/maintenance/ExtendCancelDateRequest.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rest/maintenance/ExtendCancelDateRequest.java new file mode 100644 index 00000000..895734ae --- /dev/null +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rest/maintenance/ExtendCancelDateRequest.java @@ -0,0 +1,78 @@ +package ca.bc.gov.hlth.hnweb.model.rest.maintenance; + +import java.time.LocalDate; + +public class ExtendCancelDateRequest { + private String groupNumber; + private String phn; + private LocalDate existingCancellationDate; + private LocalDate newCancellationDate; + private String immigrationCode; + private LocalDate permitIssueDate; + private LocalDate permitExpiryDate; + + public String getGroupNumber() { + return groupNumber; + } + + public void setGroupNumber(String groupNumber) { + this.groupNumber = groupNumber; + } + + public String getPhn() { + return phn; + } + + public void setPhn(String phn) { + this.phn = phn; + } + + public LocalDate getExistingCancellationDate() { + return existingCancellationDate; + } + + public void setExistingCancellationDate(LocalDate existingCancellationDate) { + this.existingCancellationDate = existingCancellationDate; + } + + public LocalDate getNewCancellationDate() { + return newCancellationDate; + } + + public void setNewCancellationDate(LocalDate newCancellationDate) { + this.newCancellationDate = newCancellationDate; + } + + public String getImmigrationCode() { + return immigrationCode; + } + + public void setImmigrationCode(String immigrationCode) { + this.immigrationCode = immigrationCode; + } + + public LocalDate getPermitIssueDate() { + return permitIssueDate; + } + + public void setPermitIssueDate(LocalDate permitIssueDate) { + this.permitIssueDate = permitIssueDate; + } + + public LocalDate getPermitExpiryDate() { + return permitExpiryDate; + } + + public void setPermitExpiryDate(LocalDate permitExpiryDate) { + this.permitExpiryDate = permitExpiryDate; + } + + @Override + public String toString() { + return "ExtendCancelDateRequest [groupNumber=" + groupNumber + ", phn=" + phn + ", existingCancellationDate=" + + existingCancellationDate + ", newCancellationDate=" + newCancellationDate + ", immigrationCode=" + + immigrationCode + ", permitIssueDate=" + permitIssueDate + ", permitExpiryDate=" + permitExpiryDate + + "]"; + } + +} diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rest/maintenance/ExtendCancelDateResponse.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rest/maintenance/ExtendCancelDateResponse.java new file mode 100644 index 00000000..9250c5c8 --- /dev/null +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/model/rest/maintenance/ExtendCancelDateResponse.java @@ -0,0 +1,21 @@ +package ca.bc.gov.hlth.hnweb.model.rest.maintenance; + +import ca.bc.gov.hlth.hnweb.model.rest.BaseResponse; + +public class ExtendCancelDateResponse extends BaseResponse { + private String phn; + + public String getPhn() { + return phn; + } + + public void setPhn(String phn) { + this.phn = phn; + } + + @Override + public String toString() { + return "ExtendCancelDateResponse [phn=" + phn + "]"; + } + +} diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/service/MaintenanceService.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/service/MaintenanceService.java index 7f6ed8d2..315793bc 100644 --- a/backend/src/main/java/ca/bc/gov/hlth/hnweb/service/MaintenanceService.java +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/service/MaintenanceService.java @@ -35,6 +35,9 @@ public class MaintenanceService extends BaseService { @Value("${rapid.r46Path:}") private String r46Path; + + @Value("${rapid.r51Path:}") + private String r51Path; @Autowired private WebClient rapidWebClient; @@ -97,6 +100,35 @@ public RPBSPAG0 changeCancelDate(RPBSPAG0 rpbspag0, Transaction transaction) thr return rpbspag0Response; } + /** + * Changes Coverage Cancellation Date for the group member based on the R46/RPBSPAG0 request. + * + * @param rpbspag0 + * @param transaction + * @return The RPBSPAG0 response. + * @throws HNWebException + */ + public RPBSPAG0 extendCancelDate(RPBSPAG0 rpbspag0, Transaction transaction) throws HNWebException { + String rpbspag0Str = rpbspag0.serializeECD(); + + logger.info("Request:\n{}", rpbspag0Str); + + messageSent(transaction); + ResponseEntity response = postRapidRequest(r46Path, rpbspag0Str, + transaction.getTransactionId().toString()); + messageReceived(transaction); + logger.info("Response Status: {}; Message:\n{}", response.getStatusCode(), response.getBody()); + + if (response.getStatusCode() != HttpStatus.OK) { + logger.error("Could not connect to downstream service. Service returned {}", response.getStatusCode()); + throw new HNWebException(ExceptionType.DOWNSTREAM_FAILURE); + } + + RPBSPAG0 rpbspag0Response = new RPBSPAG0(response.getBody()); + + return rpbspag0Response; + } + /** * Reinstate an Over Age Dependent based on the R43/RPBSPRE0 request. * diff --git a/frontend/src/components/template/TheNavBar.vue b/frontend/src/components/template/TheNavBar.vue index 35b8e0b9..39daaca8 100644 --- a/frontend/src/components/template/TheNavBar.vue +++ b/frontend/src/components/template/TheNavBar.vue @@ -33,6 +33,7 @@ Change Cancel Date Reinstate OverAge Dependent Renew Cancelled Group Coverage + Extend Cancel Date @@ -146,7 +147,7 @@ export default { return this.hasPermission('AddGroupMember') || this.hasPermission('AddDependent') || this.hasPermission('UpdateNumberAndDept') || this.hasPermission('CancelGroupMember') || this.hasPermission('CancelDependent') }, hasMaintenancePermission() { - return this.hasPermission('ReinstateOverAgeDependent') || this.hasPermission('ChangeEffectiveDate') || this.hasPermission('ChangeCancelDate') || this.hasPermission('RenewCancelledCoverage') + return this.hasPermission('ReinstateOverAgeDependent') || this.hasPermission('ChangeEffectiveDate') || this.hasPermission('ChangeCancelDate') || this.hasPermission('RenewCancelledCoverage') || this.hasPermission('ExtendCancelDate') }, hasMSPContractsPermission() { return this.hasPermission('GetContractPeriods') || this.hasPermission('ContractInquiry') || this.hasPermission('UpdateContractAddress') diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index f5b8eb60..3697192f 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -17,6 +17,7 @@ import CoverageEnrollmentHome from '../views/coverage/enrollment/CoverageEnrollm import ChangeCancelDate from '../views/coverage/maintenance/ChangeCancelDate.vue' import ChangeEffectiveDate from '../views/coverage/maintenance/ChangeEffectiveDate.vue' import CoverageMaintenanceHome from '../views/coverage/maintenance/CoverageMaintenanceHome.vue' +import ExtendCancelDate from '../views/coverage/maintenance/ExtendCancelDate.vue' import ReinstateOverAgeDependent from '../views/coverage/maintenance/ReinstateOverAgeDependent.vue' import RenewCancelledGroupCoverage from '../views/coverage/maintenance/RenewCancelledGroupCoverage.vue' import EligibilityHome from '../views/eligibility/EligibilityHome.vue' @@ -130,6 +131,15 @@ const createRoutes = (app) => [ requiresAuth: true, }, }, + { + path: 'extendCancelDate', + name: 'ExtendCancelDate', + component: ExtendCancelDate, + meta: { + permission: 'ExtendCancelDate', + requiresAuth: true, + }, + }, { path: 'reinstateOverAgeDependent', name: 'ReinstateOverAgeDependent', diff --git a/frontend/src/services/BaseService.js b/frontend/src/services/BaseService.js index d4c25fe3..a3f64381 100644 --- a/frontend/src/services/BaseService.js +++ b/frontend/src/services/BaseService.js @@ -19,7 +19,7 @@ export const resources = { getPatientRegistration: '/patient-registration/get-patient-registration', }, bcscPayeeMappings: { - getBcscPayeeMapping: '/payee-mapping' + getBcscPayeeMapping: '/payee-mapping', }, groupMember: { addGroupMember: '/group-member/add-group-member', @@ -31,6 +31,7 @@ export const resources = { maintenance: { changeEffectiveDate: '/maintenance/change-effective-date', changeCancelDate: '/maintenance/change-cancel-date', + extendCancelDate: '/maintenance/extend-cancel-date', reinstateOverAgeDependent: '/maintenance/reinstate-over-age-dependent', renewCancelledGroupCoverage: '/maintenance/renew-cancelled-group-coverage', }, diff --git a/frontend/src/services/MaintenanceService.js b/frontend/src/services/MaintenanceService.js index e9848521..0cbe2418 100644 --- a/frontend/src/services/MaintenanceService.js +++ b/frontend/src/services/MaintenanceService.js @@ -10,8 +10,10 @@ export default { reinstateOverAgeDependent(request) { return apiRequest().then((axiosInstance) => axiosInstance.post(resources.maintenance.reinstateOverAgeDependent, request)) }, - renewCancelledGroupCoverage(request) { return apiRequest().then((axiosInstance) => axiosInstance.post(resources.maintenance.renewCancelledGroupCoverage, request)) }, + extendCancelDate(request) { + return apiRequest().then((axiosInstance) => axiosInstance.post(resources.maintenance.extendCancelDate, request)) + }, } diff --git a/frontend/src/views/coverage/maintenance/CoverageMaintenanceHome.vue b/frontend/src/views/coverage/maintenance/CoverageMaintenanceHome.vue index eb75dfec..98242b7f 100644 --- a/frontend/src/views/coverage/maintenance/CoverageMaintenanceHome.vue +++ b/frontend/src/views/coverage/maintenance/CoverageMaintenanceHome.vue @@ -2,6 +2,7 @@ + diff --git a/frontend/src/views/coverage/maintenance/ExtendCancelDate.vue b/frontend/src/views/coverage/maintenance/ExtendCancelDate.vue new file mode 100644 index 00000000..b59889b5 --- /dev/null +++ b/frontend/src/views/coverage/maintenance/ExtendCancelDate.vue @@ -0,0 +1,178 @@ + + + From 768e8180867ca0067ef2c541c291f4bc8a8448d6 Mon Sep 17 00:00:00 2001 From: AnumehaSrivastava05 Date: Fri, 28 Oct 2022 12:32:59 -0600 Subject: [PATCH 2/4] R51: Added Unit test --- .../controller/MaintenanceController.java | 30 +++- .../hlth/hnweb/security/TransactionType.java | 1 + .../controller/MaintenanceControllerTest.java | 134 +++++++++++++++++- 3 files changed, 158 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceController.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceController.java index 8121e279..32ff9e20 100644 --- a/backend/src/main/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceController.java +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceController.java @@ -121,8 +121,7 @@ public ResponseEntity changeCancelDate( } } /** - * Extend the premium cancellation date of an employee. - * Maps to the legacy R51 (z25). + * Extend the premium cancellation date of an employee. Maps to the legacy R51(z25). * * @param extendCancelDateRequest * @return The result of the operation. @@ -131,19 +130,20 @@ public ResponseEntity changeCancelDate( public ResponseEntity extendCancelDate( @Valid @RequestBody ExtendCancelDateRequest extendCancelDateRequest, HttpServletRequest request) { - Transaction transaction = auditChangeCancelDateStart(extendCancelDateRequest.getPhn(), request); + Transaction transaction = auditExtendCancelDateStart(extendCancelDateRequest.getPhn(), request); try { RPBSPAG0Converter converter = new RPBSPAG0Converter(); RPBSPAG0 rpbspag0Request = converter.convertRequest(extendCancelDateRequest); RPBSPAG0 rpbspag0Response = maintenanceService.extendCancelDate(rpbspag0Request, transaction); - ExtendCancelDateResponse extendCancelDateResponse = converter.convertExtendCancelDateResponse(rpbspag0Response); + ExtendCancelDateResponse extendCancelDateResponse = converter + .convertExtendCancelDateResponse(rpbspag0Response); ResponseEntity response = ResponseEntity.ok(extendCancelDateResponse); logger.info("extendCancelDateResponse response: {} ", extendCancelDateResponse); - auditChangeCancelDateComplete(transaction, extendCancelDateResponse.getPhn()); + auditExtendCancelDateComplete(transaction, extendCancelDateResponse.getPhn()); return response; } catch (Exception e) { @@ -151,6 +151,7 @@ public ResponseEntity extendCancelDate( return null; } } + /** * Reinstates coverage for an overage dependent. Maps to the legacy R43. * @@ -257,6 +258,25 @@ private void auditChangeEffectiveDateComplete(Transaction transaction, } } + private Transaction auditExtendCancelDateStart(String phn, HttpServletRequest request) { + + Transaction transaction = transactionStart(request, TransactionType.EXTEND_CANCEL_DATE); + + if (StringUtils.isNotBlank(phn)) { + addAffectedParty(transaction, IdentifierType.PHN, phn, AffectedPartyDirection.INBOUND); + } + return transaction; + } + + private void auditExtendCancelDateComplete(Transaction transaction, String phn) { + + transactionComplete(transaction); + + if (StringUtils.isNotBlank(phn)) { + addAffectedParty(transaction, IdentifierType.PHN, phn, AffectedPartyDirection.OUTBOUND); + } + } + private Transaction auditChangeCancelDateStart(String phn, HttpServletRequest request) { Transaction transaction = transactionStart(request, TransactionType.CHANGE_CANCEL_DATE); diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/security/TransactionType.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/security/TransactionType.java index f154597f..c5a2447e 100644 --- a/backend/src/main/java/ca/bc/gov/hlth/hnweb/security/TransactionType.java +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/security/TransactionType.java @@ -24,6 +24,7 @@ public enum TransactionType { RENEW_CANCELLED_COVERAGE("RenewCancelledCoverage"), // R45 CHANGE_EFFECTIVE_DATE("ChangeEffectiveDate"), // R46a CHANGE_CANCEL_DATE("ChangeCancelDate"), // R46b + EXTEND_CANCEL_DATE("ExtendCancelDate"), // R51 GET_PATIENT_REGISTRATION("GetPatientRegistration"), // R70 UNKNOWN("Unknown"); diff --git a/backend/src/test/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceControllerTest.java b/backend/src/test/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceControllerTest.java index 0f736306..3a628c16 100644 --- a/backend/src/test/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceControllerTest.java +++ b/backend/src/test/java/ca/bc/gov/hlth/hnweb/controller/MaintenanceControllerTest.java @@ -20,6 +20,8 @@ import ca.bc.gov.hlth.hnweb.model.rest.groupmember.ChangeEffectiveDateResponse; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ChangeCancelDateRequest; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ChangeCancelDateResponse; +import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ExtendCancelDateRequest; +import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ExtendCancelDateResponse; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ReinstateOverAgeDependentRequest; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.ReinstateOverAgeDependentResponse; import ca.bc.gov.hlth.hnweb.model.rest.maintenance.RenewCancelledGroupCoverageRequest; @@ -73,6 +75,14 @@ public class MaintenanceControllerTest extends BaseControllerTest { private static final String R30_SUCCESS = " RPBSPXP000000010 RESPONSERPBS9014TRANSACTION SUCCESSFUL 6267405 2021-12-01 550 KP RD VICTORIA BC V4R8U8 9873098549"; + private static final String R51_SUCCESS = " RPBSPAG000000010 RESPONSERPBS9014TRANSACTION SUCCESSFUL 606855598730689262022-10-312022-11-30S2022-10-012023-05-31"; + + private static final String R51_EXPIRY_DATE_MUST_BE_AFTER_ISSUE_DATE = " RPBSPAG000000010 ERRORMSGRPBS0210VISA EXPIRY DATE MUST BE AFTER VISA ISSUE DATE 606855598730689262022-10-312023-10-31S2022-10-012022-05-31"; + + private static final String R51_INVALID_IMMIGRATION_CODE= " RPBSPAG000000010 ERRORMSGRPBS0194IMMIGRATION CODE IS INVALID 633710993329124862022-09-302022-10-31nullnullnull"; + + private static final String R51_VISA_DATE_CHANGE_REJECTED= " RPBSPAG000000010 ERRORMSGRPBS0172COVERAGE NOT CANCELLED D, VISA DATE CHANGE REJECTED 633710993329124862022-09-302022-10-31S2022-10-012023-10-31"; + protected static DateTimeFormatter dateOnlyFormatter = DateTimeFormatter.ofPattern(V2MessageUtil.DATE_FORMAT_DATE_ONLY); @Autowired @@ -578,6 +588,115 @@ public void testRenewCancelledCoverage_success() throws Exception { assertAffectedPartyCount(AffectedPartyDirection.OUTBOUND, 1); } + @Test + public void testExtendCancelDate_success() throws Exception { + mockBackEnd.enqueue( + new MockResponse().setBody(R51_SUCCESS).addHeader(CONTENT_TYPE, MediaType.TEXT_PLAIN.toString())); + + ExtendCancelDateRequest extendCancelDateRequest = createExtendCancelDateRequest("9873068926", "6068555", + LocalDate.parse("2022-10-31"), "S", LocalDate.parse("2022-10-01"), LocalDate.parse("2023-10-31")); + + ResponseEntity response = maintenanceController + .extendCancelDate(extendCancelDateRequest, createHttpServletRequest()); + + ExtendCancelDateResponse extendCancelDateResponse = response.getBody(); + assertEquals(StatusEnum.SUCCESS, extendCancelDateResponse.getStatus()); + assertEquals("RPBS9014 TRANSACTION COMPLETED", extendCancelDateResponse.getMessage()); + + assertEquals("9873068926", extendCancelDateResponse.getPhn()); + + // Check the client request is sent as expected + RecordedRequest recordedRequest = mockBackEnd.takeRequest(); + assertEquals(HttpMethod.POST.name(), recordedRequest.getMethod()); + assertEquals(MediaType.TEXT_PLAIN.toString(), recordedRequest.getHeader(CONTENT_TYPE)); + + assertTransactionCreated(TransactionType.EXTEND_CANCEL_DATE); + assertAffectedPartyCount(AffectedPartyDirection.INBOUND, 1); + assertAffectedPartyCount(AffectedPartyDirection.OUTBOUND, 1); + } + + @Test + public void testExtendCancelDate_error_invalidImmigrationCode() throws Exception { + mockBackEnd.enqueue(new MockResponse().setBody(R51_INVALID_IMMIGRATION_CODE).addHeader(CONTENT_TYPE, + MediaType.TEXT_PLAIN.toString())); + + ExtendCancelDateRequest extendCancelDateRequest = createExtendCancelDateRequest("9332912486", "6337109", + LocalDate.parse("2022-10-31"), null, null, null); + + ResponseEntity response = maintenanceController + .extendCancelDate(extendCancelDateRequest, createHttpServletRequest()); + + ExtendCancelDateResponse extendCancelDateResponse = response.getBody(); + assertEquals(StatusEnum.ERROR, extendCancelDateResponse.getStatus()); + assertEquals("RPBS0194 IMMIGRATION CODE IS INVALID", extendCancelDateResponse.getMessage()); + + assertEquals("9332912486", extendCancelDateResponse.getPhn()); + + // Check the client request is sent as expected + RecordedRequest recordedRequest = mockBackEnd.takeRequest(); + assertEquals(HttpMethod.POST.name(), recordedRequest.getMethod()); + assertEquals(MediaType.TEXT_PLAIN.toString(), recordedRequest.getHeader(CONTENT_TYPE)); + + assertTransactionCreated(TransactionType.EXTEND_CANCEL_DATE); + assertAffectedPartyCount(AffectedPartyDirection.INBOUND, 1); + assertAffectedPartyCount(AffectedPartyDirection.OUTBOUND, 1); + } + + @Test + public void testExtendCancelDate_error_expiryDateMustBeAfterIssueDate() throws Exception { + mockBackEnd.enqueue(new MockResponse().setBody(R51_EXPIRY_DATE_MUST_BE_AFTER_ISSUE_DATE).addHeader(CONTENT_TYPE, + MediaType.TEXT_PLAIN.toString())); + + ExtendCancelDateRequest extendCancelDateRequest = createExtendCancelDateRequest("9873068926", "6068555", + LocalDate.parse("2022-10-31"), "S", LocalDate.parse("2023-10-01"), LocalDate.parse("2022-10-31")); + + ResponseEntity response = maintenanceController + .extendCancelDate(extendCancelDateRequest, createHttpServletRequest()); + + ExtendCancelDateResponse extendCancelDateResponse = response.getBody(); + assertEquals(StatusEnum.ERROR, extendCancelDateResponse.getStatus()); + assertEquals("RPBS0210 VISA EXPIRY DATE MUST BE AFTER VISA ISSUE DATE", extendCancelDateResponse.getMessage()); + + assertEquals("9873068926", extendCancelDateResponse.getPhn()); + + // Check the client request is sent as expected + RecordedRequest recordedRequest = mockBackEnd.takeRequest(); + assertEquals(HttpMethod.POST.name(), recordedRequest.getMethod()); + assertEquals(MediaType.TEXT_PLAIN.toString(), recordedRequest.getHeader(CONTENT_TYPE)); + + assertTransactionCreated(TransactionType.EXTEND_CANCEL_DATE); + assertAffectedPartyCount(AffectedPartyDirection.INBOUND, 1); + assertAffectedPartyCount(AffectedPartyDirection.OUTBOUND, 1); + } + + @Test + public void testExtendCancelDate_error_visaDateChangeRejected() throws Exception { + mockBackEnd.enqueue(new MockResponse().setBody(R51_VISA_DATE_CHANGE_REJECTED).addHeader(CONTENT_TYPE, + MediaType.TEXT_PLAIN.toString())); + + ExtendCancelDateRequest extendCancelDateRequest = createExtendCancelDateRequest("9332912486", "6337109", + LocalDate.parse("2022-10-31"), "S", LocalDate.parse("2022-10-01"), LocalDate.parse("2023-10-31")); + + ResponseEntity response = maintenanceController + .extendCancelDate(extendCancelDateRequest, createHttpServletRequest()); + + ExtendCancelDateResponse extendCancelDateResponse = response.getBody(); + assertEquals(StatusEnum.ERROR, extendCancelDateResponse.getStatus()); + assertEquals("RPBS0172 COVERAGE NOT CANCELLED D, VISA DATE CHANGE REJECTED", + extendCancelDateResponse.getMessage()); + + assertEquals("9332912486", extendCancelDateResponse.getPhn()); + + // Check the client request is sent as expected + RecordedRequest recordedRequest = mockBackEnd.takeRequest(); + assertEquals(HttpMethod.POST.name(), recordedRequest.getMethod()); + assertEquals(MediaType.TEXT_PLAIN.toString(), recordedRequest.getHeader(CONTENT_TYPE)); + + assertTransactionCreated(TransactionType.EXTEND_CANCEL_DATE); + assertAffectedPartyCount(AffectedPartyDirection.INBOUND, 1); + assertAffectedPartyCount(AffectedPartyDirection.OUTBOUND, 1); + } + /** * The URL property used by the mocked endpoint needs to be set after the MockWebServer starts as the port it uses is @@ -589,7 +708,6 @@ static void registerMockUrlProperty(DynamicPropertyRegistry registry) { registry.add("rapid.url", () -> String.format("http://localhost:%s", mockBackEnd.getPort())); } - private ChangeEffectiveDateRequest createChangeEffectiveDate(LocalDate newEffectiveDate, LocalDate oldEffectiveDate) { ChangeEffectiveDateRequest changeEffDateRequest = new ChangeEffectiveDateRequest(); changeEffDateRequest.setGroupNumber("6337109"); @@ -600,7 +718,6 @@ private ChangeEffectiveDateRequest createChangeEffectiveDate(LocalDate newEffect return changeEffDateRequest; } - private ChangeCancelDateRequest createChangeCancelDateRequest(String phn, LocalDate existingCancellationDate, LocalDate newCancellationDate) { ChangeCancelDateRequest changeCancelDateRequest = new ChangeCancelDateRequest(); @@ -632,4 +749,17 @@ private RenewCancelledGroupCoverageRequest createRenewCancelledGroupCoverageRequ return renewCancelledGroupCoverageRequest; } + private ExtendCancelDateRequest createExtendCancelDateRequest(String phn, String groupNumber, + LocalDate newCancelDate, String immigrationCode, LocalDate issueDate, LocalDate expiryDate) { + ExtendCancelDateRequest extendCancelDateRequest = new ExtendCancelDateRequest(); + extendCancelDateRequest.setPhn(phn); + extendCancelDateRequest.setGroupNumber(groupNumber); + extendCancelDateRequest.setNewCancellationDate(newCancelDate); + extendCancelDateRequest.setExistingCancellationDate(LocalDate.parse("2022-09-30")); + extendCancelDateRequest.setPermitIssueDate(issueDate); + extendCancelDateRequest.setPermitExpiryDate(expiryDate); + extendCancelDateRequest.setImmigrationCode(immigrationCode); + return extendCancelDateRequest; + } + } From 14843bc405354015aba64fae5f2ccc2985f856b0 Mon Sep 17 00:00:00 2001 From: AnumehaSrivastava05 Date: Mon, 31 Oct 2022 13:59:17 -0600 Subject: [PATCH 3/4] 5271: Added testcafe --- .../src/test/resources/application-dev.yaml | 5 +- .../coverage/maintenance/ExtendCancelDate.vue | 1 + .../pages/maintenance/ExtendCancelDatePage.js | 18 ++ .../tests/maintenance/ExtendCancelDateTest.js | 165 ++++++++++++++++++ 4 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 frontend/tests/e2e/pages/maintenance/ExtendCancelDatePage.js create mode 100644 frontend/tests/e2e/tests/maintenance/ExtendCancelDateTest.js diff --git a/backend/src/test/resources/application-dev.yaml b/backend/src/test/resources/application-dev.yaml index dd3a9e98..dc8caed7 100644 --- a/backend/src/test/resources/application-dev.yaml +++ b/backend/src/test/resources/application-dev.yaml @@ -42,7 +42,8 @@ rapid: r41Path: r42Path: r43Path: - r46Path: + r46Path: + r51Path: user: name: password: @@ -117,4 +118,4 @@ security: - ExtendCancelDate - AddPermitHolderWOPHN - AddPermitHolderWithPHN - - AuditReporting + - AuditReporting \ No newline at end of file diff --git a/frontend/src/views/coverage/maintenance/ExtendCancelDate.vue b/frontend/src/views/coverage/maintenance/ExtendCancelDate.vue index b59889b5..b2e92423 100644 --- a/frontend/src/views/coverage/maintenance/ExtendCancelDate.vue +++ b/frontend/src/views/coverage/maintenance/ExtendCancelDate.vue @@ -75,6 +75,7 @@ export default { existingCancellationDate: null, newCancellationDate: null, immigrationCode: '', + immigrationCodeOptions: {}, permitIssueDate: null, permitExpiryDate: null, result: { diff --git a/frontend/tests/e2e/pages/maintenance/ExtendCancelDatePage.js b/frontend/tests/e2e/pages/maintenance/ExtendCancelDatePage.js new file mode 100644 index 00000000..d6f01d84 --- /dev/null +++ b/frontend/tests/e2e/pages/maintenance/ExtendCancelDatePage.js @@ -0,0 +1,18 @@ +import { Selector } from 'testcafe' + +class ExtendCancelDate { + constructor() { + this.groupNumberInput = Selector('#groupNumber') + this.phnInput = Selector('#phn') + this.existingCancelDateInput = Selector('#dp-input-existingCancellationDate') + this.newCancelDateInput = Selector('#dp-input-newCancellationDate') + this.immigrationCodeSelect = Selector('#immigrationCode') + this.permitIssueDate = Selector('#dp-input-permitIssueDate') + this.permitExpiryDate = Selector('#dp-input-permitExpiryDate') + this.submitButton = Selector('button[type="submit"]') + this.clearButton = Selector('button[type="button"]').withText('Clear') + this.errorText = Selector('div').withAttribute('class', 'error-text') + } +} + +export default new ExtendCancelDate() diff --git a/frontend/tests/e2e/tests/maintenance/ExtendCancelDateTest.js b/frontend/tests/e2e/tests/maintenance/ExtendCancelDateTest.js new file mode 100644 index 00000000..bef49b43 --- /dev/null +++ b/frontend/tests/e2e/tests/maintenance/ExtendCancelDateTest.js @@ -0,0 +1,165 @@ +import { SITE_UNDER_TEST } from '../../configuration' +import AlertPage from '../../pages/AlertPage' +import ExtendCancelDatePage from '../../pages/maintenance/ExtendCancelDatePage' +import { regularAccUser } from '../../roles/roles' + +const immigrationCodeOption = ExtendCancelDatePage.immigrationCodeSelect.find('option') +const ERROR_MESSAGE = 'Please correct errors before submitting' +const GROUP_NUMBER_REQUIRED_MESSAGE = 'Group Number is required' +const PHN_REQUIRED_MESSAGE = 'PHN is required' +const EXISTING_CANCELLATION_DATE_REQUIRED_MESSAGE = 'Existing Cancellation Date is required' +const NEW_CANCELLATION_DATE_REQUIRED_MESSAGE = 'New Cancellation Date is required' +const IMMIGRATION_CODE_REQUIRED_MESSAGE = 'Immigration Code is required' +const PERMIT_ISSUE_DATE_REQUIRED_MESSAGE = 'Permit Issue Date is required' +const PERMIT_EXPIRY_DATE_REQUIRED_MESSAGE = 'Permit Expiry Date is required' +const INVALID_GROUP_NUMBER_ERROR_MESSAGE = 'Group Number is invalid' +const INVALID_PHN_ERROR_MESSAGE = 'PHN format is invalid' +const NEW_DATE_CANNOT_EQUAL_OLD_DATE = 'RPBS0138 NEW CANCEL DATE CANNOT EQUAL OLD CANCEL DATE' +const VISA_EXPIRY_DATE_MUST_BE_AFTER_ISSUE_DATE = 'RPBS0210 VISA EXPIRY DATE MUST BE AFTER VISA ISSUE DATE' +const CANCEL_DATE_TOO_FAR_IN_THE_PAST = 'RPBS0159 NEW COVERAGE CANCEL DATE TOO FAR IN THE PAST' +const PAGE_TO_TEST = SITE_UNDER_TEST + '/coverage/maintenance/extendCancelDate' + +fixture(`Contract Inquiry Page`).disablePageCaching`Test Change Cancel Date` + .beforeEach(async (t) => { + await t.useRole(regularAccUser).navigateTo(PAGE_TO_TEST) + }) + .page(SITE_UNDER_TEST) + +test('Check required fields validation', async (t) => { + await t + // Given required fields aren't filled out (PHN) + // When I click the submit button + .click(ExtendCancelDatePage.submitButton) + // I expect an error message stating the page had errors and individual error messages for each required field + .expect(AlertPage.alertBannerText.textContent) + .contains(ERROR_MESSAGE) + .expect(ExtendCancelDatePage.errorText.nth(0).textContent) + .contains(GROUP_NUMBER_REQUIRED_MESSAGE) + .expect(ExtendCancelDatePage.errorText.nth(1).textContent) + .contains(PHN_REQUIRED_MESSAGE) + .expect(ExtendCancelDatePage.errorText.nth(2).textContent) + .contains(EXISTING_CANCELLATION_DATE_REQUIRED_MESSAGE) + .expect(ExtendCancelDatePage.errorText.nth(3).textContent) + .contains(NEW_CANCELLATION_DATE_REQUIRED_MESSAGE) + .expect(ExtendCancelDatePage.errorText.nth(4).textContent) + .contains(IMMIGRATION_CODE_REQUIRED_MESSAGE) + .expect(ExtendCancelDatePage.errorText.nth(5).textContent) + .contains(PERMIT_ISSUE_DATE_REQUIRED_MESSAGE) + .expect(ExtendCancelDatePage.errorText.nth(5).textContent) + .contains(PERMIT_EXPIRY_DATE_REQUIRED_MESSAGE) +}) + +test('Check invalid phn, groupNumber format validation', async (t) => { + await t + // Given a PHN entered with an invalid format + .typeText(ExtendCancelDatePage.phnInput, '9000448000') + .typeText(ExtendCancelDatePage.groupNumberInput, '0000001') + // When I click the submit button + .click(ExtendCancelDatePage.submitButton) + // I expect an error message stating the page had errors and an individual error message for the PHN format + .expect(AlertPage.alertBannerText.textContent) + .contains(ERROR_MESSAGE) + .expect(ExtendCancelDatePage.errorText.nth(0).textContent) + .contains(INVALID_GROUP_NUMBER_ERROR_MESSAGE) + .expect(ExtendCancelDatePage.errorText.nth(1).textContent) + .contains(INVALID_PHN_ERROR_MESSAGE) +}) + +test('Check properly filled form passes validation and validate results, dates cannot be equal', async (t) => { + await t + .typeText(ExtendCancelDatePage.groupNumberInput, '4841904') + .typeText(ExtendCancelDatePage.phnInput, '9873251693') + .click(ExtendCancelDatePage.immigrationCodeSelect) + .click(immigrationCodeOption.withText('Student Authorization')) + .typeText(ExtendCancelDatePage.existingCancelDateInput, '20220731') + .pressKey('tab') + .pressKey('tab') + .typeText(ExtendCancelDatePage.newCancelDateInput, '20220731') + .pressKey('tab') + .pressKey('tab') + .typeText(ExtendCancelDatePage.permitIssueDate, '20220701') + .typeText(ExtendCancelDatePage.permitExpiryDate, '20230731') + // When I click the submit button + .click(ExtendCancelDatePage.submitButton) + .wait(5000) + // I expect a Error message + .expect(AlertPage.alertBannerText.textContent) + .contains(NEW_DATE_CANNOT_EQUAL_OLD_DATE) +}) + +test('Check properly filled form passes validation and validate results, invalid visa expiry date', async (t) => { + await t + // Given the page is filled out correctly + .typeText(ExtendCancelDatePage.groupNumberInput, '4841904') + .typeText(ExtendCancelDatePage.phnInput, '9873251693') + .click(ExtendCancelDatePage.immigrationCodeSelect) + .click(immigrationCodeOption.withText('Student Authorization')) + .typeText(ExtendCancelDatePage.existingCancelDateInput, '20220630') + .pressKey('tab') + .pressKey('tab') + .typeText(ExtendCancelDatePage.newCancelDateInput, '20220731') + .pressKey('tab') + .pressKey('tab') + .typeText(ExtendCancelDatePage.permitIssueDate, '20230701') + .typeText(ExtendCancelDatePage.permitExpiryDate, '20220731') + // When I click the submit button + .click(ExtendCancelDatePage.submitButton) + // I expect a Error message + .expect(AlertPage.alertBannerText.textContent) + .contains(VISA_EXPIRY_DATE_MUST_BE_AFTER_ISSUE_DATE) +}) + +test('Check properly filled form passes validation and validate results, cancel date too far in the past', async (t) => { + await t + // Given the page is filled out correctly + .typeText(ExtendCancelDatePage.groupNumberInput, '6337109') + .typeText(ExtendCancelDatePage.phnInput, '9332912486') + .click(ExtendCancelDatePage.immigrationCodeSelect) + .click(immigrationCodeOption.withText('Student Authorization')) + .typeText(ExtendCancelDatePage.existingCancelDateInput, '20220630') + .pressKey('tab') + .pressKey('tab') + .typeText(ExtendCancelDatePage.newCancelDateInput, '20220731') + .pressKey('tab') + .pressKey('tab') + .typeText(ExtendCancelDatePage.permitIssueDate, '20220701') + .typeText(ExtendCancelDatePage.permitExpiryDate, '20230731') + .wait(1000) + // When I click the submit button + .click(ExtendCancelDatePage.submitButton) + // I expect a Error message + .expect(AlertPage.alertBannerText.textContent) + .contains(CANCEL_DATE_TOO_FAR_IN_THE_PAST) +}) + +test('Check clear button clears the form', async (t) => { + await t + // Given I have a form filled out with data + .typeText(ExtendCancelDatePage.groupNumberInput, '4841904') + .typeText(ExtendCancelDatePage.phnInput, '9873251693') + .typeText(ExtendCancelDatePage.existingCancelDateInput, '20220731') + .pressKey('tab') + .typeText(ExtendCancelDatePage.newCancelDateInput, '20220831') + .pressKey('tab') + .click(ExtendCancelDatePage.immigrationCodeSelect) + .click(immigrationCodeOption.withText('Student Authorization')) + .typeText(ExtendCancelDatePage.permitIssueDate, '20220701') + .typeText(ExtendCancelDatePage.permitExpiryDate, '20230731') + // When I click the Clear button + .click(ExtendCancelDatePage.clearButton) + // I expect the form to be cleared + .expect(ExtendCancelDatePage.phnInput.value) + .eql('') + .expect(ExtendCancelDatePage.groupNumberInput.value) + .eql('') + .expect(ExtendCancelDatePage.existingCancelDateInput.value) + .eql('') + .expect(ExtendCancelDatePage.newCancelDateInput.value) + .eql('') + .expect(ExtendCancelDatePage.immigrationCode.value) + .eql('') + .expect(ExtendCancelDatePage.permitIssueDate.value) + .eql('') + .expect(ExtendCancelDatePage.permitExpiryDate.value) + .eql('') +}) From 72c749e9aee077bc49f4fd81d5c6d1add770a4c1 Mon Sep 17 00:00:00 2001 From: AnumehaSrivastava05 Date: Mon, 31 Oct 2022 14:17:52 -0600 Subject: [PATCH 4/4] code cleanup --- .../ca/bc/gov/hlth/hnweb/converter/rapid/RPBSPAG0Converter.java | 1 - .../java/ca/bc/gov/hlth/hnweb/service/MaintenanceService.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/converter/rapid/RPBSPAG0Converter.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/converter/rapid/RPBSPAG0Converter.java index f3a40b0c..8e7b3b38 100644 --- a/backend/src/main/java/ca/bc/gov/hlth/hnweb/converter/rapid/RPBSPAG0Converter.java +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/converter/rapid/RPBSPAG0Converter.java @@ -47,7 +47,6 @@ public RPBSPAG0 convertRequest(ExtendCancelDateRequest request) { ag0.setPermitIssueDate(formatDate(request.getPermitIssueDate())); ag0.setPermitExpiryDate(formatDate(request.getPermitExpiryDate())); - RPBSPAG0 rpbspag0 = new RPBSPAG0(); rpbspag0.setRpbsHeader(rpbsHeader); rpbspag0.setAg0(ag0); diff --git a/backend/src/main/java/ca/bc/gov/hlth/hnweb/service/MaintenanceService.java b/backend/src/main/java/ca/bc/gov/hlth/hnweb/service/MaintenanceService.java index 315793bc..d492575c 100644 --- a/backend/src/main/java/ca/bc/gov/hlth/hnweb/service/MaintenanceService.java +++ b/backend/src/main/java/ca/bc/gov/hlth/hnweb/service/MaintenanceService.java @@ -101,7 +101,7 @@ public RPBSPAG0 changeCancelDate(RPBSPAG0 rpbspag0, Transaction transaction) thr } /** - * Changes Coverage Cancellation Date for the group member based on the R46/RPBSPAG0 request. + * Extends Coverage Cancellation Date for the group member based on the R51/RPBSPAG0 request. * * @param rpbspag0 * @param transaction