tidy up response for client data with display name and also loanschedule field of new loan data.
This commit is contained in:
@@ -4,10 +4,9 @@ import java.io.Serializable;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||||
import org.codehaus.jackson.map.annotate.JsonFilter;
|
import org.codehaus.jackson.map.annotate.JsonFilter;
|
||||||
import org.joda.time.DateTime;
|
|
||||||
import org.joda.time.Days;
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
@JsonIgnoreProperties({ "organisationId","organisationName"})
|
@JsonIgnoreProperties({ "organisationId","organisationName"})
|
||||||
@@ -42,17 +41,18 @@ public class ClientData implements Serializable {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
this.firstname = firstname;
|
this.firstname = firstname;
|
||||||
this.lastname = lastname;
|
this.lastname = lastname;
|
||||||
this.displayName = new StringBuilder(this.firstname).append(' ')
|
|
||||||
.append(this.lastname).toString();
|
StringBuilder nameBuilder = new StringBuilder(this.firstname);
|
||||||
|
if (StringUtils.isNotBlank(nameBuilder.toString())) {
|
||||||
|
nameBuilder.append(' ');
|
||||||
|
}
|
||||||
|
nameBuilder.append(this.lastname);
|
||||||
|
|
||||||
|
this.displayName = nameBuilder.toString();
|
||||||
this.externalId = externalId;
|
this.externalId = externalId;
|
||||||
this.joinedDate = joinedDate;
|
this.joinedDate = joinedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxJoinedOnOffsetFromToday() {
|
|
||||||
return Days.daysBetween(new DateTime(),
|
|
||||||
this.getJoinedDate().toDateMidnight().toDateTime()).getDays();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ public class NewLoanData implements Serializable {
|
|||||||
|
|
||||||
private LocalDate expectedDisbursementDate;
|
private LocalDate expectedDisbursementDate;
|
||||||
|
|
||||||
private LoanSchedule repaymentSchedule;
|
|
||||||
|
|
||||||
private List<LoanProductLookup> allowedProducts = new ArrayList<LoanProductLookup>();
|
private List<LoanProductLookup> allowedProducts = new ArrayList<LoanProductLookup>();
|
||||||
|
|
||||||
public NewLoanData() {
|
public NewLoanData() {
|
||||||
@@ -75,14 +73,6 @@ public class NewLoanData implements Serializable {
|
|||||||
this.selectedProduct = selectedProduct;
|
this.selectedProduct = selectedProduct;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoanSchedule getRepaymentSchedule() {
|
|
||||||
return repaymentSchedule;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRepaymentSchedule(LoanSchedule repaymentSchedule) {
|
|
||||||
this.repaymentSchedule = repaymentSchedule;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getExpectedDisbursementDate() {
|
public LocalDate getExpectedDisbursementDate() {
|
||||||
return expectedDisbursementDate;
|
return expectedDisbursementDate;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user