Fix deposit account data object, make it immutable again.
This commit is contained in:
+1
-2
@@ -130,10 +130,9 @@ public class DepositAccountsApiResource {
|
|||||||
responseParameters.addAll(associationParameters);
|
responseParameters.addAll(associationParameters);
|
||||||
}
|
}
|
||||||
permissions = this.depositAccountReadPlatformService.retrieveDepositAccountsPermissions(account);
|
permissions = this.depositAccountReadPlatformService.retrieveDepositAccountsPermissions(account);
|
||||||
|
account = new DepositAccountData(account, permissions, account.getTransactions());
|
||||||
}
|
}
|
||||||
|
|
||||||
account.setPermissions(permissions);
|
|
||||||
|
|
||||||
return this.apiJsonSerializerService.serializeDepositAccountDataToJson(prettyPrint, responseParameters, account);
|
return this.apiJsonSerializerService.serializeDepositAccountDataToJson(prettyPrint, responseParameters, account);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+38
-11
@@ -45,8 +45,8 @@ public class DepositAccountData {
|
|||||||
private final List<EnumOptionData> interestCompoundedEveryPeriodTypeOptions;
|
private final List<EnumOptionData> interestCompoundedEveryPeriodTypeOptions;
|
||||||
private final List<DepositProductLookup> productOptions;
|
private final List<DepositProductLookup> productOptions;
|
||||||
|
|
||||||
private Collection<DepositAccountTransactionData> transactions;
|
private final Collection<DepositAccountTransactionData> transactions;
|
||||||
private DepositPermissionData permissions;
|
private final DepositPermissionData permissions;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* used when returning account template data but only a clientId is passed, no selected product.
|
* used when returning account template data but only a clientId is passed, no selected product.
|
||||||
@@ -132,6 +132,42 @@ public class DepositAccountData {
|
|||||||
this.permissions=account.getPermissions();
|
this.permissions=account.getPermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DepositAccountData(final DepositAccountData account, final DepositPermissionData permissions, final Collection<DepositAccountTransactionData> transactions) {
|
||||||
|
this.id = account.getId();
|
||||||
|
this.externalId = account.getExternalId();
|
||||||
|
this.status = account.getStatus();
|
||||||
|
this.clientId = account.getClientId();
|
||||||
|
this.clientName = account.getClientName();
|
||||||
|
this.productId = account.getProductId();
|
||||||
|
this.productName = account.getProductName();
|
||||||
|
this.currency = account.getCurrency();
|
||||||
|
this.deposit = account.getDeposit();
|
||||||
|
this.maturityInterestRate = account.getMaturityInterestRate();
|
||||||
|
this.tenureInMonths = account.getTenureInMonths();
|
||||||
|
this.projectedCommencementDate = account.getProjectedCommencementDate();
|
||||||
|
this.actualCommencementDate = account.getActualCommencementDate();
|
||||||
|
this.maturedOn = account.getMaturedOn();
|
||||||
|
this.projectedInterestAccrued = account.getProjectedInterestAccrued();
|
||||||
|
this.actualInterestAccrued = account.getActualInterestAccrued();
|
||||||
|
this.projectedMaturityAmount = account.getProjectedMaturityAmount();
|
||||||
|
this.actualMaturityAmount = account.getActualMaturityAmount();
|
||||||
|
this.interestCompoundedEvery = account.getInterestCompoundedEvery();
|
||||||
|
this.interestCompoundedEveryPeriodType = account.getInterestCompoundedEveryPeriodType();
|
||||||
|
this.renewalAllowed = account.isRenewalAllowed();
|
||||||
|
this.preClosureAllowed = account.isPreClosureAllowed();
|
||||||
|
this.preClosureInterestRate = account.getPreClosureInterestRate();
|
||||||
|
|
||||||
|
this.interestCompoundedEveryPeriodTypeOptions = account.getInterestCompoundedEveryPeriodTypeOptions();
|
||||||
|
this.productOptions = account.getProductOptions();
|
||||||
|
|
||||||
|
this.withdrawnonDate=account.getWithdrawnonDate();
|
||||||
|
this.rejectedonDate=account.getRejectedonDate();
|
||||||
|
this.closedonDate=account.getClosedonDate();
|
||||||
|
|
||||||
|
this.transactions=transactions;
|
||||||
|
this.permissions=permissions;
|
||||||
|
}
|
||||||
|
|
||||||
public DepositAccountData(
|
public DepositAccountData(
|
||||||
final Long id,
|
final Long id,
|
||||||
final String externalId,
|
final String externalId,
|
||||||
@@ -357,16 +393,7 @@ public class DepositAccountData {
|
|||||||
return transactions;
|
return transactions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTransactions(Collection<DepositAccountTransactionData> transactions) {
|
|
||||||
this.transactions = transactions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DepositPermissionData getPermissions() {
|
public DepositPermissionData getPermissions() {
|
||||||
return permissions;
|
return permissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPermissions(DepositPermissionData permissions) {
|
|
||||||
this.permissions = permissions;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
+6
-15
@@ -4,6 +4,9 @@ import java.math.BigDecimal;
|
|||||||
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Immutable data object to represent transactions on a deposit account.
|
||||||
|
*/
|
||||||
public class DepositAccountTransactionData {
|
public class DepositAccountTransactionData {
|
||||||
|
|
||||||
private final Long transactionId;
|
private final Long transactionId;
|
||||||
@@ -12,18 +15,9 @@ public class DepositAccountTransactionData {
|
|||||||
private final BigDecimal transactionAmount;
|
private final BigDecimal transactionAmount;
|
||||||
private final Long accountId;
|
private final Long accountId;
|
||||||
|
|
||||||
public DepositAccountTransactionData() {
|
public DepositAccountTransactionData(
|
||||||
|
final Long transactionId, final Long accountId, final EnumOptionData transactionType,
|
||||||
this.transactionId = null;
|
final LocalDate transactionDate, final BigDecimal transactionAmount ) {
|
||||||
this.accountId = null;
|
|
||||||
this.transactionType = null;
|
|
||||||
this.transactionDate = null;
|
|
||||||
this.transactionAmount = null;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public DepositAccountTransactionData(final Long transactionId, final Long accountId, final EnumOptionData transactionType, final LocalDate transactionDate, final BigDecimal transactionAmount ){
|
|
||||||
|
|
||||||
this.transactionId = transactionId;
|
this.transactionId = transactionId;
|
||||||
this.accountId = accountId;
|
this.accountId = accountId;
|
||||||
this.transactionType = transactionType;
|
this.transactionType = transactionType;
|
||||||
@@ -50,7 +44,4 @@ public class DepositAccountTransactionData {
|
|||||||
public BigDecimal getTransactionAmount() {
|
public BigDecimal getTransactionAmount() {
|
||||||
return transactionAmount;
|
return transactionAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
+4
-4
@@ -8,7 +8,7 @@ public class DepositPermissionData {
|
|||||||
private final boolean pendingApproval;
|
private final boolean pendingApproval;
|
||||||
private final boolean isActive;
|
private final boolean isActive;
|
||||||
|
|
||||||
private final boolean anyActionOnLoanAllowed;
|
private final boolean anyActionOnAccountAllowed;
|
||||||
|
|
||||||
public DepositPermissionData(final boolean rejectAllowed,final boolean withdrawnByApplicantAllowed,final boolean undoApprovalAllowed,final boolean pendingApproval,final boolean isActive) {
|
public DepositPermissionData(final boolean rejectAllowed,final boolean withdrawnByApplicantAllowed,final boolean undoApprovalAllowed,final boolean pendingApproval,final boolean isActive) {
|
||||||
this.rejectAllowed = rejectAllowed;
|
this.rejectAllowed = rejectAllowed;
|
||||||
@@ -16,7 +16,7 @@ public class DepositPermissionData {
|
|||||||
this.undoApprovalAllowed = undoApprovalAllowed;
|
this.undoApprovalAllowed = undoApprovalAllowed;
|
||||||
this.pendingApproval = pendingApproval;
|
this.pendingApproval = pendingApproval;
|
||||||
this.isActive=isActive;
|
this.isActive=isActive;
|
||||||
this.anyActionOnLoanAllowed = isRejectAllowed() || isPendingApproval() || isUndoApprovalAllowed() || isWithdrawnByApplicantAllowed();
|
this.anyActionOnAccountAllowed = isRejectAllowed() || isPendingApproval() || isUndoApprovalAllowed() || isWithdrawnByApplicantAllowed();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRejectAllowed() {
|
public boolean isRejectAllowed() {
|
||||||
@@ -35,8 +35,8 @@ public class DepositPermissionData {
|
|||||||
return pendingApproval;
|
return pendingApproval;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAnyActionOnLoanAllowed() {
|
public boolean isAnyActionOnAccountAllowed() {
|
||||||
return anyActionOnLoanAllowed;
|
return anyActionOnAccountAllowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
|
|||||||
@@ -916,7 +916,7 @@ public class Loan extends AbstractAuditableCustom<AppUser, Long> {
|
|||||||
if (StringUtils.isNotBlank(externalSystemIdentifer)) {
|
if (StringUtils.isNotBlank(externalSystemIdentifer)) {
|
||||||
this.externalId = externalSystemIdentifer.trim();
|
this.externalId = externalSystemIdentifer.trim();
|
||||||
} else {
|
} else {
|
||||||
this.externalId = externalSystemIdentifer;
|
this.externalId = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -18,6 +18,7 @@ import javax.persistence.Temporal;
|
|||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
import javax.persistence.UniqueConstraint;
|
import javax.persistence.UniqueConstraint;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.hibernate.annotations.LazyCollection;
|
import org.hibernate.annotations.LazyCollection;
|
||||||
import org.hibernate.annotations.LazyCollectionOption;
|
import org.hibernate.annotations.LazyCollectionOption;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
@@ -179,7 +180,8 @@ public class DepositAccount extends AbstractAuditableCustom<AppUser, Long> {
|
|||||||
final Integer depositStatus) {
|
final Integer depositStatus) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.product = product;
|
this.product = product;
|
||||||
this.externalId = externalId;
|
setExternalId(externalId);
|
||||||
|
|
||||||
this.currency = deposit.getCurrency();
|
this.currency = deposit.getCurrency();
|
||||||
this.depositAmount = deposit.getAmount();
|
this.depositAmount = deposit.getAmount();
|
||||||
product.validateDepositInRange(this.depositAmount);
|
product.validateDepositInRange(this.depositAmount);
|
||||||
@@ -205,6 +207,14 @@ public class DepositAccount extends AbstractAuditableCustom<AppUser, Long> {
|
|||||||
this.depositStatus=depositStatus;
|
this.depositStatus=depositStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setExternalId(final String externalId) {
|
||||||
|
if (StringUtils.isNotBlank(externalId)) {
|
||||||
|
this.externalId = externalId.trim();
|
||||||
|
} else {
|
||||||
|
this.externalId = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isDeleted() {
|
public boolean isDeleted() {
|
||||||
return deleted;
|
return deleted;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-40
@@ -19,12 +19,12 @@ import org.joda.time.LocalDate;
|
|||||||
import org.mifosng.platform.currency.domain.MonetaryCurrency;
|
import org.mifosng.platform.currency.domain.MonetaryCurrency;
|
||||||
import org.mifosng.platform.currency.domain.Money;
|
import org.mifosng.platform.currency.domain.Money;
|
||||||
import org.springframework.data.jpa.domain.AbstractPersistable;
|
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="m_deposit_account_transaction")
|
@Table(name="m_deposit_account_transaction")
|
||||||
public class DepositAccountTransaction extends AbstractPersistable<Long> {
|
public class DepositAccountTransaction extends AbstractPersistable<Long> {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
@ManyToOne(optional = false)
|
@ManyToOne(optional = false)
|
||||||
@JoinColumn(name = "deposit_account_id", nullable=false)
|
@JoinColumn(name = "deposit_account_id", nullable=false)
|
||||||
private DepositAccount depositAccount;
|
private DepositAccount depositAccount;
|
||||||
@@ -33,6 +33,7 @@ public class DepositAccountTransaction extends AbstractPersistable<Long> {
|
|||||||
@Column(name = "transaction_type_enum", nullable = false)
|
@Column(name = "transaction_type_enum", nullable = false)
|
||||||
private DepositAccountTransactionType typeOf;
|
private DepositAccountTransactionType typeOf;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
@OneToOne(optional=true, cascade={CascadeType.PERSIST})
|
@OneToOne(optional=true, cascade={CascadeType.PERSIST})
|
||||||
@JoinColumn(name="contra_id")
|
@JoinColumn(name="contra_id")
|
||||||
private DepositAccountTransaction contra;
|
private DepositAccountTransaction contra;
|
||||||
@@ -45,20 +46,16 @@ public class DepositAccountTransaction extends AbstractPersistable<Long> {
|
|||||||
private final BigDecimal amount;
|
private final BigDecimal amount;
|
||||||
|
|
||||||
protected DepositAccountTransaction(){
|
protected DepositAccountTransaction(){
|
||||||
|
|
||||||
this.depositAccount=null;
|
this.depositAccount=null;
|
||||||
this.typeOf=null;
|
this.typeOf=null;
|
||||||
this.amount=null;
|
this.amount=null;
|
||||||
this.dateOf=null;
|
this.dateOf=null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private DepositAccountTransaction(DepositAccountTransactionType type, final BigDecimal amount, final LocalDate date) {
|
private DepositAccountTransaction(DepositAccountTransactionType type, final BigDecimal amount, final LocalDate date) {
|
||||||
|
|
||||||
this.typeOf = type;
|
this.typeOf = type;
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.dateOf = date.toDateMidnight().toDate();
|
this.dateOf = date.toDateMidnight().toDate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getDateOf() {
|
public Date getDateOf() {
|
||||||
@@ -73,28 +70,16 @@ public class DepositAccountTransaction extends AbstractPersistable<Long> {
|
|||||||
return typeOf;
|
return typeOf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Money getAmount(MonetaryCurrency currency) {
|
public Money getAmount(MonetaryCurrency currency) {
|
||||||
return Money.of(currency, this.amount);
|
return Money.of(currency, this.amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@DateTimeFormat(style="-M")
|
|
||||||
public LocalDate getTransactionDate() {
|
public LocalDate getTransactionDate() {
|
||||||
return new LocalDate(this.dateOf);
|
return new LocalDate(this.dateOf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DepositAccountTransaction getContra() {
|
|
||||||
return contra;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isNotContra() {
|
|
||||||
return this.contra == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDeposit(){
|
public boolean isDeposit(){
|
||||||
return DepositAccountTransactionType.DEPOSIT.equals(typeOf) && isNotContra();
|
return DepositAccountTransactionType.DEPOSIT.equals(typeOf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DepositAccountTransaction deposit(Money amount, LocalDate paymentDate) {
|
public static DepositAccountTransaction deposit(Money amount, LocalDate paymentDate) {
|
||||||
@@ -105,29 +90,7 @@ public class DepositAccountTransaction extends AbstractPersistable<Long> {
|
|||||||
return new DepositAccountTransaction(DepositAccountTransactionType.WITHDRAW, amount.getAmount(), paymentDate);
|
return new DepositAccountTransaction(DepositAccountTransactionType.WITHDRAW, amount.getAmount(), paymentDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DepositAccountTransaction contra(DepositAccountTransaction originalTransaction) {
|
|
||||||
|
|
||||||
DepositAccountTransaction contra = new DepositAccountTransaction(DepositAccountTransactionType.REVERSAL, originalTransaction.getAmount().negate(), new LocalDate(originalTransaction.getDateOf()));
|
|
||||||
contra.updateContra(originalTransaction);
|
|
||||||
|
|
||||||
return contra;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateContra(DepositAccountTransaction transaction) {
|
|
||||||
this.contra = transaction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DepositAccount getDepositAccount() {
|
|
||||||
return depositAccount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDepositAccount(DepositAccount depositAccount) {
|
|
||||||
this.depositAccount = depositAccount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateAccount(DepositAccount depositAccount) {
|
public void updateAccount(DepositAccount depositAccount) {
|
||||||
this.depositAccount=depositAccount;
|
this.depositAccount=depositAccount;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+26
-31
@@ -3,9 +3,7 @@ package org.mifosng.platform.saving.service;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosng.platform.api.data.ClientData;
|
import org.mifosng.platform.api.data.ClientData;
|
||||||
@@ -54,24 +52,27 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
|
|||||||
|
|
||||||
String sql = "select " + mapper.schema() + " where da.is_deleted=0";
|
String sql = "select " + mapper.schema() + " where da.is_deleted=0";
|
||||||
|
|
||||||
Collection<DepositAccountData> depositAccountDatas = this.jdbcTemplate.query(sql,mapper, new Object[]{});
|
return this.jdbcTemplate.query(sql,mapper, new Object[]{});
|
||||||
|
|
||||||
DepositAccountTransactionMapper transactionMapper = new DepositAccountTransactionMapper();
|
// NOTE: when retrieving a list of deposit accounts, its unlikey we want to much detail so at that point in time,
|
||||||
String transactionSchema = "Select "+transactionMapper.schema();
|
// not likely that returning what transactions have is useful so removing it.
|
||||||
Collection<DepositAccountTransactionData> depositAccountTransactionDatas = this.jdbcTemplate.query(transactionSchema, transactionMapper, new Object[]{});
|
|
||||||
|
|
||||||
for(DepositAccountData depositAccountData : depositAccountDatas){
|
// DepositAccountTransactionMapper transactionMapper = new DepositAccountTransactionMapper();
|
||||||
List<DepositAccountTransactionData> myAccountTransactionDatas = new ArrayList<DepositAccountTransactionData>();
|
// String transactionSchema = "Select " + transactionMapper.schema();
|
||||||
for(DepositAccountTransactionData depositAccountTransactionData : depositAccountTransactionDatas){
|
// Collection<DepositAccountTransactionData> depositAccountTransactionDatas = this.jdbcTemplate.query(transactionSchema, transactionMapper, new Object[]{});
|
||||||
if(depositAccountData.getId().equals(depositAccountTransactionData.getAccountId())){
|
|
||||||
myAccountTransactionDatas.add(depositAccountTransactionData);
|
|
||||||
}
|
|
||||||
depositAccountData.setTransactions(myAccountTransactionDatas);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return depositAccountDatas;
|
// for (DepositAccountData depositAccountData : depositAccountDatas) {
|
||||||
|
// List<DepositAccountTransactionData> myAccountTransactionDatas = new ArrayList<DepositAccountTransactionData>();
|
||||||
|
//
|
||||||
|
// for (DepositAccountTransactionData depositAccountTransactionData : depositAccountTransactionDatas) {
|
||||||
|
// if (depositAccountData.getId().equals(depositAccountTransactionData.getAccountId())) {
|
||||||
|
// myAccountTransactionDatas.add(depositAccountTransactionData);
|
||||||
|
// }
|
||||||
|
// depositAccountData.setTransactions(myAccountTransactionDatas);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return depositAccountDatas;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -79,26 +80,20 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
|
|||||||
try{
|
try{
|
||||||
DepositAccountMapper mapper = new DepositAccountMapper();
|
DepositAccountMapper mapper = new DepositAccountMapper();
|
||||||
|
|
||||||
String sql = "select " + mapper.schema()
|
String sql = "select " + mapper.schema() + " where da.id = ? and da.is_deleted=0";
|
||||||
+ " where da.id = ? and da.is_deleted=0";
|
|
||||||
|
|
||||||
DepositAccountData productData = this.jdbcTemplate.queryForObject(sql, mapper, new Object[] { accountId });
|
DepositAccountData depositAccountData = this.jdbcTemplate.queryForObject(sql, mapper, new Object[] { accountId });
|
||||||
|
|
||||||
DepositAccountTransactionMapper transactionMapper = new DepositAccountTransactionMapper();
|
DepositAccountTransactionMapper transactionMapper = new DepositAccountTransactionMapper();
|
||||||
String transactionSchema = "Select "+transactionMapper.schema() +" where txn.deposit_account_id = ? ";
|
String transactionSchema = "select " + transactionMapper.schema() + " where txn.deposit_account_id = ? ";
|
||||||
Collection<DepositAccountTransactionData> depositAccountTransactionDatas = this.jdbcTemplate.query(transactionSchema, transactionMapper, new Object[]{accountId});
|
|
||||||
|
|
||||||
List<DepositAccountTransactionData> myAccountTransactionDatas = new ArrayList<DepositAccountTransactionData>();
|
Collection<DepositAccountTransactionData> depositAccountTransactions = this.jdbcTemplate.query(transactionSchema, transactionMapper, new Object[]{accountId});
|
||||||
for(DepositAccountTransactionData depositAccountTransactionData : depositAccountTransactionDatas){
|
if (!depositAccountTransactions.isEmpty()) {
|
||||||
|
DepositPermissionData permissions = null;
|
||||||
|
depositAccountData = new DepositAccountData(depositAccountData, permissions, depositAccountTransactions);
|
||||||
|
}
|
||||||
|
|
||||||
if(productData.getId().equals(depositAccountTransactionData.getAccountId()))
|
return depositAccountData;
|
||||||
myAccountTransactionDatas.add(depositAccountTransactionData);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
productData.setTransactions(myAccountTransactionDatas);
|
|
||||||
|
|
||||||
return productData;
|
|
||||||
} catch (EmptyResultDataAccessException e) {
|
} catch (EmptyResultDataAccessException e) {
|
||||||
throw new LoanProductNotFoundException(accountId);
|
throw new LoanProductNotFoundException(accountId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user