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

fix(ccls-2033) fix searching applications repository by passing through nulled out booleans into qbe #24

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ public void testSaveApplication_allFields(){
assertEquals(clientFirstName, fetchedApplication.getClientFirstName());
assertEquals(clientSurname, fetchedApplication.getClientSurname());
assertEquals(clientReference, fetchedApplication.getClientReference());
assertEquals(amendment, fetchedApplication.isAmendment());
assertEquals(meansAssessmentAmended, fetchedApplication.isMeansAssessmentAmended());
assertEquals(meritsAssessmentAmended, fetchedApplication.isMeritsAssessmentAmended());
assertEquals(costLimitChanged, fetchedApplication.isCostLimitChanged());
assertEquals(amendment, fetchedApplication.getAmendment());
assertEquals(meansAssessmentAmended, fetchedApplication.getMeansAssessmentAmended());
assertEquals(meritsAssessmentAmended, fetchedApplication.getMeritsAssessmentAmended());
assertEquals(costLimitChanged, fetchedApplication.getCostLimitChanged());
assertEquals(costLimitAtTimeOfMerits, fetchedApplication.getCostLimitAtTimeOfMerits());
assertEquals(applicationType, fetchedApplication.getApplicationType());
assertEquals(applicationTypeDisplayValue, fetchedApplication.getApplicationTypeDisplayValue());
Expand All @@ -170,9 +170,9 @@ public void testSaveApplication_allFields(){
assertEquals(sdf.format(dateDevolvedPowersUsed), sdf.format(fetchedApplication.getDateDevolvedPowersUsed()));

assertEquals(devolvedPowersContractFlag, fetchedApplication.getDevolvedPowersContractFlag());
assertEquals(meritsReassessmentReqdInd, fetchedApplication.isMeritsReassessmentReqdInd());
assertEquals(meritsReassessmentReqdInd, fetchedApplication.getMeritsReassessmentReqdInd());
assertEquals(larScopeFlag, fetchedApplication.getLarScopeFlag());
assertEquals(leadProceedingChanged, fetchedApplication.isLeadProceedingChangedOpaInput());
assertEquals(leadProceedingChanged, fetchedApplication.getLeadProceedingChangedOpaInput());

assertEquals(caabUserLoginId, fetchedApplication.getAuditTrail().getLastSavedBy());
assertEquals(caabUserLoginId, fetchedApplication.getAuditTrail().getCreatedBy());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public class Application implements Serializable {
private String clientReference;

@Column(name = "AMENDMENT")
private boolean amendment = false;
private Boolean amendment;

//Application Type
@Column(name = "APPLICATION_TYPE", length = 30)
Expand All @@ -131,25 +131,25 @@ public class Application implements Serializable {
private Boolean larScopeFlag;

@Column(name = "MEANS_ASSESSMENT_AMENDED")
private boolean meansAssessmentAmended = false;
private Boolean meansAssessmentAmended;

@Column(name = "MERITS_ASSESSMENT_AMENDED")
private boolean meritsAssessmentAmended = false;
private Boolean meritsAssessmentAmended;

//Cost Limit
@Column(name = "COST_LIMIT_CHANGED")
private boolean costLimitChanged;
private Boolean costLimitChanged;
@Column(name = "COST_LIMIT_AT_TIME_OF_MERITS", precision = 10, scale = 2)
private BigDecimal costLimitAtTimeOfMerits;

//submission status
//poll_transaction_id

@Column(name = "MERITS_REASSESSMENT_REQD_IND")
private boolean meritsReassessmentReqdInd = false;
private Boolean meritsReassessmentReqdInd;

@Column(name = "LEAD_PROCEEDING_CHANGED")
private boolean leadProceedingChangedOpaInput = false;
private Boolean leadProceedingChangedOpaInput;

@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "FK_COST_STRUCTURE")
Expand Down Expand Up @@ -178,5 +178,6 @@ public class Application implements Serializable {

@Embedded
private AuditTrail auditTrail = new AuditTrail();


}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface ApplicationMapper {
@Mapping(target = "clientFirstName", source = "client.firstName")
@Mapping(target = "clientSurname", source = "client.surname")
@Mapping(target = "clientReference", source = "client.reference")
@Mapping(target = "costLimitChanged", source = "costLimit.changed")
@Mapping(target = "costLimitChanged", source = "costLimit.changed", defaultValue = "false")
@Mapping(target = "costLimitAtTimeOfMerits", source = "costLimit.limitAtTimeOfMerits")
@Mapping(target = "applicationType", source = "applicationType.id")
@Mapping(target = "applicationTypeDisplayValue", source = "applicationType.displayValue")
Expand All @@ -64,8 +64,16 @@ public interface ApplicationMapper {
source = "applicationType.devolvedPowers.dateUsed")
@Mapping(target = "devolvedPowersContractFlag",
source = "applicationType.devolvedPowers.contractFlag")
@Mapping(target = "meritsReassessmentReqdInd", source = "meritsReassessmentRequired")
@Mapping(target = "leadProceedingChangedOpaInput", source = "leadProceedingChanged")
@Mapping(target = "meritsReassessmentReqdInd", source = "meritsReassessmentRequired",
defaultValue = "false")
@Mapping(target = "leadProceedingChangedOpaInput", source = "leadProceedingChanged",
defaultValue = "false")
@Mapping(target = "meansAssessmentAmended", source = "meansAssessmentAmended",
defaultValue = "false")
@Mapping(target = "meritsAssessmentAmended", source = "meritsAssessmentAmended",
defaultValue = "false")
@Mapping(target = "amendment", source = "amendment",
defaultValue = "false")
@Mapping(target = "costs", source = "costs", qualifiedByName = "toCostStructure")
@Mapping(target = "correspondenceAddress", source = "correspondenceAddress",
qualifiedByName = "toAddress")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ public void testApplicationMapping() {
assertEquals("clientRef", application.getClientReference());
assertEquals("appTypeId", application.getApplicationType());
assertEquals("appTypeDisp", application.getApplicationTypeDisplayValue());
assertTrue(application.isCostLimitChanged());
assertTrue(application.getCostLimitChanged());
assertEquals(BigDecimal.valueOf(123), application.getCostLimitAtTimeOfMerits());
assertTrue(application.isAmendment());
assertTrue(application.isMeansAssessmentAmended());
assertTrue(application.isMeritsAssessmentAmended());
assertTrue(application.getAmendment());
assertTrue(application.getMeansAssessmentAmended());
assertTrue(application.getMeritsAssessmentAmended());

}

Expand All @@ -132,10 +132,10 @@ public void testApplicationMapping_unsetBooleansFalse() {

Application application = mapper.toApplication(detail);

assertFalse(application.isCostLimitChanged());
assertFalse(application.isAmendment());
assertFalse(application.isMeansAssessmentAmended());
assertFalse(application.isMeritsAssessmentAmended());
assertFalse(application.getCostLimitChanged());
assertFalse(application.getAmendment());
assertFalse(application.getMeansAssessmentAmended());
assertFalse(application.getMeritsAssessmentAmended());
}

@Test
Expand Down