MIFOSX-946 capture loanpurpose for group and jlg loans
This commit is contained in:
+7
-9
@@ -317,36 +317,34 @@ public class Loan extends AbstractPersistable<Long> {
|
|||||||
final Boolean syncDisbursementWithMeeting = null;
|
final Boolean syncDisbursementWithMeeting = null;
|
||||||
return new Loan(accountNo, client, group, loanType, fund, officer, loanPurpose, transactionProcessingStrategy, loanProduct,
|
return new Loan(accountNo, client, group, loanType, fund, officer, loanPurpose, transactionProcessingStrategy, loanProduct,
|
||||||
loanRepaymentScheduleDetail, status, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount,
|
loanRepaymentScheduleDetail, status, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount,
|
||||||
disbursementDetails,maxOutstandingLoanBalance);
|
disbursementDetails, maxOutstandingLoanBalance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Loan newGroupLoanApplication(final String accountNo, final Group group, final Integer loanType,
|
public static Loan newGroupLoanApplication(final String accountNo, final Group group, final Integer loanType,
|
||||||
final LoanProduct loanProduct, final Fund fund, final Staff officer,
|
final LoanProduct loanProduct, final Fund fund, final Staff officer, final CodeValue loanPurpose,
|
||||||
final LoanTransactionProcessingStrategy transactionProcessingStrategy,
|
final LoanTransactionProcessingStrategy transactionProcessingStrategy,
|
||||||
final LoanProductRelatedDetail loanRepaymentScheduleDetail, final Set<LoanCharge> loanCharges,
|
final LoanProductRelatedDetail loanRepaymentScheduleDetail, final Set<LoanCharge> loanCharges,
|
||||||
final Boolean syncDisbursementWithMeeting, final BigDecimal fixedEmiAmount,
|
final Boolean syncDisbursementWithMeeting, final BigDecimal fixedEmiAmount,
|
||||||
final Set<LoanDisbursementDetails> disbursementDetails,final BigDecimal maxOutstandingLoanBalance) {
|
final Set<LoanDisbursementDetails> disbursementDetails, final BigDecimal maxOutstandingLoanBalance) {
|
||||||
final LoanStatus status = null;
|
final LoanStatus status = null;
|
||||||
final CodeValue loanPurpose = null;
|
|
||||||
final Set<LoanCollateral> collateral = null;
|
final Set<LoanCollateral> collateral = null;
|
||||||
final Client client = null;
|
final Client client = null;
|
||||||
return new Loan(accountNo, client, group, loanType, fund, officer, loanPurpose, transactionProcessingStrategy, loanProduct,
|
return new Loan(accountNo, client, group, loanType, fund, officer, loanPurpose, transactionProcessingStrategy, loanProduct,
|
||||||
loanRepaymentScheduleDetail, status, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount,
|
loanRepaymentScheduleDetail, status, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount,
|
||||||
disbursementDetails,maxOutstandingLoanBalance);
|
disbursementDetails, maxOutstandingLoanBalance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Loan newIndividualLoanApplicationFromGroup(final String accountNo, final Client client, final Group group,
|
public static Loan newIndividualLoanApplicationFromGroup(final String accountNo, final Client client, final Group group,
|
||||||
final Integer loanType, final LoanProduct loanProduct, final Fund fund, final Staff officer,
|
final Integer loanType, final LoanProduct loanProduct, final Fund fund, final Staff officer, final CodeValue loanPurpose,
|
||||||
final LoanTransactionProcessingStrategy transactionProcessingStrategy,
|
final LoanTransactionProcessingStrategy transactionProcessingStrategy,
|
||||||
final LoanProductRelatedDetail loanRepaymentScheduleDetail, final Set<LoanCharge> loanCharges,
|
final LoanProductRelatedDetail loanRepaymentScheduleDetail, final Set<LoanCharge> loanCharges,
|
||||||
final Boolean syncDisbursementWithMeeting, final BigDecimal fixedEmiAmount,
|
final Boolean syncDisbursementWithMeeting, final BigDecimal fixedEmiAmount,
|
||||||
final Set<LoanDisbursementDetails> disbursementDetails,final BigDecimal maxOutstandingLoanBalance) {
|
final Set<LoanDisbursementDetails> disbursementDetails, final BigDecimal maxOutstandingLoanBalance) {
|
||||||
final LoanStatus status = null;
|
final LoanStatus status = null;
|
||||||
final CodeValue loanPurpose = null;
|
|
||||||
final Set<LoanCollateral> collateral = null;
|
final Set<LoanCollateral> collateral = null;
|
||||||
return new Loan(accountNo, client, group, loanType, fund, officer, loanPurpose, transactionProcessingStrategy, loanProduct,
|
return new Loan(accountNo, client, group, loanType, fund, officer, loanPurpose, transactionProcessingStrategy, loanProduct,
|
||||||
loanRepaymentScheduleDetail, status, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount,
|
loanRepaymentScheduleDetail, status, loanCharges, collateral, syncDisbursementWithMeeting, fixedEmiAmount,
|
||||||
disbursementDetails,maxOutstandingLoanBalance);
|
disbursementDetails, maxOutstandingLoanBalance);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Loan() {
|
protected Loan() {
|
||||||
|
|||||||
+16
-11
@@ -212,20 +212,12 @@ public class LoanAssembler {
|
|||||||
if (clientId != null) {
|
if (clientId != null) {
|
||||||
client = this.clientRepository.findOneWithNotFoundDetection(clientId);
|
client = this.clientRepository.findOneWithNotFoundDetection(clientId);
|
||||||
if (client.isNotActive()) { throw new ClientNotActiveException(clientId); }
|
if (client.isNotActive()) { throw new ClientNotActiveException(clientId); }
|
||||||
|
|
||||||
loanApplication = Loan.newIndividualLoanApplication(accountNo, client, loanType.getId().intValue(), loanProduct, fund,
|
|
||||||
loanOfficer, loanPurpose, loanTransactionProcessingStrategy, loanProductRelatedDetail, loanCharges, collateral,
|
|
||||||
fixedEmiAmount, disbursementDetails,maxOutstandingLoanBalance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (groupId != null) {
|
if (groupId != null) {
|
||||||
group = this.groupRepository.findOne(groupId);
|
group = this.groupRepository.findOne(groupId);
|
||||||
if (group == null) { throw new GroupNotFoundException(groupId); }
|
if (group == null) { throw new GroupNotFoundException(groupId); }
|
||||||
if (group.isNotActive()) { throw new GroupNotActiveException(groupId); }
|
if (group.isNotActive()) { throw new GroupNotActiveException(groupId); }
|
||||||
|
|
||||||
loanApplication = Loan.newGroupLoanApplication(accountNo, group, loanType.getId().intValue(), loanProduct, fund, loanOfficer,
|
|
||||||
loanTransactionProcessingStrategy, loanProductRelatedDetail, loanCharges, syncDisbursementWithMeeting, fixedEmiAmount,
|
|
||||||
disbursementDetails, maxOutstandingLoanBalance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client != null && group != null) {
|
if (client != null && group != null) {
|
||||||
@@ -233,10 +225,23 @@ public class LoanAssembler {
|
|||||||
if (!group.hasClientAsMember(client)) { throw new ClientNotInGroupException(clientId, groupId); }
|
if (!group.hasClientAsMember(client)) { throw new ClientNotInGroupException(clientId, groupId); }
|
||||||
|
|
||||||
loanApplication = Loan.newIndividualLoanApplicationFromGroup(accountNo, client, group, loanType.getId().intValue(),
|
loanApplication = Loan.newIndividualLoanApplicationFromGroup(accountNo, client, group, loanType.getId().intValue(),
|
||||||
loanProduct, fund, loanOfficer, loanTransactionProcessingStrategy, loanProductRelatedDetail, loanCharges,
|
loanProduct, fund, loanOfficer, loanPurpose, loanTransactionProcessingStrategy, loanProductRelatedDetail, loanCharges,
|
||||||
syncDisbursementWithMeeting, fixedEmiAmount, disbursementDetails,maxOutstandingLoanBalance);
|
syncDisbursementWithMeeting, fixedEmiAmount, disbursementDetails, maxOutstandingLoanBalance);
|
||||||
|
|
||||||
|
} else if (group != null) {
|
||||||
|
|
||||||
|
loanApplication = Loan.newGroupLoanApplication(accountNo, group, loanType.getId().intValue(), loanProduct, fund, loanOfficer,
|
||||||
|
loanPurpose, loanTransactionProcessingStrategy, loanProductRelatedDetail, loanCharges, syncDisbursementWithMeeting,
|
||||||
|
fixedEmiAmount, disbursementDetails, maxOutstandingLoanBalance);
|
||||||
|
|
||||||
|
} else if (client != null) {
|
||||||
|
|
||||||
|
loanApplication = Loan.newIndividualLoanApplication(accountNo, client, loanType.getId().intValue(), loanProduct, fund,
|
||||||
|
loanOfficer, loanPurpose, loanTransactionProcessingStrategy, loanProductRelatedDetail, loanCharges, collateral,
|
||||||
|
fixedEmiAmount, disbursementDetails, maxOutstandingLoanBalance);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final String externalId = this.fromApiJsonHelper.extractStringNamed("externalId", element);
|
final String externalId = this.fromApiJsonHelper.extractStringNamed("externalId", element);
|
||||||
final LocalDate submittedOnDate = this.fromApiJsonHelper.extractLocalDateNamed("submittedOnDate", element);
|
final LocalDate submittedOnDate = this.fromApiJsonHelper.extractLocalDateNamed("submittedOnDate", element);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user