wip: repayment/disbursal apis support optional payment details
This commit is contained in:
+29
-27
@@ -2,37 +2,39 @@ package org.mifosplatform.portfolio.loanaccount;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.mifosplatform.organisation.monetary.domain.Money;
|
||||
import org.mifosplatform.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanTransactionBuilder {
|
||||
|
||||
private Money transactionAmount = new MoneyBuilder().build();
|
||||
private LocalDate transactionDate = LocalDate.now();
|
||||
private boolean repayment = false;
|
||||
@SuppressWarnings("unused")
|
||||
private Money transactionAmount = new MoneyBuilder().build();
|
||||
@SuppressWarnings("unused")
|
||||
private LocalDate transactionDate = LocalDate.now();
|
||||
@SuppressWarnings("unused")
|
||||
private boolean repayment = false;
|
||||
|
||||
public LoanTransaction build() {
|
||||
|
||||
LoanTransaction transaction = null;
|
||||
|
||||
if (repayment) {
|
||||
transaction = LoanTransaction.repayment(transactionAmount, transactionDate);
|
||||
}
|
||||
|
||||
return transaction;
|
||||
}
|
||||
/** public LoanTransaction build() {
|
||||
|
||||
public LoanTransactionBuilder with(final Money newAmount) {
|
||||
this.transactionAmount = newAmount;
|
||||
return this;
|
||||
}
|
||||
LoanTransaction transaction = null;
|
||||
|
||||
public LoanTransactionBuilder with(final LocalDate withTransactionDate) {
|
||||
this.transactionDate = withTransactionDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanTransactionBuilder repayment() {
|
||||
this.repayment = true;
|
||||
return this;
|
||||
}
|
||||
if (repayment) {
|
||||
transaction = LoanTransaction.repayment(transactionAmount, transactionDate);
|
||||
}
|
||||
|
||||
return transaction;
|
||||
}**/
|
||||
|
||||
public LoanTransactionBuilder with(final Money newAmount) {
|
||||
this.transactionAmount = newAmount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanTransactionBuilder with(final LocalDate withTransactionDate) {
|
||||
this.transactionDate = withTransactionDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LoanTransactionBuilder repayment() {
|
||||
this.repayment = true;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user