handle client resource and sub resources for notes and loanaccount summaries.

This commit is contained in:
Keith Woodlock
2012-05-15 16:45:16 +01:00
parent dc1c39c5ec
commit 04d4fbaf85
32 changed files with 1324 additions and 1695 deletions
@@ -1,96 +0,0 @@
package org.mifosng.data;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class ClientDataWithAccountsData {
private ClientData clientInfo;
private List<LoanAccountData> pendingApprovalLoans = new ArrayList<LoanAccountData>();
private List<LoanAccountData> awaitingDisbursalLoans = new ArrayList<LoanAccountData>();
private List<LoanAccountData> openLoans = new ArrayList<LoanAccountData>();
private List<LoanAccountData> closedLoans = new ArrayList<LoanAccountData>();
public ClientDataWithAccountsData() {
//
}
public ClientDataWithAccountsData(final ClientData clientInfo,
final List<LoanAccountData> pendingApprovalLoans,
final List<LoanAccountData> awaitingDisbursalLoans,
final List<LoanAccountData> openLoans,
final List<LoanAccountData> closedLoans) {
this.clientInfo = clientInfo;
this.pendingApprovalLoans = pendingApprovalLoans;
this.awaitingDisbursalLoans = awaitingDisbursalLoans;
this.openLoans = openLoans;
this.closedLoans = closedLoans;
}
public Integer getAnyLoanCount() {
return getPendingApprovalLoanCount() + getAwaitingDisbursalLoanCount()
+ getActiveLoanCount() + getClosedLoanCount();
}
public Integer getPendingApprovalLoanCount() {
return this.pendingApprovalLoans.size();
}
public Integer getAwaitingDisbursalLoanCount() {
return this.awaitingDisbursalLoans.size();
}
public Integer getActiveLoanCount() {
return this.openLoans.size();
}
public Integer getClosedLoanCount() {
return this.closedLoans.size();
}
public ClientData getClientInfo() {
return this.clientInfo;
}
public void setClientInfo(final ClientData clientInfo) {
this.clientInfo = clientInfo;
}
public List<LoanAccountData> getPendingApprovalLoans() {
return this.pendingApprovalLoans;
}
public void setPendingApprovalLoans(
final List<LoanAccountData> pendingApprovalLoans) {
this.pendingApprovalLoans = pendingApprovalLoans;
}
public List<LoanAccountData> getAwaitingDisbursalLoans() {
return this.awaitingDisbursalLoans;
}
public void setAwaitingDisbursalLoans(
final List<LoanAccountData> awaitingDisbursalLoans) {
this.awaitingDisbursalLoans = awaitingDisbursalLoans;
}
public List<LoanAccountData> getOpenLoans() {
return this.openLoans;
}
public void setOpenLoans(final List<LoanAccountData> openLoans) {
this.openLoans = openLoans;
}
public List<LoanAccountData> getClosedLoans() {
return this.closedLoans;
}
public void setClosedLoans(final List<LoanAccountData> closedLoans) {
this.closedLoans = closedLoans;
}
}
@@ -0,0 +1,85 @@
package org.mifosng.data;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class ClientLoanAccountSummaryCollectionData {
private List<ClientLoanAccountSummaryData> pendingApprovalLoans = new ArrayList<ClientLoanAccountSummaryData>();
private List<ClientLoanAccountSummaryData> awaitingDisbursalLoans = new ArrayList<ClientLoanAccountSummaryData>();
private List<ClientLoanAccountSummaryData> openLoans = new ArrayList<ClientLoanAccountSummaryData>();
private List<ClientLoanAccountSummaryData> closedLoans = new ArrayList<ClientLoanAccountSummaryData>();
public ClientLoanAccountSummaryCollectionData() {
//
}
public ClientLoanAccountSummaryCollectionData(
final List<ClientLoanAccountSummaryData> pendingApprovalLoans,
final List<ClientLoanAccountSummaryData> awaitingDisbursalLoans,
final List<ClientLoanAccountSummaryData> openLoans,
final List<ClientLoanAccountSummaryData> closedLoans) {
this.pendingApprovalLoans = pendingApprovalLoans;
this.awaitingDisbursalLoans = awaitingDisbursalLoans;
this.openLoans = openLoans;
this.closedLoans = closedLoans;
}
public Integer getAnyLoanCount() {
return getPendingApprovalLoanCount() + getAwaitingDisbursalLoanCount()
+ getActiveLoanCount() + getClosedLoanCount();
}
public Integer getPendingApprovalLoanCount() {
return this.pendingApprovalLoans.size();
}
public Integer getAwaitingDisbursalLoanCount() {
return this.awaitingDisbursalLoans.size();
}
public Integer getActiveLoanCount() {
return this.openLoans.size();
}
public Integer getClosedLoanCount() {
return this.closedLoans.size();
}
public List<ClientLoanAccountSummaryData> getPendingApprovalLoans() {
return pendingApprovalLoans;
}
public void setPendingApprovalLoans(
List<ClientLoanAccountSummaryData> pendingApprovalLoans) {
this.pendingApprovalLoans = pendingApprovalLoans;
}
public List<ClientLoanAccountSummaryData> getAwaitingDisbursalLoans() {
return awaitingDisbursalLoans;
}
public void setAwaitingDisbursalLoans(
List<ClientLoanAccountSummaryData> awaitingDisbursalLoans) {
this.awaitingDisbursalLoans = awaitingDisbursalLoans;
}
public List<ClientLoanAccountSummaryData> getOpenLoans() {
return openLoans;
}
public void setOpenLoans(List<ClientLoanAccountSummaryData> openLoans) {
this.openLoans = openLoans;
}
public List<ClientLoanAccountSummaryData> getClosedLoans() {
return closedLoans;
}
public void setClosedLoans(List<ClientLoanAccountSummaryData> closedLoans) {
this.closedLoans = closedLoans;
}
}
@@ -0,0 +1,142 @@
package org.mifosng.data;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlRootElement;
import org.joda.time.LocalDate;
@XmlRootElement(name = "clientLoanAccountSummary")
public class ClientLoanAccountSummaryData implements Serializable {
private Long id;
private String externalId;
private Long loanProductId;
private String loanProductName;
private Integer loanStatusId;
private boolean pendingApproval;
private boolean waitingForDisbursal;
private boolean open;
private boolean closed;
private String lifeCycleStatusText;
private LocalDate lifeCycleStatusDate;
// private LocalDate submittedOnDate;
// private LocalDate approvedOnDate;
// private LocalDate expectedDisbursementDate;
// private LocalDate actualDisbursementDate;
// private LocalDate expectedFirstRepaymentOnDate;
// private LocalDate interestCalculatedFromDate;
// private LocalDate expectedMaturityDate;
// private LocalDate closedOnDate;
public ClientLoanAccountSummaryData() {
//
}
public ClientLoanAccountSummaryData(Long id, String externalId,
Long productId, String loanProductName, Integer loanStatusId,
String lifeCycleStatusText, boolean pendingApproval,
boolean waitingForDisbursal, boolean open, boolean closed) {
this.id = id;
this.externalId = externalId;
this.loanProductId = productId;
this.loanProductName = loanProductName;
this.loanStatusId = loanStatusId;
this.lifeCycleStatusText = lifeCycleStatusText;
this.pendingApproval = pendingApproval;
this.waitingForDisbursal = waitingForDisbursal;
this.open = open;
this.closed = closed;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getExternalId() {
return externalId;
}
public void setExternalId(String externalId) {
this.externalId = externalId;
}
public String getLoanProductName() {
return loanProductName;
}
public void setLoanProductName(String loanProductName) {
this.loanProductName = loanProductName;
}
public boolean isPendingApproval() {
return pendingApproval;
}
public void setPendingApproval(boolean pendingApproval) {
this.pendingApproval = pendingApproval;
}
public boolean isWaitingForDisbursal() {
return waitingForDisbursal;
}
public void setWaitingForDisbursal(boolean waitingForDisbursal) {
this.waitingForDisbursal = waitingForDisbursal;
}
public boolean isOpen() {
return open;
}
public void setOpen(boolean open) {
this.open = open;
}
public boolean isClosed() {
return closed;
}
public void setClosed(boolean closed) {
this.closed = closed;
}
public String getLifeCycleStatusText() {
return lifeCycleStatusText;
}
public void setLifeCycleStatusText(String lifeCycleStatusText) {
this.lifeCycleStatusText = lifeCycleStatusText;
}
public LocalDate getLifeCycleStatusDate() {
return lifeCycleStatusDate;
}
public void setLifeCycleStatusDate(LocalDate lifeCycleStatusDate) {
this.lifeCycleStatusDate = lifeCycleStatusDate;
}
public Long getLoanProductId() {
return loanProductId;
}
public void setLoanProductId(Long loanProductId) {
this.loanProductId = loanProductId;
}
public Integer getLoanStatusId() {
return loanStatusId;
}
public void setLoanStatusId(Integer loanStatusId) {
this.loanStatusId = loanStatusId;
}
}
@@ -12,6 +12,9 @@ public class EnrollClientCommand {
private String fullname;
private Long officeId;
private String externalId;
private String dateFormat;
private String joiningDateFormatted;
private LocalDate joiningDate;
protected EnrollClientCommand() {
@@ -73,4 +76,20 @@ public class EnrollClientCommand {
public void setFullname(String fullname) {
this.fullname = fullname;
}
public String getDateFormat() {
return dateFormat;
}
public void setDateFormat(String dateFormat) {
this.dateFormat = dateFormat;
}
public String getJoiningDateFormatted() {
return joiningDateFormatted;
}
public void setJoiningDateFormatted(String joiningDateFormatted) {
this.joiningDateFormatted = joiningDateFormatted;
}
}