add base gradle setting and data project.
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
sourceCompatibility = JavaVersion.VERSION_1_6
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_6
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
bin
|
||||||
|
build
|
||||||
|
repos
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.gradle
|
||||||
|
*.log
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
apply plugin: 'eclipse'
|
||||||
|
apply plugin: 'java'
|
||||||
|
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_6
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_6
|
||||||
|
|
||||||
|
group = 'org.mifosng.data'
|
||||||
|
version = '0.2'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile( [group: 'joda-time', name: 'joda-time', version: '2.1'],)
|
||||||
|
}
|
||||||
|
|
||||||
|
uploadArchives {
|
||||||
|
repositories {
|
||||||
|
flatDir {
|
||||||
|
dirs '../repos'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "user")
|
||||||
|
public class AppUserData {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private Long orgId;
|
||||||
|
private Long officeId;
|
||||||
|
private String officeName;
|
||||||
|
private String username;
|
||||||
|
private String firstname;
|
||||||
|
private String lastname;
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private List<OfficeData> allowedOffices = new ArrayList<OfficeData>();
|
||||||
|
|
||||||
|
private List<RoleData> availableRoles = new ArrayList<RoleData>();
|
||||||
|
private List<RoleData> selectedRoles = new ArrayList<RoleData>();
|
||||||
|
|
||||||
|
public AppUserData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public AppUserData(final Long id, final String username,
|
||||||
|
final String email, final Long orgId, final Long officeId,
|
||||||
|
final String officeName) {
|
||||||
|
this.id = id;
|
||||||
|
this.username = username;
|
||||||
|
this.email = email;
|
||||||
|
this.orgId = orgId;
|
||||||
|
this.officeId = officeId;
|
||||||
|
this.officeName = officeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return this.username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return this.email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrgId() {
|
||||||
|
return this.orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOfficeId() {
|
||||||
|
return this.officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOfficeName() {
|
||||||
|
return this.officeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(final String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(final String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgId(final Long orgId) {
|
||||||
|
this.orgId = orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOfficeId(final Long officeId) {
|
||||||
|
this.officeId = officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOfficeName(final String officeName) {
|
||||||
|
this.officeName = officeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<OfficeData> getAllowedOffices() {
|
||||||
|
return allowedOffices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllowedOffices(List<OfficeData> allowedOffices) {
|
||||||
|
this.allowedOffices = allowedOffices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RoleData> getAvailableRoles() {
|
||||||
|
return availableRoles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvailableRoles(List<RoleData> availableRoles) {
|
||||||
|
this.availableRoles = availableRoles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RoleData> getSelectedRoles() {
|
||||||
|
return selectedRoles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedRoles(List<RoleData> selectedRoles) {
|
||||||
|
this.selectedRoles = selectedRoles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstname() {
|
||||||
|
return firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstname(String firstname) {
|
||||||
|
this.firstname = firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastname() {
|
||||||
|
return lastname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastname(String lastname) {
|
||||||
|
this.lastname = lastname;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class AuthenticatedUserData {
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
private Collection<String> permissions = new ArrayList<String>();
|
||||||
|
|
||||||
|
protected AuthenticatedUserData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public AuthenticatedUserData(final Collection<String> permissions) {
|
||||||
|
this.permissions = permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<String> getPermissions() {
|
||||||
|
return this.permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPermissions(final Collection<String> permissions) {
|
||||||
|
this.permissions = permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,470 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.joda.time.Days;
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
import org.joda.time.Months;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "loan")
|
||||||
|
public class BasicLoanAccountData {
|
||||||
|
|
||||||
|
private boolean open = true;
|
||||||
|
private boolean openWithRepaymentMade = true;
|
||||||
|
private boolean closed = false;
|
||||||
|
private boolean interestRebateOutstanding = false;
|
||||||
|
private boolean pendingApproval = false;
|
||||||
|
private boolean waitingForDisbursal = false;
|
||||||
|
private String lifeCycleStatusText = "Active";
|
||||||
|
|
||||||
|
private Long id = Long.valueOf(1);
|
||||||
|
private String externalId = "1234567";
|
||||||
|
private String loanProductName = "Standard loan 1.75%";
|
||||||
|
|
||||||
|
private LocalDate submittedOnDate = new LocalDate();
|
||||||
|
private String submittedOnNote = "";
|
||||||
|
private LocalDate approvedOnDate = new LocalDate();
|
||||||
|
private String approvedOnNote = "";
|
||||||
|
|
||||||
|
private LocalDate expectedDisbursementDate = new LocalDate();
|
||||||
|
private LocalDate actualDisbursementDate = new LocalDate();
|
||||||
|
private String disbursedOnNote = "";
|
||||||
|
private boolean undoDisbursalAllowed = true;
|
||||||
|
|
||||||
|
private LocalDate closedOnDate = new LocalDate();
|
||||||
|
private String closedOnNote = "";
|
||||||
|
|
||||||
|
private LocalDate maturityDate = new LocalDate();
|
||||||
|
|
||||||
|
private MoneyData principal = MoneyData.of(new CurrencyData("XOF", "CFA", 0, "CFA", "currency.CFA"), BigDecimal.valueOf(Double.valueOf("12345.89")));
|
||||||
|
private BigDecimal interestRatePerYear = BigDecimal.valueOf(Double.valueOf("21.0"));
|
||||||
|
private BigDecimal interestRatePerPeriod = BigDecimal.valueOf(Double.valueOf("1.75"));
|
||||||
|
private Integer interestPeriodFrequencyType = Integer.valueOf(2);
|
||||||
|
private String interestPeriodFrequencyText = "Month(s)";
|
||||||
|
private Integer interestMethodType = Integer.valueOf(1);
|
||||||
|
private String interestMethodText = "Declining Balance";
|
||||||
|
private Integer amortizationMethodValue = Integer.valueOf(1);
|
||||||
|
private String amortizationMethodText = "Equal Installments";
|
||||||
|
private Integer numberOfRepayments = 12;
|
||||||
|
|
||||||
|
private Integer repaymentFrequencyNumber = 1;
|
||||||
|
private Integer repaymentFrequencyTypeEnumOrdinal = 2;
|
||||||
|
private String repaymentFrequencyTypeText = "Month(s)";
|
||||||
|
|
||||||
|
private MoneyData interestRebateOwed = MoneyData.of(new CurrencyData("XOF", "CFA", 0, "CFA", "currency.CFA"), BigDecimal.valueOf(Double.valueOf("0.0")));
|
||||||
|
|
||||||
|
// private DerivedLoanData loanData;
|
||||||
|
// private MoneyData arrearsTolerance;
|
||||||
|
private boolean waiveAllowed = false;
|
||||||
|
|
||||||
|
public BasicLoanAccountData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasicLoanAccountData(final boolean closed, final boolean open,
|
||||||
|
final boolean openWithRepaymentMade,
|
||||||
|
final boolean interestRebateOutstanding,
|
||||||
|
final boolean pendingApproval, final boolean waitingForDisbursal,
|
||||||
|
final String lifeCycleStatusText, final Long id, String externalId,
|
||||||
|
final String loanProductName, final LocalDate closedOnDate,
|
||||||
|
final String closedOnNote, final LocalDate submittedOnDate,
|
||||||
|
final String submittedOnNote, final LocalDate approvedOnDate,
|
||||||
|
final String approvedOnNote,
|
||||||
|
final LocalDate expectedDisbursementDate,
|
||||||
|
final LocalDate actualDisbursementDate,
|
||||||
|
final String disbursedOnNote, final LocalDate maturityDate,
|
||||||
|
final MoneyData principal, final BigDecimal interestRatePerYear,
|
||||||
|
final BigDecimal interestRatePerPeriod,
|
||||||
|
final Integer interestPeriodFrequencyType,
|
||||||
|
final String interestPeriodFrequencyText,
|
||||||
|
final Integer interestMethodType,
|
||||||
|
final String interestMethodText,
|
||||||
|
final Integer amortizationMethodValue,
|
||||||
|
final String amortizationMethodText,
|
||||||
|
final Integer numberOfRepayments,
|
||||||
|
final Integer repayEvery,
|
||||||
|
final Integer repaymentFrequencyValue,
|
||||||
|
final String repaymentFrequencyText,
|
||||||
|
final MoneyData arrearsTolerance, final DerivedLoanData derivedLoanData,
|
||||||
|
boolean waiveAllowed, final MoneyData interestRebateOwed) {
|
||||||
|
this.closed = closed;
|
||||||
|
this.open = open;
|
||||||
|
this.openWithRepaymentMade = openWithRepaymentMade;
|
||||||
|
this.externalId = externalId;
|
||||||
|
this.undoDisbursalAllowed = !openWithRepaymentMade;
|
||||||
|
this.interestRebateOutstanding = interestRebateOutstanding;
|
||||||
|
this.pendingApproval = pendingApproval;
|
||||||
|
this.waitingForDisbursal = waitingForDisbursal;
|
||||||
|
this.lifeCycleStatusText = lifeCycleStatusText;
|
||||||
|
this.id = id;
|
||||||
|
this.loanProductName = loanProductName;
|
||||||
|
this.closedOnDate = closedOnDate;
|
||||||
|
this.closedOnNote = closedOnNote;
|
||||||
|
this.submittedOnDate = submittedOnDate;
|
||||||
|
this.submittedOnNote = submittedOnNote;
|
||||||
|
this.approvedOnDate = approvedOnDate;
|
||||||
|
this.approvedOnNote = approvedOnNote;
|
||||||
|
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||||
|
this.actualDisbursementDate = actualDisbursementDate;
|
||||||
|
this.disbursedOnNote = disbursedOnNote;
|
||||||
|
this.maturityDate = maturityDate;
|
||||||
|
this.principal = principal;
|
||||||
|
this.interestRatePerYear = interestRatePerYear;
|
||||||
|
|
||||||
|
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||||
|
this.interestPeriodFrequencyType = interestPeriodFrequencyType;
|
||||||
|
this.interestPeriodFrequencyText = interestPeriodFrequencyText;
|
||||||
|
this.interestMethodType = interestMethodType;
|
||||||
|
this.interestMethodText = interestMethodText;
|
||||||
|
this.amortizationMethodValue = amortizationMethodValue;
|
||||||
|
this.amortizationMethodText = amortizationMethodText;
|
||||||
|
this.numberOfRepayments = numberOfRepayments;
|
||||||
|
|
||||||
|
this.repaymentFrequencyNumber = repayEvery;
|
||||||
|
this.repaymentFrequencyTypeEnumOrdinal = repaymentFrequencyValue;
|
||||||
|
this.repaymentFrequencyTypeText = repaymentFrequencyText;
|
||||||
|
this.waiveAllowed = waiveAllowed;
|
||||||
|
|
||||||
|
this.interestRebateOwed = interestRebateOwed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxSubmittedOnOffsetFromToday() {
|
||||||
|
return Days.daysBetween(new DateTime(),
|
||||||
|
this.getSubmittedOnDate().toDateMidnight().toDateTime())
|
||||||
|
.getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxApprovedOnOffsetFromToday() {
|
||||||
|
return Days.daysBetween(new DateTime(),
|
||||||
|
this.getApprovedOnDate().toDateMidnight().toDateTime())
|
||||||
|
.getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxDisbursedOnOffsetFromToday() {
|
||||||
|
|
||||||
|
int offset = 0;
|
||||||
|
if (this.getActualDisbursementDate() != null) {
|
||||||
|
offset = Days.daysBetween(new DateTime(),
|
||||||
|
this.getActualDisbursementDate().toDateMidnight().toDateTime())
|
||||||
|
.getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLoanTermInDays() {
|
||||||
|
|
||||||
|
LocalDate dateToUse = getExpectedDisbursementDate();
|
||||||
|
if (getActualDisbursementDate() != null) {
|
||||||
|
dateToUse = getActualDisbursementDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Days.daysBetween(dateToUse.toDateMidnight().toDateTime(), this.getMaturityDate().toDateMidnight().toDateTime()).getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLoanTermInMonths() {
|
||||||
|
|
||||||
|
LocalDate dateToUse = getExpectedDisbursementDate();
|
||||||
|
if (getActualDisbursementDate() != null) {
|
||||||
|
dateToUse = getActualDisbursementDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Months.monthsBetween(dateToUse.toDateMidnight().toDateTime(), this.getMaturityDate().toDateMidnight().toDateTime()).getMonths();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOpen() {
|
||||||
|
return this.open;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpen(final boolean open) {
|
||||||
|
this.open = open;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isClosed() {
|
||||||
|
return this.closed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClosed(final boolean closed) {
|
||||||
|
this.closed = closed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInterestRebateOutstanding() {
|
||||||
|
return this.interestRebateOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateOutstanding(
|
||||||
|
final boolean interestRebateOutstanding) {
|
||||||
|
this.interestRebateOutstanding = interestRebateOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPendingApproval() {
|
||||||
|
return this.pendingApproval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPendingApproval(final boolean pendingApproval) {
|
||||||
|
this.pendingApproval = pendingApproval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isWaitingForDisbursal() {
|
||||||
|
return this.waitingForDisbursal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWaitingForDisbursal(final boolean waitingForDisbursal) {
|
||||||
|
this.waitingForDisbursal = waitingForDisbursal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getClosedOnDate() {
|
||||||
|
return this.closedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClosedOnDate(final LocalDate closedOnDate) {
|
||||||
|
this.closedOnDate = closedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getSubmittedOnDate() {
|
||||||
|
return this.submittedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmittedOnDate(final LocalDate submittedOnDate) {
|
||||||
|
this.submittedOnDate = submittedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getExpectedDisbursementDate() {
|
||||||
|
return this.expectedDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpectedDisbursementDate(
|
||||||
|
final LocalDate expectedDisbursementDate) {
|
||||||
|
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getActualDisbursementDate() {
|
||||||
|
return this.actualDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActualDisbursementDate(final LocalDate actualDisbursementDate) {
|
||||||
|
this.actualDisbursementDate = actualDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipal() {
|
||||||
|
return this.principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(final MoneyData principal) {
|
||||||
|
this.principal = principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInterestRatePerYear() {
|
||||||
|
return this.interestRatePerYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerYear(final BigDecimal interestRatePerYear) {
|
||||||
|
this.interestRatePerYear = interestRatePerYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubmittedOnNote() {
|
||||||
|
return this.submittedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmittedOnNote(final String submittedOnNote) {
|
||||||
|
this.submittedOnNote = submittedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentFrequencyNumber() {
|
||||||
|
return this.repaymentFrequencyNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequencyNumber(
|
||||||
|
final Integer repaymentFrequencyNumber) {
|
||||||
|
this.repaymentFrequencyNumber = repaymentFrequencyNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentFrequencyTypeEnumOrdinal() {
|
||||||
|
return this.repaymentFrequencyTypeEnumOrdinal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequencyTypeEnumOrdinal(
|
||||||
|
final Integer repaymentFrequencyTypeEnumOrdinal) {
|
||||||
|
this.repaymentFrequencyTypeEnumOrdinal = repaymentFrequencyTypeEnumOrdinal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRepaymentFrequencyTypeText() {
|
||||||
|
return this.repaymentFrequencyTypeText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequencyTypeText(
|
||||||
|
final String repaymentFrequencyTypeText) {
|
||||||
|
this.repaymentFrequencyTypeText = repaymentFrequencyTypeText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLoanProductName() {
|
||||||
|
return this.loanProductName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanProductName(final String loanProductName) {
|
||||||
|
this.loanProductName = loanProductName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getApprovedOnDate() {
|
||||||
|
return this.approvedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApprovedOnDate(final LocalDate approvedOnDate) {
|
||||||
|
this.approvedOnDate = approvedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApprovedOnNote() {
|
||||||
|
return this.approvedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApprovedOnNote(final String approvedOnNote) {
|
||||||
|
this.approvedOnNote = approvedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisbursedOnNote() {
|
||||||
|
return this.disbursedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisbursedOnNote(final String disbursedOnNote) {
|
||||||
|
this.disbursedOnNote = disbursedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClosedOnNote() {
|
||||||
|
return this.closedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClosedOnNote(final String closedOnNote) {
|
||||||
|
this.closedOnNote = closedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInterestRebateOwed() {
|
||||||
|
return this.interestRebateOwed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateOwed(final MoneyData interestRebateOwed) {
|
||||||
|
this.interestRebateOwed = interestRebateOwed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLifeCycleStatusText() {
|
||||||
|
return this.lifeCycleStatusText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLifeCycleStatusText(final String lifeCycleStatusText) {
|
||||||
|
this.lifeCycleStatusText = lifeCycleStatusText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getMaturityDate() {
|
||||||
|
return this.maturityDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaturityDate(final LocalDate maturityDate) {
|
||||||
|
this.maturityDate = maturityDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOpenWithRepaymentMade() {
|
||||||
|
return this.openWithRepaymentMade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenWithRepaymentMade(final boolean openWithRepaymentMade) {
|
||||||
|
this.openWithRepaymentMade = openWithRepaymentMade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUndoDisbursalAllowed() {
|
||||||
|
return this.undoDisbursalAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUndoDisbursalAllowed(final boolean undoDisbursalAllowed) {
|
||||||
|
this.undoDisbursalAllowed = undoDisbursalAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalId() {
|
||||||
|
return externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalId(String externalId) {
|
||||||
|
this.externalId = externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInterestRatePerPeriod() {
|
||||||
|
return interestRatePerPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) {
|
||||||
|
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestPeriodFrequencyType() {
|
||||||
|
return interestPeriodFrequencyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestPeriodFrequencyType(Integer interestPeriodFrequencyType) {
|
||||||
|
this.interestPeriodFrequencyType = interestPeriodFrequencyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInterestPeriodFrequencyText() {
|
||||||
|
return interestPeriodFrequencyText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestPeriodFrequencyText(String interestPeriodFrequencyText) {
|
||||||
|
this.interestPeriodFrequencyText = interestPeriodFrequencyText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestMethodType() {
|
||||||
|
return interestMethodType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestMethodType(Integer interestMethodType) {
|
||||||
|
this.interestMethodType = interestMethodType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInterestMethodText() {
|
||||||
|
return interestMethodText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestMethodText(String interestMethodText) {
|
||||||
|
this.interestMethodText = interestMethodText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAmortizationMethodValue() {
|
||||||
|
return amortizationMethodValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationMethodValue(Integer amortizationMethodValue) {
|
||||||
|
this.amortizationMethodValue = amortizationMethodValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAmortizationMethodText() {
|
||||||
|
return amortizationMethodText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationMethodText(String amortizationMethodText) {
|
||||||
|
this.amortizationMethodText = amortizationMethodText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumberOfRepayments() {
|
||||||
|
return numberOfRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfRepayments(Integer numberOfRepayments) {
|
||||||
|
this.numberOfRepayments = numberOfRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isWaiveAllowed() {
|
||||||
|
return waiveAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWaiveAllowed(boolean waiveAllowed) {
|
||||||
|
this.waiveAllowed = waiveAllowed;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.joda.time.Days;
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "client")
|
||||||
|
public class ClientData implements Serializable {
|
||||||
|
|
||||||
|
private Long organisationId;
|
||||||
|
private String organisationName;
|
||||||
|
private Long officeId;
|
||||||
|
private String officeName;
|
||||||
|
private Long id;
|
||||||
|
private String firstname;
|
||||||
|
private String lastname;
|
||||||
|
private String displayName;
|
||||||
|
private String externalId;
|
||||||
|
private LocalDate joinedDate;
|
||||||
|
|
||||||
|
private List<OfficeData> allowedOffices = new ArrayList<OfficeData>();
|
||||||
|
|
||||||
|
public ClientData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientData(final Long organisationId,
|
||||||
|
final String organisationName, final Long officeId,
|
||||||
|
final String officeName, final Long id, final String firstname,
|
||||||
|
final String lastname, final String externalId,
|
||||||
|
final LocalDate joinedDate) {
|
||||||
|
this.organisationId = organisationId;
|
||||||
|
this.organisationName = organisationName;
|
||||||
|
this.officeId = officeId;
|
||||||
|
this.officeName = officeName;
|
||||||
|
this.id = id;
|
||||||
|
this.firstname = firstname;
|
||||||
|
this.lastname = lastname;
|
||||||
|
this.displayName = new StringBuilder(this.firstname).append(' ').append(this.lastname).toString();
|
||||||
|
this.externalId = externalId;
|
||||||
|
this.joinedDate = joinedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxJoinedOnOffsetFromToday() {
|
||||||
|
return Days.daysBetween(new DateTime(),
|
||||||
|
this.getJoinedDate().toDateMidnight().toDateTime())
|
||||||
|
.getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstname() {
|
||||||
|
return this.firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastname() {
|
||||||
|
return this.lastname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalId() {
|
||||||
|
return this.externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrganisationId() {
|
||||||
|
return this.organisationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrganisationName() {
|
||||||
|
return this.organisationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOfficeId() {
|
||||||
|
return this.officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOfficeName() {
|
||||||
|
return this.officeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getJoinedDate() {
|
||||||
|
return this.joinedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrganisationId(final Long organisationId) {
|
||||||
|
this.organisationId = organisationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrganisationName(final String organisationName) {
|
||||||
|
this.organisationName = organisationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOfficeId(final Long officeId) {
|
||||||
|
this.officeId = officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOfficeName(final String officeName) {
|
||||||
|
this.officeName = officeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstname(final String firstname) {
|
||||||
|
this.firstname = firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastname(final String lastname) {
|
||||||
|
this.lastname = lastname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalId(final String externalId) {
|
||||||
|
this.externalId = externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJoinedDate(final LocalDate joinedDate) {
|
||||||
|
this.joinedDate = joinedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplayName() {
|
||||||
|
return this.displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisplayName(final String displayName) {
|
||||||
|
this.displayName = displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<OfficeData> getAllowedOffices() {
|
||||||
|
return allowedOffices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllowedOffices(List<OfficeData> allowedOffices) {
|
||||||
|
this.allowedOffices = allowedOffices;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
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,28 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class ClientList {
|
||||||
|
|
||||||
|
private Collection<ClientData> clients = new ArrayList<ClientData>();
|
||||||
|
|
||||||
|
protected ClientList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClientList(final Collection<ClientData> clients) {
|
||||||
|
this.clients = clients;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<ClientData> getClients() {
|
||||||
|
return this.clients;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClients(final Collection<ClientData> clients) {
|
||||||
|
this.clients = clients;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "configuration")
|
||||||
|
public class ConfigurationData implements Serializable {
|
||||||
|
|
||||||
|
private List<CurrencyData> selectedCurrencyOptions = new ArrayList<CurrencyData>();
|
||||||
|
private List<CurrencyData> currencyOptions = new ArrayList<CurrencyData>();
|
||||||
|
|
||||||
|
public ConfigurationData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CurrencyData> getSelectedCurrencyOptions() {
|
||||||
|
return selectedCurrencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedCurrencyOptions(
|
||||||
|
List<CurrencyData> selectedCurrencyOptions) {
|
||||||
|
this.selectedCurrencyOptions = selectedCurrencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CurrencyData> getCurrencyOptions() {
|
||||||
|
return currencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencyOptions(List<CurrencyData> currencyOptions) {
|
||||||
|
this.currencyOptions = currencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "currency")
|
||||||
|
public class CurrencyData implements Serializable {
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
private String name;
|
||||||
|
private int decimalPlaces;
|
||||||
|
private String displaySymbol;
|
||||||
|
private String nameCode;
|
||||||
|
|
||||||
|
public CurrencyData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public CurrencyData(final String code, final String name, final int decimalPlaces, String displaySymbol, String nameCode) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
this.decimalPlaces = decimalPlaces;
|
||||||
|
this.displaySymbol = displaySymbol;
|
||||||
|
this.nameCode = nameCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
CurrencyData currencyData = (CurrencyData) obj;
|
||||||
|
return currencyData.code.equals(this.code);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return this.code.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplayLabel() {
|
||||||
|
|
||||||
|
StringBuilder builder = new StringBuilder(this.name).append(' ');
|
||||||
|
|
||||||
|
if (this.displaySymbol != null && !"".equalsIgnoreCase(displaySymbol.trim())) {
|
||||||
|
builder.append('(').append(this.displaySymbol).append(')');
|
||||||
|
} else {
|
||||||
|
builder.append('[').append(this.code).append(']');
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDecimalPlaces() {
|
||||||
|
return this.decimalPlaces;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(final String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDecimalPlaces(final int decimalPlaces) {
|
||||||
|
this.decimalPlaces = decimalPlaces;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplaySymbol() {
|
||||||
|
return displaySymbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisplaySymbol(String displaySymbol) {
|
||||||
|
this.displaySymbol = displaySymbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNameCode() {
|
||||||
|
return nameCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNameCode(String nameCode) {
|
||||||
|
this.nameCode = nameCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class CurrencyList {
|
||||||
|
|
||||||
|
private Collection<CurrencyData> currencies = new ArrayList<CurrencyData>();
|
||||||
|
|
||||||
|
protected CurrencyList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public CurrencyList(final List<CurrencyData> currencyOptions) {
|
||||||
|
this.currencies = currencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<CurrencyData> getCurrencies() {
|
||||||
|
return this.currencies;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencies(final Collection<CurrencyData> currencies) {
|
||||||
|
this.currencies = currencies;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class DerivedLoanData {
|
||||||
|
|
||||||
|
private LoanRepaymentScheduleData repaymentSchedule;
|
||||||
|
private LoanAccountSummaryData summary;
|
||||||
|
private List<LoanRepaymentData> loanRepayments;
|
||||||
|
|
||||||
|
public DerivedLoanData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public DerivedLoanData(LoanRepaymentScheduleData repaymentScheduleData, LoanAccountSummaryData summaryData, List<LoanRepaymentData> loanRepayments) {
|
||||||
|
this.repaymentSchedule = repaymentScheduleData;
|
||||||
|
this.summary = summaryData;
|
||||||
|
this.loanRepayments = loanRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanRepaymentScheduleData getRepaymentSchedule() {
|
||||||
|
return repaymentSchedule;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentSchedule(LoanRepaymentScheduleData repaymentSchedule) {
|
||||||
|
this.repaymentSchedule = repaymentSchedule;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanAccountSummaryData getSummary() {
|
||||||
|
return summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSummary(LoanAccountSummaryData summary) {
|
||||||
|
this.summary = summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<LoanRepaymentData> getLoanRepayments() {
|
||||||
|
return loanRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanRepayments(List<LoanRepaymentData> loanRepayments) {
|
||||||
|
this.loanRepayments = loanRepayments;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "identifier")
|
||||||
|
public class EntityIdentifier {
|
||||||
|
|
||||||
|
private Long entityId;
|
||||||
|
|
||||||
|
public EntityIdentifier() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityIdentifier(final Long entityId) {
|
||||||
|
this.entityId = entityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getEntityId() {
|
||||||
|
return this.entityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEntityId(final Long entityId) {
|
||||||
|
this.entityId = entityId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class EnumOptionList {
|
||||||
|
|
||||||
|
private Collection<EnumOptionReadModel> options = new ArrayList<EnumOptionReadModel>();
|
||||||
|
|
||||||
|
protected EnumOptionList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumOptionList(final List<EnumOptionReadModel> options) {
|
||||||
|
this.options = options;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<EnumOptionReadModel> getOptions() {
|
||||||
|
return this.options;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOptions(final Collection<EnumOptionReadModel> options) {
|
||||||
|
this.options = options;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "option")
|
||||||
|
public class EnumOptionReadModel implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
public EnumOptionReadModel() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumOptionReadModel(final String value, final Long id) {
|
||||||
|
this.value = value;
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(final String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO - Arguments is still not correctly supported
|
||||||
|
*/
|
||||||
|
@XmlRootElement(name="errorResponse")
|
||||||
|
public class ErrorResponse {
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
private String field;
|
||||||
|
private String value;
|
||||||
|
private Object[] args;
|
||||||
|
|
||||||
|
public ErrorResponse() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public ErrorResponse(final String code, final String field, final String value) {
|
||||||
|
this.code = code;
|
||||||
|
this.field = field;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ErrorResponse(final String code, final String field, final Object... args) {
|
||||||
|
this.code = code;
|
||||||
|
this.field = field;
|
||||||
|
this.args = args;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(final String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getField() {
|
||||||
|
return this.field;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setField(final String field) {
|
||||||
|
this.field = field;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(final String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object[] getArgs() {
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArgs(Object[] args) {
|
||||||
|
this.args = args;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class ErrorResponseList {
|
||||||
|
|
||||||
|
private List<ErrorResponse> errors = new ArrayList<ErrorResponse>();
|
||||||
|
|
||||||
|
public ErrorResponseList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public ErrorResponseList(final List<ErrorResponse> errors) {
|
||||||
|
this.errors = errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElementWrapper(name="errors")
|
||||||
|
@XmlElement(name="errorResponse")
|
||||||
|
public List<ErrorResponse> getErrors() {
|
||||||
|
return errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrors(List<ErrorResponse> errors) {
|
||||||
|
this.errors = errors;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class ExtraDatasets {
|
||||||
|
|
||||||
|
private List<String> names = new ArrayList<String>();
|
||||||
|
|
||||||
|
protected ExtraDatasets() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtraDatasets(final List<String> names) {
|
||||||
|
this.names = names;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getNames() {
|
||||||
|
return names;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNames(List<String> names) {
|
||||||
|
this.names = names;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,590 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.joda.time.Days;
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
import org.joda.time.Months;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "loan")
|
||||||
|
public class LoanAccountData {
|
||||||
|
|
||||||
|
private boolean open;
|
||||||
|
private boolean openWithRepaymentMade;
|
||||||
|
private boolean closed;
|
||||||
|
private boolean interestRebateOutstanding;
|
||||||
|
private boolean pendingApproval;
|
||||||
|
private boolean waitingForDisbursal;
|
||||||
|
private String lifeCycleStatusText;
|
||||||
|
private LocalDate lifeCycleStatusDate;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String externalId;
|
||||||
|
private String loanProductName;
|
||||||
|
|
||||||
|
private LocalDate submittedOnDate;
|
||||||
|
private LocalDate approvedOnDate;
|
||||||
|
|
||||||
|
private LocalDate expectedDisbursementDate;
|
||||||
|
private LocalDate actualDisbursementDate;
|
||||||
|
private boolean undoDisbursalAllowed;
|
||||||
|
|
||||||
|
private LocalDate expectedFirstRepaymentOnDate;
|
||||||
|
private LocalDate interestCalculatedFromDate;
|
||||||
|
|
||||||
|
private LocalDate closedOnDate;
|
||||||
|
|
||||||
|
private LocalDate expectedMaturityDate;
|
||||||
|
|
||||||
|
private MoneyData principal;
|
||||||
|
private BigDecimal interestRatePerYear;
|
||||||
|
private BigDecimal interestRatePerPeriod;
|
||||||
|
private Integer interestPeriodFrequencyType;
|
||||||
|
private String interestPeriodFrequencyText;
|
||||||
|
private Integer interestMethodType;
|
||||||
|
private String interestMethodText;
|
||||||
|
private Integer amortizationMethodValue;
|
||||||
|
private String amortizationMethodText;
|
||||||
|
private Integer numberOfRepayments;
|
||||||
|
|
||||||
|
private Integer repaymentFrequencyNumber;
|
||||||
|
private Integer repaymentFrequencyTypeEnumOrdinal;
|
||||||
|
private String repaymentFrequencyTypeText;
|
||||||
|
|
||||||
|
private MoneyData interestRebateOwed;
|
||||||
|
|
||||||
|
private DerivedLoanData loanData;
|
||||||
|
private MoneyData arrearsTolerance;
|
||||||
|
|
||||||
|
// permissions on actions against loan based on the user who request loan data.
|
||||||
|
private boolean waiveAllowed;
|
||||||
|
private boolean makeRepaymentAllowed;
|
||||||
|
private boolean rejectAllowed;
|
||||||
|
private boolean withdrawnByApplicantAllowed;
|
||||||
|
private boolean undoApprovalAllowed;
|
||||||
|
private boolean disbursalAllowed;
|
||||||
|
|
||||||
|
public LoanAccountData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanAccountData(
|
||||||
|
final boolean closed,
|
||||||
|
final boolean open,
|
||||||
|
final boolean openWithRepaymentMade,
|
||||||
|
final boolean interestRebateOutstanding,
|
||||||
|
final boolean pendingApproval,
|
||||||
|
final boolean waitingForDisbursal,
|
||||||
|
final boolean undoDisbursalAllowed,
|
||||||
|
final boolean makeRepaymentAllowed,
|
||||||
|
final boolean rejectAllowed,
|
||||||
|
final boolean withdrawnByApplicantAllowed, final boolean undoApprovalAllowed, final boolean disbursalAllowed,
|
||||||
|
final String lifeCycleStatusText,
|
||||||
|
final LocalDate lifeCycleStatusDate,
|
||||||
|
final Long id, String externalId,
|
||||||
|
final String loanProductName, final LocalDate closedOnDate,
|
||||||
|
final LocalDate submittedOnDate,
|
||||||
|
final LocalDate approvedOnDate,
|
||||||
|
final LocalDate expectedDisbursementDate,
|
||||||
|
final LocalDate actualDisbursementDate,
|
||||||
|
final LocalDate expectedMaturityDate,
|
||||||
|
final LocalDate expectedFirstRepaymentOnDate,
|
||||||
|
final LocalDate interestCalculatedFromDate,
|
||||||
|
final MoneyData principal, final BigDecimal interestRatePerYear,
|
||||||
|
final BigDecimal interestRatePerPeriod,
|
||||||
|
final Integer interestPeriodFrequencyType,
|
||||||
|
final String interestPeriodFrequencyText,
|
||||||
|
final Integer interestMethodType,
|
||||||
|
final String interestMethodText,
|
||||||
|
final Integer amortizationMethodValue,
|
||||||
|
final String amortizationMethodText,
|
||||||
|
final Integer numberOfRepayments,
|
||||||
|
final Integer repayEvery,
|
||||||
|
final Integer repaymentFrequencyValue,
|
||||||
|
final String repaymentFrequencyText,
|
||||||
|
final MoneyData arrearsTolerance, final DerivedLoanData derivedLoanData,
|
||||||
|
boolean waiveAllowed, final MoneyData interestRebateOwed) {
|
||||||
|
this.closed = closed;
|
||||||
|
this.open = open;
|
||||||
|
this.openWithRepaymentMade = openWithRepaymentMade;
|
||||||
|
this.makeRepaymentAllowed = makeRepaymentAllowed;
|
||||||
|
this.rejectAllowed = rejectAllowed;
|
||||||
|
this.withdrawnByApplicantAllowed = withdrawnByApplicantAllowed;
|
||||||
|
this.undoApprovalAllowed = undoApprovalAllowed;
|
||||||
|
this.disbursalAllowed = disbursalAllowed;
|
||||||
|
this.lifeCycleStatusDate = lifeCycleStatusDate;
|
||||||
|
this.externalId = externalId;
|
||||||
|
this.undoDisbursalAllowed = undoDisbursalAllowed;
|
||||||
|
this.interestRebateOutstanding = interestRebateOutstanding;
|
||||||
|
this.pendingApproval = pendingApproval;
|
||||||
|
this.waitingForDisbursal = waitingForDisbursal;
|
||||||
|
this.lifeCycleStatusText = lifeCycleStatusText;
|
||||||
|
this.id = id;
|
||||||
|
this.loanProductName = loanProductName;
|
||||||
|
this.closedOnDate = closedOnDate;
|
||||||
|
this.submittedOnDate = submittedOnDate;
|
||||||
|
this.approvedOnDate = approvedOnDate;
|
||||||
|
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||||
|
this.actualDisbursementDate = actualDisbursementDate;
|
||||||
|
this.expectedMaturityDate = expectedMaturityDate;
|
||||||
|
this.expectedFirstRepaymentOnDate = expectedFirstRepaymentOnDate;
|
||||||
|
this.interestCalculatedFromDate = interestCalculatedFromDate;
|
||||||
|
this.principal = principal;
|
||||||
|
this.interestRatePerYear = interestRatePerYear;
|
||||||
|
|
||||||
|
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||||
|
this.interestPeriodFrequencyType = interestPeriodFrequencyType;
|
||||||
|
this.interestPeriodFrequencyText = interestPeriodFrequencyText;
|
||||||
|
this.interestMethodType = interestMethodType;
|
||||||
|
this.interestMethodText = interestMethodText;
|
||||||
|
this.amortizationMethodValue = amortizationMethodValue;
|
||||||
|
this.amortizationMethodText = amortizationMethodText;
|
||||||
|
this.numberOfRepayments = numberOfRepayments;
|
||||||
|
|
||||||
|
this.repaymentFrequencyNumber = repayEvery;
|
||||||
|
this.repaymentFrequencyTypeEnumOrdinal = repaymentFrequencyValue;
|
||||||
|
this.repaymentFrequencyTypeText = repaymentFrequencyText;
|
||||||
|
this.arrearsTolerance = arrearsTolerance;
|
||||||
|
this.waiveAllowed = waiveAllowed;
|
||||||
|
|
||||||
|
this.loanData = derivedLoanData;
|
||||||
|
this.interestRebateOwed = interestRebateOwed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAnyActionOnLoanAllowed() {
|
||||||
|
return isRejectAllowed() || isWithdrawnByApplicantAllowed() || isPendingApproval() || isUndoDisbursalAllowed() || isMakeRepaymentAllowed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxSubmittedOnOffsetFromToday() {
|
||||||
|
return Days.daysBetween(new DateTime(),
|
||||||
|
this.getSubmittedOnDate().toDateMidnight().toDateTime())
|
||||||
|
.getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxApprovedOnOffsetFromToday() {
|
||||||
|
|
||||||
|
int offset = 0;
|
||||||
|
if (this.getApprovedOnDate() != null) {
|
||||||
|
offset = Days.daysBetween(new DateTime(),
|
||||||
|
this.getApprovedOnDate().toDateMidnight().toDateTime())
|
||||||
|
.getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxDisbursedOnOffsetFromToday() {
|
||||||
|
|
||||||
|
int offset = 0;
|
||||||
|
if (this.getActualDisbursementDate() != null) {
|
||||||
|
offset = Days.daysBetween(new DateTime(),
|
||||||
|
this.getActualDisbursementDate().toDateMidnight().toDateTime())
|
||||||
|
.getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getActualLoanTermInDays() {
|
||||||
|
|
||||||
|
LocalDate dateToUse = getExpectedDisbursementDate();
|
||||||
|
if (getActualDisbursementDate() != null) {
|
||||||
|
dateToUse = getActualDisbursementDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDate closingDateToUse = getExpectedMaturityDate();
|
||||||
|
if (getClosedOnDate() != null) {
|
||||||
|
closingDateToUse = getClosedOnDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Days.daysBetween(dateToUse.toDateMidnight().toDateTime(), closingDateToUse.toDateMidnight().toDateTime()).getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getActualLoanTermInMonths() {
|
||||||
|
|
||||||
|
LocalDate dateToUse = getExpectedDisbursementDate();
|
||||||
|
if (getActualDisbursementDate() != null) {
|
||||||
|
dateToUse = getActualDisbursementDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDate closingDateToUse = getExpectedMaturityDate();
|
||||||
|
if (getClosedOnDate() != null) {
|
||||||
|
closingDateToUse = getClosedOnDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Months.monthsBetween(dateToUse.toDateMidnight().toDateTime(), closingDateToUse.toDateMidnight().toDateTime()).getMonths();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLoanTermInDays() {
|
||||||
|
|
||||||
|
LocalDate dateToUse = getExpectedDisbursementDate();
|
||||||
|
if (getActualDisbursementDate() != null) {
|
||||||
|
dateToUse = getActualDisbursementDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDate closingDateToUse = getExpectedMaturityDate();
|
||||||
|
|
||||||
|
return Days.daysBetween(dateToUse.toDateMidnight().toDateTime(), closingDateToUse.toDateMidnight().toDateTime()).getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLoanTermInMonths() {
|
||||||
|
|
||||||
|
LocalDate dateToUse = getExpectedDisbursementDate();
|
||||||
|
if (getActualDisbursementDate() != null) {
|
||||||
|
dateToUse = getActualDisbursementDate();
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDate closingDateToUse = getExpectedMaturityDate();
|
||||||
|
|
||||||
|
return Months.monthsBetween(dateToUse.toDateMidnight().toDateTime(), closingDateToUse.toDateMidnight().toDateTime()).getMonths();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOpen() {
|
||||||
|
return this.open;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpen(final boolean open) {
|
||||||
|
this.open = open;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isClosed() {
|
||||||
|
return this.closed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClosed(final boolean closed) {
|
||||||
|
this.closed = closed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInterestRebateOutstanding() {
|
||||||
|
return this.interestRebateOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateOutstanding(
|
||||||
|
final boolean interestRebateOutstanding) {
|
||||||
|
this.interestRebateOutstanding = interestRebateOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPendingApproval() {
|
||||||
|
return this.pendingApproval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPendingApproval(final boolean pendingApproval) {
|
||||||
|
this.pendingApproval = pendingApproval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isWaitingForDisbursal() {
|
||||||
|
return this.waitingForDisbursal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWaitingForDisbursal(final boolean waitingForDisbursal) {
|
||||||
|
this.waitingForDisbursal = waitingForDisbursal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getClosedOnDate() {
|
||||||
|
return this.closedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClosedOnDate(final LocalDate closedOnDate) {
|
||||||
|
this.closedOnDate = closedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getSubmittedOnDate() {
|
||||||
|
return this.submittedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmittedOnDate(final LocalDate submittedOnDate) {
|
||||||
|
this.submittedOnDate = submittedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getExpectedDisbursementDate() {
|
||||||
|
return this.expectedDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpectedDisbursementDate(
|
||||||
|
final LocalDate expectedDisbursementDate) {
|
||||||
|
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getActualDisbursementDate() {
|
||||||
|
return this.actualDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActualDisbursementDate(final LocalDate actualDisbursementDate) {
|
||||||
|
this.actualDisbursementDate = actualDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipal() {
|
||||||
|
return this.principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(final MoneyData principal) {
|
||||||
|
this.principal = principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInterestRatePerYear() {
|
||||||
|
return this.interestRatePerYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerYear(final BigDecimal interestRatePerYear) {
|
||||||
|
this.interestRatePerYear = interestRatePerYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentFrequencyNumber() {
|
||||||
|
return this.repaymentFrequencyNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequencyNumber(
|
||||||
|
final Integer repaymentFrequencyNumber) {
|
||||||
|
this.repaymentFrequencyNumber = repaymentFrequencyNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentFrequencyTypeEnumOrdinal() {
|
||||||
|
return this.repaymentFrequencyTypeEnumOrdinal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequencyTypeEnumOrdinal(
|
||||||
|
final Integer repaymentFrequencyTypeEnumOrdinal) {
|
||||||
|
this.repaymentFrequencyTypeEnumOrdinal = repaymentFrequencyTypeEnumOrdinal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRepaymentFrequencyTypeText() {
|
||||||
|
return this.repaymentFrequencyTypeText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequencyTypeText(
|
||||||
|
final String repaymentFrequencyTypeText) {
|
||||||
|
this.repaymentFrequencyTypeText = repaymentFrequencyTypeText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLoanProductName() {
|
||||||
|
return this.loanProductName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanProductName(final String loanProductName) {
|
||||||
|
this.loanProductName = loanProductName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getApprovedOnDate() {
|
||||||
|
return this.approvedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApprovedOnDate(final LocalDate approvedOnDate) {
|
||||||
|
this.approvedOnDate = approvedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInterestRebateOwed() {
|
||||||
|
return this.interestRebateOwed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateOwed(final MoneyData interestRebateOwed) {
|
||||||
|
this.interestRebateOwed = interestRebateOwed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLifeCycleStatusText() {
|
||||||
|
return this.lifeCycleStatusText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLifeCycleStatusText(final String lifeCycleStatusText) {
|
||||||
|
this.lifeCycleStatusText = lifeCycleStatusText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getExpectedMaturityDate() {
|
||||||
|
return this.expectedMaturityDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaturityDate(final LocalDate maturityDate) {
|
||||||
|
this.expectedMaturityDate = maturityDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOpenWithRepaymentMade() {
|
||||||
|
return this.openWithRepaymentMade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenWithRepaymentMade(final boolean openWithRepaymentMade) {
|
||||||
|
this.openWithRepaymentMade = openWithRepaymentMade;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUndoDisbursalAllowed() {
|
||||||
|
return this.undoDisbursalAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUndoDisbursalAllowed(final boolean undoDisbursalAllowed) {
|
||||||
|
this.undoDisbursalAllowed = undoDisbursalAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalId() {
|
||||||
|
return externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalId(String externalId) {
|
||||||
|
this.externalId = externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInterestRatePerPeriod() {
|
||||||
|
return interestRatePerPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) {
|
||||||
|
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestPeriodFrequencyType() {
|
||||||
|
return interestPeriodFrequencyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestPeriodFrequencyType(Integer interestPeriodFrequencyType) {
|
||||||
|
this.interestPeriodFrequencyType = interestPeriodFrequencyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInterestPeriodFrequencyText() {
|
||||||
|
return interestPeriodFrequencyText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestPeriodFrequencyText(String interestPeriodFrequencyText) {
|
||||||
|
this.interestPeriodFrequencyText = interestPeriodFrequencyText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestMethodType() {
|
||||||
|
return interestMethodType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestMethodType(Integer interestMethodType) {
|
||||||
|
this.interestMethodType = interestMethodType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInterestMethodText() {
|
||||||
|
return interestMethodText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestMethodText(String interestMethodText) {
|
||||||
|
this.interestMethodText = interestMethodText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAmortizationMethodValue() {
|
||||||
|
return amortizationMethodValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationMethodValue(Integer amortizationMethodValue) {
|
||||||
|
this.amortizationMethodValue = amortizationMethodValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAmortizationMethodText() {
|
||||||
|
return amortizationMethodText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationMethodText(String amortizationMethodText) {
|
||||||
|
this.amortizationMethodText = amortizationMethodText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumberOfRepayments() {
|
||||||
|
return numberOfRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfRepayments(Integer numberOfRepayments) {
|
||||||
|
this.numberOfRepayments = numberOfRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DerivedLoanData getLoanData() {
|
||||||
|
return loanData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanData(DerivedLoanData loanData) {
|
||||||
|
this.loanData = loanData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getArrearsTolerance() {
|
||||||
|
return arrearsTolerance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrearsTolerance(MoneyData arrearsTolerance) {
|
||||||
|
this.arrearsTolerance = arrearsTolerance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isWaiveAllowed() {
|
||||||
|
return waiveAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWaiveAllowed(boolean waiveAllowed) {
|
||||||
|
this.waiveAllowed = waiveAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMakeRepaymentAllowed() {
|
||||||
|
return makeRepaymentAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMakeRepaymentAllowed(boolean makeRepaymentAllowed) {
|
||||||
|
this.makeRepaymentAllowed = makeRepaymentAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getLifeCycleStatusDate() {
|
||||||
|
return lifeCycleStatusDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLifeCycleStatusDate(LocalDate lifeCycleStatusDate) {
|
||||||
|
this.lifeCycleStatusDate = lifeCycleStatusDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRejectAllowed() {
|
||||||
|
return rejectAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRejectAllowed(boolean rejectAllowed) {
|
||||||
|
this.rejectAllowed = rejectAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isWithdrawnByApplicantAllowed() {
|
||||||
|
return withdrawnByApplicantAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWithdrawnByApplicantAllowed(boolean withdrawnByApplicantAllowed) {
|
||||||
|
this.withdrawnByApplicantAllowed = withdrawnByApplicantAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUndoApprovalAllowed() {
|
||||||
|
return undoApprovalAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUndoApprovalAllowed(boolean undoApprovalAllowed) {
|
||||||
|
this.undoApprovalAllowed = undoApprovalAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDisbursalAllowed() {
|
||||||
|
return disbursalAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisbursalAllowed(boolean disbursalAllowed) {
|
||||||
|
this.disbursalAllowed = disbursalAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getExpectedFirstRepaymentOnDate() {
|
||||||
|
return expectedFirstRepaymentOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpectedFirstRepaymentOnDate(
|
||||||
|
LocalDate expectedFirstRepaymentOnDate) {
|
||||||
|
this.expectedFirstRepaymentOnDate = expectedFirstRepaymentOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getInterestCalculatedFromDate() {
|
||||||
|
return interestCalculatedFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestCalculatedFromDate(LocalDate interestCalculatedFromDate) {
|
||||||
|
this.interestCalculatedFromDate = interestCalculatedFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpectedMaturityDate(LocalDate expectedMaturityDate) {
|
||||||
|
this.expectedMaturityDate = expectedMaturityDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class LoanAccountSummaryData {
|
||||||
|
|
||||||
|
private MoneyData originalPrincipal;
|
||||||
|
private MoneyData originalInterest;
|
||||||
|
private MoneyData originalTotal;
|
||||||
|
private MoneyData principalPaid;
|
||||||
|
private MoneyData principalOutstanding;
|
||||||
|
private MoneyData interestPaid;
|
||||||
|
private MoneyData interestOutstanding;
|
||||||
|
private MoneyData totalPaid;
|
||||||
|
private MoneyData totalOutstanding;
|
||||||
|
private MoneyData totalInArrears;
|
||||||
|
private MoneyData totalWaived;
|
||||||
|
|
||||||
|
protected LoanAccountSummaryData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanAccountSummaryData(MoneyData originalPrincipal,
|
||||||
|
MoneyData principalPaid, MoneyData principalOutstanding,
|
||||||
|
MoneyData originalInterest, MoneyData interestPaid,
|
||||||
|
MoneyData interestOutstanding, MoneyData originalTotal,
|
||||||
|
MoneyData totalPaid, MoneyData totalOutstanding, MoneyData totalInArrears, MoneyData totalWaived) {
|
||||||
|
this.originalPrincipal = originalPrincipal;
|
||||||
|
this.principalPaid = principalPaid;
|
||||||
|
this.principalOutstanding = principalOutstanding;
|
||||||
|
this.originalInterest = originalInterest;
|
||||||
|
this.interestPaid = interestPaid;
|
||||||
|
this.interestOutstanding = interestOutstanding;
|
||||||
|
this.originalTotal = originalTotal;
|
||||||
|
this.totalPaid = totalPaid;
|
||||||
|
this.totalOutstanding = totalOutstanding;
|
||||||
|
this.totalInArrears = totalInArrears;
|
||||||
|
this.totalWaived = totalWaived;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isWaiveAllowed(MoneyData tolerance) {
|
||||||
|
return tolerance.isGreaterThan(this.totalOutstanding) || tolerance.isEqualTo(this.totalOutstanding);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getOriginalPrincipal() {
|
||||||
|
return originalPrincipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalPrincipal(MoneyData originalPrincipal) {
|
||||||
|
this.originalPrincipal = originalPrincipal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getOriginalInterest() {
|
||||||
|
return originalInterest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalInterest(MoneyData originalInterest) {
|
||||||
|
this.originalInterest = originalInterest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getOriginalTotal() {
|
||||||
|
return originalTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalTotal(MoneyData originalTotal) {
|
||||||
|
this.originalTotal = originalTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipalPaid() {
|
||||||
|
return principalPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipalPaid(MoneyData principalPaid) {
|
||||||
|
this.principalPaid = principalPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipalOutstanding() {
|
||||||
|
return principalOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipalOutstanding(MoneyData principalOutstanding) {
|
||||||
|
this.principalOutstanding = principalOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInterestPaid() {
|
||||||
|
return interestPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestPaid(MoneyData interestPaid) {
|
||||||
|
this.interestPaid = interestPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInterestOutstanding() {
|
||||||
|
return interestOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestOutstanding(MoneyData interestOutstanding) {
|
||||||
|
this.interestOutstanding = interestOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalPaid() {
|
||||||
|
return totalPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPaid(MoneyData totalPaid) {
|
||||||
|
this.totalPaid = totalPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalOutstanding() {
|
||||||
|
return totalOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalOutstanding(MoneyData totalOutstanding) {
|
||||||
|
this.totalOutstanding = totalOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalInArrears() {
|
||||||
|
return totalInArrears;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalInArrears(MoneyData totalInArrears) {
|
||||||
|
this.totalInArrears = totalInArrears;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalWaived() {
|
||||||
|
return totalWaived;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalWaived(MoneyData totalWaived) {
|
||||||
|
this.totalWaived = totalWaived;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
import org.joda.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class LoanPayoffReadModel {
|
||||||
|
|
||||||
|
private String reference;
|
||||||
|
private String acutalDisbursementDate;
|
||||||
|
private String expectedMaturityDate;
|
||||||
|
private String projectedMaturityDate;
|
||||||
|
private Integer expectedLoanTermInDays;
|
||||||
|
private Integer projectedLoanTermInDays;
|
||||||
|
private MoneyData totalPaidToDate;
|
||||||
|
private MoneyData totalOutstandingBasedOnExpectedMaturityDate;
|
||||||
|
private MoneyData totalOutstandingBasedOnPayoffDate;
|
||||||
|
private MoneyData interestRebateOwed;
|
||||||
|
|
||||||
|
protected LoanPayoffReadModel() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanPayoffReadModel(
|
||||||
|
final String reference,
|
||||||
|
final LocalDate acutalDisbursementDate,
|
||||||
|
final LocalDate expectedMaturityDate,
|
||||||
|
final LocalDate projectedMaturityDate,
|
||||||
|
final Integer expectedLoanTermInDays,
|
||||||
|
final Integer projectedLoanTermInDays,
|
||||||
|
final MoneyData totalPaidToDate,
|
||||||
|
final MoneyData totalOutstandingBasedOnExpectedMaturityDate,
|
||||||
|
final MoneyData totalOutstandingBasedOnPayoffDate,
|
||||||
|
final MoneyData interestRebateOwed) {
|
||||||
|
|
||||||
|
this.reference = reference;
|
||||||
|
|
||||||
|
DateTimeFormatter formatter = org.joda.time.format.DateTimeFormat
|
||||||
|
.forPattern("yyyy-MM-dd");
|
||||||
|
this.acutalDisbursementDate = formatter.print(acutalDisbursementDate);
|
||||||
|
this.expectedMaturityDate = formatter.print(expectedMaturityDate);
|
||||||
|
this.projectedMaturityDate = formatter.print(projectedMaturityDate);
|
||||||
|
this.expectedLoanTermInDays = expectedLoanTermInDays;
|
||||||
|
this.projectedLoanTermInDays = projectedLoanTermInDays;
|
||||||
|
|
||||||
|
this.totalPaidToDate = totalPaidToDate;
|
||||||
|
this.totalOutstandingBasedOnExpectedMaturityDate = totalOutstandingBasedOnExpectedMaturityDate;
|
||||||
|
this.totalOutstandingBasedOnPayoffDate = totalOutstandingBasedOnPayoffDate;
|
||||||
|
this.interestRebateOwed = interestRebateOwed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReference() {
|
||||||
|
return this.reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReference(final String reference) {
|
||||||
|
this.reference = reference;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAcutalDisbursementDate() {
|
||||||
|
return this.acutalDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAcutalDisbursementDate(final String acutalDisbursementDate) {
|
||||||
|
this.acutalDisbursementDate = acutalDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExpectedMaturityDate() {
|
||||||
|
return this.expectedMaturityDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpectedMaturityDate(final String expectedMaturityDate) {
|
||||||
|
this.expectedMaturityDate = expectedMaturityDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProjectedMaturityDate() {
|
||||||
|
return this.projectedMaturityDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectedMaturityDate(final String projectedMaturityDate) {
|
||||||
|
this.projectedMaturityDate = projectedMaturityDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getExpectedLoanTermInDays() {
|
||||||
|
return this.expectedLoanTermInDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpectedLoanTermInDays(final Integer expectedLoanTermInDays) {
|
||||||
|
this.expectedLoanTermInDays = expectedLoanTermInDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getProjectedLoanTermInDays() {
|
||||||
|
return this.projectedLoanTermInDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectedLoanTermInDays(final Integer projectedLoanTermInDays) {
|
||||||
|
this.projectedLoanTermInDays = projectedLoanTermInDays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalPaidToDate() {
|
||||||
|
return this.totalPaidToDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPaidToDate(final MoneyData totalPaidToDate) {
|
||||||
|
this.totalPaidToDate = totalPaidToDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInterestRebateOwed() {
|
||||||
|
return this.interestRebateOwed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateOwed(final MoneyData interestRebateOwed) {
|
||||||
|
this.interestRebateOwed = interestRebateOwed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalOutstandingBasedOnExpectedMaturityDate() {
|
||||||
|
return this.totalOutstandingBasedOnExpectedMaturityDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalOutstandingBasedOnExpectedMaturityDate(
|
||||||
|
final MoneyData totalOutstandingBasedOnExpectedMaturityDate) {
|
||||||
|
this.totalOutstandingBasedOnExpectedMaturityDate = totalOutstandingBasedOnExpectedMaturityDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalOutstandingBasedOnPayoffDate() {
|
||||||
|
return this.totalOutstandingBasedOnPayoffDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalOutstandingBasedOnPayoffDate(
|
||||||
|
final MoneyData totalOutstandingBasedOnPayoffDate) {
|
||||||
|
this.totalOutstandingBasedOnPayoffDate = totalOutstandingBasedOnPayoffDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,259 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "loanProduct")
|
||||||
|
public class LoanProductData implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
private boolean isFlexible;
|
||||||
|
private boolean isInterestRebateAllowed;
|
||||||
|
private MoneyData principalMoney;
|
||||||
|
private BigDecimal interestRatePerPeriod = BigDecimal.ZERO;
|
||||||
|
private int interestRatePeriod;
|
||||||
|
private BigDecimal annualInterestRate = BigDecimal.ZERO;
|
||||||
|
private int interestMethod;
|
||||||
|
private Integer numberOfInterestFreePeriods = Integer.valueOf(0);
|
||||||
|
private Integer repaidEvery;
|
||||||
|
private int repaymentPeriodFrequency;
|
||||||
|
private Integer numberOfRepayments;
|
||||||
|
private int amortizationMethod;
|
||||||
|
private MoneyData inArrearsTolerance;
|
||||||
|
private DateTime createdOn;
|
||||||
|
private DateTime lastModifedOn;
|
||||||
|
|
||||||
|
private List<CurrencyData> possibleCurrencies = new ArrayList<CurrencyData>();
|
||||||
|
private List<EnumOptionReadModel> possibleAmortizationOptions = new ArrayList<EnumOptionReadModel>();
|
||||||
|
private List<EnumOptionReadModel> possibleInterestOptions = new ArrayList<EnumOptionReadModel>();
|
||||||
|
private List<EnumOptionReadModel> repaymentFrequencyOptions = new ArrayList<EnumOptionReadModel>();
|
||||||
|
private List<EnumOptionReadModel> interestFrequencyOptions = new ArrayList<EnumOptionReadModel>();
|
||||||
|
|
||||||
|
public LoanProductData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanProductData(final Long id, final String name,
|
||||||
|
String description, final boolean isFlexible,
|
||||||
|
final boolean isInterestRebateAllowed,
|
||||||
|
final MoneyData principalMoney,
|
||||||
|
final BigDecimal interestRatePerPeriod,
|
||||||
|
final int interestRatePeriod, final BigDecimal annualInterestRate,
|
||||||
|
final int interestMethod, final Integer repaidEvery,
|
||||||
|
final int repaymentPeriodFrequency, final Integer numberOfRepayments,
|
||||||
|
final int amortizationMethod, MoneyData inArrearsTolerance, DateTime createdOn, DateTime lastModifedOn) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.isFlexible = isFlexible;
|
||||||
|
this.isInterestRebateAllowed = isInterestRebateAllowed;
|
||||||
|
this.principalMoney = principalMoney;
|
||||||
|
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||||
|
this.interestRatePeriod = interestRatePeriod;
|
||||||
|
this.annualInterestRate = annualInterestRate;
|
||||||
|
this.interestMethod = interestMethod;
|
||||||
|
this.numberOfRepayments = numberOfRepayments;
|
||||||
|
this.repaidEvery = repaidEvery;
|
||||||
|
this.repaymentPeriodFrequency = repaymentPeriodFrequency;
|
||||||
|
this.amortizationMethod = amortizationMethod;
|
||||||
|
this.inArrearsTolerance = inArrearsTolerance;
|
||||||
|
this.createdOn = createdOn;
|
||||||
|
this.lastModifedOn = lastModifedOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFlexible() {
|
||||||
|
return isFlexible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlexible(boolean isFlexible) {
|
||||||
|
this.isFlexible = isFlexible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInterestRebateAllowed() {
|
||||||
|
return isInterestRebateAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateAllowed(boolean isInterestRebateAllowed) {
|
||||||
|
this.isInterestRebateAllowed = isInterestRebateAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipalMoney() {
|
||||||
|
return principalMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipalMoney(MoneyData principalMoney) {
|
||||||
|
this.principalMoney = principalMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInterestRatePerPeriod() {
|
||||||
|
return interestRatePerPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) {
|
||||||
|
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getInterestRatePeriod() {
|
||||||
|
return interestRatePeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePeriod(int interestRatePeriod) {
|
||||||
|
this.interestRatePeriod = interestRatePeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getAnnualInterestRate() {
|
||||||
|
return annualInterestRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnnualInterestRate(BigDecimal annualInterestRate) {
|
||||||
|
this.annualInterestRate = annualInterestRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getInterestMethod() {
|
||||||
|
return interestMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestMethod(int interestMethod) {
|
||||||
|
this.interestMethod = interestMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaidEvery() {
|
||||||
|
return repaidEvery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaidEvery(Integer repaidEvery) {
|
||||||
|
this.repaidEvery = repaidEvery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRepaymentPeriodFrequency() {
|
||||||
|
return repaymentPeriodFrequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentPeriodFrequency(int repaymentPeriodFrequency) {
|
||||||
|
this.repaymentPeriodFrequency = repaymentPeriodFrequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumberOfRepayments() {
|
||||||
|
return numberOfRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfRepayments(Integer numberOfRepayments) {
|
||||||
|
this.numberOfRepayments = numberOfRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAmortizationMethod() {
|
||||||
|
return amortizationMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationMethod(int amortizationMethod) {
|
||||||
|
this.amortizationMethod = amortizationMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInArrearsTolerance() {
|
||||||
|
return inArrearsTolerance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInArrearsTolerance(MoneyData inArrearsTolerance) {
|
||||||
|
this.inArrearsTolerance = inArrearsTolerance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime getCreatedOn() {
|
||||||
|
return createdOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedOn(DateTime createdOn) {
|
||||||
|
this.createdOn = createdOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime getLastModifedOn() {
|
||||||
|
return lastModifedOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastModifedOn(DateTime lastModifedOn) {
|
||||||
|
this.lastModifedOn = lastModifedOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CurrencyData> getPossibleCurrencies() {
|
||||||
|
return possibleCurrencies;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPossibleCurrencies(List<CurrencyData> possibleCurrencies) {
|
||||||
|
this.possibleCurrencies = possibleCurrencies;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnumOptionReadModel> getPossibleAmortizationOptions() {
|
||||||
|
return possibleAmortizationOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPossibleAmortizationOptions(
|
||||||
|
List<EnumOptionReadModel> possibleAmortizationOptions) {
|
||||||
|
this.possibleAmortizationOptions = possibleAmortizationOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnumOptionReadModel> getPossibleInterestOptions() {
|
||||||
|
return possibleInterestOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPossibleInterestOptions(
|
||||||
|
List<EnumOptionReadModel> possibleInterestOptions) {
|
||||||
|
this.possibleInterestOptions = possibleInterestOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnumOptionReadModel> getRepaymentFrequencyOptions() {
|
||||||
|
return repaymentFrequencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequencyOptions(
|
||||||
|
List<EnumOptionReadModel> repaymentFrequencyOptions) {
|
||||||
|
this.repaymentFrequencyOptions = repaymentFrequencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnumOptionReadModel> getInterestFrequencyOptions() {
|
||||||
|
return interestFrequencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestFrequencyOptions(
|
||||||
|
List<EnumOptionReadModel> interestFrequencyOptions) {
|
||||||
|
this.interestFrequencyOptions = interestFrequencyOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumberOfInterestFreePeriods() {
|
||||||
|
return numberOfInterestFreePeriods;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfInterestFreePeriods(Integer numberOfInterestFreePeriods) {
|
||||||
|
this.numberOfInterestFreePeriods = numberOfInterestFreePeriods;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class LoanProductList {
|
||||||
|
|
||||||
|
private Collection<LoanProductData> products = new ArrayList<LoanProductData>();
|
||||||
|
|
||||||
|
protected LoanProductList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanProductList(final Collection<LoanProductData> products) {
|
||||||
|
this.products = products;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<LoanProductData> getProducts() {
|
||||||
|
return this.products;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProducts(final Collection<LoanProductData> products) {
|
||||||
|
this.products = products;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.DateMidnight;
|
||||||
|
import org.joda.time.Days;
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class LoanRepaymentData {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private LocalDate date;
|
||||||
|
private MoneyData principal;
|
||||||
|
private MoneyData interest;
|
||||||
|
private MoneyData total;
|
||||||
|
private MoneyData totalWaived;
|
||||||
|
private MoneyData overpaid;
|
||||||
|
|
||||||
|
public LoanRepaymentData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanRepaymentData(
|
||||||
|
Long id, final LocalDate date,
|
||||||
|
final MoneyData principal,
|
||||||
|
final MoneyData interest,
|
||||||
|
final MoneyData total, final MoneyData overpaid) {
|
||||||
|
this.id = id;
|
||||||
|
this.date = date;
|
||||||
|
this.principal = principal;
|
||||||
|
this.interest = interest;
|
||||||
|
this.total = total;
|
||||||
|
this.overpaid = overpaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getDate() {
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTransactionOffsetFromToday() {
|
||||||
|
return Days.daysBetween(new DateMidnight().toDateTime(), this.date.toDateMidnight().toDateTime()).getDays();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate(LocalDate date) {
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipal() {
|
||||||
|
return principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(MoneyData principal) {
|
||||||
|
this.principal = principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInterest() {
|
||||||
|
return interest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterest(MoneyData interest) {
|
||||||
|
this.interest = interest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(MoneyData total) {
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getOverpaid() {
|
||||||
|
return overpaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOverpaid(MoneyData overpaid) {
|
||||||
|
this.overpaid = overpaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasOverpaidComponent() {
|
||||||
|
return this.overpaid.isGreaterThanZero();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalWaived() {
|
||||||
|
return totalWaived;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalWaived(MoneyData totalWaived) {
|
||||||
|
this.totalWaived = totalWaived;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
|
import org.mifosng.data.LoanRepaymentData;
|
||||||
|
|
||||||
|
|
||||||
|
public class LoanRepaymentDataComparator implements Comparator<LoanRepaymentData> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compare(final LoanRepaymentData o1, final LoanRepaymentData o2) {
|
||||||
|
return o2.getDate().compareTo(o1.getDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class LoanRepaymentPeriodData {
|
||||||
|
|
||||||
|
private Integer period;
|
||||||
|
private LocalDate date;
|
||||||
|
private MoneyData disbursed;
|
||||||
|
private MoneyData principal;
|
||||||
|
private MoneyData principalPaid;
|
||||||
|
private MoneyData principalOutstanding;
|
||||||
|
private MoneyData interest;
|
||||||
|
private MoneyData interestPaid;
|
||||||
|
private MoneyData interestOutstanding;
|
||||||
|
private MoneyData total;
|
||||||
|
private MoneyData totalPaid;
|
||||||
|
private MoneyData totalOutstanding;
|
||||||
|
private MoneyData totalWaived;
|
||||||
|
private MoneyData totalArrears;
|
||||||
|
private LocalDate arrearsFrom;
|
||||||
|
private LocalDate arrearsTo;
|
||||||
|
private LocalDate paidInFullOn;
|
||||||
|
private LocalDate lastAffectingPaymentOn;
|
||||||
|
|
||||||
|
private static CurrencyData currencyData(MoneyData moneyData) {
|
||||||
|
String code = moneyData.getCurrencyCode();
|
||||||
|
String name = moneyData.getDefaultName();
|
||||||
|
int decimalPlaces = moneyData.getCurrencyDigitsAfterDecimal();
|
||||||
|
String displaySymbol = moneyData.getDisplaySymbol();
|
||||||
|
String nameCode = moneyData.getNameCode();
|
||||||
|
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanRepaymentPeriodData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanRepaymentPeriodData(Integer period, LocalDate date,
|
||||||
|
MoneyData disbursed, MoneyData total) {
|
||||||
|
this.period = period;
|
||||||
|
this.date = date;
|
||||||
|
this.disbursed = disbursed;
|
||||||
|
this.principal = null;
|
||||||
|
this.principalPaid = null;
|
||||||
|
this.principalOutstanding = null;
|
||||||
|
this.interest = null;
|
||||||
|
this.interestPaid = null;
|
||||||
|
this.interestOutstanding = null;
|
||||||
|
this.total = total;
|
||||||
|
this.totalPaid = null;
|
||||||
|
this.totalOutstanding = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanRepaymentPeriodData(Integer period, LocalDate date,
|
||||||
|
MoneyData disbursed, MoneyData principal,
|
||||||
|
MoneyData interest, MoneyData total,
|
||||||
|
MoneyData totalOutstanding) {
|
||||||
|
this.period = period;
|
||||||
|
this.date = date;
|
||||||
|
this.disbursed = disbursed;
|
||||||
|
this.principal = principal;
|
||||||
|
this.principalPaid = MoneyData.zero(currencyData(principal));
|
||||||
|
this.principalOutstanding = principal;
|
||||||
|
this.interest = interest;
|
||||||
|
this.interestPaid = MoneyData.zero(currencyData(principal));
|
||||||
|
this.interestOutstanding = interest;
|
||||||
|
this.total = total;
|
||||||
|
this.totalPaid = MoneyData.zero(currencyData(principal));
|
||||||
|
this.totalOutstanding = totalOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInArrearsWithToleranceOf(MoneyData arrearsTolerance, LocalDate asOf) {
|
||||||
|
|
||||||
|
boolean inArrears = false;
|
||||||
|
if (arrearsTolerance.isGreaterThanZero()) {
|
||||||
|
inArrears = this.totalOutstanding.isGreaterThan(arrearsTolerance);
|
||||||
|
} else {
|
||||||
|
inArrears = this.totalOutstanding.isGreaterThanZero();
|
||||||
|
}
|
||||||
|
|
||||||
|
return inArrears && this.date.isBefore(asOf);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPeriod() {
|
||||||
|
return period;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeriod(Integer period) {
|
||||||
|
this.period = period;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getDate() {
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate(LocalDate date) {
|
||||||
|
this.date = date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getDisbursed() {
|
||||||
|
return disbursed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisbursed(MoneyData disbursed) {
|
||||||
|
this.disbursed = disbursed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipal() {
|
||||||
|
return principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(MoneyData principal) {
|
||||||
|
this.principal = principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInterest() {
|
||||||
|
return interest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterest(MoneyData interest) {
|
||||||
|
this.interest = interest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(MoneyData total) {
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipalPaid() {
|
||||||
|
return principalPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipalPaid(MoneyData principalPaid) {
|
||||||
|
this.principalPaid = principalPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipalOutstanding() {
|
||||||
|
return principalOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipalOutstanding(MoneyData principalOutstanding) {
|
||||||
|
this.principalOutstanding = principalOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInterestPaid() {
|
||||||
|
return interestPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestPaid(MoneyData interestPaid) {
|
||||||
|
this.interestPaid = interestPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInterestOutstanding() {
|
||||||
|
return interestOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestOutstanding(MoneyData interestOutstanding) {
|
||||||
|
this.interestOutstanding = interestOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalPaid() {
|
||||||
|
return totalPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPaid(MoneyData totalPaid) {
|
||||||
|
this.totalPaid = totalPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalOutstanding() {
|
||||||
|
return totalOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalOutstanding(MoneyData totalOutstanding) {
|
||||||
|
this.totalOutstanding = totalOutstanding;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFullyPaid() {
|
||||||
|
return this.totalOutstanding.isZero();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalArrears() {
|
||||||
|
return totalArrears;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalArrears(MoneyData totalArrears) {
|
||||||
|
this.totalArrears = totalArrears;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getArrearsFrom() {
|
||||||
|
return arrearsFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrearsFrom(LocalDate arrearsFrom) {
|
||||||
|
this.arrearsFrom = arrearsFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getArrearsTo() {
|
||||||
|
return arrearsTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrearsTo(LocalDate arrearsTo) {
|
||||||
|
this.arrearsTo = arrearsTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getPaidInFullOn() {
|
||||||
|
return paidInFullOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaidInFullOn(LocalDate paidInFullOn) {
|
||||||
|
this.paidInFullOn = paidInFullOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getLastAffectingPaymentOn() {
|
||||||
|
return lastAffectingPaymentOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastAffectingPaymentOn(LocalDate lastAffectingPaymentOn) {
|
||||||
|
this.lastAffectingPaymentOn = lastAffectingPaymentOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalWaived() {
|
||||||
|
return totalWaived;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalWaived(MoneyData totalWaived) {
|
||||||
|
this.totalWaived = totalWaived;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class LoanRepaymentScheduleData {
|
||||||
|
|
||||||
|
private List<LoanRepaymentPeriodData> periods = new ArrayList<LoanRepaymentPeriodData>();
|
||||||
|
|
||||||
|
public LoanRepaymentScheduleData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanRepaymentScheduleData(
|
||||||
|
final List<LoanRepaymentPeriodData> periods) {
|
||||||
|
this.periods = periods;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<LoanRepaymentPeriodData> getPeriods() {
|
||||||
|
return periods;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeriods(List<LoanRepaymentPeriodData> periods) {
|
||||||
|
this.periods = periods;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "loanSchedule")
|
||||||
|
public class LoanSchedule implements Serializable {
|
||||||
|
|
||||||
|
private List<ScheduledLoanInstallment> scheduledLoanInstallments = new ArrayList<ScheduledLoanInstallment>();
|
||||||
|
|
||||||
|
private static CurrencyData currencyData(MoneyData moneyData) {
|
||||||
|
String code = moneyData.getCurrencyCode();
|
||||||
|
String name = moneyData.getDefaultName();
|
||||||
|
int decimalPlaces = moneyData.getCurrencyDigitsAfterDecimal();
|
||||||
|
String displaySymbol = moneyData.getDisplaySymbol();
|
||||||
|
String nameCode = moneyData.getNameCode();
|
||||||
|
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanSchedule() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanSchedule(final List<ScheduledLoanInstallment> scheduledLoanInstallments) {
|
||||||
|
this.scheduledLoanInstallments = scheduledLoanInstallments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getCumulativePrincipal() {
|
||||||
|
MoneyData cumulative = MoneyData.zero(currencyData(this.scheduledLoanInstallments.get(0).getPrincipalDue()));
|
||||||
|
for (ScheduledLoanInstallment installment : this.scheduledLoanInstallments) {
|
||||||
|
cumulative = cumulative.plus(installment.getPrincipalDue());
|
||||||
|
}
|
||||||
|
return cumulative;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getCumulativeInterest() {
|
||||||
|
MoneyData cumulative = MoneyData.zero(currencyData(this.scheduledLoanInstallments.get(0).getPrincipalDue()));
|
||||||
|
for (ScheduledLoanInstallment installment : this.scheduledLoanInstallments) {
|
||||||
|
cumulative = cumulative.plus(installment.getInterestDue());
|
||||||
|
}
|
||||||
|
return cumulative;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getCumulativeTotal() {
|
||||||
|
MoneyData cumulative = MoneyData.zero(currencyData(this.scheduledLoanInstallments.get(0).getPrincipalDue()));
|
||||||
|
for (ScheduledLoanInstallment installment : this.scheduledLoanInstallments) {
|
||||||
|
cumulative = cumulative.plus(installment.getTotalInstallmentDue());
|
||||||
|
}
|
||||||
|
return cumulative;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ScheduledLoanInstallment> getScheduledLoanInstallments() {
|
||||||
|
return this.scheduledLoanInstallments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScheduledLoanInstallments(
|
||||||
|
final List<ScheduledLoanInstallment> scheduledLoanInstallments) {
|
||||||
|
this.scheduledLoanInstallments = scheduledLoanInstallments;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class MoneyData implements Serializable, Comparable<MoneyData> {
|
||||||
|
|
||||||
|
private String currencyCode;
|
||||||
|
private Integer currencyDigitsAfterDecimal;
|
||||||
|
private BigDecimal amount;
|
||||||
|
private String defaultName;
|
||||||
|
private String nameCode;
|
||||||
|
private String displaySymbol;
|
||||||
|
|
||||||
|
public static MoneyData of(final CurrencyData currency, final BigDecimal amount) {
|
||||||
|
return new MoneyData(currency.getCode(), currency.getDecimalPlaces(), currency.getName(), currency.getNameCode(), currency.getDisplaySymbol(), amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MoneyData zero(final CurrencyData currency) {
|
||||||
|
return new MoneyData(currency.getCode(), currency.getDecimalPlaces(), currency.getName(), currency.getNameCode(), currency.getDisplaySymbol(), BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected MoneyData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
private MoneyData(final String currencyCode,
|
||||||
|
final int currencyDigitsAfterDecimal,
|
||||||
|
String defaultName, String nameCode, String displaySymbol,
|
||||||
|
final BigDecimal amount) {
|
||||||
|
this.currencyCode = currencyCode;
|
||||||
|
this.currencyDigitsAfterDecimal = currencyDigitsAfterDecimal;
|
||||||
|
this.defaultName = defaultName;
|
||||||
|
this.nameCode = nameCode;
|
||||||
|
this.displaySymbol = displaySymbol;
|
||||||
|
BigDecimal amountStripped = amount.stripTrailingZeros();
|
||||||
|
this.amount = amountStripped.setScale(this.currencyDigitsAfterDecimal,
|
||||||
|
RoundingMode.HALF_EVEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData plus(final Iterable<? extends MoneyData> moniesToAdd) {
|
||||||
|
BigDecimal total = this.amount;
|
||||||
|
for (MoneyData moneyProvider : moniesToAdd) {
|
||||||
|
MoneyData money = this.checkCurrencyEqual(moneyProvider);
|
||||||
|
total = total.add(money.amount);
|
||||||
|
}
|
||||||
|
return MoneyData.of(currencyData(this), total);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData plus(final MoneyData moneyToAdd) {
|
||||||
|
MoneyData toAdd = this.checkCurrencyEqual(moneyToAdd);
|
||||||
|
return this.plus(toAdd.getAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData plus(final BigDecimal amountToAdd) {
|
||||||
|
if (amountToAdd.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
BigDecimal newAmount = this.amount.add(amountToAdd);
|
||||||
|
return MoneyData.of(currencyData(this), newAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData plus(final double amountToAdd) {
|
||||||
|
if (amountToAdd == 0) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
BigDecimal newAmount = this.amount.add(BigDecimal.valueOf(amountToAdd));
|
||||||
|
return MoneyData.of(currencyData(this), newAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static CurrencyData currencyData(MoneyData moneyData) {
|
||||||
|
String code = moneyData.getCurrencyCode();
|
||||||
|
String name = moneyData.getDefaultName();
|
||||||
|
int decimalPlaces = moneyData.getCurrencyDigitsAfterDecimal();
|
||||||
|
String displaySymbol = moneyData.getDisplaySymbol();
|
||||||
|
String nameCode = moneyData.getNameCode();
|
||||||
|
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
private MoneyData checkCurrencyEqual(final MoneyData money) {
|
||||||
|
if (this.isSameCurrency(money) == false) {
|
||||||
|
throw new UnsupportedOperationException("currencies are different.");
|
||||||
|
}
|
||||||
|
return money;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSameCurrency(final MoneyData money) {
|
||||||
|
return this.currencyCode.equals(money.getCurrencyCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrencyCode() {
|
||||||
|
return this.currencyCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCurrencyDigitsAfterDecimal() {
|
||||||
|
return this.currencyDigitsAfterDecimal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getAmount() {
|
||||||
|
return this.amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencyCode(final String currencyCode) {
|
||||||
|
this.currencyCode = currencyCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencyDigitsAfterDecimal(final Integer currencyDigitsAfterDecimal) {
|
||||||
|
this.currencyDigitsAfterDecimal = currencyDigitsAfterDecimal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmount(final BigDecimal amount) {
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultName() {
|
||||||
|
return defaultName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefaultName(String defaultName) {
|
||||||
|
this.defaultName = defaultName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNameCode() {
|
||||||
|
return nameCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNameCode(String nameCode) {
|
||||||
|
this.nameCode = nameCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplaySymbol() {
|
||||||
|
return displaySymbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisplaySymbol(String displaySymbol) {
|
||||||
|
this.displaySymbol = displaySymbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isGreaterThanZero() {
|
||||||
|
return this.isGreaterThan(MoneyData.of(currencyData(this), BigDecimal.ZERO));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isGreaterThan(final MoneyData other) {
|
||||||
|
return this.compareTo(other) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isZero() {
|
||||||
|
return this.isEqualTo(MoneyData.zero(currencyData(this)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEqualTo(final MoneyData other) {
|
||||||
|
return this.compareTo(other) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(final MoneyData other) {
|
||||||
|
MoneyData otherMoney = other;
|
||||||
|
if (this.currencyCode.equals(otherMoney.currencyCode) == false) {
|
||||||
|
throw new UnsupportedOperationException(
|
||||||
|
"currencies arent different");
|
||||||
|
}
|
||||||
|
return this.amount.compareTo(otherMoney.amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
MoneyData money = (MoneyData) obj;
|
||||||
|
return money.toString().equals(this.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return this.toString().hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new StringBuilder().append(this.amount.toPlainString()).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplaySymbolValue() {
|
||||||
|
return new StringBuilder().append(this.amount.toPlainString()).append(' ').append(this.displaySymbol).toString().trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "newloanworkflow")
|
||||||
|
public class NewLoanWorkflowStepOneData implements Serializable {
|
||||||
|
|
||||||
|
private Long organisationId;
|
||||||
|
private String organisationName;
|
||||||
|
private Long clientId;
|
||||||
|
private String clientName;
|
||||||
|
private Long productId;
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
private List<LoanProductData> allowedProducts = new ArrayList<LoanProductData>();
|
||||||
|
|
||||||
|
// extra
|
||||||
|
private LocalDate submittedOnDate;
|
||||||
|
private String submittedOnNote = "";
|
||||||
|
|
||||||
|
private LocalDate expectedDisbursementDate = new LocalDate();
|
||||||
|
private LocalDate repaymentsStartingFromDate;
|
||||||
|
|
||||||
|
private LocalDate interestCalculatedFromDate;
|
||||||
|
|
||||||
|
private LoanSchedule repaymentSchedule;
|
||||||
|
|
||||||
|
private LoanProductData selectedProduct;
|
||||||
|
|
||||||
|
public NewLoanWorkflowStepOneData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrganisationId() {
|
||||||
|
return organisationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrganisationId(Long organisationId) {
|
||||||
|
this.organisationId = organisationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrganisationName() {
|
||||||
|
return organisationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrganisationName(String organisationName) {
|
||||||
|
this.organisationName = organisationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getClientId() {
|
||||||
|
return clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientId(Long clientId) {
|
||||||
|
this.clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClientName() {
|
||||||
|
return clientName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientName(String clientName) {
|
||||||
|
this.clientName = clientName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getProductId() {
|
||||||
|
return productId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductId(Long productId) {
|
||||||
|
this.productId = productId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductName() {
|
||||||
|
return productName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductName(String productName) {
|
||||||
|
this.productName = productName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<LoanProductData> getAllowedProducts() {
|
||||||
|
return allowedProducts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllowedProducts(List<LoanProductData> allowedProducts) {
|
||||||
|
this.allowedProducts = allowedProducts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getSubmittedOnDate() {
|
||||||
|
return submittedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmittedOnDate(LocalDate submittedOnDate) {
|
||||||
|
this.submittedOnDate = submittedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubmittedOnNote() {
|
||||||
|
return submittedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmittedOnNote(String submittedOnNote) {
|
||||||
|
this.submittedOnNote = submittedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanProductData getSelectedProduct() {
|
||||||
|
return selectedProduct;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedProduct(LoanProductData selectedProduct) {
|
||||||
|
this.selectedProduct = selectedProduct;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getExpectedDisbursementDate() {
|
||||||
|
return expectedDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpectedDisbursementDate(LocalDate expectedDisbursementDate) {
|
||||||
|
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getRepaymentsStartingFromDate() {
|
||||||
|
return repaymentsStartingFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentsStartingFromDate(LocalDate repaymentsStartingFromDate) {
|
||||||
|
this.repaymentsStartingFromDate = repaymentsStartingFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getInterestCalculatedFromDate() {
|
||||||
|
return interestCalculatedFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestCalculatedFromDate(LocalDate interestCalculatedFromDate) {
|
||||||
|
this.interestCalculatedFromDate = interestCalculatedFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanSchedule getRepaymentSchedule() {
|
||||||
|
return repaymentSchedule;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentSchedule(LoanSchedule repaymentSchedule) {
|
||||||
|
this.repaymentSchedule = repaymentSchedule;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "note")
|
||||||
|
public class NoteData {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private Long clientId;
|
||||||
|
private Long loanId;
|
||||||
|
private Long loanTransactionId;
|
||||||
|
private Integer noteTypeId;
|
||||||
|
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
private Long createdById;
|
||||||
|
private String createdByUsername;
|
||||||
|
private DateTime createdOn;
|
||||||
|
private Long updatedById;
|
||||||
|
private String updatedByUsername;
|
||||||
|
private DateTime updatedOn;
|
||||||
|
|
||||||
|
public NoteData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoteData(Long id, Long clientId, Long loanId,
|
||||||
|
Long transactionId, Integer noteTypeId, String note,
|
||||||
|
DateTime createdDate, Long createdById, String createdByUsername,
|
||||||
|
DateTime lastModifiedDate, Long lastModifiedById, String updatedByUsername) {
|
||||||
|
this.id = id;
|
||||||
|
this.clientId = clientId;
|
||||||
|
this.loanId = loanId;
|
||||||
|
this.loanTransactionId = transactionId;
|
||||||
|
this.noteTypeId = noteTypeId;
|
||||||
|
this.note = note;
|
||||||
|
this.createdOn = createdDate;
|
||||||
|
this.createdById = createdById;
|
||||||
|
this.createdByUsername = createdByUsername;
|
||||||
|
this.updatedOn = lastModifiedDate;
|
||||||
|
this.updatedById = lastModifiedById;
|
||||||
|
this.updatedByUsername = updatedByUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getClientId() {
|
||||||
|
return clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientId(Long clientId) {
|
||||||
|
this.clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanId() {
|
||||||
|
return loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanId(Long loanId) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanTransactionId() {
|
||||||
|
return loanTransactionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanTransactionId(Long loanTransactionId) {
|
||||||
|
this.loanTransactionId = loanTransactionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCreatedById() {
|
||||||
|
return createdById;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedById(Long createdById) {
|
||||||
|
this.createdById = createdById;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedByUsername() {
|
||||||
|
return createdByUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedByUsername(String createdByUsername) {
|
||||||
|
this.createdByUsername = createdByUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime getCreatedOn() {
|
||||||
|
return createdOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedOn(DateTime createdOn) {
|
||||||
|
this.createdOn = createdOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUpdatedById() {
|
||||||
|
return updatedById;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdatedById(Long updatedById) {
|
||||||
|
this.updatedById = updatedById;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUpdatedByUsername() {
|
||||||
|
return updatedByUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdatedByUsername(String updatedByUsername) {
|
||||||
|
this.updatedByUsername = updatedByUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime getUpdatedOn() {
|
||||||
|
return updatedOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdatedOn(DateTime updatedOn) {
|
||||||
|
this.updatedOn = updatedOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNoteTypeId() {
|
||||||
|
return noteTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoteTypeId(Integer noteTypeId) {
|
||||||
|
this.noteTypeId = noteTypeId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class NoteDataList {
|
||||||
|
|
||||||
|
private Collection<NoteData> notes = new ArrayList<NoteData>();
|
||||||
|
|
||||||
|
public NoteDataList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public NoteDataList(final Collection<NoteData> notes) {
|
||||||
|
this.notes = notes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<NoteData> getNotes() {
|
||||||
|
return notes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNotes(Collection<NoteData> notes) {
|
||||||
|
this.notes = notes;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "office")
|
||||||
|
public class OfficeData implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private String externalId;
|
||||||
|
private LocalDate openingDate;
|
||||||
|
private String hierarchy;
|
||||||
|
private String parentName;
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
private List<OfficeData> allowedParents = new ArrayList<OfficeData>();
|
||||||
|
|
||||||
|
public OfficeData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public OfficeData(final Long id, final String name,
|
||||||
|
final String externalId, final LocalDate openingDate,
|
||||||
|
String hierarchy, final Long parentId, final String parentName) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.externalId = externalId;
|
||||||
|
this.openingDate = openingDate;
|
||||||
|
this.hierarchy = hierarchy;
|
||||||
|
this.parentName = parentName;
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalId() {
|
||||||
|
return this.externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getOpeningDate() {
|
||||||
|
return this.openingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getParentId() {
|
||||||
|
return this.parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentName() {
|
||||||
|
return this.parentName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalId(final String externalId) {
|
||||||
|
this.externalId = externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpeningDate(final LocalDate openingDate) {
|
||||||
|
this.openingDate = openingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentName(final String parentName) {
|
||||||
|
this.parentName = parentName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentId(final Long parentId) {
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<OfficeData> getAllowedParents() {
|
||||||
|
return allowedParents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllowedParents(List<OfficeData> allowedParents) {
|
||||||
|
this.allowedParents = allowedParents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHierarchy() {
|
||||||
|
return hierarchy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHierarchy(String hierarchy) {
|
||||||
|
this.hierarchy = hierarchy;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class OfficeList {
|
||||||
|
|
||||||
|
private Collection<OfficeData> offices = new ArrayList<OfficeData>();
|
||||||
|
|
||||||
|
protected OfficeList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public OfficeList(final Collection<OfficeData> offices) {
|
||||||
|
this.offices = offices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<OfficeData> getOffices() {
|
||||||
|
return this.offices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOffices(final Collection<OfficeData> offices) {
|
||||||
|
this.offices = offices;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class OrganisationList {
|
||||||
|
|
||||||
|
private Collection<OrganisationReadModel> organisations = new ArrayList<OrganisationReadModel>();
|
||||||
|
|
||||||
|
protected OrganisationList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrganisationList(
|
||||||
|
final Collection<OrganisationReadModel> organisations) {
|
||||||
|
this.organisations = organisations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<OrganisationReadModel> getOrganisations() {
|
||||||
|
return this.organisations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrganisations(
|
||||||
|
final Collection<OrganisationReadModel> organisations) {
|
||||||
|
this.organisations = organisations;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "organisation")
|
||||||
|
public class OrganisationReadModel implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private String contactName;
|
||||||
|
private LocalDate openingDate;
|
||||||
|
|
||||||
|
public OrganisationReadModel() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrganisationReadModel(final Long id, final String name,
|
||||||
|
final String contactName, final LocalDate openingDate) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.contactName = contactName;
|
||||||
|
this.openingDate = openingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContactName() {
|
||||||
|
return this.contactName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getOpeningDate() {
|
||||||
|
return this.openingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContactName(final String contactName) {
|
||||||
|
this.contactName = contactName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpeningDate(final LocalDate openingDate) {
|
||||||
|
this.openingDate = openingDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "permission")
|
||||||
|
public class PermissionData implements Serializable {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private Long orgId;
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
private String code;
|
||||||
|
private int groupType;
|
||||||
|
|
||||||
|
public PermissionData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public PermissionData(final Long id, final Long orgId,
|
||||||
|
final String name, final String description, final String code, int groupType) {
|
||||||
|
this.id = id;
|
||||||
|
this.orgId = orgId;
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.code = code;
|
||||||
|
this.groupType = groupType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
PermissionData data = (PermissionData) obj;
|
||||||
|
return this.code.equalsIgnoreCase(data.code);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return this.code.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrgId() {
|
||||||
|
return this.orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgId(final Long orgId) {
|
||||||
|
this.orgId = orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(final String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(final String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGroupType() {
|
||||||
|
return groupType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupType(int groupType) {
|
||||||
|
this.groupType = groupType;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class PermissionList {
|
||||||
|
|
||||||
|
private Collection<PermissionData> permissions = new ArrayList<PermissionData>();
|
||||||
|
|
||||||
|
protected PermissionList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public PermissionList(final Collection<PermissionData> permissions) {
|
||||||
|
this.permissions = permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<PermissionData> getPermissions() {
|
||||||
|
return this.permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPermissions(final Collection<PermissionData> permissions) {
|
||||||
|
this.permissions = permissions;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "role")
|
||||||
|
public class RoleData {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private Long orgId;
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private Collection<PermissionData> availablePermissions = new ArrayList<PermissionData>();
|
||||||
|
private Collection<PermissionData> selectedPermissions = new ArrayList<PermissionData>();
|
||||||
|
|
||||||
|
public RoleData() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoleData(final Long id, final Long orgId, final String name,
|
||||||
|
final String description) {
|
||||||
|
this.id = id;
|
||||||
|
this.orgId = orgId;
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
RoleData role = (RoleData) obj;
|
||||||
|
return this.id.equals(role.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return this.id.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrgId() {
|
||||||
|
return this.orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgId(final Long orgId) {
|
||||||
|
this.orgId = orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(final String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<PermissionData> getAvailablePermissions() {
|
||||||
|
return availablePermissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvailablePermissions(
|
||||||
|
Collection<PermissionData> availablePermissions) {
|
||||||
|
this.availablePermissions = availablePermissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<PermissionData> getSelectedPermissions() {
|
||||||
|
return selectedPermissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedPermissions(
|
||||||
|
Collection<PermissionData> selectedPermissions) {
|
||||||
|
this.selectedPermissions = selectedPermissions;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class RoleList {
|
||||||
|
|
||||||
|
private Collection<RoleData> roles = new ArrayList<RoleData>();
|
||||||
|
|
||||||
|
protected RoleList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoleList(final Collection<RoleData> roles) {
|
||||||
|
this.roles = roles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<RoleData> getRoles() {
|
||||||
|
return this.roles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoles(final Collection<RoleData> roles) {
|
||||||
|
this.roles = roles;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement(name = "installment")
|
||||||
|
public class ScheduledLoanInstallment implements Serializable {
|
||||||
|
|
||||||
|
private Integer installmentNumber;
|
||||||
|
private LocalDate periodStart;
|
||||||
|
private LocalDate periodEnd;
|
||||||
|
private MoneyData principalDue;
|
||||||
|
private MoneyData interestDue;
|
||||||
|
private MoneyData totalInstallmentDue;
|
||||||
|
private MoneyData outStandingBalance;
|
||||||
|
|
||||||
|
public ScheduledLoanInstallment() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public ScheduledLoanInstallment(final Integer installmentNumber,
|
||||||
|
final LocalDate periodStart, final LocalDate periodEnd,
|
||||||
|
final MoneyData principalDue,
|
||||||
|
final MoneyData interestDue,
|
||||||
|
final MoneyData totalInstallmentDue,
|
||||||
|
final MoneyData outStandingBalance) {
|
||||||
|
this.installmentNumber = installmentNumber;
|
||||||
|
this.periodStart = periodStart;
|
||||||
|
this.periodEnd = periodEnd;
|
||||||
|
this.principalDue = principalDue;
|
||||||
|
this.interestDue = interestDue;
|
||||||
|
this.totalInstallmentDue = totalInstallmentDue;
|
||||||
|
this.outStandingBalance = outStandingBalance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInstallmentNumber() {
|
||||||
|
return this.installmentNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getPeriodStart() {
|
||||||
|
return this.periodStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getPeriodEnd() {
|
||||||
|
return this.periodEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
public void setDueDate(final LocalDate dueDate) {
|
||||||
|
this.periodEnd = dueDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(final BigDecimal principal) {
|
||||||
|
CurrencyData currencyData = currencyData(this.principalDue);
|
||||||
|
this.principalDue = MoneyData.of(currencyData, principal);
|
||||||
|
this.totalInstallmentDue = this.principalDue.plus(this.interestDue);
|
||||||
|
}
|
||||||
|
|
||||||
|
private CurrencyData currencyData(MoneyData moneyData) {
|
||||||
|
String code = moneyData.getCurrencyCode();
|
||||||
|
String name = moneyData.getDefaultName();
|
||||||
|
int decimalPlaces = moneyData.getCurrencyDigitsAfterDecimal();
|
||||||
|
String displaySymbol = moneyData.getDisplaySymbol();
|
||||||
|
String nameCode = moneyData.getNameCode();
|
||||||
|
return new CurrencyData(code, name, decimalPlaces, displaySymbol, nameCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterest(final BigDecimal interest) {
|
||||||
|
CurrencyData currencyData = currencyData(this.principalDue);
|
||||||
|
this.interestDue = MoneyData.of(currencyData, interest);
|
||||||
|
this.totalInstallmentDue = this.principalDue.plus(this.interestDue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOutstanding(final BigDecimal outstanding) {
|
||||||
|
CurrencyData currencyData = currencyData(this.principalDue);
|
||||||
|
this.outStandingBalance = MoneyData.of(currencyData, outstanding);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getPrincipalDue() {
|
||||||
|
return this.principalDue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipalDue(final MoneyData principalDue) {
|
||||||
|
this.principalDue = principalDue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getInterestDue() {
|
||||||
|
return this.interestDue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestDue(final MoneyData interestDue) {
|
||||||
|
this.interestDue = interestDue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getTotalInstallmentDue() {
|
||||||
|
return this.totalInstallmentDue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalInstallmentDue(final MoneyData totalInstallmentDue) {
|
||||||
|
this.totalInstallmentDue = totalInstallmentDue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyData getOutStandingBalance() {
|
||||||
|
return this.outStandingBalance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOutStandingBalance(final MoneyData outStandingBalance) {
|
||||||
|
this.outStandingBalance = outStandingBalance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInstallmentNumber(final Integer installmentNumber) {
|
||||||
|
this.installmentNumber = installmentNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeriodStart(final LocalDate periodStart) {
|
||||||
|
this.periodStart = periodStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeriodEnd(final LocalDate periodEnd) {
|
||||||
|
this.periodEnd = periodEnd;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class UserList {
|
||||||
|
|
||||||
|
private Collection<AppUserData> users = new ArrayList<AppUserData>();
|
||||||
|
|
||||||
|
protected UserList() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserList(final Collection<AppUserData> users) {
|
||||||
|
this.users = users;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<AppUserData> getUsers() {
|
||||||
|
return this.users;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsers(final Collection<AppUserData> users) {
|
||||||
|
this.users = users;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class AdjustLoanTransactionCommand {
|
||||||
|
|
||||||
|
private Long loanId;
|
||||||
|
private Long repaymentId;
|
||||||
|
private LocalDate paymentDate;
|
||||||
|
private String comment;
|
||||||
|
private BigDecimal paymentAmount;
|
||||||
|
|
||||||
|
protected AdjustLoanTransactionCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public AdjustLoanTransactionCommand(final Long loanId, final Long repaymentId,
|
||||||
|
final LocalDate paymentDate, final String comment,
|
||||||
|
final BigDecimal paymentAmount) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
this.repaymentId = repaymentId;
|
||||||
|
this.paymentDate = paymentDate;
|
||||||
|
this.comment = comment;
|
||||||
|
this.paymentAmount = paymentAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanId() {
|
||||||
|
return this.loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanId(final Long loanId) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getComment() {
|
||||||
|
return this.comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComment(final String comment) {
|
||||||
|
this.comment = comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getPaymentDate() {
|
||||||
|
return this.paymentDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaymentDate(final LocalDate paymentDate) {
|
||||||
|
this.paymentDate = paymentDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPaymentAmount() {
|
||||||
|
return this.paymentAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaymentAmount(final BigDecimal paymentAmount) {
|
||||||
|
this.paymentAmount = paymentAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRepaymentId() {
|
||||||
|
return repaymentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentId(Long repaymentId) {
|
||||||
|
this.repaymentId = repaymentId;
|
||||||
|
}
|
||||||
|
}
|
||||||
+176
@@ -0,0 +1,176 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class CalculateLoanScheduleCommand {
|
||||||
|
|
||||||
|
private CommonLoanProperties commonLoanProperties;
|
||||||
|
|
||||||
|
private LocalDate expectedDisbursementDate;
|
||||||
|
private LocalDate repaymentsStartingFromDate;
|
||||||
|
private LocalDate interestCalculatedFromDate;
|
||||||
|
|
||||||
|
public CalculateLoanScheduleCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public CalculateLoanScheduleCommand(final String currencyCode,
|
||||||
|
final Integer digitsAfterDecimal, final Number principal,
|
||||||
|
final Number interestRatePerPeriod, Integer interestRateFrequencyMethod, final Integer interestMethod,
|
||||||
|
final Integer repaymentEvery, final Integer repaymentFrequency, final Integer numberOfRepayments, Integer amortizationMethod,
|
||||||
|
final boolean flexibleRepaymentSchedule,
|
||||||
|
final boolean interestRebateAllowed,
|
||||||
|
final LocalDate expectedDisbursementDate,
|
||||||
|
final LocalDate repaymentsStartingFromDate, final LocalDate interestCalculatedFromDate) {
|
||||||
|
|
||||||
|
commonLoanProperties = new CommonLoanProperties(currencyCode, digitsAfterDecimal, principal, interestRatePerPeriod, interestRateFrequencyMethod, interestMethod,
|
||||||
|
repaymentEvery, repaymentFrequency, numberOfRepayments, amortizationMethod, Integer.valueOf(0),
|
||||||
|
flexibleRepaymentSchedule, interestRebateAllowed);
|
||||||
|
|
||||||
|
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||||
|
this.repaymentsStartingFromDate = repaymentsStartingFromDate;
|
||||||
|
this.interestCalculatedFromDate = interestCalculatedFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrencyCode() {
|
||||||
|
return this.commonLoanProperties.getCurrencyCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencyCode(final String currencyCode) {
|
||||||
|
this.commonLoanProperties.setCurrencyCode(currencyCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDigitsAfterDecimal() {
|
||||||
|
return this.commonLoanProperties.getDigitsAfterDecimal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDigitsAfterDecimal(final Integer digitsAfterDecimal) {
|
||||||
|
this.commonLoanProperties.setDigitsAfterDecimal(digitsAfterDecimal);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentEvery() {
|
||||||
|
return this.commonLoanProperties.getRepaymentEvery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentEvery(final Integer repaymentEvery) {
|
||||||
|
this.commonLoanProperties.setRepaymentEvery(repaymentEvery);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentFrequency() {
|
||||||
|
return this.commonLoanProperties.getRepaymentFrequency();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequency(final Integer repaymentFrequency) {
|
||||||
|
this.commonLoanProperties.setRepaymentFrequency(repaymentFrequency);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isFlexibleRepaymentSchedule() {
|
||||||
|
return this.commonLoanProperties.isFlexibleRepaymentSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlexibleRepaymentSchedule(
|
||||||
|
final Boolean flexibleRepaymentSchedule) {
|
||||||
|
this.commonLoanProperties.setFlexibleRepaymentSchedule(flexibleRepaymentSchedule);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isInterestRebateAllowed() {
|
||||||
|
return this.commonLoanProperties.isInterestRebateAllowed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateAllowed(final Boolean interestRebateAllowed) {
|
||||||
|
this.commonLoanProperties.setInterestRebateAllowed(interestRebateAllowed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPrincipal() {
|
||||||
|
return this.commonLoanProperties.getPrincipal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(final BigDecimal principal) {
|
||||||
|
this.commonLoanProperties.setPrincipal(principal);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getFlexibleRepaymentSchedule() {
|
||||||
|
return this.commonLoanProperties.getFlexibleRepaymentSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getInterestRebateAllowed() {
|
||||||
|
return this.commonLoanProperties.getInterestRebateAllowed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestRateFrequencyMethod() {
|
||||||
|
return commonLoanProperties.getInterestRateFrequencyMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRateFrequencyMethod(Integer interestRateFrequencyMethod) {
|
||||||
|
this.commonLoanProperties.setInterestRateFrequencyMethod(interestRateFrequencyMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestMethod() {
|
||||||
|
return commonLoanProperties.getInterestMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestMethod(Integer interestMethod) {
|
||||||
|
this.commonLoanProperties.setInterestMethod(interestMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAmortizationMethod() {
|
||||||
|
return commonLoanProperties.getAmortizationMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationMethod(Integer amortizationMethod) {
|
||||||
|
this.commonLoanProperties.setAmortizationMethod(amortizationMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumberOfRepayments() {
|
||||||
|
return commonLoanProperties.getNumberOfRepayments();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfRepayments(Integer numberOfRepayments) {
|
||||||
|
this.commonLoanProperties.setNumberOfRepayments(numberOfRepayments);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInterestRatePerPeriod() {
|
||||||
|
return commonLoanProperties.getInterestRatePerPeriod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) {
|
||||||
|
this.commonLoanProperties.setInterestRatePerPeriod(interestRatePerPeriod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommonLoanProperties getCommonLoanProperties() {
|
||||||
|
return commonLoanProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommonLoanProperties(CommonLoanProperties commonLoanProperties) {
|
||||||
|
this.commonLoanProperties = commonLoanProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getExpectedDisbursementDate() {
|
||||||
|
return expectedDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpectedDisbursementDate(LocalDate expectedDisbursementDate) {
|
||||||
|
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getRepaymentsStartingFromDate() {
|
||||||
|
return repaymentsStartingFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentsStartingFromDate(LocalDate repaymentsStartingFromDate) {
|
||||||
|
this.repaymentsStartingFromDate = repaymentsStartingFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getInterestCalculatedFromDate() {
|
||||||
|
return interestCalculatedFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestCalculatedFromDate(LocalDate interestCalculatedFromDate) {
|
||||||
|
this.interestCalculatedFromDate = interestCalculatedFromDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class ChangePasswordCommand {
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
private String passwordrepeat;
|
||||||
|
|
||||||
|
public ChangePasswordCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPasswordrepeat() {
|
||||||
|
return passwordrepeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPasswordrepeat(String passwordrepeat) {
|
||||||
|
this.passwordrepeat = passwordrepeat;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class CommonLoanProperties {
|
||||||
|
|
||||||
|
private String currencyCode;
|
||||||
|
private Integer digitsAfterDecimal;
|
||||||
|
|
||||||
|
private BigDecimal principal;
|
||||||
|
|
||||||
|
private Integer repaymentEvery;
|
||||||
|
private Integer repaymentFrequency;
|
||||||
|
private Integer numberOfRepayments;
|
||||||
|
private Integer amortizationMethod;
|
||||||
|
private BigDecimal inArrearsToleranceAmount;
|
||||||
|
|
||||||
|
private BigDecimal interestRatePerPeriod;
|
||||||
|
private Integer interestRateFrequencyMethod;
|
||||||
|
private Integer interestMethod;
|
||||||
|
|
||||||
|
private boolean flexibleRepaymentSchedule = false;
|
||||||
|
private boolean interestRebateAllowed = false;
|
||||||
|
|
||||||
|
public CommonLoanProperties() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommonLoanProperties(final String currencyCode,
|
||||||
|
final Integer digitsAfterDecimal, final Number principal,
|
||||||
|
final Number interestRatePerPeriod, Integer interestRateFrequencyMethod, final Integer interestMethod,
|
||||||
|
final Integer repaymentEvery, final Integer repaymentFrequency, final Integer numberOfRepayments, Integer amortizationMethod, final Number toleranceAmount,
|
||||||
|
final boolean flexibleRepaymentSchedule,
|
||||||
|
final boolean interestRebateAllowed) {
|
||||||
|
this.currencyCode = currencyCode;
|
||||||
|
this.digitsAfterDecimal = digitsAfterDecimal;
|
||||||
|
if (principal != null) {
|
||||||
|
this.principal = BigDecimal.valueOf(Double.valueOf(principal.doubleValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interestRatePerPeriod != null) {
|
||||||
|
this.interestRatePerPeriod = BigDecimal.valueOf(Double.valueOf(interestRatePerPeriod.doubleValue()));
|
||||||
|
}
|
||||||
|
this.interestRateFrequencyMethod = interestRateFrequencyMethod;
|
||||||
|
this.interestMethod = interestMethod;
|
||||||
|
|
||||||
|
this.repaymentEvery = repaymentEvery;
|
||||||
|
this.repaymentFrequency = repaymentFrequency;
|
||||||
|
this.numberOfRepayments = numberOfRepayments;
|
||||||
|
this.amortizationMethod = amortizationMethod;
|
||||||
|
this.inArrearsToleranceAmount = BigDecimal.valueOf(Double.valueOf(toleranceAmount.toString()));
|
||||||
|
|
||||||
|
this.flexibleRepaymentSchedule = flexibleRepaymentSchedule;
|
||||||
|
this.interestRebateAllowed = interestRebateAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrencyCode() {
|
||||||
|
return this.currencyCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencyCode(final String currencyCode) {
|
||||||
|
this.currencyCode = currencyCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDigitsAfterDecimal() {
|
||||||
|
return this.digitsAfterDecimal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDigitsAfterDecimal(final Integer digitsAfterDecimal) {
|
||||||
|
this.digitsAfterDecimal = digitsAfterDecimal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentEvery() {
|
||||||
|
return this.repaymentEvery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentEvery(final Integer repaymentEvery) {
|
||||||
|
this.repaymentEvery = repaymentEvery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentFrequency() {
|
||||||
|
return this.repaymentFrequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequency(final Integer repaymentFrequency) {
|
||||||
|
this.repaymentFrequency = repaymentFrequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFlexibleRepaymentSchedule() {
|
||||||
|
return this.flexibleRepaymentSchedule;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlexibleRepaymentSchedule(
|
||||||
|
final boolean flexibleRepaymentSchedule) {
|
||||||
|
this.flexibleRepaymentSchedule = flexibleRepaymentSchedule;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInterestRebateAllowed() {
|
||||||
|
return this.interestRebateAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateAllowed(final boolean interestRebateAllowed) {
|
||||||
|
this.interestRebateAllowed = interestRebateAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPrincipal() {
|
||||||
|
return this.principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(final BigDecimal principal) {
|
||||||
|
this.principal = principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getFlexibleRepaymentSchedule() {
|
||||||
|
return this.flexibleRepaymentSchedule;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getInterestRebateAllowed() {
|
||||||
|
return this.interestRebateAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestRateFrequencyMethod() {
|
||||||
|
return interestRateFrequencyMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRateFrequencyMethod(Integer interestRateFrequencyMethod) {
|
||||||
|
this.interestRateFrequencyMethod = interestRateFrequencyMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestMethod() {
|
||||||
|
return interestMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestMethod(Integer interestMethod) {
|
||||||
|
this.interestMethod = interestMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAmortizationMethod() {
|
||||||
|
return amortizationMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationMethod(Integer amortizationMethod) {
|
||||||
|
this.amortizationMethod = amortizationMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumberOfRepayments() {
|
||||||
|
return numberOfRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfRepayments(Integer numberOfRepayments) {
|
||||||
|
this.numberOfRepayments = numberOfRepayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInterestRatePerPeriod() {
|
||||||
|
return interestRatePerPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) {
|
||||||
|
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInArrearsToleranceAmount() {
|
||||||
|
return inArrearsToleranceAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInArrearsToleranceAmount(BigDecimal inArrearsToleranceAmount) {
|
||||||
|
this.inArrearsToleranceAmount = inArrearsToleranceAmount;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,241 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class CreateLoanProductCommand implements LoanProductCommandData {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private CommonLoanProperties commonLoanProperties;
|
||||||
|
|
||||||
|
public CreateLoanProductCommand() {
|
||||||
|
this.commonLoanProperties = new CommonLoanProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateLoanProductCommand(final String currencyCode,
|
||||||
|
final Integer digitsAfterDecimal, final Number principal,
|
||||||
|
final String name, final String description,
|
||||||
|
final Number interestRatePerPeriod, Integer interestRateFrequencyMethod, final Integer interestMethod,
|
||||||
|
final Integer repaymentEvery, final Integer repaymentFrequency, final Integer numberOfRepayments, Integer amortizationMethod, final Number toleranceAmount,
|
||||||
|
final boolean flexibleRepaymentSchedule,
|
||||||
|
final boolean interestRebateAllowed) {
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
|
||||||
|
commonLoanProperties = new CommonLoanProperties(currencyCode, digitsAfterDecimal, principal, interestRatePerPeriod, interestRateFrequencyMethod, interestMethod,
|
||||||
|
repaymentEvery, repaymentFrequency, numberOfRepayments, amortizationMethod, toleranceAmount, flexibleRepaymentSchedule, interestRebateAllowed);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getName()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getDescription()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(final String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getCurrencyCode()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getCurrencyCode() {
|
||||||
|
return this.commonLoanProperties.getCurrencyCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencyCode(final String currencyCode) {
|
||||||
|
this.commonLoanProperties.setCurrencyCode(currencyCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getDigitsAfterDecimal()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getDigitsAfterDecimal() {
|
||||||
|
return this.commonLoanProperties.getDigitsAfterDecimal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDigitsAfterDecimal(final Integer digitsAfterDecimal) {
|
||||||
|
this.commonLoanProperties.setDigitsAfterDecimal(digitsAfterDecimal);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getRepaymentEvery()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getRepaymentEvery() {
|
||||||
|
return this.commonLoanProperties.getRepaymentEvery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentEvery(final Integer repaymentEvery) {
|
||||||
|
this.commonLoanProperties.setRepaymentEvery(repaymentEvery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getRepaymentFrequency()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getRepaymentFrequency() {
|
||||||
|
return this.commonLoanProperties.getRepaymentFrequency();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequency(final Integer repaymentFrequency) {
|
||||||
|
this.commonLoanProperties.setRepaymentFrequency(repaymentFrequency);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#isFlexibleRepaymentSchedule()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean isFlexibleRepaymentSchedule() {
|
||||||
|
return this.commonLoanProperties.isFlexibleRepaymentSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlexibleRepaymentSchedule(
|
||||||
|
final Boolean flexibleRepaymentSchedule) {
|
||||||
|
this.commonLoanProperties.setFlexibleRepaymentSchedule(flexibleRepaymentSchedule);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#isInterestRebateAllowed()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean isInterestRebateAllowed() {
|
||||||
|
return this.commonLoanProperties.isInterestRebateAllowed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateAllowed(final Boolean interestRebateAllowed) {
|
||||||
|
this.commonLoanProperties.setInterestRebateAllowed(interestRebateAllowed);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getPrincipal()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BigDecimal getPrincipal() {
|
||||||
|
return this.commonLoanProperties.getPrincipal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(final BigDecimal principal) {
|
||||||
|
this.commonLoanProperties.setPrincipal(principal);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getFlexibleRepaymentSchedule()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean getFlexibleRepaymentSchedule() {
|
||||||
|
return this.commonLoanProperties.getFlexibleRepaymentSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getInterestRebateAllowed()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean getInterestRebateAllowed() {
|
||||||
|
return this.commonLoanProperties.getInterestRebateAllowed();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getInterestRateFrequencyMethod()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getInterestRateFrequencyMethod() {
|
||||||
|
return commonLoanProperties.getInterestRateFrequencyMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRateFrequencyMethod(Integer interestRateFrequencyMethod) {
|
||||||
|
this.commonLoanProperties.setInterestRateFrequencyMethod(interestRateFrequencyMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getInterestMethod()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getInterestMethod() {
|
||||||
|
return commonLoanProperties.getInterestMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestMethod(Integer interestMethod) {
|
||||||
|
this.commonLoanProperties.setInterestMethod(interestMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getAmortizationMethod()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getAmortizationMethod() {
|
||||||
|
return commonLoanProperties.getAmortizationMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationMethod(Integer amortizationMethod) {
|
||||||
|
this.commonLoanProperties.setAmortizationMethod(amortizationMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getNumberOfRepayments()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer getNumberOfRepayments() {
|
||||||
|
return commonLoanProperties.getNumberOfRepayments();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfRepayments(Integer numberOfRepayments) {
|
||||||
|
this.commonLoanProperties.setNumberOfRepayments(numberOfRepayments);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getInterestRatePerPeriod()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BigDecimal getInterestRatePerPeriod() {
|
||||||
|
return commonLoanProperties.getInterestRatePerPeriod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) {
|
||||||
|
this.commonLoanProperties.setInterestRatePerPeriod(interestRatePerPeriod);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getCommonLoanProperties()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CommonLoanProperties getCommonLoanProperties() {
|
||||||
|
return commonLoanProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommonLoanProperties(CommonLoanProperties commonLoanProperties) {
|
||||||
|
this.commonLoanProperties = commonLoanProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.mifosng.data.command.LoanProductCommandData#getInArrearsToleranceAmount()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BigDecimal getInArrearsToleranceAmount() {
|
||||||
|
return this.commonLoanProperties.getInArrearsToleranceAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInArrearsToleranceAmount(BigDecimal inArrearsToleranceAmount) {
|
||||||
|
this.commonLoanProperties.setInArrearsToleranceAmount(inArrearsToleranceAmount);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class EnrollClientCommand {
|
||||||
|
|
||||||
|
private String firstname;
|
||||||
|
private String lastname;
|
||||||
|
private String fullname;
|
||||||
|
private Long officeId;
|
||||||
|
private String externalId;
|
||||||
|
private LocalDate joiningDate;
|
||||||
|
|
||||||
|
protected EnrollClientCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnrollClientCommand(final String firstname, final String lastname, String fullname, final Long officeId, final LocalDate joiningDate) {
|
||||||
|
this.firstname = firstname;
|
||||||
|
this.lastname = lastname;
|
||||||
|
this.fullname = fullname;
|
||||||
|
this.officeId = officeId;
|
||||||
|
this.joiningDate = joiningDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstname() {
|
||||||
|
return this.firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstname(final String firstname) {
|
||||||
|
this.firstname = firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastname() {
|
||||||
|
return this.lastname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastname(final String lastname) {
|
||||||
|
this.lastname = lastname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOfficeId() {
|
||||||
|
return this.officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOfficeId(final Long officeId) {
|
||||||
|
this.officeId = officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getJoiningDate() {
|
||||||
|
return this.joiningDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJoiningDate(final LocalDate joiningDate) {
|
||||||
|
this.joiningDate = joiningDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalId() {
|
||||||
|
return externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalId(String externalId) {
|
||||||
|
this.externalId = externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFullname() {
|
||||||
|
return fullname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFullname(String fullname) {
|
||||||
|
this.fullname = fullname;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class ImportClientCommand {
|
||||||
|
|
||||||
|
private List<EnrollClientCommand> clients = new ArrayList<EnrollClientCommand>();
|
||||||
|
|
||||||
|
public ImportClientCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnrollClientCommand> getClients() {
|
||||||
|
return clients;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClients(List<EnrollClientCommand> clients) {
|
||||||
|
this.clients = clients;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class ImportLoanCommand {
|
||||||
|
|
||||||
|
private List<SubmitApproveDisburseLoanCommand> loans = new ArrayList<SubmitApproveDisburseLoanCommand>();
|
||||||
|
|
||||||
|
public ImportLoanCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SubmitApproveDisburseLoanCommand> getLoans() {
|
||||||
|
return loans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoans(List<SubmitApproveDisburseLoanCommand> loans) {
|
||||||
|
this.loans = loans;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class ImportLoanRepaymentsCommand {
|
||||||
|
|
||||||
|
private List<LoanTransactionCommand> repayments = new ArrayList<LoanTransactionCommand>();
|
||||||
|
|
||||||
|
public ImportLoanRepaymentsCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<LoanTransactionCommand> getRepayments() {
|
||||||
|
return repayments;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepayments(List<LoanTransactionCommand> repayments) {
|
||||||
|
this.repayments = repayments;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class KeyValueInformation {
|
||||||
|
|
||||||
|
private String key;
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
protected KeyValueInformation() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public KeyValueInformation(String key, String value) {
|
||||||
|
this.key = key;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKey() {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKey(String key) {
|
||||||
|
this.key = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public interface LoanProductCommandData {
|
||||||
|
|
||||||
|
public abstract String getName();
|
||||||
|
|
||||||
|
public abstract String getDescription();
|
||||||
|
|
||||||
|
public abstract String getCurrencyCode();
|
||||||
|
|
||||||
|
public abstract Integer getDigitsAfterDecimal();
|
||||||
|
|
||||||
|
public abstract Integer getRepaymentEvery();
|
||||||
|
|
||||||
|
public abstract Integer getRepaymentFrequency();
|
||||||
|
|
||||||
|
public abstract Boolean isFlexibleRepaymentSchedule();
|
||||||
|
|
||||||
|
public abstract Boolean isInterestRebateAllowed();
|
||||||
|
|
||||||
|
public abstract BigDecimal getPrincipal();
|
||||||
|
|
||||||
|
public abstract Boolean getFlexibleRepaymentSchedule();
|
||||||
|
|
||||||
|
public abstract Boolean getInterestRebateAllowed();
|
||||||
|
|
||||||
|
public abstract Integer getInterestRateFrequencyMethod();
|
||||||
|
|
||||||
|
public abstract Integer getInterestMethod();
|
||||||
|
|
||||||
|
public abstract Integer getAmortizationMethod();
|
||||||
|
|
||||||
|
public abstract Integer getNumberOfRepayments();
|
||||||
|
|
||||||
|
public abstract BigDecimal getInterestRatePerPeriod();
|
||||||
|
|
||||||
|
public abstract CommonLoanProperties getCommonLoanProperties();
|
||||||
|
|
||||||
|
public abstract BigDecimal getInArrearsToleranceAmount();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use for any of the loan state transitions eg. reject, withdrawn by client, approve, disburse
|
||||||
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
public class LoanStateTransitionCommand {
|
||||||
|
|
||||||
|
private Long loanId;
|
||||||
|
private LocalDate eventDate;
|
||||||
|
private String comment;
|
||||||
|
|
||||||
|
protected LoanStateTransitionCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanStateTransitionCommand(final Long loanId, final LocalDate eventDate,
|
||||||
|
final String comment) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
this.eventDate = eventDate;
|
||||||
|
this.comment = comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanId() {
|
||||||
|
return this.loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanId(final Long loanId) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getComment() {
|
||||||
|
return this.comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComment(final String comment) {
|
||||||
|
this.comment = comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getEventDate() {
|
||||||
|
return eventDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEventDate(LocalDate eventDate) {
|
||||||
|
this.eventDate = eventDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class LoanTransactionCommand {
|
||||||
|
|
||||||
|
private Long loanId;
|
||||||
|
private LocalDate paymentDate;
|
||||||
|
private String comment;
|
||||||
|
private BigDecimal paymentAmount;
|
||||||
|
|
||||||
|
protected LoanTransactionCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanTransactionCommand(final Long loanId,
|
||||||
|
final LocalDate paymentDate, final String comment,
|
||||||
|
final BigDecimal paymentAmount) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
this.paymentDate = paymentDate;
|
||||||
|
this.comment = comment;
|
||||||
|
this.paymentAmount = paymentAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanId() {
|
||||||
|
return this.loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanId(final Long loanId) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getComment() {
|
||||||
|
return this.comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComment(final String comment) {
|
||||||
|
this.comment = comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getPaymentDate() {
|
||||||
|
return this.paymentDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaymentDate(final LocalDate paymentDate) {
|
||||||
|
this.paymentDate = paymentDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPaymentAmount() {
|
||||||
|
return this.paymentAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaymentAmount(final BigDecimal paymentAmount) {
|
||||||
|
this.paymentAmount = paymentAmount;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Command used for add or edit notes.
|
||||||
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
public class NoteCommand {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private Long clientId;
|
||||||
|
private Long loanId;
|
||||||
|
private Long loanTransactionId;
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
public NoteCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getClientId() {
|
||||||
|
return clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientId(Long clientId) {
|
||||||
|
this.clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanId() {
|
||||||
|
return loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanId(Long loanId) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanTransactionId() {
|
||||||
|
return loanTransactionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanTransactionId(Long loanTransactionId) {
|
||||||
|
this.loanTransactionId = loanTransactionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Command used for create and update office operations.
|
||||||
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
public class OfficeCommand {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private String externalId;
|
||||||
|
|
||||||
|
private LocalDate openingDate;
|
||||||
|
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
protected OfficeCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public OfficeCommand(final String officeName, final String externalId,
|
||||||
|
final Long parentId, final LocalDate openingDate) {
|
||||||
|
this.name = officeName;
|
||||||
|
this.externalId = externalId;
|
||||||
|
this.parentId = parentId;
|
||||||
|
this.openingDate = openingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OfficeCommand(final Long id, final String officeName,
|
||||||
|
final String externalId, final Long parentId,
|
||||||
|
final LocalDate openingDate) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = officeName;
|
||||||
|
this.externalId = externalId;
|
||||||
|
this.parentId = parentId;
|
||||||
|
this.openingDate = openingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getOpeningDate() {
|
||||||
|
return this.openingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpeningDate(final LocalDate openingDate) {
|
||||||
|
this.openingDate = openingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalId() {
|
||||||
|
return this.externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalId(final String externalId) {
|
||||||
|
this.externalId = externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getParentId() {
|
||||||
|
return this.parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentId(final Long parentId) {
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(final Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For creating and updating roles. When updating the id is expected to be populated.
|
||||||
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
public class RoleCommand {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
private String[] permissionIds;
|
||||||
|
|
||||||
|
protected RoleCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoleCommand(final String name, final String description, final String[] permissionIds) {
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.permissionIds = permissionIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(final String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getPermissionIds() {
|
||||||
|
return this.permissionIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPermissionIds(final String[] permissionIds) {
|
||||||
|
this.permissionIds = permissionIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class SignupCommand {
|
||||||
|
|
||||||
|
private String organisationName;
|
||||||
|
private String contactEmail;
|
||||||
|
private String contactName;
|
||||||
|
|
||||||
|
// @DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate openingDate = new LocalDate();
|
||||||
|
|
||||||
|
protected SignupCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public SignupCommand(final String organisationName,
|
||||||
|
final String contactEmail, final String contactName,
|
||||||
|
final LocalDate openingDate) {
|
||||||
|
this.organisationName = organisationName;
|
||||||
|
this.contactEmail = contactEmail;
|
||||||
|
this.contactName = contactName;
|
||||||
|
this.openingDate = openingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContactEmail() {
|
||||||
|
return this.contactEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContactEmail(final String contactEmail) {
|
||||||
|
this.contactEmail = contactEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContactName() {
|
||||||
|
return this.contactName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContactName(final String contactName) {
|
||||||
|
this.contactName = contactName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrganisationName() {
|
||||||
|
return this.organisationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrganisationName(final String organisationName) {
|
||||||
|
this.organisationName = organisationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getOpeningDate() {
|
||||||
|
return this.openingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpeningDate(final LocalDate openingDate) {
|
||||||
|
this.openingDate = openingDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class SubmitApproveDisburseLoanCommand {
|
||||||
|
|
||||||
|
private SubmitLoanApplicationCommand submitLoanApplicationCommand;
|
||||||
|
private LoanStateTransitionCommand approveLoanCommand;
|
||||||
|
private LoanStateTransitionCommand disburseLoanCommand;
|
||||||
|
|
||||||
|
public SubmitApproveDisburseLoanCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public SubmitLoanApplicationCommand getSubmitLoanApplicationCommand() {
|
||||||
|
return submitLoanApplicationCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmitLoanApplicationCommand(
|
||||||
|
SubmitLoanApplicationCommand submitLoanApplicationCommand) {
|
||||||
|
this.submitLoanApplicationCommand = submitLoanApplicationCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanStateTransitionCommand getApproveLoanCommand() {
|
||||||
|
return approveLoanCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApproveLoanCommand(LoanStateTransitionCommand approveLoanCommand) {
|
||||||
|
this.approveLoanCommand = approveLoanCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanStateTransitionCommand getDisburseLoanCommand() {
|
||||||
|
return disburseLoanCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisburseLoanCommand(LoanStateTransitionCommand disburseLoanCommand) {
|
||||||
|
this.disburseLoanCommand = disburseLoanCommand;
|
||||||
|
}
|
||||||
|
}
|
||||||
+252
@@ -0,0 +1,252 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
import org.mifosng.data.LoanSchedule;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class SubmitLoanApplicationCommand {
|
||||||
|
|
||||||
|
private Long applicantId;
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
private LocalDate expectedDisbursementDate;
|
||||||
|
private LocalDate repaymentsStartingFromDate;
|
||||||
|
private LocalDate interestCalculatedFromDate;
|
||||||
|
|
||||||
|
private LocalDate submittedOnDate;
|
||||||
|
private String submittedOnNote;
|
||||||
|
private String externalId;
|
||||||
|
|
||||||
|
private CommonLoanProperties commonLoanProperties;
|
||||||
|
|
||||||
|
private LoanSchedule loanSchedule;
|
||||||
|
|
||||||
|
protected SubmitLoanApplicationCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public SubmitLoanApplicationCommand(final Long applicantId,
|
||||||
|
final Long productId, final LocalDate submittedOnDate,
|
||||||
|
final String submittedOnNote,
|
||||||
|
final LocalDate expectedDisbursementDate,
|
||||||
|
final LocalDate repaymentsStartingFromDate,
|
||||||
|
final LocalDate interestCalculatedFromDate,
|
||||||
|
final LoanSchedule loanSchedule, final String currencyCode,
|
||||||
|
final Integer digitsAfterDecimal, final Number principal,
|
||||||
|
final Number interestRatePerPeriod, Integer interestRateFrequencyMethod, final Integer interestMethod,
|
||||||
|
final Integer repaymentEvery, final Integer repaymentFrequency, final Integer numberOfRepayments, Integer amortizationMethod, final Number toleranceAmount,
|
||||||
|
final boolean flexibleRepaymentSchedule,
|
||||||
|
final boolean interestRebateAllowed) {
|
||||||
|
this.applicantId = applicantId;
|
||||||
|
this.productId = productId;
|
||||||
|
this.submittedOnDate = submittedOnDate;
|
||||||
|
this.submittedOnNote = submittedOnNote;
|
||||||
|
|
||||||
|
commonLoanProperties = new CommonLoanProperties(currencyCode, digitsAfterDecimal, principal, interestRatePerPeriod, interestRateFrequencyMethod, interestMethod,
|
||||||
|
repaymentEvery, repaymentFrequency, numberOfRepayments, amortizationMethod, toleranceAmount, flexibleRepaymentSchedule, interestRebateAllowed);
|
||||||
|
|
||||||
|
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||||
|
this.repaymentsStartingFromDate = repaymentsStartingFromDate;
|
||||||
|
this.interestCalculatedFromDate = interestCalculatedFromDate;
|
||||||
|
this.loanSchedule = loanSchedule;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getApplicantId() {
|
||||||
|
return this.applicantId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApplicantId(final Long applicantId) {
|
||||||
|
this.applicantId = applicantId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getProductId() {
|
||||||
|
return this.productId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductId(final Long productId) {
|
||||||
|
this.productId = productId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getSubmittedOnDate() {
|
||||||
|
return this.submittedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmittedOnDate(final LocalDate submittedOnDate) {
|
||||||
|
this.submittedOnDate = submittedOnDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubmittedOnNote() {
|
||||||
|
return this.submittedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmittedOnNote(final String submittedOnNote) {
|
||||||
|
this.submittedOnNote = submittedOnNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getExpectedDisbursementDate() {
|
||||||
|
return this.expectedDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpectedDisbursementDate(
|
||||||
|
final LocalDate expectedDisbursementDate) {
|
||||||
|
this.expectedDisbursementDate = expectedDisbursementDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getRepaymentsStartingFromDate() {
|
||||||
|
return this.repaymentsStartingFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentsStartingFromDate(
|
||||||
|
final LocalDate repaymentsStartingFromDate) {
|
||||||
|
this.repaymentsStartingFromDate = repaymentsStartingFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoanSchedule getLoanSchedule() {
|
||||||
|
return this.loanSchedule;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanSchedule(final LoanSchedule loanSchedule) {
|
||||||
|
this.loanSchedule = loanSchedule;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExternalId() {
|
||||||
|
return externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExternalId(String externalId) {
|
||||||
|
this.externalId = externalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommonLoanProperties getCommonLoanProperties() {
|
||||||
|
return commonLoanProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommonLoanProperties(CommonLoanProperties commonLoanProperties) {
|
||||||
|
this.commonLoanProperties = commonLoanProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrencyCode() {
|
||||||
|
return this.commonLoanProperties.getCurrencyCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencyCode(final String currencyCode) {
|
||||||
|
this.commonLoanProperties.setCurrencyCode(currencyCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDigitsAfterDecimal() {
|
||||||
|
return this.commonLoanProperties.getDigitsAfterDecimal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDigitsAfterDecimal(final Integer digitsAfterDecimal) {
|
||||||
|
this.commonLoanProperties.setDigitsAfterDecimal(digitsAfterDecimal);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentEvery() {
|
||||||
|
return this.commonLoanProperties.getRepaymentEvery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentEvery(final Integer repaymentEvery) {
|
||||||
|
this.commonLoanProperties.setRepaymentEvery(repaymentEvery);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentFrequency() {
|
||||||
|
return this.commonLoanProperties.getRepaymentFrequency();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequency(final Integer repaymentFrequency) {
|
||||||
|
this.commonLoanProperties.setRepaymentFrequency(repaymentFrequency);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isFlexibleRepaymentSchedule() {
|
||||||
|
return this.commonLoanProperties.isFlexibleRepaymentSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlexibleRepaymentSchedule(
|
||||||
|
final Boolean flexibleRepaymentSchedule) {
|
||||||
|
this.commonLoanProperties.setFlexibleRepaymentSchedule(flexibleRepaymentSchedule);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isInterestRebateAllowed() {
|
||||||
|
return this.commonLoanProperties.isInterestRebateAllowed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateAllowed(final Boolean interestRebateAllowed) {
|
||||||
|
this.commonLoanProperties.setInterestRebateAllowed(interestRebateAllowed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPrincipal() {
|
||||||
|
return this.commonLoanProperties.getPrincipal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(final BigDecimal principal) {
|
||||||
|
this.commonLoanProperties.setPrincipal(principal);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getFlexibleRepaymentSchedule() {
|
||||||
|
return this.commonLoanProperties.getFlexibleRepaymentSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getInterestRebateAllowed() {
|
||||||
|
return this.commonLoanProperties.getInterestRebateAllowed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestRateFrequencyMethod() {
|
||||||
|
return commonLoanProperties.getInterestRateFrequencyMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRateFrequencyMethod(Integer interestRateFrequencyMethod) {
|
||||||
|
this.commonLoanProperties.setInterestRateFrequencyMethod(interestRateFrequencyMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestMethod() {
|
||||||
|
return commonLoanProperties.getInterestMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestMethod(Integer interestMethod) {
|
||||||
|
this.commonLoanProperties.setInterestMethod(interestMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAmortizationMethod() {
|
||||||
|
return commonLoanProperties.getAmortizationMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationMethod(Integer amortizationMethod) {
|
||||||
|
this.commonLoanProperties.setAmortizationMethod(amortizationMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumberOfRepayments() {
|
||||||
|
return commonLoanProperties.getNumberOfRepayments();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfRepayments(Integer numberOfRepayments) {
|
||||||
|
this.commonLoanProperties.setNumberOfRepayments(numberOfRepayments);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInterestRatePerPeriod() {
|
||||||
|
return commonLoanProperties.getInterestRatePerPeriod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) {
|
||||||
|
this.commonLoanProperties.setInterestRatePerPeriod(interestRatePerPeriod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInArrearsToleranceAmount() {
|
||||||
|
return this.commonLoanProperties.getInArrearsToleranceAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInArrearsToleranceAmount(BigDecimal inArrearsToleranceAmount) {
|
||||||
|
this.commonLoanProperties.setInArrearsToleranceAmount(inArrearsToleranceAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getInterestCalculatedFromDate() {
|
||||||
|
return interestCalculatedFromDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestCalculatedFromDate(LocalDate interestCalculatedFromDate) {
|
||||||
|
this.interestCalculatedFromDate = interestCalculatedFromDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class UndoLoanApprovalCommand {
|
||||||
|
|
||||||
|
private Long loanId;
|
||||||
|
|
||||||
|
protected UndoLoanApprovalCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public UndoLoanApprovalCommand(final Long loanId) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanId() {
|
||||||
|
return this.loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanId(final Long loanId) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class UndoLoanDisbursalCommand {
|
||||||
|
|
||||||
|
private Long loanId;
|
||||||
|
|
||||||
|
protected UndoLoanDisbursalCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public UndoLoanDisbursalCommand(final Long loanId) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoanId() {
|
||||||
|
return this.loanId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanId(final Long loanId) {
|
||||||
|
this.loanId = loanId;
|
||||||
|
}
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.mifosng.data.EntityIdentifier;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class UpdateClientInformationCommand {
|
||||||
|
|
||||||
|
private EntityIdentifier id;
|
||||||
|
private List<KeyValueInformation> fields = new ArrayList<KeyValueInformation>();
|
||||||
|
|
||||||
|
protected UpdateClientInformationCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateClientInformationCommand(EntityIdentifier id, List<KeyValueInformation> fields) {
|
||||||
|
this.id = id;
|
||||||
|
this.fields = fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<KeyValueInformation> getFields() {
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFields(List<KeyValueInformation> fields) {
|
||||||
|
this.fields = fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityIdentifier getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(EntityIdentifier id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class UpdateLoanProductCommand implements LoanProductCommandData {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
private String externalId;
|
||||||
|
|
||||||
|
private CommonLoanProperties commonLoanProperties;
|
||||||
|
|
||||||
|
public UpdateLoanProductCommand() {
|
||||||
|
this.commonLoanProperties = new CommonLoanProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateLoanProductCommand(final String currencyCode,
|
||||||
|
final Integer digitsAfterDecimal, final Number principal,
|
||||||
|
final String name, final String description,
|
||||||
|
final Number interestRatePerPeriod, Integer interestRateFrequencyMethod, final Integer interestMethod,
|
||||||
|
final Integer repaymentEvery, final Integer repaymentFrequency, final Integer numberOfRepayments, Integer amortizationMethod, final Number toleranceAmount,
|
||||||
|
final boolean flexibleRepaymentSchedule,
|
||||||
|
final boolean interestRebateAllowed) {
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
|
||||||
|
commonLoanProperties = new CommonLoanProperties(currencyCode, digitsAfterDecimal, principal, interestRatePerPeriod, interestRateFrequencyMethod, interestMethod,
|
||||||
|
repaymentEvery, repaymentFrequency, numberOfRepayments, amortizationMethod, toleranceAmount, flexibleRepaymentSchedule, interestRebateAllowed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(final String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrencyCode() {
|
||||||
|
return this.commonLoanProperties.getCurrencyCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrencyCode(final String currencyCode) {
|
||||||
|
this.commonLoanProperties.setCurrencyCode(currencyCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDigitsAfterDecimal() {
|
||||||
|
return this.commonLoanProperties.getDigitsAfterDecimal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDigitsAfterDecimal(final Integer digitsAfterDecimal) {
|
||||||
|
this.commonLoanProperties.setDigitsAfterDecimal(digitsAfterDecimal);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentEvery() {
|
||||||
|
return this.commonLoanProperties.getRepaymentEvery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentEvery(final Integer repaymentEvery) {
|
||||||
|
this.commonLoanProperties.setRepaymentEvery(repaymentEvery);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRepaymentFrequency() {
|
||||||
|
return this.commonLoanProperties.getRepaymentFrequency();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepaymentFrequency(final Integer repaymentFrequency) {
|
||||||
|
this.commonLoanProperties.setRepaymentFrequency(repaymentFrequency);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isFlexibleRepaymentSchedule() {
|
||||||
|
return this.commonLoanProperties.isFlexibleRepaymentSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlexibleRepaymentSchedule(
|
||||||
|
final Boolean flexibleRepaymentSchedule) {
|
||||||
|
this.commonLoanProperties.setFlexibleRepaymentSchedule(flexibleRepaymentSchedule);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isInterestRebateAllowed() {
|
||||||
|
return this.commonLoanProperties.isInterestRebateAllowed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRebateAllowed(final Boolean interestRebateAllowed) {
|
||||||
|
this.commonLoanProperties.setInterestRebateAllowed(interestRebateAllowed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPrincipal() {
|
||||||
|
return this.commonLoanProperties.getPrincipal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrincipal(final BigDecimal principal) {
|
||||||
|
this.commonLoanProperties.setPrincipal(principal);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getFlexibleRepaymentSchedule() {
|
||||||
|
return this.commonLoanProperties.getFlexibleRepaymentSchedule();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getInterestRebateAllowed() {
|
||||||
|
return this.commonLoanProperties.getInterestRebateAllowed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestRateFrequencyMethod() {
|
||||||
|
return commonLoanProperties.getInterestRateFrequencyMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRateFrequencyMethod(Integer interestRateFrequencyMethod) {
|
||||||
|
this.commonLoanProperties.setInterestRateFrequencyMethod(interestRateFrequencyMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInterestMethod() {
|
||||||
|
return commonLoanProperties.getInterestMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestMethod(Integer interestMethod) {
|
||||||
|
this.commonLoanProperties.setInterestMethod(interestMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAmortizationMethod() {
|
||||||
|
return commonLoanProperties.getAmortizationMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmortizationMethod(Integer amortizationMethod) {
|
||||||
|
this.commonLoanProperties.setAmortizationMethod(amortizationMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumberOfRepayments() {
|
||||||
|
return commonLoanProperties.getNumberOfRepayments();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumberOfRepayments(Integer numberOfRepayments) {
|
||||||
|
this.commonLoanProperties.setNumberOfRepayments(numberOfRepayments);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInterestRatePerPeriod() {
|
||||||
|
return commonLoanProperties.getInterestRatePerPeriod();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInterestRatePerPeriod(BigDecimal interestRatePerPeriod) {
|
||||||
|
this.commonLoanProperties.setInterestRatePerPeriod(interestRatePerPeriod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommonLoanProperties getCommonLoanProperties() {
|
||||||
|
return commonLoanProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommonLoanProperties(CommonLoanProperties commonLoanProperties) {
|
||||||
|
this.commonLoanProperties = commonLoanProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getInArrearsToleranceAmount() {
|
||||||
|
return this.commonLoanProperties.getInArrearsToleranceAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInArrearsToleranceAmount(BigDecimal inArrearsToleranceAmount) {
|
||||||
|
this.commonLoanProperties.setInArrearsToleranceAmount(inArrearsToleranceAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class UpdateOrganisationCurrencyCommand implements Serializable {
|
||||||
|
|
||||||
|
private Collection<String> codes = new ArrayList<String>();
|
||||||
|
|
||||||
|
public UpdateOrganisationCurrencyCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateOrganisationCurrencyCommand(final List<String> currencyCodes) {
|
||||||
|
this.codes = currencyCodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<String> getCodes() {
|
||||||
|
return this.codes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodes(final Collection<String> codes) {
|
||||||
|
this.codes = codes;
|
||||||
|
}
|
||||||
|
}
|
||||||
+55
@@ -0,0 +1,55 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class UpdateUsernamePasswordCommand {
|
||||||
|
|
||||||
|
private boolean usernameToBeChanged = true;
|
||||||
|
private String oldUsername;
|
||||||
|
private String username;
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
protected UpdateUsernamePasswordCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateUsernamePasswordCommand(final String oldUsername,
|
||||||
|
final String username, final String password) {
|
||||||
|
this.oldUsername = oldUsername;
|
||||||
|
this.username = username;
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUsernameToBeChanged() {
|
||||||
|
return this.usernameToBeChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsernameToBeChanged(final boolean usernameToBeChanged) {
|
||||||
|
this.usernameToBeChanged = usernameToBeChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOldUsername() {
|
||||||
|
return this.oldUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return this.username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return this.password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOldUsername(final String oldUsername) {
|
||||||
|
this.oldUsername = oldUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(final String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(final String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create or update user details command.
|
||||||
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
public class UserCommand {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String username;
|
||||||
|
private String firstname;
|
||||||
|
private String lastname;
|
||||||
|
private String password;
|
||||||
|
private String email;
|
||||||
|
private String[] roleIds;
|
||||||
|
private Long officeId;
|
||||||
|
|
||||||
|
public UserCommand() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserCommand(final String username, final String firstname, final String lastname, final String password,
|
||||||
|
final String email, final String[] roleIds, final Long officeId) {
|
||||||
|
this.username = username;
|
||||||
|
this.firstname = firstname;
|
||||||
|
this.lastname = lastname;
|
||||||
|
this.password = password;
|
||||||
|
this.email = email;
|
||||||
|
this.roleIds = roleIds;
|
||||||
|
this.officeId = officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserCommand(final String username, final String firstname, final String lastname, final String email) {
|
||||||
|
this.username = username;
|
||||||
|
this.firstname = firstname;
|
||||||
|
this.lastname = lastname;
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserCommand(final String username, final String password,
|
||||||
|
final String email, final String[] roleIds, final Long officeId) {
|
||||||
|
this.username = username;
|
||||||
|
this.password = password;
|
||||||
|
this.email = email;
|
||||||
|
this.roleIds = roleIds;
|
||||||
|
this.officeId = officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplayName() {
|
||||||
|
return new StringBuilder(this.lastname).append(", ").append(this.firstname).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return this.username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(final String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return this.password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(final String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return this.email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(final String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getRoleIds() {
|
||||||
|
return this.roleIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleIds(final String[] roleIds) {
|
||||||
|
this.roleIds = roleIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOfficeId() {
|
||||||
|
return this.officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOfficeId(final Long officeId) {
|
||||||
|
this.officeId = officeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstname() {
|
||||||
|
return firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstname(String firstname) {
|
||||||
|
this.firstname = firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastname() {
|
||||||
|
return lastname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastname(String lastname) {
|
||||||
|
this.lastname = lastname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
@XmlJavaTypeAdapters({@XmlJavaTypeAdapter(type=DateTime.class, value=DateTimeAdapter.class),@XmlJavaTypeAdapter(type = LocalDate.class, value = LocalDateAdapter.class) })
|
||||||
|
package org.mifosng.data.command;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
import org.mifosng.jodaadapters.DateTimeAdapter;
|
||||||
|
import org.mifosng.jodaadapters.LocalDateAdapter;
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
@XmlJavaTypeAdapters({@XmlJavaTypeAdapter(type=DateTime.class, value=DateTimeAdapter.class),@XmlJavaTypeAdapter(type = LocalDate.class, value = LocalDateAdapter.class) })
|
||||||
|
package org.mifosng.data;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
import org.mifosng.jodaadapters.DateTimeAdapter;
|
||||||
|
import org.mifosng.jodaadapters.LocalDateAdapter;
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package org.mifosng.data.query;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class CalculatePayoffQuery {
|
||||||
|
|
||||||
|
private LocalDate payoffDate;
|
||||||
|
|
||||||
|
protected CalculatePayoffQuery() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDate getPayoffDate() {
|
||||||
|
return this.payoffDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPayoffDate(final LocalDate payoffDate) {
|
||||||
|
this.payoffDate = payoffDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
@XmlJavaTypeAdapters({@XmlJavaTypeAdapter(type=DateTime.class, value=DateTimeAdapter.class),@XmlJavaTypeAdapter(type = LocalDate.class, value = LocalDateAdapter.class) })
|
||||||
|
package org.mifosng.data.query;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
import org.mifosng.jodaadapters.DateTimeAdapter;
|
||||||
|
import org.mifosng.jodaadapters.LocalDateAdapter;
|
||||||
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package org.mifosng.data.reports;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class GenericResultset {
|
||||||
|
|
||||||
|
// [
|
||||||
|
// [contact_email, field 2, field 3],
|
||||||
|
// [
|
||||||
|
// ["abb.net", "r2", "x"], ["abb.net", "r3"]
|
||||||
|
// ]
|
||||||
|
// ]
|
||||||
|
|
||||||
|
// create types for these
|
||||||
|
private List<ResultsetColumnHeader> columnHeaders = new ArrayList<ResultsetColumnHeader>();
|
||||||
|
private List<ResultsetDataRow> data = new ArrayList<ResultsetDataRow>();
|
||||||
|
|
||||||
|
public GenericResultset() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ResultsetColumnHeader> getColumnHeaders() {
|
||||||
|
return columnHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnHeaders(List<ResultsetColumnHeader> columnHeaders) {
|
||||||
|
this.columnHeaders = columnHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ResultsetDataRow> getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(List<ResultsetDataRow> data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package org.mifosng.data.reports;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class ResultsetColumnHeader {
|
||||||
|
|
||||||
|
private String columnName;
|
||||||
|
private String columnType;
|
||||||
|
private Integer columnLength;
|
||||||
|
private String columnDisplayType;
|
||||||
|
private List<String> columnValues = new ArrayList<String>();
|
||||||
|
|
||||||
|
public ResultsetColumnHeader() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getColumnValues() {
|
||||||
|
return columnValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnValues(List<String> columnValues) {
|
||||||
|
this.columnValues = columnValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColumnName() {
|
||||||
|
return columnName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnName(String columnName) {
|
||||||
|
this.columnName = columnName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColumnType() {
|
||||||
|
return columnType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnType(String columnType) {
|
||||||
|
this.columnType = columnType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getColumnLength() {
|
||||||
|
return columnLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnLength(Integer columnLength) {
|
||||||
|
this.columnLength = columnLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColumnDisplayType() {
|
||||||
|
return columnDisplayType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnDisplayType(String columnDisplayType) {
|
||||||
|
this.columnDisplayType = columnDisplayType;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.mifosng.data.reports;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
@XmlRootElement
|
||||||
|
public class ResultsetDataRow {
|
||||||
|
|
||||||
|
private List<String> row = new ArrayList<String>();
|
||||||
|
|
||||||
|
public ResultsetDataRow() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getRow() {
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRow(List<String> row) {
|
||||||
|
this.row = row;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
@XmlJavaTypeAdapters({@XmlJavaTypeAdapter(type=DateTime.class, value=DateTimeAdapter.class),@XmlJavaTypeAdapter(type = LocalDate.class, value = LocalDateAdapter.class) })
|
||||||
|
package org.mifosng.data.reports;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
import org.mifosng.jodaadapters.DateTimeAdapter;
|
||||||
|
import org.mifosng.jodaadapters.LocalDateAdapter;
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.mifosng.jodaadapters;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlAdapter;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
|
public class DateTimeAdapter extends XmlAdapter<String, DateTime> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DateTime unmarshal(final String v) throws Exception {
|
||||||
|
return new DateTime(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String marshal(final DateTime v) throws Exception {
|
||||||
|
return v.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.mifosng.jodaadapters;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.adapters.XmlAdapter;
|
||||||
|
|
||||||
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
public class LocalDateAdapter extends XmlAdapter<String, LocalDate> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LocalDate unmarshal(final String v) throws Exception {
|
||||||
|
return new LocalDate(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String marshal(final LocalDate v) throws Exception {
|
||||||
|
return v.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
include 'mifosng-data', 'mifosng-provider'
|
||||||
Reference in New Issue
Block a user