MIFOSX-1904 : Moving payment type to their own table
This commit is contained in:
+16
-14
@@ -29,7 +29,6 @@ import org.mifosplatform.accounting.journalentry.data.OfficeOpeningBalancesData;
|
|||||||
import org.mifosplatform.accounting.journalentry.data.TransactionDetailData;
|
import org.mifosplatform.accounting.journalentry.data.TransactionDetailData;
|
||||||
import org.mifosplatform.accounting.journalentry.data.TransactionTypeEnumData;
|
import org.mifosplatform.accounting.journalentry.data.TransactionTypeEnumData;
|
||||||
import org.mifosplatform.accounting.journalentry.exception.JournalEntriesNotFoundException;
|
import org.mifosplatform.accounting.journalentry.exception.JournalEntriesNotFoundException;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
|
import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
|
||||||
import org.mifosplatform.infrastructure.core.exception.GeneralPlatformDomainRuleException;
|
import org.mifosplatform.infrastructure.core.exception.GeneralPlatformDomainRuleException;
|
||||||
@@ -37,15 +36,16 @@ import org.mifosplatform.infrastructure.core.service.DateUtils;
|
|||||||
import org.mifosplatform.infrastructure.core.service.Page;
|
import org.mifosplatform.infrastructure.core.service.Page;
|
||||||
import org.mifosplatform.infrastructure.core.service.PaginationHelper;
|
import org.mifosplatform.infrastructure.core.service.PaginationHelper;
|
||||||
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
||||||
|
import org.mifosplatform.infrastructure.core.service.SearchParameters;
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.organisation.office.data.OfficeData;
|
import org.mifosplatform.organisation.office.data.OfficeData;
|
||||||
import org.mifosplatform.organisation.office.service.OfficeReadPlatformService;
|
import org.mifosplatform.organisation.office.service.OfficeReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.account.PortfolioAccountType;
|
import org.mifosplatform.portfolio.account.PortfolioAccountType;
|
||||||
import org.mifosplatform.infrastructure.core.service.SearchParameters;
|
|
||||||
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionEnumData;
|
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionEnumData;
|
||||||
import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations;
|
import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations;
|
||||||
import org.mifosplatform.portfolio.note.data.NoteData;
|
import org.mifosplatform.portfolio.note.data.NoteData;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
import org.mifosplatform.portfolio.savings.data.SavingsAccountTransactionEnumData;
|
import org.mifosplatform.portfolio.savings.data.SavingsAccountTransactionEnumData;
|
||||||
import org.mifosplatform.portfolio.savings.service.SavingsEnumerations;
|
import org.mifosplatform.portfolio.savings.service.SavingsEnumerations;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -66,8 +66,9 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
|||||||
private final PaginationHelper<JournalEntryData> paginationHelper = new PaginationHelper<>();
|
private final PaginationHelper<JournalEntryData> paginationHelper = new PaginationHelper<>();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public JournalEntryReadPlatformServiceImpl(final RoutingDataSource dataSource, final GLAccountReadPlatformService glAccountReadPlatformService,
|
public JournalEntryReadPlatformServiceImpl(final RoutingDataSource dataSource,
|
||||||
final OfficeReadPlatformService officeReadPlatformService, final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepositoryWrapper) {
|
final GLAccountReadPlatformService glAccountReadPlatformService, final OfficeReadPlatformService officeReadPlatformService,
|
||||||
|
final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepositoryWrapper) {
|
||||||
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||||
this.glAccountReadPlatformService = glAccountReadPlatformService;
|
this.glAccountReadPlatformService = glAccountReadPlatformService;
|
||||||
this.officeReadPlatformService = officeReadPlatformService;
|
this.officeReadPlatformService = officeReadPlatformService;
|
||||||
@@ -106,8 +107,8 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
|||||||
}
|
}
|
||||||
if (associationParametersData.isTransactionDetailsRequired()) {
|
if (associationParametersData.isTransactionDetailsRequired()) {
|
||||||
sb.append(" ,pd.receipt_number as receiptNumber, ").append(" pd.check_number as checkNumber, ")
|
sb.append(" ,pd.receipt_number as receiptNumber, ").append(" pd.check_number as checkNumber, ")
|
||||||
.append(" pd.account_number as accountNumber, ").append(" cdv.code_value as paymentTypeName, ")
|
.append(" pd.account_number as accountNumber, ").append(" pt.value as paymentTypeName, ")
|
||||||
.append(" pd.payment_type_cv_id as paymentTypeId,").append(" pd.bank_number as bankNumber, ")
|
.append(" pd.payment_type_id as paymentTypeId,").append(" pd.bank_number as bankNumber, ")
|
||||||
.append(" pd.routing_code as routingCode, ").append(" note.id as noteId, ")
|
.append(" pd.routing_code as routingCode, ").append(" note.id as noteId, ")
|
||||||
.append(" note.note as transactionNote, ").append(" lt.transaction_type_enum as loanTransactionType, ")
|
.append(" note.note as transactionNote, ").append(" lt.transaction_type_enum as loanTransactionType, ")
|
||||||
.append(" st.transaction_type_enum as savingsTransactionType ");
|
.append(" st.transaction_type_enum as savingsTransactionType ");
|
||||||
@@ -121,7 +122,7 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
|||||||
sb.append(" left join m_loan_transaction as lt on journalEntry.loan_transaction_id = lt.id ")
|
sb.append(" left join m_loan_transaction as lt on journalEntry.loan_transaction_id = lt.id ")
|
||||||
.append(" left join m_savings_account_transaction as st on journalEntry.savings_transaction_id = st.id ")
|
.append(" left join m_savings_account_transaction as st on journalEntry.savings_transaction_id = st.id ")
|
||||||
.append(" left join m_payment_detail as pd on lt.payment_detail_id = pd.id or st.payment_detail_id = pd.id")
|
.append(" left join m_payment_detail as pd on lt.payment_detail_id = pd.id or st.payment_detail_id = pd.id")
|
||||||
.append(" left join m_code_value as cdv on cdv.id = pd.payment_type_cv_id ")
|
.append(" left join m_payment_type as pt on pt.id = pd.payment_type_id ")
|
||||||
.append(" left join m_note as note on lt.id = note.loan_transaction_id or st.id = note.savings_account_transaction_id ");
|
.append(" left join m_note as note on lt.id = note.loan_transaction_id or st.id = note.savings_account_transaction_id ");
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
@@ -184,7 +185,7 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
|||||||
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentTypeId");
|
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentTypeId");
|
||||||
if (paymentTypeId != null) {
|
if (paymentTypeId != null) {
|
||||||
final String typeName = rs.getString("paymentTypeName");
|
final String typeName = rs.getString("paymentTypeName");
|
||||||
final CodeValueData paymentType = CodeValueData.instance(paymentTypeId, typeName);
|
final PaymentTypeData paymentType = PaymentTypeData.instance(paymentTypeId, typeName);
|
||||||
final String accountNumber = rs.getString("accountNumber");
|
final String accountNumber = rs.getString("accountNumber");
|
||||||
final String checkNumber = rs.getString("checkNumber");
|
final String checkNumber = rs.getString("checkNumber");
|
||||||
final String routingCode = rs.getString("routingCode");
|
final String routingCode = rs.getString("routingCode");
|
||||||
@@ -356,12 +357,12 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
|||||||
@Override
|
@Override
|
||||||
public OfficeOpeningBalancesData retrieveOfficeOpeningBalances(final Long officeId) {
|
public OfficeOpeningBalancesData retrieveOfficeOpeningBalances(final Long officeId) {
|
||||||
|
|
||||||
final FinancialActivityAccount financialActivityAccountId = this.financialActivityAccountRepositoryWrapper.findByFinancialActivityTypeWithNotFoundDetection(300);
|
final FinancialActivityAccount financialActivityAccountId = this.financialActivityAccountRepositoryWrapper
|
||||||
final Long contraId = financialActivityAccountId.getGlAccount().getId();
|
.findByFinancialActivityTypeWithNotFoundDetection(300);
|
||||||
if (contraId == null) { throw new GeneralPlatformDomainRuleException(
|
final Long contraId = financialActivityAccountId.getGlAccount().getId();
|
||||||
|
if (contraId == null) { throw new GeneralPlatformDomainRuleException(
|
||||||
"error.msg.financial.activity.mapping.opening.balance.contra.account.cannot.be.null",
|
"error.msg.financial.activity.mapping.opening.balance.contra.account.cannot.be.null",
|
||||||
"office-opening-balances-contra-account value can not be null",
|
"office-opening-balances-contra-account value can not be null", "office-opening-balances-contra-account"); }
|
||||||
"office-opening-balances-contra-account");}
|
|
||||||
|
|
||||||
final JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData();
|
final JournalEntryAssociationParametersData associationParametersData = new JournalEntryAssociationParametersData();
|
||||||
final GLAccountData contraAccount = this.glAccountReadPlatformService.retrieveGLAccountById(contraId, associationParametersData);
|
final GLAccountData contraAccount = this.glAccountReadPlatformService.retrieveGLAccountById(contraId, associationParametersData);
|
||||||
@@ -448,7 +449,8 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
|
|||||||
final String transactionId = "";
|
final String transactionId = "";
|
||||||
final Page<JournalEntryData> contraJournalEntries = retrieveContraTransactions(officeId, contraId, transactionId);
|
final Page<JournalEntryData> contraJournalEntries = retrieveContraTransactions(officeId, contraId, transactionId);
|
||||||
if (!CollectionUtils.isEmpty(contraJournalEntries.getPageItems())) {
|
if (!CollectionUtils.isEmpty(contraJournalEntries.getPageItems())) {
|
||||||
final JournalEntryData contraTransaction = contraJournalEntries.getPageItems().get(contraJournalEntries.getPageItems().size()-1);
|
final JournalEntryData contraTransaction = contraJournalEntries.getPageItems().get(
|
||||||
|
contraJournalEntries.getPageItems().size() - 1);
|
||||||
return contraTransaction.getTransactionId();
|
return contraTransaction.getTransactionId();
|
||||||
}
|
}
|
||||||
return transactionId;
|
return transactionId;
|
||||||
|
|||||||
-1
@@ -39,7 +39,6 @@ import org.mifosplatform.accounting.journalentry.serialization.JournalEntryComma
|
|||||||
import org.mifosplatform.accounting.rule.domain.AccountingRule;
|
import org.mifosplatform.accounting.rule.domain.AccountingRule;
|
||||||
import org.mifosplatform.accounting.rule.domain.AccountingRuleRepository;
|
import org.mifosplatform.accounting.rule.domain.AccountingRuleRepository;
|
||||||
import org.mifosplatform.accounting.rule.exception.AccountingRuleNotFoundException;
|
import org.mifosplatform.accounting.rule.exception.AccountingRuleNotFoundException;
|
||||||
import org.mifosplatform.infrastructure.configuration.domain.ConfigurationDomainService;
|
|
||||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
import org.mifosplatform.infrastructure.core.data.ApiParameterError;
|
import org.mifosplatform.infrastructure.core.data.ApiParameterError;
|
||||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
|
|||||||
+3
-3
@@ -6,16 +6,16 @@
|
|||||||
package org.mifosplatform.accounting.producttoaccountmapping.data;
|
package org.mifosplatform.accounting.producttoaccountmapping.data;
|
||||||
|
|
||||||
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
|
||||||
public class PaymentTypeToGLAccountMapper {
|
public class PaymentTypeToGLAccountMapper {
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final CodeValueData paymentType;
|
private final PaymentTypeData paymentType;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final GLAccountData fundSourceAccount;
|
private final GLAccountData fundSourceAccount;
|
||||||
|
|
||||||
public PaymentTypeToGLAccountMapper(final CodeValueData paymentType, final GLAccountData fundSourceAccount) {
|
public PaymentTypeToGLAccountMapper(final PaymentTypeData paymentType, final GLAccountData fundSourceAccount) {
|
||||||
this.paymentType = paymentType;
|
this.paymentType = paymentType;
|
||||||
this.fundSourceAccount = fundSourceAccount;
|
this.fundSourceAccount = fundSourceAccount;
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -14,8 +14,8 @@ import javax.persistence.Table;
|
|||||||
import javax.persistence.UniqueConstraint;
|
import javax.persistence.UniqueConstraint;
|
||||||
|
|
||||||
import org.mifosplatform.accounting.glaccount.domain.GLAccount;
|
import org.mifosplatform.accounting.glaccount.domain.GLAccount;
|
||||||
import org.mifosplatform.infrastructure.codes.domain.CodeValue;
|
|
||||||
import org.mifosplatform.portfolio.charge.domain.Charge;
|
import org.mifosplatform.portfolio.charge.domain.Charge;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentType;
|
||||||
import org.springframework.data.jpa.domain.AbstractPersistable;
|
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@@ -32,7 +32,7 @@ public class ProductToGLAccountMapping extends AbstractPersistable<Long> {
|
|||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "payment_type", nullable = true)
|
@JoinColumn(name = "payment_type", nullable = true)
|
||||||
private CodeValue paymentType;
|
private PaymentType paymentType;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "charge_id", nullable = true)
|
@JoinColumn(name = "charge_id", nullable = true)
|
||||||
@@ -63,12 +63,12 @@ public class ProductToGLAccountMapping extends AbstractPersistable<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ProductToGLAccountMapping(final GLAccount glAccount, final Long productId, final int productType,
|
public ProductToGLAccountMapping(final GLAccount glAccount, final Long productId, final int productType,
|
||||||
final int financialAccountType, final CodeValue paymentType) {
|
final int financialAccountType, final PaymentType paymentType) {
|
||||||
this(glAccount, productId, productType, financialAccountType, paymentType, null);
|
this(glAccount, productId, productType, financialAccountType, paymentType, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProductToGLAccountMapping(final GLAccount glAccount, final Long productId, final int productType,
|
private ProductToGLAccountMapping(final GLAccount glAccount, final Long productId, final int productType,
|
||||||
final int financialAccountType, final CodeValue paymentType, final Charge charge) {
|
final int financialAccountType, final PaymentType paymentType, final Charge charge) {
|
||||||
this.glAccount = glAccount;
|
this.glAccount = glAccount;
|
||||||
this.productId = productId;
|
this.productId = productId;
|
||||||
this.productType = productType;
|
this.productType = productType;
|
||||||
@@ -109,11 +109,11 @@ public class ProductToGLAccountMapping extends AbstractPersistable<Long> {
|
|||||||
this.financialAccountType = financialAccountType;
|
this.financialAccountType = financialAccountType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CodeValue getPaymentType() {
|
public PaymentType getPaymentType() {
|
||||||
return this.paymentType;
|
return this.paymentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPaymentType(final CodeValue paymentType) {
|
public void setPaymentType(final PaymentType paymentType) {
|
||||||
this.paymentType = paymentType;
|
this.paymentType = paymentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -21,6 +21,7 @@ import org.mifosplatform.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
|||||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
||||||
import org.mifosplatform.portfolio.charge.domain.ChargeRepositoryWrapper;
|
import org.mifosplatform.portfolio.charge.domain.ChargeRepositoryWrapper;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentTypeRepositoryWrapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -33,9 +34,9 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
|
|||||||
public LoanProductToGLAccountMappingHelper(final GLAccountRepository glAccountRepository,
|
public LoanProductToGLAccountMappingHelper(final GLAccountRepository glAccountRepository,
|
||||||
final ProductToGLAccountMappingRepository glAccountMappingRepository, final FromJsonHelper fromApiJsonHelper,
|
final ProductToGLAccountMappingRepository glAccountMappingRepository, final FromJsonHelper fromApiJsonHelper,
|
||||||
final CodeValueRepositoryWrapper codeValueRepositoryWrapper, final ChargeRepositoryWrapper chargeRepositoryWrapper,
|
final CodeValueRepositoryWrapper codeValueRepositoryWrapper, final ChargeRepositoryWrapper chargeRepositoryWrapper,
|
||||||
final GLAccountRepositoryWrapper accountRepositoryWrapper) {
|
final GLAccountRepositoryWrapper accountRepositoryWrapper, final PaymentTypeRepositoryWrapper paymentTypeRepositoryWrapper) {
|
||||||
super(glAccountRepository, glAccountMappingRepository, fromApiJsonHelper, codeValueRepositoryWrapper, chargeRepositoryWrapper,
|
super(glAccountRepository, glAccountMappingRepository, fromApiJsonHelper, codeValueRepositoryWrapper, chargeRepositoryWrapper,
|
||||||
accountRepositoryWrapper);
|
accountRepositoryWrapper, paymentTypeRepositoryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** Set of abstractions for saving Loan Products to GL Account Mappings ***/
|
/*** Set of abstractions for saving Loan Products to GL Account Mappings ***/
|
||||||
|
|||||||
+6
-5
@@ -23,13 +23,13 @@ import org.mifosplatform.accounting.producttoaccountmapping.domain.ProductToGLAc
|
|||||||
import org.mifosplatform.accounting.producttoaccountmapping.domain.ProductToGLAccountMappingRepository;
|
import org.mifosplatform.accounting.producttoaccountmapping.domain.ProductToGLAccountMappingRepository;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.exception.ProductToGLAccountMappingInvalidException;
|
import org.mifosplatform.accounting.producttoaccountmapping.exception.ProductToGLAccountMappingInvalidException;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.exception.ProductToGLAccountMappingNotFoundException;
|
import org.mifosplatform.accounting.producttoaccountmapping.exception.ProductToGLAccountMappingNotFoundException;
|
||||||
import org.mifosplatform.infrastructure.codes.domain.CodeValue;
|
|
||||||
import org.mifosplatform.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
import org.mifosplatform.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
||||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
||||||
import org.mifosplatform.portfolio.charge.domain.Charge;
|
import org.mifosplatform.portfolio.charge.domain.Charge;
|
||||||
import org.mifosplatform.portfolio.charge.domain.ChargeRepositoryWrapper;
|
import org.mifosplatform.portfolio.charge.domain.ChargeRepositoryWrapper;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentType;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentTypeRepositoryWrapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -46,18 +46,20 @@ public class ProductToGLAccountMappingHelper {
|
|||||||
protected final FromJsonHelper fromApiJsonHelper;
|
protected final FromJsonHelper fromApiJsonHelper;
|
||||||
private final CodeValueRepositoryWrapper codeValueRepositoryWrapper;
|
private final CodeValueRepositoryWrapper codeValueRepositoryWrapper;
|
||||||
private final ChargeRepositoryWrapper chargeRepositoryWrapper;
|
private final ChargeRepositoryWrapper chargeRepositoryWrapper;
|
||||||
|
private final PaymentTypeRepositoryWrapper paymentTypeRepositoryWrapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public ProductToGLAccountMappingHelper(final GLAccountRepository glAccountRepository,
|
public ProductToGLAccountMappingHelper(final GLAccountRepository glAccountRepository,
|
||||||
final ProductToGLAccountMappingRepository glAccountMappingRepository, final FromJsonHelper fromApiJsonHelper,
|
final ProductToGLAccountMappingRepository glAccountMappingRepository, final FromJsonHelper fromApiJsonHelper,
|
||||||
final CodeValueRepositoryWrapper codeValueRepositoryWrapper, final ChargeRepositoryWrapper chargeRepositoryWrapper,
|
final CodeValueRepositoryWrapper codeValueRepositoryWrapper, final ChargeRepositoryWrapper chargeRepositoryWrapper,
|
||||||
final GLAccountRepositoryWrapper accountRepositoryWrapper) {
|
final GLAccountRepositoryWrapper accountRepositoryWrapper, PaymentTypeRepositoryWrapper paymentTypeRepositoryWrapper) {
|
||||||
this.accountRepository = glAccountRepository;
|
this.accountRepository = glAccountRepository;
|
||||||
this.accountMappingRepository = glAccountMappingRepository;
|
this.accountMappingRepository = glAccountMappingRepository;
|
||||||
this.fromApiJsonHelper = fromApiJsonHelper;
|
this.fromApiJsonHelper = fromApiJsonHelper;
|
||||||
this.codeValueRepositoryWrapper = codeValueRepositoryWrapper;
|
this.codeValueRepositoryWrapper = codeValueRepositoryWrapper;
|
||||||
this.chargeRepositoryWrapper = chargeRepositoryWrapper;
|
this.chargeRepositoryWrapper = chargeRepositoryWrapper;
|
||||||
this.accountRepositoryWrapper = accountRepositoryWrapper;
|
this.accountRepositoryWrapper = accountRepositoryWrapper;
|
||||||
|
this.paymentTypeRepositoryWrapper = paymentTypeRepositoryWrapper;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,8 +334,7 @@ public class ProductToGLAccountMappingHelper {
|
|||||||
*/
|
*/
|
||||||
private void savePaymentChannelToFundSourceMapping(final Long productId, final Long paymentTypeId,
|
private void savePaymentChannelToFundSourceMapping(final Long productId, final Long paymentTypeId,
|
||||||
final Long paymentTypeSpecificFundAccountId, final PortfolioProductType portfolioProductType) {
|
final Long paymentTypeSpecificFundAccountId, final PortfolioProductType portfolioProductType) {
|
||||||
final CodeValue paymentType = this.codeValueRepositoryWrapper.findOneByCodeNameAndIdWithNotFoundDetection(
|
final PaymentType paymentType = this.paymentTypeRepositoryWrapper.findOneWithNotFoundDetection(paymentTypeId);
|
||||||
PaymentDetailConstants.paymentTypeCodeName, paymentTypeId);
|
|
||||||
final GLAccount glAccount = getAccountByIdAndType(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), GLAccountType.ASSET,
|
final GLAccount glAccount = getAccountByIdAndType(LOAN_PRODUCT_ACCOUNTING_PARAMS.FUND_SOURCE.getValue(), GLAccountType.ASSET,
|
||||||
paymentTypeSpecificFundAccountId);
|
paymentTypeSpecificFundAccountId);
|
||||||
final ProductToGLAccountMapping accountMapping = new ProductToGLAccountMapping(glAccount, productId,
|
final ProductToGLAccountMapping accountMapping = new ProductToGLAccountMapping(glAccount, productId,
|
||||||
|
|||||||
+7
-6
@@ -22,10 +22,10 @@ import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
|||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.domain.PortfolioProductType;
|
import org.mifosplatform.accounting.producttoaccountmapping.domain.PortfolioProductType;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
|
import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
|
||||||
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.jdbc.core.RowMapper;
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
@@ -46,11 +46,11 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
|
|||||||
public String schema() {
|
public String schema() {
|
||||||
return " mapping.id as id, mapping.gl_account_id as glAccountId,glaccount.name as name,glaccount.gl_code as code,"
|
return " mapping.id as id, mapping.gl_account_id as glAccountId,glaccount.name as name,glaccount.gl_code as code,"
|
||||||
+ " mapping.product_id as productId, mapping.product_type as productType,mapping.financial_account_type as financialAccountType, "
|
+ " mapping.product_id as productId, mapping.product_type as productType,mapping.financial_account_type as financialAccountType, "
|
||||||
+ " mapping.payment_type as paymentTypeId,cv.code_value codeValue, mapping.charge_id as chargeId, charge.is_penalty as penalty, "
|
+ " mapping.payment_type as paymentTypeId,pt.value as paymentTypeValue, mapping.charge_id as chargeId, charge.is_penalty as penalty, "
|
||||||
+ " charge.name as chargeName "
|
+ " charge.name as chargeName "
|
||||||
+ " from acc_product_mapping mapping left join m_charge charge on mapping.charge_id=charge.id "
|
+ " from acc_product_mapping mapping left join m_charge charge on mapping.charge_id=charge.id "
|
||||||
+ " left join acc_gl_account as glaccount on mapping.gl_account_id = glaccount.id"
|
+ " left join acc_gl_account as glaccount on mapping.gl_account_id = glaccount.id"
|
||||||
+ " left join m_code_value cv on mapping.payment_type=cv.id" + " where mapping.product_type= ? ";
|
+ " left join m_payment_type pt on mapping.payment_type=pt.id" + " where mapping.product_type= ? ";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -62,7 +62,7 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
|
|||||||
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentTypeId");
|
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentTypeId");
|
||||||
final Long chargeId = rs.getLong("chargeId");
|
final Long chargeId = rs.getLong("chargeId");
|
||||||
final Integer productType = rs.getInt("productType");
|
final Integer productType = rs.getInt("productType");
|
||||||
final String paymentTypeValue = rs.getString("codeValue");
|
final String paymentTypeValue = rs.getString("paymentTypeValue");
|
||||||
final Integer financialAccountType = rs.getInt("financialAccountType");
|
final Integer financialAccountType = rs.getInt("financialAccountType");
|
||||||
final String glAccountName = rs.getString("name");
|
final String glAccountName = rs.getString("name");
|
||||||
final String glCode = rs.getString("code");
|
final String glCode = rs.getString("code");
|
||||||
@@ -249,13 +249,14 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
|
|||||||
}
|
}
|
||||||
final Long paymentTypeId = (Long) productToGLAccountMap.get("paymentTypeId");
|
final Long paymentTypeId = (Long) productToGLAccountMap.get("paymentTypeId");
|
||||||
final String paymentTypeValue = (String) productToGLAccountMap.get("paymentTypeValue");
|
final String paymentTypeValue = (String) productToGLAccountMap.get("paymentTypeValue");
|
||||||
final CodeValueData codeValueData = CodeValueData.instance(paymentTypeId, paymentTypeValue);
|
final PaymentTypeData paymentTypeData = PaymentTypeData.instance(paymentTypeId, paymentTypeValue);
|
||||||
final Long glAccountId = (Long) productToGLAccountMap.get("glAccountId");
|
final Long glAccountId = (Long) productToGLAccountMap.get("glAccountId");
|
||||||
final String glAccountName = (String) productToGLAccountMap.get("glAccountName");
|
final String glAccountName = (String) productToGLAccountMap.get("glAccountName");
|
||||||
final String glCode = (String) productToGLAccountMap.get("glCode");
|
final String glCode = (String) productToGLAccountMap.get("glCode");
|
||||||
final GLAccountData gLAccountData = new GLAccountData(glAccountId, glAccountName, glCode);
|
final GLAccountData gLAccountData = new GLAccountData(glAccountId, glAccountName, glCode);
|
||||||
|
|
||||||
final PaymentTypeToGLAccountMapper paymentTypeToGLAccountMapper = new PaymentTypeToGLAccountMapper(codeValueData, gLAccountData);
|
final PaymentTypeToGLAccountMapper paymentTypeToGLAccountMapper = new PaymentTypeToGLAccountMapper(paymentTypeData,
|
||||||
|
gLAccountData);
|
||||||
paymentTypeToGLAccountMappers.add(paymentTypeToGLAccountMapper);
|
paymentTypeToGLAccountMappers.add(paymentTypeToGLAccountMapper);
|
||||||
}
|
}
|
||||||
return paymentTypeToGLAccountMappers;
|
return paymentTypeToGLAccountMappers;
|
||||||
|
|||||||
+3
-2
@@ -20,6 +20,7 @@ import org.mifosplatform.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
|||||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
||||||
import org.mifosplatform.portfolio.charge.domain.ChargeRepositoryWrapper;
|
import org.mifosplatform.portfolio.charge.domain.ChargeRepositoryWrapper;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentTypeRepositoryWrapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -32,9 +33,9 @@ public class SavingsProductToGLAccountMappingHelper extends ProductToGLAccountMa
|
|||||||
public SavingsProductToGLAccountMappingHelper(final GLAccountRepository glAccountRepository,
|
public SavingsProductToGLAccountMappingHelper(final GLAccountRepository glAccountRepository,
|
||||||
final ProductToGLAccountMappingRepository glAccountMappingRepository, final FromJsonHelper fromApiJsonHelper,
|
final ProductToGLAccountMappingRepository glAccountMappingRepository, final FromJsonHelper fromApiJsonHelper,
|
||||||
final CodeValueRepositoryWrapper codeValueRepositoryWrapper, final ChargeRepositoryWrapper chargeRepositoryWrapper,
|
final CodeValueRepositoryWrapper codeValueRepositoryWrapper, final ChargeRepositoryWrapper chargeRepositoryWrapper,
|
||||||
final GLAccountRepositoryWrapper accountRepositoryWrapper) {
|
final GLAccountRepositoryWrapper accountRepositoryWrapper, final PaymentTypeRepositoryWrapper paymentTypeRepositoryWrapper) {
|
||||||
super(glAccountRepository, glAccountMappingRepository, fromApiJsonHelper, codeValueRepositoryWrapper, chargeRepositoryWrapper,
|
super(glAccountRepository, glAccountMappingRepository, fromApiJsonHelper, codeValueRepositoryWrapper, chargeRepositoryWrapper,
|
||||||
accountRepositoryWrapper);
|
accountRepositoryWrapper, paymentTypeRepositoryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** Set of abstractions for saving Saving Products to GL Account Mappings ***/
|
/*** Set of abstractions for saving Saving Products to GL Account Mappings ***/
|
||||||
|
|||||||
@@ -1016,4 +1016,8 @@ public class CommandWrapper {
|
|||||||
public boolean isEntityMappingResource() {
|
public boolean isEntityMappingResource() {
|
||||||
return this.entityName.equalsIgnoreCase("ENTITYMAPPING");
|
return this.entityName.equalsIgnoreCase("ENTITYMAPPING");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPaymentTypeResource() {
|
||||||
|
return this.entityName.equalsIgnoreCase("PAYMENTTYPE");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+25
@@ -2353,4 +2353,29 @@ public class CommandWrapperBuilder {
|
|||||||
this.href = "/entitytoentitymapping/" + mapId;
|
this.href = "/entitytoentitymapping/" + mapId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CommandWrapperBuilder createPaymentType() {
|
||||||
|
this.actionName = "CREATE";
|
||||||
|
this.entityName = "PAYMENTTYPE";
|
||||||
|
this.entityId = null;
|
||||||
|
this.href = "/paymenttype";
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommandWrapperBuilder updatePaymentType(final Long paymentTypeId) {
|
||||||
|
this.actionName = "UPDATE";
|
||||||
|
this.entityName = "PAYMENTTYPE";
|
||||||
|
this.entityId = paymentTypeId;
|
||||||
|
this.href = "/paymenttype/" + paymentTypeId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommandWrapperBuilder deletePaymentType(final Long paymentTypeId) {
|
||||||
|
this.actionName = "DELETE";
|
||||||
|
this.entityName = "PAYMENTTYPE";
|
||||||
|
this.entityId = paymentTypeId;
|
||||||
|
this.href = "/paymenttype/" + paymentTypeId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+12
@@ -923,6 +923,18 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer
|
|||||||
} else {
|
} else {
|
||||||
throw new UnsupportedCommandException(wrapper.commandName());
|
throw new UnsupportedCommandException(wrapper.commandName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (wrapper.isPaymentTypeResource()) {
|
||||||
|
if (wrapper.isCreate()) {
|
||||||
|
handler = this.applicationContext.getBean("createPaymentTypeCommandHandler", NewCommandSourceHandler.class);
|
||||||
|
} else if (wrapper.isUpdate()) {
|
||||||
|
handler = this.applicationContext.getBean("updatePaymentTypeCommandHandler", NewCommandSourceHandler.class);
|
||||||
|
} else if (wrapper.isDelete()) {
|
||||||
|
handler = this.applicationContext.getBean("deletePaymentTypeCommandHandler", NewCommandSourceHandler.class);
|
||||||
|
} else {
|
||||||
|
throw new UnsupportedCommandException(wrapper.commandName());
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
throw new UnsupportedCommandException(wrapper.commandName());
|
throw new UnsupportedCommandException(wrapper.commandName());
|
||||||
|
|||||||
+2
-2
@@ -417,9 +417,9 @@ public class TellerManagementReadPlatformServiceImpl implements TellerManagement
|
|||||||
startDate = cashierData.getStartDate();
|
startDate = cashierData.getStartDate();
|
||||||
endDate = cashierData.getEndDate();
|
endDate = cashierData.getEndDate();
|
||||||
}
|
}
|
||||||
//Fetching all currency type from m_organisation_currency table
|
// Fetching all currency type from m_organisation_currency table
|
||||||
final Collection<CurrencyData> currencyOptions = this.currencyReadPlatformService.retrieveAllowedCurrencies();
|
final Collection<CurrencyData> currencyOptions = this.currencyReadPlatformService.retrieveAllowedCurrencies();
|
||||||
|
|
||||||
return CashierTransactionData.template(cashierId, tellerId, tellerName, officeId, officeName, cashierName, cashierData, startDate,
|
return CashierTransactionData.template(cashierId, tellerId, tellerName, officeId, officeName, cashierName, cashierData, startDate,
|
||||||
endDate, currencyOptions);
|
endDate, currencyOptions);
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-23
@@ -5,11 +5,26 @@
|
|||||||
*/
|
*/
|
||||||
package org.mifosplatform.portfolio.loanaccount.api;
|
package org.mifosplatform.portfolio.loanaccount.api;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.ws.rs.Consumes;
|
||||||
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.POST;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.PathParam;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
|
import javax.ws.rs.QueryParam;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.mifosplatform.commands.domain.CommandWrapper;
|
import org.mifosplatform.commands.domain.CommandWrapper;
|
||||||
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
||||||
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
@@ -19,20 +34,12 @@ import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSeria
|
|||||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||||
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData;
|
import org.mifosplatform.portfolio.loanaccount.data.LoanTransactionData;
|
||||||
import org.mifosplatform.portfolio.loanaccount.service.LoanReadPlatformService;
|
import org.mifosplatform.portfolio.loanaccount.service.LoanReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.ws.rs.*;
|
|
||||||
import javax.ws.rs.core.Context;
|
|
||||||
import javax.ws.rs.core.MediaType;
|
|
||||||
import javax.ws.rs.core.UriInfo;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@Path("/loans/{loanId}/transactions")
|
@Path("/loans/{loanId}/transactions")
|
||||||
@Component
|
@Component
|
||||||
@Scope("singleton")
|
@Scope("singleton")
|
||||||
@@ -49,19 +56,21 @@ public class LoanTransactionsApiResource {
|
|||||||
private final DefaultToApiJsonSerializer<LoanTransactionData> toApiJsonSerializer;
|
private final DefaultToApiJsonSerializer<LoanTransactionData> toApiJsonSerializer;
|
||||||
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
|
||||||
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public LoanTransactionsApiResource(final PlatformSecurityContext context, final LoanReadPlatformService loanReadPlatformService,
|
public LoanTransactionsApiResource(final PlatformSecurityContext context, final LoanReadPlatformService loanReadPlatformService,
|
||||||
final ApiRequestParameterHelper apiRequestParameterHelper,
|
final ApiRequestParameterHelper apiRequestParameterHelper,
|
||||||
final DefaultToApiJsonSerializer<LoanTransactionData> toApiJsonSerializer,
|
final DefaultToApiJsonSerializer<LoanTransactionData> toApiJsonSerializer,
|
||||||
final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
|
final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
|
||||||
final CodeValueReadPlatformService codeValueReadPlatformService) {
|
final CodeValueReadPlatformService codeValueReadPlatformService, PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.loanReadPlatformService = loanReadPlatformService;
|
this.loanReadPlatformService = loanReadPlatformService;
|
||||||
this.apiRequestParameterHelper = apiRequestParameterHelper;
|
this.apiRequestParameterHelper = apiRequestParameterHelper;
|
||||||
this.toApiJsonSerializer = toApiJsonSerializer;
|
this.toApiJsonSerializer = toApiJsonSerializer;
|
||||||
this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
|
this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
|
||||||
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean is(final String commandParam, final String commandValue) {
|
private boolean is(final String commandParam, final String commandValue) {
|
||||||
@@ -96,14 +105,11 @@ public class LoanTransactionsApiResource {
|
|||||||
transactionData = this.loanReadPlatformService.retrieveRecoveryPaymentTemplate(loanId);
|
transactionData = this.loanReadPlatformService.retrieveRecoveryPaymentTemplate(loanId);
|
||||||
} else if (is(commandParam, "prepayLoan")) {
|
} else if (is(commandParam, "prepayLoan")) {
|
||||||
transactionData = this.loanReadPlatformService.retrieveLoanPrePaymentTemplate(loanId);
|
transactionData = this.loanReadPlatformService.retrieveLoanPrePaymentTemplate(loanId);
|
||||||
}
|
} else if (is(commandParam, "refundbycash")) {
|
||||||
else if (is(commandParam, "refundbycash")) {
|
|
||||||
transactionData = this.loanReadPlatformService.retrieveRefundByCashTemplate(loanId);
|
transactionData = this.loanReadPlatformService.retrieveRefundByCashTemplate(loanId);
|
||||||
}
|
} else if (is(commandParam, "refundbytransfer")) {
|
||||||
else if (is(commandParam, "refundbytransfer")) {
|
|
||||||
transactionData = this.loanReadPlatformService.retrieveDisbursalTemplate(loanId, true);
|
transactionData = this.loanReadPlatformService.retrieveDisbursalTemplate(loanId, true);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw new UnrecognizedQueryParamException("command", commandParam);
|
throw new UnrecognizedQueryParamException("command", commandParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,8 +129,7 @@ public class LoanTransactionsApiResource {
|
|||||||
LoanTransactionData transactionData = this.loanReadPlatformService.retrieveLoanTransaction(loanId, transactionId);
|
LoanTransactionData transactionData = this.loanReadPlatformService.retrieveLoanTransaction(loanId, transactionId);
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
if (settings.isTemplate()) {
|
if (settings.isTemplate()) {
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
transactionData = LoanTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
transactionData = LoanTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,11 +166,10 @@ public class LoanTransactionsApiResource {
|
|||||||
} else if (is(commandParam, "recoverypayment")) {
|
} else if (is(commandParam, "recoverypayment")) {
|
||||||
final CommandWrapper commandRequest = builder.loanRecoveryPaymentTransaction(loanId).build();
|
final CommandWrapper commandRequest = builder.loanRecoveryPaymentTransaction(loanId).build();
|
||||||
result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
}
|
} else if (is(commandParam, "refundByCash")) {
|
||||||
else if (is(commandParam, "refundByCash")) {
|
|
||||||
final CommandWrapper commandRequest = builder.refundLoanTransactionByCash(loanId).build();
|
final CommandWrapper commandRequest = builder.refundLoanTransactionByCash(loanId).build();
|
||||||
result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == null) { throw new UnrecognizedQueryParamException("command", commandParam); }
|
if (result == null) { throw new UnrecognizedQueryParamException("command", commandParam); }
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -9,10 +9,10 @@ import java.math.BigDecimal;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.portfolio.account.data.AccountTransferData;
|
import org.mifosplatform.portfolio.account.data.AccountTransferData;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immutable data object representing a loan transaction.
|
* Immutable data object representing a loan transaction.
|
||||||
@@ -47,10 +47,10 @@ public class LoanTransactionData {
|
|||||||
private final boolean manuallyReversed;
|
private final boolean manuallyReversed;
|
||||||
|
|
||||||
// templates
|
// templates
|
||||||
final Collection<CodeValueData> paymentTypeOptions;
|
final Collection<PaymentTypeData> paymentTypeOptions;
|
||||||
|
|
||||||
public static LoanTransactionData templateOnTop(final LoanTransactionData loanTransactionData,
|
public static LoanTransactionData templateOnTop(final LoanTransactionData loanTransactionData,
|
||||||
final Collection<CodeValueData> paymentTypeOptions) {
|
final Collection<PaymentTypeData> paymentTypeOptions) {
|
||||||
return new LoanTransactionData(loanTransactionData.id, loanTransactionData.officeId, loanTransactionData.officeName,
|
return new LoanTransactionData(loanTransactionData.id, loanTransactionData.officeId, loanTransactionData.officeName,
|
||||||
loanTransactionData.type, loanTransactionData.paymentDetailData, loanTransactionData.currency, loanTransactionData.date,
|
loanTransactionData.type, loanTransactionData.paymentDetailData, loanTransactionData.currency, loanTransactionData.date,
|
||||||
loanTransactionData.amount, loanTransactionData.principalPortion, loanTransactionData.interestPortion,
|
loanTransactionData.amount, loanTransactionData.principalPortion, loanTransactionData.interestPortion,
|
||||||
@@ -76,7 +76,7 @@ public class LoanTransactionData {
|
|||||||
final PaymentDetailData paymentDetailData, final CurrencyData currency, final LocalDate date, final BigDecimal amount,
|
final PaymentDetailData paymentDetailData, final CurrencyData currency, final LocalDate date, final BigDecimal amount,
|
||||||
final BigDecimal principalPortion, final BigDecimal interestPortion, final BigDecimal feeChargesPortion,
|
final BigDecimal principalPortion, final BigDecimal interestPortion, final BigDecimal feeChargesPortion,
|
||||||
final BigDecimal penaltyChargesPortion, final BigDecimal overpaymentPortion, BigDecimal unrecognizedIncomePortion,
|
final BigDecimal penaltyChargesPortion, final BigDecimal overpaymentPortion, BigDecimal unrecognizedIncomePortion,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final String externalId, final AccountTransferData transfer,
|
final Collection<PaymentTypeData> paymentTypeOptions, final String externalId, final AccountTransferData transfer,
|
||||||
final BigDecimal fixedEmiAmount, BigDecimal outstandingLoanBalance,boolean manuallyReversed) {
|
final BigDecimal fixedEmiAmount, BigDecimal outstandingLoanBalance,boolean manuallyReversed) {
|
||||||
this(id, officeId, officeName, transactionType, paymentDetailData, currency, date, amount, principalPortion, interestPortion,
|
this(id, officeId, officeName, transactionType, paymentDetailData, currency, date, amount, principalPortion, interestPortion,
|
||||||
feeChargesPortion, penaltyChargesPortion, overpaymentPortion, unrecognizedIncomePortion, paymentTypeOptions, externalId,
|
feeChargesPortion, penaltyChargesPortion, overpaymentPortion, unrecognizedIncomePortion, paymentTypeOptions, externalId,
|
||||||
@@ -98,7 +98,7 @@ public class LoanTransactionData {
|
|||||||
final PaymentDetailData paymentDetailData, final CurrencyData currency, final LocalDate date, final BigDecimal amount,
|
final PaymentDetailData paymentDetailData, final CurrencyData currency, final LocalDate date, final BigDecimal amount,
|
||||||
final BigDecimal principalPortion, final BigDecimal interestPortion, final BigDecimal feeChargesPortion,
|
final BigDecimal principalPortion, final BigDecimal interestPortion, final BigDecimal feeChargesPortion,
|
||||||
final BigDecimal penaltyChargesPortion, final BigDecimal overpaymentPortion, final BigDecimal unrecognizedIncomePortion,
|
final BigDecimal penaltyChargesPortion, final BigDecimal overpaymentPortion, final BigDecimal unrecognizedIncomePortion,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final String externalId, final AccountTransferData transfer,
|
final Collection<PaymentTypeData> paymentTypeOptions, final String externalId, final AccountTransferData transfer,
|
||||||
final BigDecimal fixedEmiAmount, BigDecimal outstandingLoanBalance, final LocalDate submittedOnDate,final boolean manuallyReversed) {
|
final BigDecimal fixedEmiAmount, BigDecimal outstandingLoanBalance, final LocalDate submittedOnDate,final boolean manuallyReversed) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.officeId = officeId;
|
this.officeId = officeId;
|
||||||
|
|||||||
+1
-1
@@ -91,7 +91,7 @@ public class DecliningBalanceInterestLoanScheduleGenerator extends AbstractLoanS
|
|||||||
Money interestForPeriod = interestForThisInstallment;
|
Money interestForPeriod = interestForThisInstallment;
|
||||||
if (interestForPeriod.isGreaterThanZero()) {
|
if (interestForPeriod.isGreaterThanZero()) {
|
||||||
interestForPeriod = interestForPeriod.minus(cumulatingInterestPaymentDueToGrace);
|
interestForPeriod = interestForPeriod.minus(cumulatingInterestPaymentDueToGrace);
|
||||||
}else{
|
} else {
|
||||||
interestForPeriod = result.interestPaymentDueToGrace().minus(cumulatingInterestPaymentDueToGrace);
|
interestForPeriod = result.interestPaymentDueToGrace().minus(cumulatingInterestPaymentDueToGrace);
|
||||||
}
|
}
|
||||||
Money principalForThisInstallment = loanApplicationTerms.calculateTotalPrincipalForPeriod(calculator,
|
Money principalForThisInstallment = loanApplicationTerms.calculateTotalPrincipalForPeriod(calculator,
|
||||||
|
|||||||
+2
@@ -271,6 +271,7 @@ public class LoanScheduleAssembler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final BigDecimal principalThresholdForLastInstalment = loanProduct.getPrincipalThresholdForLastInstallment();
|
final BigDecimal principalThresholdForLastInstalment = loanProduct.getPrincipalThresholdForLastInstallment();
|
||||||
|
|
||||||
final Integer installmentAmountInMultiplesOf = loanProduct.getInstallmentAmountInMultiplesOf();
|
final Integer installmentAmountInMultiplesOf = loanProduct.getInstallmentAmountInMultiplesOf();
|
||||||
|
|
||||||
return LoanApplicationTerms.assembleFrom(applicationCurrency, loanTermFrequency, loanTermPeriodFrequencyType, numberOfRepayments,
|
return LoanApplicationTerms.assembleFrom(applicationCurrency, loanTermFrequency, loanTermPeriodFrequencyType, numberOfRepayments,
|
||||||
@@ -463,6 +464,7 @@ public class LoanScheduleAssembler {
|
|||||||
|
|
||||||
return loanScheduleGenerator.calculatePrepaymentAmount(installments, currency, onDate, loanApplicationTerms, mc, loanCharges,
|
return loanScheduleGenerator.calculatePrepaymentAmount(installments, currency, onDate, loanApplicationTerms, mc, loanCharges,
|
||||||
holidayDetailDTO);
|
holidayDetailDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateDisbursementDateIsOnNonWorkingDay(final LocalDate disbursementDate, final WorkingDays workingDays) {
|
private void validateDisbursementDateIsOnNonWorkingDay(final LocalDate disbursementDate, final WorkingDays workingDays) {
|
||||||
|
|||||||
+16
-17
@@ -99,8 +99,9 @@ import org.mifosplatform.portfolio.loanproduct.data.TransactionProcessingStrateg
|
|||||||
import org.mifosplatform.portfolio.loanproduct.service.LoanDropdownReadPlatformService;
|
import org.mifosplatform.portfolio.loanproduct.service.LoanDropdownReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations;
|
import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations;
|
||||||
import org.mifosplatform.portfolio.loanproduct.service.LoanProductReadPlatformService;
|
import org.mifosplatform.portfolio.loanproduct.service.LoanProductReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
|
||||||
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.mifosplatform.useradministration.domain.AppUser;
|
import org.mifosplatform.useradministration.domain.AppUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
@@ -138,6 +139,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
private final HolidayRepository holidayRepository;
|
private final HolidayRepository holidayRepository;
|
||||||
private final ConfigurationDomainService configurationDomainService;
|
private final ConfigurationDomainService configurationDomainService;
|
||||||
private final WorkingDaysRepositoryWrapper workingDaysRepository;
|
private final WorkingDaysRepositoryWrapper workingDaysRepository;
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public LoanReadPlatformServiceImpl(final PlatformSecurityContext context, final LoanRepository loanRepository,
|
public LoanReadPlatformServiceImpl(final PlatformSecurityContext context, final LoanRepository loanRepository,
|
||||||
@@ -150,7 +152,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
final CalendarReadPlatformService calendarReadPlatformService, final StaffReadPlatformService staffReadPlatformService,
|
final CalendarReadPlatformService calendarReadPlatformService, final StaffReadPlatformService staffReadPlatformService,
|
||||||
final LoanScheduleGeneratorFactory loanScheduleFactory, final CalendarInstanceRepository calendarInstanceRepository,
|
final LoanScheduleGeneratorFactory loanScheduleFactory, final CalendarInstanceRepository calendarInstanceRepository,
|
||||||
final HolidayRepository holidayRepository, final ConfigurationDomainService configurationDomainService,
|
final HolidayRepository holidayRepository, final ConfigurationDomainService configurationDomainService,
|
||||||
final WorkingDaysRepositoryWrapper workingDaysRepository) {
|
final WorkingDaysRepositoryWrapper workingDaysRepository, PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.loanRepository = loanRepository;
|
this.loanRepository = loanRepository;
|
||||||
this.loanTransactionRepository = loanTransactionRepository;
|
this.loanTransactionRepository = loanTransactionRepository;
|
||||||
@@ -171,6 +173,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
this.holidayRepository = holidayRepository;
|
this.holidayRepository = holidayRepository;
|
||||||
this.configurationDomainService = configurationDomainService;
|
this.configurationDomainService = configurationDomainService;
|
||||||
this.workingDaysRepository = workingDaysRepository;
|
this.workingDaysRepository = workingDaysRepository;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -383,8 +386,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
|
|
||||||
final LoanRepaymentScheduleInstallment loanRepaymentScheduleInstallment = loan.possibleNextRepaymentInstallment();
|
final LoanRepaymentScheduleInstallment loanRepaymentScheduleInstallment = loan.possibleNextRepaymentInstallment();
|
||||||
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.REPAYMENT);
|
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.REPAYMENT);
|
||||||
final Collection<CodeValueData> paymentOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
final BigDecimal outstandingLoanBalance = null;
|
final BigDecimal outstandingLoanBalance = null;
|
||||||
final BigDecimal unrecognizedIncomePortion = null;
|
final BigDecimal unrecognizedIncomePortion = null;
|
||||||
return new LoanTransactionData(null, null, null, transactionType, null, currencyData, earliestUnpaidInstallmentDate,
|
return new LoanTransactionData(null, null, null, transactionType, null, currencyData, earliestUnpaidInstallmentDate,
|
||||||
@@ -425,8 +427,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
final LoanRepaymentScheduleInstallment loanRepaymentScheduleInstallment = loan.fetchPrepaymentDetail(this.loanScheduleFactory,
|
final LoanRepaymentScheduleInstallment loanRepaymentScheduleInstallment = loan.fetchPrepaymentDetail(this.loanScheduleFactory,
|
||||||
restCalendarInstance, holidayDetailDTO);
|
restCalendarInstance, holidayDetailDTO);
|
||||||
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.REPAYMENT);
|
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.REPAYMENT);
|
||||||
final Collection<CodeValueData> paymentOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
final BigDecimal outstandingLoanBalance = loanRepaymentScheduleInstallment.getPrincipalOutstanding(currency).getAmount();
|
final BigDecimal outstandingLoanBalance = loanRepaymentScheduleInstallment.getPrincipalOutstanding(currency).getAmount();
|
||||||
final BigDecimal unrecognizedIncomePortion = null;
|
final BigDecimal unrecognizedIncomePortion = null;
|
||||||
return new LoanTransactionData(null, null, null, transactionType, null, currencyData, earliestUnpaidInstallmentDate,
|
return new LoanTransactionData(null, null, null, transactionType, null, currencyData, earliestUnpaidInstallmentDate,
|
||||||
@@ -491,9 +492,9 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
final Loan loan = this.loanRepository.findOne(loanId);
|
final Loan loan = this.loanRepository.findOne(loanId);
|
||||||
if (loan == null) { throw new LoanNotFoundException(loanId); }
|
if (loan == null) { throw new LoanNotFoundException(loanId); }
|
||||||
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.DISBURSEMENT);
|
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.DISBURSEMENT);
|
||||||
Collection<CodeValueData> paymentOptions = null;
|
Collection<PaymentTypeData> paymentOptions = null;
|
||||||
if (paymentDetailsRequired) {
|
if (paymentDetailsRequired) {
|
||||||
paymentOptions = this.codeValueReadPlatformService.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
paymentOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
}
|
}
|
||||||
final BigDecimal outstandingLoanBalance = null;
|
final BigDecimal outstandingLoanBalance = null;
|
||||||
final BigDecimal unrecognizedIncomePortion = null;
|
final BigDecimal unrecognizedIncomePortion = null;
|
||||||
@@ -1135,11 +1136,11 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
+ " tr.unrecognized_income_portion as unrecognizedIncome,"
|
+ " tr.unrecognized_income_portion as unrecognizedIncome,"
|
||||||
+ " tr.submitted_on_date as submittedOnDate, "
|
+ " tr.submitted_on_date as submittedOnDate, "
|
||||||
+ " tr.manually_adjusted_or_reversed as manuallyReversed, "
|
+ " tr.manually_adjusted_or_reversed as manuallyReversed, "
|
||||||
+ " pd.payment_type_cv_id as paymentType,pd.account_number as accountNumber,pd.check_number as checkNumber, "
|
+ " pd.payment_type_id as paymentType,pd.account_number as accountNumber,pd.check_number as checkNumber, "
|
||||||
+ " pd.receipt_number as receiptNumber, pd.bank_number as bankNumber,pd.routing_code as routingCode, "
|
+ " pd.receipt_number as receiptNumber, pd.bank_number as bankNumber,pd.routing_code as routingCode, "
|
||||||
+ " l.currency_code as currencyCode, l.currency_digits as currencyDigits, l.currency_multiplesof as inMultiplesOf, rc.`name` as currencyName, "
|
+ " l.currency_code as currencyCode, l.currency_digits as currencyDigits, l.currency_multiplesof as inMultiplesOf, rc.`name` as currencyName, "
|
||||||
+ " rc.display_symbol as currencyDisplaySymbol, rc.internationalized_name_code as currencyNameCode, "
|
+ " rc.display_symbol as currencyDisplaySymbol, rc.internationalized_name_code as currencyNameCode, "
|
||||||
+ " cv.code_value as paymentTypeName, tr.external_id as externalId, tr.office_id as officeId, office.name as officeName, "
|
+ " pt.value as paymentTypeName, tr.external_id as externalId, tr.office_id as officeId, office.name as officeName, "
|
||||||
+ " fromtran.id as fromTransferId, fromtran.is_reversed as fromTransferReversed,"
|
+ " fromtran.id as fromTransferId, fromtran.is_reversed as fromTransferReversed,"
|
||||||
+ " fromtran.transaction_date as fromTransferDate, fromtran.amount as fromTransferAmount,"
|
+ " fromtran.transaction_date as fromTransferDate, fromtran.amount as fromTransferAmount,"
|
||||||
+ " fromtran.description as fromTransferDescription,"
|
+ " fromtran.description as fromTransferDescription,"
|
||||||
@@ -1148,8 +1149,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
+ " totran.description as toTransferDescription " + " from m_loan l join m_loan_transaction tr on tr.loan_id = l.id"
|
+ " totran.description as toTransferDescription " + " from m_loan l join m_loan_transaction tr on tr.loan_id = l.id"
|
||||||
+ " join m_currency rc on rc.`code` = l.currency_code "
|
+ " join m_currency rc on rc.`code` = l.currency_code "
|
||||||
+ " left JOIN m_payment_detail pd ON tr.payment_detail_id = pd.id"
|
+ " left JOIN m_payment_detail pd ON tr.payment_detail_id = pd.id"
|
||||||
+ " left join m_code_value cv on pd.payment_type_cv_id = cv.id"
|
+ " left join m_payment_type pt on pd.payment_type_id = pt.id" + " left join m_office office on office.id=tr.office_id"
|
||||||
+ " left join m_office office on office.id=tr.office_id"
|
|
||||||
+ " left join m_account_transfer_transaction fromtran on fromtran.from_loan_transaction_id = tr.id "
|
+ " left join m_account_transfer_transaction fromtran on fromtran.from_loan_transaction_id = tr.id "
|
||||||
+ " left join m_account_transfer_transaction totran on totran.to_loan_transaction_id = tr.id ";
|
+ " left join m_account_transfer_transaction totran on totran.to_loan_transaction_id = tr.id ";
|
||||||
}
|
}
|
||||||
@@ -1179,7 +1179,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentType");
|
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentType");
|
||||||
if (paymentTypeId != null) {
|
if (paymentTypeId != null) {
|
||||||
final String typeName = rs.getString("paymentTypeName");
|
final String typeName = rs.getString("paymentTypeName");
|
||||||
final CodeValueData paymentType = CodeValueData.instance(paymentTypeId, typeName);
|
final PaymentTypeData paymentType = PaymentTypeData.instance(paymentTypeId, typeName);
|
||||||
final String accountNumber = rs.getString("accountNumber");
|
final String accountNumber = rs.getString("accountNumber");
|
||||||
final String checkNumber = rs.getString("checkNumber");
|
final String checkNumber = rs.getString("checkNumber");
|
||||||
final String routingCode = rs.getString("routingCode");
|
final String routingCode = rs.getString("routingCode");
|
||||||
@@ -1642,8 +1642,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
final Loan loan = this.loanRepository.findOne(loanId);
|
final Loan loan = this.loanRepository.findOne(loanId);
|
||||||
if (loan == null) { throw new LoanNotFoundException(loanId); }
|
if (loan == null) { throw new LoanNotFoundException(loanId); }
|
||||||
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.RECOVERY_REPAYMENT);
|
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.RECOVERY_REPAYMENT);
|
||||||
final Collection<CodeValueData> paymentOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
BigDecimal outstandingLoanBalance = null;
|
BigDecimal outstandingLoanBalance = null;
|
||||||
final BigDecimal unrecognizedIncomePortion = null;
|
final BigDecimal unrecognizedIncomePortion = null;
|
||||||
return new LoanTransactionData(null, null, null, transactionType, null, null, null, loan.getTotalWrittenOff(), null, null, null,
|
return new LoanTransactionData(null, null, null, transactionType, null, null, null, loan.getTotalWrittenOff(), null, null, null,
|
||||||
@@ -1866,8 +1865,8 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
|||||||
final LocalDate earliestUnpaidInstallmentDate = new LocalDate();
|
final LocalDate earliestUnpaidInstallmentDate = new LocalDate();
|
||||||
|
|
||||||
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.REFUND_FOR_ACTIVE_LOAN);
|
final LoanTransactionEnumData transactionType = LoanEnumerations.transactionType(LoanTransactionType.REFUND_FOR_ACTIVE_LOAN);
|
||||||
final Collection<CodeValueData> paymentOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
return new LoanTransactionData(null, null, null, transactionType, null, currencyData, earliestUnpaidInstallmentDate,
|
return new LoanTransactionData(null, null, null, transactionType, null, currencyData, earliestUnpaidInstallmentDate,
|
||||||
retrieveTotalPaidInAdvance(loan.getId()).getPaidInAdvance(), null, null, null, null, null, null, paymentOptions, null,
|
retrieveTotalPaidInAdvance(loan.getId()).getPaidInAdvance(), null, null, null, null, null, null, paymentOptions, null,
|
||||||
null, null, null, false);
|
null, null, null, false);
|
||||||
|
|||||||
+9
-6
@@ -32,7 +32,6 @@ import org.mifosplatform.accounting.producttoaccountmapping.service.ProductToGLA
|
|||||||
import org.mifosplatform.commands.domain.CommandWrapper;
|
import org.mifosplatform.commands.domain.CommandWrapper;
|
||||||
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
||||||
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
@@ -54,7 +53,8 @@ import org.mifosplatform.portfolio.loanproduct.productmix.data.ProductMixData;
|
|||||||
import org.mifosplatform.portfolio.loanproduct.productmix.service.ProductMixReadPlatformService;
|
import org.mifosplatform.portfolio.loanproduct.productmix.service.ProductMixReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.loanproduct.service.LoanDropdownReadPlatformService;
|
import org.mifosplatform.portfolio.loanproduct.service.LoanDropdownReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.loanproduct.service.LoanProductReadPlatformService;
|
import org.mifosplatform.portfolio.loanproduct.service.LoanProductReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -96,6 +96,7 @@ public class LoanProductsApiResource {
|
|||||||
private final DefaultToApiJsonSerializer<ProductMixData> productMixDataApiJsonSerializer;
|
private final DefaultToApiJsonSerializer<ProductMixData> productMixDataApiJsonSerializer;
|
||||||
private final ProductMixReadPlatformService productMixReadPlatformService;
|
private final ProductMixReadPlatformService productMixReadPlatformService;
|
||||||
private final DropdownReadPlatformService commonDropdownReadPlatformService;
|
private final DropdownReadPlatformService commonDropdownReadPlatformService;
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public LoanProductsApiResource(final PlatformSecurityContext context, final LoanProductReadPlatformService readPlatformService,
|
public LoanProductsApiResource(final PlatformSecurityContext context, final LoanProductReadPlatformService readPlatformService,
|
||||||
@@ -109,7 +110,8 @@ public class LoanProductsApiResource {
|
|||||||
final AccountingDropdownReadPlatformService accountingDropdownReadPlatformService,
|
final AccountingDropdownReadPlatformService accountingDropdownReadPlatformService,
|
||||||
final DefaultToApiJsonSerializer<ProductMixData> productMixDataApiJsonSerializer,
|
final DefaultToApiJsonSerializer<ProductMixData> productMixDataApiJsonSerializer,
|
||||||
final ProductMixReadPlatformService productMixReadPlatformService,
|
final ProductMixReadPlatformService productMixReadPlatformService,
|
||||||
final DropdownReadPlatformService commonDropdownReadPlatformService) {
|
final DropdownReadPlatformService commonDropdownReadPlatformService,
|
||||||
|
PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.loanProductReadPlatformService = readPlatformService;
|
this.loanProductReadPlatformService = readPlatformService;
|
||||||
this.chargeReadPlatformService = chargeReadPlatformService;
|
this.chargeReadPlatformService = chargeReadPlatformService;
|
||||||
@@ -125,6 +127,7 @@ public class LoanProductsApiResource {
|
|||||||
this.productMixDataApiJsonSerializer = productMixDataApiJsonSerializer;
|
this.productMixDataApiJsonSerializer = productMixDataApiJsonSerializer;
|
||||||
this.productMixReadPlatformService = productMixReadPlatformService;
|
this.productMixReadPlatformService = productMixReadPlatformService;
|
||||||
this.commonDropdownReadPlatformService = commonDropdownReadPlatformService;
|
this.commonDropdownReadPlatformService = commonDropdownReadPlatformService;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@@ -205,7 +208,8 @@ public class LoanProductsApiResource {
|
|||||||
.accountingRuleType().getId().intValue());
|
.accountingRuleType().getId().intValue());
|
||||||
paymentChannelToFundSourceMappings = this.accountMappingReadPlatformService
|
paymentChannelToFundSourceMappings = this.accountMappingReadPlatformService
|
||||||
.fetchPaymentTypeToFundSourceMappingsForLoanProduct(productId);
|
.fetchPaymentTypeToFundSourceMappingsForLoanProduct(productId);
|
||||||
feeToGLAccountMappings = this.accountMappingReadPlatformService.fetchFeeToIncomeOrLiabilityAccountMappingsForLoanProduct(productId);
|
feeToGLAccountMappings = this.accountMappingReadPlatformService
|
||||||
|
.fetchFeeToIncomeOrLiabilityAccountMappingsForLoanProduct(productId);
|
||||||
penaltyToGLAccountMappings = this.accountMappingReadPlatformService
|
penaltyToGLAccountMappings = this.accountMappingReadPlatformService
|
||||||
.fetchPenaltyToIncomeAccountMappingsForLoanProduct(productId);
|
.fetchPenaltyToIncomeAccountMappingsForLoanProduct(productId);
|
||||||
loanProduct = LoanProductData.withAccountingDetails(loanProduct, accountingMappings, paymentChannelToFundSourceMappings,
|
loanProduct = LoanProductData.withAccountingDetails(loanProduct, accountingMappings, paymentChannelToFundSourceMappings,
|
||||||
@@ -252,8 +256,7 @@ public class LoanProductsApiResource {
|
|||||||
final List<EnumOptionData> repaymentFrequencyTypeOptions = this.dropdownReadPlatformService.retrieveRepaymentFrequencyTypeOptions();
|
final List<EnumOptionData> repaymentFrequencyTypeOptions = this.dropdownReadPlatformService.retrieveRepaymentFrequencyTypeOptions();
|
||||||
final List<EnumOptionData> interestRateFrequencyTypeOptions = this.dropdownReadPlatformService
|
final List<EnumOptionData> interestRateFrequencyTypeOptions = this.dropdownReadPlatformService
|
||||||
.retrieveInterestRateFrequencyTypeOptions();
|
.retrieveInterestRateFrequencyTypeOptions();
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
|
|
||||||
Collection<FundData> fundOptions = this.fundReadPlatformService.retrieveAllFunds();
|
Collection<FundData> fundOptions = this.fundReadPlatformService.retrieveAllFunds();
|
||||||
if (fundOptions.isEmpty()) {
|
if (fundOptions.isEmpty()) {
|
||||||
|
|||||||
+3
-3
@@ -17,7 +17,6 @@ import org.mifosplatform.accounting.common.AccountingRuleType;
|
|||||||
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.portfolio.calendar.data.CalendarData;
|
import org.mifosplatform.portfolio.calendar.data.CalendarData;
|
||||||
@@ -32,6 +31,7 @@ import org.mifosplatform.portfolio.loanproduct.domain.AmortizationMethod;
|
|||||||
import org.mifosplatform.portfolio.loanproduct.domain.InterestCalculationPeriodMethod;
|
import org.mifosplatform.portfolio.loanproduct.domain.InterestCalculationPeriodMethod;
|
||||||
import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod;
|
import org.mifosplatform.portfolio.loanproduct.domain.InterestMethod;
|
||||||
import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations;
|
import org.mifosplatform.portfolio.loanproduct.service.LoanEnumerations;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,7 +103,7 @@ public class LoanProductData {
|
|||||||
// template related
|
// template related
|
||||||
private final Collection<FundData> fundOptions;
|
private final Collection<FundData> fundOptions;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final Collection<CodeValueData> paymentTypeOptions;
|
private final Collection<PaymentTypeData> paymentTypeOptions;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final Collection<CurrencyData> currencyOptions;
|
private final Collection<CurrencyData> currencyOptions;
|
||||||
private final List<EnumOptionData> repaymentFrequencyTypeOptions;
|
private final List<EnumOptionData> repaymentFrequencyTypeOptions;
|
||||||
@@ -483,7 +483,7 @@ public class LoanProductData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public LoanProductData(final LoanProductData productData, final Collection<ChargeData> chargeOptions,
|
public LoanProductData(final LoanProductData productData, final Collection<ChargeData> chargeOptions,
|
||||||
final Collection<ChargeData> penaltyOptions, final Collection<CodeValueData> paymentTypeOptions,
|
final Collection<ChargeData> penaltyOptions, final Collection<PaymentTypeData> paymentTypeOptions,
|
||||||
final Collection<CurrencyData> currencyOptions, final List<EnumOptionData> amortizationTypeOptions,
|
final Collection<CurrencyData> currencyOptions, final List<EnumOptionData> amortizationTypeOptions,
|
||||||
final List<EnumOptionData> interestTypeOptions, final List<EnumOptionData> interestCalculationPeriodTypeOptions,
|
final List<EnumOptionData> interestTypeOptions, final List<EnumOptionData> interestCalculationPeriodTypeOptions,
|
||||||
final List<EnumOptionData> repaymentFrequencyTypeOptions, final List<EnumOptionData> interestRateFrequencyTypeOptions,
|
final List<EnumOptionData> repaymentFrequencyTypeOptions, final List<EnumOptionData> interestRateFrequencyTypeOptions,
|
||||||
|
|||||||
+5
-3
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.mifosplatform.portfolio.paymentdetail.data;
|
package org.mifosplatform.portfolio.paymentdetail.data;
|
||||||
|
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immutable data object representing a payment.
|
* Immutable data object representing a payment.
|
||||||
@@ -15,7 +15,7 @@ public class PaymentDetailData {
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final Long id;
|
private final Long id;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final CodeValueData paymentType;
|
private final PaymentTypeData paymentType;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final String accountNumber;
|
private final String accountNumber;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@@ -27,7 +27,7 @@ public class PaymentDetailData {
|
|||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final String bankNumber;
|
private final String bankNumber;
|
||||||
|
|
||||||
public PaymentDetailData(final Long id, final CodeValueData paymentType, final String accountNumber, final String checkNumber,
|
public PaymentDetailData(final Long id, final PaymentTypeData paymentType, final String accountNumber, final String checkNumber,
|
||||||
final String routingCode, final String receiptNumber, final String bankNumber) {
|
final String routingCode, final String receiptNumber, final String bankNumber) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.paymentType = paymentType;
|
this.paymentType = paymentType;
|
||||||
@@ -37,5 +37,7 @@ public class PaymentDetailData {
|
|||||||
this.receiptNumber = receiptNumber;
|
this.receiptNumber = receiptNumber;
|
||||||
this.bankNumber = bankNumber;
|
this.bankNumber = bankNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
+9
-9
@@ -14,11 +14,11 @@ import javax.persistence.ManyToOne;
|
|||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.domain.CodeValue;
|
|
||||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentType;
|
||||||
import org.springframework.data.jpa.domain.AbstractPersistable;
|
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@@ -26,8 +26,8 @@ import org.springframework.data.jpa.domain.AbstractPersistable;
|
|||||||
public final class PaymentDetail extends AbstractPersistable<Long> {
|
public final class PaymentDetail extends AbstractPersistable<Long> {
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "payment_type_cv_id", nullable = false)
|
@JoinColumn(name = "payment_type_id", nullable = false)
|
||||||
private CodeValue paymentType;
|
private PaymentType paymentType;
|
||||||
|
|
||||||
@Column(name = "account_number", length = 50)
|
@Column(name = "account_number", length = 50)
|
||||||
private String accountNumber;
|
private String accountNumber;
|
||||||
@@ -48,7 +48,7 @@ public final class PaymentDetail extends AbstractPersistable<Long> {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PaymentDetail generatePaymentDetail(final CodeValue paymentType, final JsonCommand command,
|
public static PaymentDetail generatePaymentDetail(final PaymentType paymentType, final JsonCommand command,
|
||||||
final Map<String, Object> changes) {
|
final Map<String, Object> changes) {
|
||||||
final String accountNumber = command.stringValueOfParameterNamed(PaymentDetailConstants.accountNumberParamName);
|
final String accountNumber = command.stringValueOfParameterNamed(PaymentDetailConstants.accountNumberParamName);
|
||||||
final String checkNumber = command.stringValueOfParameterNamed(PaymentDetailConstants.checkNumberParamName);
|
final String checkNumber = command.stringValueOfParameterNamed(PaymentDetailConstants.checkNumberParamName);
|
||||||
@@ -76,12 +76,12 @@ public final class PaymentDetail extends AbstractPersistable<Long> {
|
|||||||
return paymentDetail;
|
return paymentDetail;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PaymentDetail instance(final CodeValue paymentType, final String accountNumber, final String checkNumber,
|
public static PaymentDetail instance(final PaymentType paymentType, final String accountNumber, final String checkNumber,
|
||||||
final String routingCode, final String receiptNumber, final String bankNumber) {
|
final String routingCode, final String receiptNumber, final String bankNumber) {
|
||||||
return new PaymentDetail(paymentType, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber);
|
return new PaymentDetail(paymentType, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PaymentDetail(final CodeValue paymentType, final String accountNumber, final String checkNumber, final String routingCode,
|
private PaymentDetail(final PaymentType paymentType, final String accountNumber, final String checkNumber, final String routingCode,
|
||||||
final String receiptNumber, final String bankNumber) {
|
final String receiptNumber, final String bankNumber) {
|
||||||
this.paymentType = paymentType;
|
this.paymentType = paymentType;
|
||||||
this.accountNumber = accountNumber;
|
this.accountNumber = accountNumber;
|
||||||
@@ -92,13 +92,13 @@ public final class PaymentDetail extends AbstractPersistable<Long> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PaymentDetailData toData() {
|
public PaymentDetailData toData() {
|
||||||
final CodeValueData paymentTypeData = this.paymentType.toData();
|
final PaymentTypeData paymentTypeData = this.paymentType.toData();
|
||||||
final PaymentDetailData paymentDetailData = new PaymentDetailData(getId(), paymentTypeData, this.accountNumber, this.checkNumber,
|
final PaymentDetailData paymentDetailData = new PaymentDetailData(getId(), paymentTypeData, this.accountNumber, this.checkNumber,
|
||||||
this.routingCode, this.receiptNumber, this.bankNumber);
|
this.routingCode, this.receiptNumber, this.bankNumber);
|
||||||
return paymentDetailData;
|
return paymentDetailData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CodeValue getPaymentType() {
|
public PaymentType getPaymentType() {
|
||||||
return this.paymentType;
|
return this.paymentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-7
@@ -5,10 +5,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.mifosplatform.portfolio.paymentdetail.domain;
|
package org.mifosplatform.portfolio.paymentdetail.domain;
|
||||||
|
|
||||||
import org.mifosplatform.infrastructure.codes.domain.CodeValue;
|
|
||||||
import org.mifosplatform.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
|
||||||
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentType;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentTypeRepositoryWrapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -18,20 +18,19 @@ import com.google.gson.JsonObject;
|
|||||||
public class PaymentDetailAssembler {
|
public class PaymentDetailAssembler {
|
||||||
|
|
||||||
private final FromJsonHelper fromApiJsonHelper;
|
private final FromJsonHelper fromApiJsonHelper;
|
||||||
private final CodeValueRepositoryWrapper codeValueRepositoryWrapper;
|
private final PaymentTypeRepositoryWrapper repositoryWrapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public PaymentDetailAssembler(final FromJsonHelper fromApiJsonHelper, final CodeValueRepositoryWrapper codeValueRepositoryWrapper) {
|
public PaymentDetailAssembler(final FromJsonHelper fromApiJsonHelper, final PaymentTypeRepositoryWrapper repositoryWrapper) {
|
||||||
this.fromApiJsonHelper = fromApiJsonHelper;
|
this.fromApiJsonHelper = fromApiJsonHelper;
|
||||||
this.codeValueRepositoryWrapper = codeValueRepositoryWrapper;
|
this.repositoryWrapper = repositoryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PaymentDetail fetchPaymentDetail(final JsonObject json) {
|
public PaymentDetail fetchPaymentDetail(final JsonObject json) {
|
||||||
final Long paymentTypeId = this.fromApiJsonHelper.extractLongNamed(PaymentDetailConstants.paymentTypeParamName, json);
|
final Long paymentTypeId = this.fromApiJsonHelper.extractLongNamed(PaymentDetailConstants.paymentTypeParamName, json);
|
||||||
if (paymentTypeId == null) { return null; }
|
if (paymentTypeId == null) { return null; }
|
||||||
|
|
||||||
final CodeValue paymentType = this.codeValueRepositoryWrapper.findOneByCodeNameAndIdWithNotFoundDetection(
|
final PaymentType paymentType = this.repositoryWrapper.findOneWithNotFoundDetection(paymentTypeId);
|
||||||
PaymentDetailConstants.paymentTypeCodeName, paymentTypeId);
|
|
||||||
|
|
||||||
final String accountNumber = this.fromApiJsonHelper.extractStringNamed(PaymentDetailConstants.accountNumberParamName, json);
|
final String accountNumber = this.fromApiJsonHelper.extractStringNamed(PaymentDetailConstants.accountNumberParamName, json);
|
||||||
final String checkNumber = this.fromApiJsonHelper.extractStringNamed(PaymentDetailConstants.checkNumberParamName, json);
|
final String checkNumber = this.fromApiJsonHelper.extractStringNamed(PaymentDetailConstants.checkNumberParamName, json);
|
||||||
|
|||||||
+7
-7
@@ -7,12 +7,12 @@ package org.mifosplatform.portfolio.paymentdetail.service;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.mifosplatform.infrastructure.codes.domain.CodeValue;
|
|
||||||
import org.mifosplatform.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
|
||||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.domain.PaymentDetail;
|
import org.mifosplatform.portfolio.paymentdetail.domain.PaymentDetail;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.domain.PaymentDetailRepository;
|
import org.mifosplatform.portfolio.paymentdetail.domain.PaymentDetailRepository;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentType;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentTypeRepositoryWrapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -21,13 +21,14 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class PaymentDetailWritePlatformServiceJpaRepositoryImpl implements PaymentDetailWritePlatformService {
|
public class PaymentDetailWritePlatformServiceJpaRepositoryImpl implements PaymentDetailWritePlatformService {
|
||||||
|
|
||||||
private final PaymentDetailRepository paymentDetailRepository;
|
private final PaymentDetailRepository paymentDetailRepository;
|
||||||
private final CodeValueRepositoryWrapper codeValueRepositoryWrapper;
|
// private final CodeValueRepositoryWrapper codeValueRepositoryWrapper;
|
||||||
|
private final PaymentTypeRepositoryWrapper paymentTyperepositoryWrapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public PaymentDetailWritePlatformServiceJpaRepositoryImpl(final PaymentDetailRepository paymentDetailRepository,
|
public PaymentDetailWritePlatformServiceJpaRepositoryImpl(final PaymentDetailRepository paymentDetailRepository,
|
||||||
final CodeValueRepositoryWrapper codeValueRepositoryWrapper) {
|
final PaymentTypeRepositoryWrapper paymentTyperepositoryWrapper) {
|
||||||
this.paymentDetailRepository = paymentDetailRepository;
|
this.paymentDetailRepository = paymentDetailRepository;
|
||||||
this.codeValueRepositoryWrapper = codeValueRepositoryWrapper;
|
this.paymentTyperepositoryWrapper = paymentTyperepositoryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -35,8 +36,7 @@ public class PaymentDetailWritePlatformServiceJpaRepositoryImpl implements Payme
|
|||||||
final Long paymentTypeId = command.longValueOfParameterNamed(PaymentDetailConstants.paymentTypeParamName);
|
final Long paymentTypeId = command.longValueOfParameterNamed(PaymentDetailConstants.paymentTypeParamName);
|
||||||
if (paymentTypeId == null) { return null; }
|
if (paymentTypeId == null) { return null; }
|
||||||
|
|
||||||
final CodeValue paymentType = this.codeValueRepositoryWrapper.findOneByCodeNameAndIdWithNotFoundDetection(
|
final PaymentType paymentType = this.paymentTyperepositoryWrapper.findOneWithNotFoundDetection(paymentTypeId);
|
||||||
PaymentDetailConstants.paymentTypeCodeName, paymentTypeId);
|
|
||||||
final PaymentDetail paymentDetail = PaymentDetail.generatePaymentDetail(paymentType, command, changes);
|
final PaymentDetail paymentDetail = PaymentDetail.generatePaymentDetail(paymentType, command, changes);
|
||||||
return paymentDetail;
|
return paymentDetail;
|
||||||
|
|
||||||
|
|||||||
+123
@@ -0,0 +1,123 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.api;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.ws.rs.Consumes;
|
||||||
|
import javax.ws.rs.DELETE;
|
||||||
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.POST;
|
||||||
|
import javax.ws.rs.PUT;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.PathParam;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
|
import org.mifosplatform.commands.domain.CommandWrapper;
|
||||||
|
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
||||||
|
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||||
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
|
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||||
|
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||||
|
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Path("/paymenttype")
|
||||||
|
@Component
|
||||||
|
public class PaymentTypeApiResource {
|
||||||
|
|
||||||
|
private final PlatformSecurityContext securityContext;
|
||||||
|
private final DefaultToApiJsonSerializer<PaymentTypeData> jsonSerializer;
|
||||||
|
private final PaymentTypeReadPlatformService readPlatformService;
|
||||||
|
private final PortfolioCommandSourceWritePlatformService commandWritePlatformService;
|
||||||
|
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
||||||
|
private final String resourceNameForPermissions = "PAYMENT_TYPE";
|
||||||
|
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "value", "description", "isCashPayment"));
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public PaymentTypeApiResource(PlatformSecurityContext securityContext, DefaultToApiJsonSerializer<PaymentTypeData> jsonSerializer,
|
||||||
|
PaymentTypeReadPlatformService readPlatformService, ApiRequestParameterHelper apiRequestParameterHelper,
|
||||||
|
PortfolioCommandSourceWritePlatformService commandWritePlatformService) {
|
||||||
|
super();
|
||||||
|
this.securityContext = securityContext;
|
||||||
|
this.jsonSerializer = jsonSerializer;
|
||||||
|
this.readPlatformService = readPlatformService;
|
||||||
|
this.apiRequestParameterHelper = apiRequestParameterHelper;
|
||||||
|
this.commandWritePlatformService = commandWritePlatformService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String getAllPaymentTypes(@Context final UriInfo uriInfo) {
|
||||||
|
this.securityContext.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
final Collection<PaymentTypeData> paymentTypes = this.readPlatformService.retrieveAllPaymentTypes();
|
||||||
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
|
return this.jsonSerializer.serialize(settings, paymentTypes, this.RESPONSE_DATA_PARAMETERS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("{paymentTypeId}")
|
||||||
|
@Consumes({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String retrieveOnePaymentType(@PathParam("paymentTypeId") final Long paymentTypeId,@Context final UriInfo uriInfo) {
|
||||||
|
this.securityContext.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||||
|
final PaymentTypeData paymentTypes = this.readPlatformService.retrieveOne(paymentTypeId);
|
||||||
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
|
return this.jsonSerializer.serialize(settings, paymentTypes, this.RESPONSE_DATA_PARAMETERS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@POST
|
||||||
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
|
public String createPaymentType(final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().createPaymentType().withJson(apiRequestBodyAsJson).build();
|
||||||
|
|
||||||
|
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(commandRequest);
|
||||||
|
|
||||||
|
return this.jsonSerializer.serialize(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PUT
|
||||||
|
@Path("{paymentTypeId}")
|
||||||
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
|
public String updatePaymentType(@PathParam("paymentTypeId") final Long paymentTypeId, final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().updatePaymentType(paymentTypeId).withJson(apiRequestBodyAsJson)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(commandRequest);
|
||||||
|
|
||||||
|
return this.jsonSerializer.serialize(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DELETE
|
||||||
|
@Path("{paymentTypeId}")
|
||||||
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
|
public String deleteCode(@PathParam("paymentTypeId") final Long paymentTypeId) {
|
||||||
|
|
||||||
|
final CommandWrapper commandRequest = new CommandWrapperBuilder().deletePaymentType(paymentTypeId).build();
|
||||||
|
|
||||||
|
final CommandProcessingResult result = this.commandWritePlatformService.logCommandSource(commandRequest);
|
||||||
|
|
||||||
|
return this.jsonSerializer.serialize(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.api;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class PaymentTypeApiResourceConstants {
|
||||||
|
|
||||||
|
public static final String resourceNameForPermissions = "PAYMENTTYPE";
|
||||||
|
public static final String ID = "id";
|
||||||
|
public static final String NAME = "name";
|
||||||
|
public static final String DESCRIPTION = "description";
|
||||||
|
public static final String ISCASHPAYMENT = "isCashPayment";
|
||||||
|
public static final String POSITION = "position";
|
||||||
|
|
||||||
|
public final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList(ID, NAME, DESCRIPTION, ISCASHPAYMENT));
|
||||||
|
|
||||||
|
public static final Set<String> CREATE_PAYMENT_TYPE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(NAME, DESCRIPTION,
|
||||||
|
ISCASHPAYMENT, POSITION));
|
||||||
|
|
||||||
|
public static final Set<String> UPDATE_PAYMENT_TYPE_REQUEST_DATA_PARAMETERS = new HashSet<>(Arrays.asList(NAME, DESCRIPTION,
|
||||||
|
ISCASHPAYMENT, POSITION));
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.data;
|
||||||
|
|
||||||
|
public class PaymentTypeData {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private Long id;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private String name;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private String description;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private Boolean isCashPayment;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private Long position;
|
||||||
|
|
||||||
|
public PaymentTypeData(final Long id, final String name, final String description, final Boolean isCashPayment, final Long position) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.isCashPayment = isCashPayment;
|
||||||
|
this.position = position;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PaymentTypeData instance(final Long id, final String name, final String description, final Boolean isCashPayment,
|
||||||
|
final Long position) {
|
||||||
|
return new PaymentTypeData(id, name, description, isCashPayment, position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PaymentTypeData instance(final Long id, final String name) {
|
||||||
|
String description = null;
|
||||||
|
Boolean isCashPayment = null;
|
||||||
|
Long position = null;
|
||||||
|
return new PaymentTypeData(id, name, description, isCashPayment, position);
|
||||||
|
}
|
||||||
|
}
|
||||||
+121
@@ -0,0 +1,121 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.data;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.mifosplatform.infrastructure.core.data.ApiParameterError;
|
||||||
|
import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder;
|
||||||
|
import org.mifosplatform.infrastructure.core.exception.InvalidJsonException;
|
||||||
|
import org.mifosplatform.infrastructure.core.exception.PlatformApiDataValidationException;
|
||||||
|
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.api.PaymentTypeApiResourceConstants;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class PaymentTypeDataValidator {
|
||||||
|
|
||||||
|
private final FromJsonHelper fromApiJsonHelper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public PaymentTypeDataValidator(final FromJsonHelper fromApiJsonHelper) {
|
||||||
|
this.fromApiJsonHelper = fromApiJsonHelper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void validateForCreate(final String json) {
|
||||||
|
|
||||||
|
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
||||||
|
|
||||||
|
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||||
|
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
|
||||||
|
PaymentTypeApiResourceConstants.CREATE_PAYMENT_TYPE_REQUEST_DATA_PARAMETERS);
|
||||||
|
final JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||||
|
|
||||||
|
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||||
|
|
||||||
|
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
|
||||||
|
.resource(PaymentTypeApiResourceConstants.resourceNameForPermissions);
|
||||||
|
|
||||||
|
if (this.fromApiJsonHelper.parameterExists(PaymentTypeApiResourceConstants.NAME, element)) {
|
||||||
|
final String name = this.fromApiJsonHelper.extractStringNamed(PaymentTypeApiResourceConstants.NAME, element);
|
||||||
|
baseDataValidator.reset().parameter(PaymentTypeApiResourceConstants.NAME).value(name).notBlank();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.fromApiJsonHelper.parameterExists(PaymentTypeApiResourceConstants.DESCRIPTION, element)) {
|
||||||
|
final String description = this.fromApiJsonHelper.extractStringNamed(PaymentTypeApiResourceConstants.DESCRIPTION, element);
|
||||||
|
baseDataValidator.reset().parameter(PaymentTypeApiResourceConstants.DESCRIPTION).value(description).notExceedingLengthOf(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.fromApiJsonHelper.parameterExists(PaymentTypeApiResourceConstants.ISCASHPAYMENT, element)) {
|
||||||
|
final Boolean isCashPayment = this.fromApiJsonHelper
|
||||||
|
.extractBooleanNamed(PaymentTypeApiResourceConstants.ISCASHPAYMENT, element);
|
||||||
|
baseDataValidator.reset().parameter(PaymentTypeApiResourceConstants.ISCASHPAYMENT).value(isCashPayment);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.fromApiJsonHelper.parameterExists(PaymentTypeApiResourceConstants.POSITION, element)) {
|
||||||
|
final Long position = this.fromApiJsonHelper.extractLongNamed(PaymentTypeApiResourceConstants.POSITION, element);
|
||||||
|
baseDataValidator.reset().parameter(PaymentTypeApiResourceConstants.POSITION).value(position).ignoreIfNull()
|
||||||
|
.integerZeroOrGreater();
|
||||||
|
}
|
||||||
|
|
||||||
|
throwExceptionIfValidationWarningsExist(dataValidationErrors);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void throwExceptionIfValidationWarningsExist(final List<ApiParameterError> dataValidationErrors) {
|
||||||
|
if (!dataValidationErrors.isEmpty()) {
|
||||||
|
//
|
||||||
|
throw new PlatformApiDataValidationException(dataValidationErrors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void validateForUpdate(final String json) {
|
||||||
|
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
||||||
|
|
||||||
|
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||||
|
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json,
|
||||||
|
PaymentTypeApiResourceConstants.UPDATE_PAYMENT_TYPE_REQUEST_DATA_PARAMETERS);
|
||||||
|
|
||||||
|
final JsonElement element = this.fromApiJsonHelper.parse(json);
|
||||||
|
|
||||||
|
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||||
|
|
||||||
|
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
|
||||||
|
.resource(PaymentTypeApiResourceConstants.resourceNameForPermissions);
|
||||||
|
|
||||||
|
if (this.fromApiJsonHelper.parameterExists(PaymentTypeApiResourceConstants.NAME, element)) {
|
||||||
|
final String name = this.fromApiJsonHelper.extractStringNamed(PaymentTypeApiResourceConstants.NAME, element);
|
||||||
|
baseDataValidator.reset().parameter(PaymentTypeApiResourceConstants.NAME).value(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.fromApiJsonHelper.parameterExists(PaymentTypeApiResourceConstants.DESCRIPTION, element)) {
|
||||||
|
final String description = this.fromApiJsonHelper.extractStringNamed(PaymentTypeApiResourceConstants.DESCRIPTION, element);
|
||||||
|
baseDataValidator.reset().parameter(PaymentTypeApiResourceConstants.DESCRIPTION).value(description).notExceedingLengthOf(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.fromApiJsonHelper.parameterExists(PaymentTypeApiResourceConstants.ISCASHPAYMENT, element)) {
|
||||||
|
final Boolean isCashPayment = this.fromApiJsonHelper
|
||||||
|
.extractBooleanNamed(PaymentTypeApiResourceConstants.ISCASHPAYMENT, element);
|
||||||
|
baseDataValidator.reset().parameter(PaymentTypeApiResourceConstants.ISCASHPAYMENT).value(isCashPayment);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.fromApiJsonHelper.parameterExists(PaymentTypeApiResourceConstants.POSITION, element)) {
|
||||||
|
final Long position = this.fromApiJsonHelper.extractLongNamed(PaymentTypeApiResourceConstants.POSITION, element);
|
||||||
|
baseDataValidator.reset().parameter(PaymentTypeApiResourceConstants.POSITION).value(position).ignoreIfNull()
|
||||||
|
.integerZeroOrGreater();
|
||||||
|
}
|
||||||
|
|
||||||
|
throwExceptionIfValidationWarningsExist(dataValidationErrors);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+84
@@ -0,0 +1,84 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.domain;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.api.PaymentTypeApiResourceConstants;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.springframework.data.jpa.domain.AbstractPersistable;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "m_payment_type")
|
||||||
|
public class PaymentType extends AbstractPersistable<Long> {
|
||||||
|
|
||||||
|
@Column(name = "value")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Column(name = "description")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Column(name = "is_cash_payment")
|
||||||
|
private Boolean isCashPayment;
|
||||||
|
|
||||||
|
@Column(name = "order_position")
|
||||||
|
private Long position;
|
||||||
|
|
||||||
|
protected PaymentType() {}
|
||||||
|
|
||||||
|
public PaymentType(final String name, final String description, final Boolean isCashPayment, final Long position) {
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.isCashPayment = isCashPayment;
|
||||||
|
this.position = position;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PaymentType create(String name, String description, Boolean isCashPayment, Long position) {
|
||||||
|
return new PaymentType(name, description, isCashPayment, position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> update(final JsonCommand command) {
|
||||||
|
|
||||||
|
final Map<String, Object> actualChanges = new LinkedHashMap<>(3);
|
||||||
|
|
||||||
|
if (command.isChangeInStringParameterNamed(PaymentTypeApiResourceConstants.NAME, this.name)) {
|
||||||
|
final String newValue = command.stringValueOfParameterNamed(PaymentTypeApiResourceConstants.NAME);
|
||||||
|
actualChanges.put(PaymentTypeApiResourceConstants.NAME, newValue);
|
||||||
|
this.name = StringUtils.defaultIfEmpty(newValue, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (command.isChangeInStringParameterNamed(PaymentTypeApiResourceConstants.DESCRIPTION, this.description)) {
|
||||||
|
final String newDescription = command.stringValueOfParameterNamed(PaymentTypeApiResourceConstants.DESCRIPTION);
|
||||||
|
actualChanges.put(PaymentTypeApiResourceConstants.DESCRIPTION, newDescription);
|
||||||
|
this.description = StringUtils.defaultIfEmpty(newDescription, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (command.isChangeInBooleanParameterNamed(PaymentTypeApiResourceConstants.ISCASHPAYMENT, this.isCashPayment)) {
|
||||||
|
final Boolean newCashPaymentType = command.booleanObjectValueOfParameterNamed(PaymentTypeApiResourceConstants.ISCASHPAYMENT);
|
||||||
|
actualChanges.put(PaymentTypeApiResourceConstants.ISCASHPAYMENT, newCashPaymentType);
|
||||||
|
this.isCashPayment = newCashPaymentType.booleanValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (command.isChangeInLongParameterNamed(PaymentTypeApiResourceConstants.POSITION, this.position)) {
|
||||||
|
final Long newPosition = command.longValueOfParameterNamed(PaymentTypeApiResourceConstants.POSITION);
|
||||||
|
actualChanges.put(PaymentTypeApiResourceConstants.POSITION, newPosition);
|
||||||
|
this.position = newPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
return actualChanges;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PaymentTypeData toData() {
|
||||||
|
return PaymentTypeData.instance(getId(), this.name, this.description, this.isCashPayment, this.position);
|
||||||
|
}
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.domain;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
|
||||||
|
public interface PaymentTypeRepository extends JpaRepository<PaymentType, Long>, JpaSpecificationExecutor<PaymentType> {
|
||||||
|
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.domain;
|
||||||
|
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.exception.PaymentTypeNotFoundException;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PaymentTypeRepositoryWrapper {
|
||||||
|
|
||||||
|
private final PaymentTypeRepository repository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public PaymentTypeRepositoryWrapper(final PaymentTypeRepository repository) {
|
||||||
|
this.repository = repository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PaymentType findOneWithNotFoundDetection(final Long id) {
|
||||||
|
final PaymentType paymentType = this.repository.findOne(id);
|
||||||
|
if (paymentType == null) { throw new PaymentTypeNotFoundException(id); }
|
||||||
|
return paymentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.exception;
|
||||||
|
|
||||||
|
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
|
||||||
|
|
||||||
|
|
||||||
|
public class PaymentTypeNotFoundException extends AbstractPlatformResourceNotFoundException {
|
||||||
|
|
||||||
|
public PaymentTypeNotFoundException(final Long id) {
|
||||||
|
super("error.msg.payment.type.invalid", "PaymentType with " + id + " does not exist", id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.handler;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
import org.mifosplatform.commands.handler.NewCommandSourceHandler;
|
||||||
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeWriteService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CreatePaymentTypeCommandHandler implements NewCommandSourceHandler {
|
||||||
|
|
||||||
|
private final PaymentTypeWriteService paymentTypeWriteService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public CreatePaymentTypeCommandHandler(final PaymentTypeWriteService paymentTypeWriteService) {
|
||||||
|
this.paymentTypeWriteService = paymentTypeWriteService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public CommandProcessingResult processCommand(JsonCommand command) {
|
||||||
|
return this.paymentTypeWriteService.createPaymentType(command);
|
||||||
|
}
|
||||||
|
}
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.handler;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
import org.mifosplatform.commands.handler.NewCommandSourceHandler;
|
||||||
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeWriteService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DeletePaymentTypeCommandHandler implements NewCommandSourceHandler {
|
||||||
|
|
||||||
|
private final PaymentTypeWriteService paymentTypeWriteService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public DeletePaymentTypeCommandHandler(final PaymentTypeWriteService paymentTypeWriteService) {
|
||||||
|
this.paymentTypeWriteService = paymentTypeWriteService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public CommandProcessingResult processCommand(JsonCommand command) {
|
||||||
|
return this.paymentTypeWriteService.deletePaymentType(command.entityId());
|
||||||
|
}
|
||||||
|
}
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.handler;
|
||||||
|
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
import org.mifosplatform.commands.handler.NewCommandSourceHandler;
|
||||||
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeWriteService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UpdatePaymentTypeCommandHandler implements NewCommandSourceHandler {
|
||||||
|
|
||||||
|
private final PaymentTypeWriteService paymentTypeWriteService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public UpdatePaymentTypeCommandHandler(final PaymentTypeWriteService paymentTypeWriteService) {
|
||||||
|
this.paymentTypeWriteService = paymentTypeWriteService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public CommandProcessingResult processCommand(JsonCommand command) {
|
||||||
|
return this.paymentTypeWriteService.updatePaymentType(command.entityId(),command);
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
|
||||||
|
public interface PaymentTypeReadPlatformService {
|
||||||
|
|
||||||
|
Collection<PaymentTypeData> retrieveAllPaymentTypes();
|
||||||
|
PaymentTypeData retrieveOne(Long paymentTypeId);
|
||||||
|
|
||||||
|
}
|
||||||
+74
@@ -0,0 +1,74 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.service;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
||||||
|
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PaymentTypeReadPlatformServiceImpl implements PaymentTypeReadPlatformService {
|
||||||
|
|
||||||
|
private final JdbcTemplate jdbcTemplate;
|
||||||
|
private final PlatformSecurityContext context;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public PaymentTypeReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
|
||||||
|
this.context = context;
|
||||||
|
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<PaymentTypeData> retrieveAllPaymentTypes() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
|
final PaymentTypeMapper ptm = new PaymentTypeMapper();
|
||||||
|
final String sql = "select " + ptm.schema() + "order by position";
|
||||||
|
|
||||||
|
return this.jdbcTemplate.query(sql, ptm, new Object[] {});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PaymentTypeData retrieveOne(Long paymentTypeId) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
|
final PaymentTypeMapper ptm = new PaymentTypeMapper();
|
||||||
|
final String sql = "select " + ptm.schema() + "where pt.id = ?";
|
||||||
|
|
||||||
|
return this.jdbcTemplate.queryForObject(sql, ptm, new Object[] { paymentTypeId });
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class PaymentTypeMapper implements RowMapper<PaymentTypeData> {
|
||||||
|
|
||||||
|
public String schema() {
|
||||||
|
return " pt.id as id, pt.value as name, pt.description as description,pt.is_cash_payment as isCashPayment,pt.order_position as position from m_payment_type pt ";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PaymentTypeData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException {
|
||||||
|
|
||||||
|
final Long id = rs.getLong("id");
|
||||||
|
final String name = rs.getString("name");
|
||||||
|
final String description = rs.getString("description");
|
||||||
|
final boolean isCashPayment = rs.getBoolean("isCashPayment");
|
||||||
|
final Long position = rs.getLong("position");
|
||||||
|
|
||||||
|
return PaymentTypeData.instance(id, name, description, isCashPayment, position);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.service;
|
||||||
|
|
||||||
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
|
|
||||||
|
public interface PaymentTypeWriteService {
|
||||||
|
|
||||||
|
CommandProcessingResult createPaymentType(final JsonCommand command);
|
||||||
|
|
||||||
|
CommandProcessingResult updatePaymentType(final Long id, final JsonCommand command);
|
||||||
|
|
||||||
|
CommandProcessingResult deletePaymentType(final Long id);
|
||||||
|
}
|
||||||
+92
@@ -0,0 +1,92 @@
|
|||||||
|
/**
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
package org.mifosplatform.portfolio.paymenttype.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResultBuilder;
|
||||||
|
import org.mifosplatform.infrastructure.core.exception.PlatformDataIntegrityException;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.api.PaymentTypeApiResourceConstants;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeDataValidator;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentType;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentTypeRepository;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.domain.PaymentTypeRepositoryWrapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.dao.DataIntegrityViolationException;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PaymentTypeWriteServiceImpl implements PaymentTypeWriteService {
|
||||||
|
|
||||||
|
// private final static Logger logger =
|
||||||
|
// LoggerFactory.getLogger(MifosEntityAccessWriteServiceImpl.class);
|
||||||
|
private final PaymentTypeRepository repository;
|
||||||
|
private final PaymentTypeRepositoryWrapper repositoryWrapper;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* private final CodeValueRepositoryWrapper codeValueRepositoryWrapper;
|
||||||
|
* private final MifosEntityAccessRepository entityAccessRepository; private
|
||||||
|
* final MifosEntityRelationRepositoryWrapper
|
||||||
|
* mifosEntityRelationRepositoryWrapper; private final
|
||||||
|
* MifosEntityToEntityMappingRepository
|
||||||
|
* mifosEntityToEntityMappingRepository; private final
|
||||||
|
* MifosEntityToEntityMappingRepositoryWrapper
|
||||||
|
* mifosEntityToEntityMappingRepositoryWrapper;
|
||||||
|
*/
|
||||||
|
private final PaymentTypeDataValidator fromApiJsonDeserializer;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public PaymentTypeWriteServiceImpl(PaymentTypeRepository repository, PaymentTypeRepositoryWrapper repositoryWrapper,
|
||||||
|
PaymentTypeDataValidator fromApiJsonDeserializer) {
|
||||||
|
this.repository = repository;
|
||||||
|
this.repositoryWrapper = repositoryWrapper;
|
||||||
|
this.fromApiJsonDeserializer = fromApiJsonDeserializer;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommandProcessingResult createPaymentType(JsonCommand command) {
|
||||||
|
this.fromApiJsonDeserializer.validateForCreate(command.json());
|
||||||
|
String name = command.stringValueOfParameterNamed(PaymentTypeApiResourceConstants.NAME);
|
||||||
|
String description = command.stringValueOfParameterNamed(PaymentTypeApiResourceConstants.DESCRIPTION);
|
||||||
|
Boolean isCashPayment = command.booleanObjectValueOfParameterNamed(PaymentTypeApiResourceConstants.ISCASHPAYMENT);
|
||||||
|
Long position = command.longValueOfParameterNamed(PaymentTypeApiResourceConstants.POSITION);
|
||||||
|
|
||||||
|
PaymentType newPaymentType = PaymentType.create(name, description, isCashPayment, position);
|
||||||
|
this.repository.save(newPaymentType);
|
||||||
|
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(newPaymentType.getId()).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommandProcessingResult updatePaymentType(Long paymentTypeId, JsonCommand command) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
this.fromApiJsonDeserializer.validateForUpdate(command.json());
|
||||||
|
final PaymentType paymentType = this.repositoryWrapper.findOneWithNotFoundDetection(paymentTypeId);
|
||||||
|
final Map<String, Object> changes = paymentType.update(command);
|
||||||
|
|
||||||
|
if (!changes.isEmpty()) {
|
||||||
|
this.repository.save(paymentType);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(command.entityId()).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommandProcessingResult deletePaymentType(Long paymentTypeId) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
final PaymentType paymentType = this.repositoryWrapper.findOneWithNotFoundDetection(paymentTypeId);
|
||||||
|
try {
|
||||||
|
this.repository.delete(paymentType);
|
||||||
|
} catch (final DataIntegrityViolationException e) {
|
||||||
|
throw new PlatformDataIntegrityException("error.msg.cund.unknown.data.integrity.issue",
|
||||||
|
"Unknown data integrity issue with resource: " + e.getMostSpecificCause());
|
||||||
|
}
|
||||||
|
return new CommandProcessingResultBuilder().withEntityId(paymentType.getId()).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+8
-7
@@ -22,7 +22,6 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.mifosplatform.commands.domain.CommandWrapper;
|
import org.mifosplatform.commands.domain.CommandWrapper;
|
||||||
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
||||||
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
@@ -30,7 +29,8 @@ import org.mifosplatform.infrastructure.core.exception.UnrecognizedQueryParamExc
|
|||||||
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||||
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
||||||
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
|
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsApiConstants;
|
import org.mifosplatform.portfolio.savings.SavingsApiConstants;
|
||||||
@@ -51,6 +51,7 @@ public class FixedDepositAccountTransactionsApiResource {
|
|||||||
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
||||||
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
||||||
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public FixedDepositAccountTransactionsApiResource(final PlatformSecurityContext context,
|
public FixedDepositAccountTransactionsApiResource(final PlatformSecurityContext context,
|
||||||
@@ -58,13 +59,14 @@ public class FixedDepositAccountTransactionsApiResource {
|
|||||||
final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
|
final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
|
||||||
final ApiRequestParameterHelper apiRequestParameterHelper,
|
final ApiRequestParameterHelper apiRequestParameterHelper,
|
||||||
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
||||||
final CodeValueReadPlatformService codeValueReadPlatformService) {
|
final CodeValueReadPlatformService codeValueReadPlatformService, PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.toApiJsonSerializer = toApiJsonSerializer;
|
this.toApiJsonSerializer = toApiJsonSerializer;
|
||||||
this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
|
this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
|
||||||
this.apiRequestParameterHelper = apiRequestParameterHelper;
|
this.apiRequestParameterHelper = apiRequestParameterHelper;
|
||||||
this.savingsAccountReadPlatformService = savingsAccountReadPlatformService;
|
this.savingsAccountReadPlatformService = savingsAccountReadPlatformService;
|
||||||
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean is(final String commandParam, final String commandValue) {
|
private boolean is(final String commandParam, final String commandValue) {
|
||||||
@@ -83,8 +85,8 @@ public class FixedDepositAccountTransactionsApiResource {
|
|||||||
|
|
||||||
SavingsAccountTransactionData savingsAccount = this.savingsAccountReadPlatformService.retrieveDepositTransactionTemplate(
|
SavingsAccountTransactionData savingsAccount = this.savingsAccountReadPlatformService.retrieveDepositTransactionTemplate(
|
||||||
fixedDepositAccountId, DepositAccountType.FIXED_DEPOSIT);
|
fixedDepositAccountId, DepositAccountType.FIXED_DEPOSIT);
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
savingsAccount = SavingsAccountTransactionData.templateOnTop(savingsAccount, paymentTypeOptions);
|
savingsAccount = SavingsAccountTransactionData.templateOnTop(savingsAccount, paymentTypeOptions);
|
||||||
|
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
@@ -104,8 +106,7 @@ public class FixedDepositAccountTransactionsApiResource {
|
|||||||
fixedDepositAccountId, transactionId, DepositAccountType.FIXED_DEPOSIT);
|
fixedDepositAccountId, transactionId, DepositAccountType.FIXED_DEPOSIT);
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
if (settings.isTemplate()) {
|
if (settings.isTemplate()) {
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
transactionData = SavingsAccountTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
transactionData = SavingsAccountTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-5
@@ -32,7 +32,6 @@ import org.mifosplatform.accounting.producttoaccountmapping.service.ProductToGLA
|
|||||||
import org.mifosplatform.commands.domain.CommandWrapper;
|
import org.mifosplatform.commands.domain.CommandWrapper;
|
||||||
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
||||||
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
@@ -47,7 +46,8 @@ import org.mifosplatform.portfolio.charge.service.ChargeReadPlatformService;
|
|||||||
import org.mifosplatform.portfolio.common.service.DropdownReadPlatformService;
|
import org.mifosplatform.portfolio.common.service.DropdownReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
||||||
import org.mifosplatform.portfolio.interestratechart.service.InterestRateChartReadPlatformService;
|
import org.mifosplatform.portfolio.interestratechart.service.InterestRateChartReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
||||||
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
|
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsCompoundingInterestPeriodType;
|
import org.mifosplatform.portfolio.savings.SavingsCompoundingInterestPeriodType;
|
||||||
@@ -84,6 +84,7 @@ public class FixedDepositProductsApiResource {
|
|||||||
private final InterestRateChartReadPlatformService interestRateChartReadPlatformService;
|
private final InterestRateChartReadPlatformService interestRateChartReadPlatformService;
|
||||||
private final DepositsDropdownReadPlatformService depositsDropdownReadPlatformService;
|
private final DepositsDropdownReadPlatformService depositsDropdownReadPlatformService;
|
||||||
private final DropdownReadPlatformService dropdownReadPlatformService;
|
private final DropdownReadPlatformService dropdownReadPlatformService;
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public FixedDepositProductsApiResource(final DepositProductReadPlatformService depositProductReadPlatformService,
|
public FixedDepositProductsApiResource(final DepositProductReadPlatformService depositProductReadPlatformService,
|
||||||
@@ -97,7 +98,8 @@ public class FixedDepositProductsApiResource {
|
|||||||
final ChargeReadPlatformService chargeReadPlatformService, final InterestRateChartReadPlatformService chartReadPlatformService,
|
final ChargeReadPlatformService chargeReadPlatformService, final InterestRateChartReadPlatformService chartReadPlatformService,
|
||||||
final InterestRateChartReadPlatformService interestRateChartReadPlatformService,
|
final InterestRateChartReadPlatformService interestRateChartReadPlatformService,
|
||||||
final DepositsDropdownReadPlatformService depositsDropdownReadPlatformService,
|
final DepositsDropdownReadPlatformService depositsDropdownReadPlatformService,
|
||||||
final DropdownReadPlatformService dropdownReadPlatformService) {
|
final DropdownReadPlatformService dropdownReadPlatformService,
|
||||||
|
final PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.depositProductReadPlatformService = depositProductReadPlatformService;
|
this.depositProductReadPlatformService = depositProductReadPlatformService;
|
||||||
this.savingsDropdownReadPlatformService = savingsDropdownReadPlatformService;
|
this.savingsDropdownReadPlatformService = savingsDropdownReadPlatformService;
|
||||||
this.currencyReadPlatformService = currencyReadPlatformService;
|
this.currencyReadPlatformService = currencyReadPlatformService;
|
||||||
@@ -113,6 +115,7 @@ public class FixedDepositProductsApiResource {
|
|||||||
this.interestRateChartReadPlatformService = interestRateChartReadPlatformService;
|
this.interestRateChartReadPlatformService = interestRateChartReadPlatformService;
|
||||||
this.depositsDropdownReadPlatformService = depositsDropdownReadPlatformService;
|
this.depositsDropdownReadPlatformService = depositsDropdownReadPlatformService;
|
||||||
this.dropdownReadPlatformService = dropdownReadPlatformService;
|
this.dropdownReadPlatformService = dropdownReadPlatformService;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@@ -253,8 +256,7 @@ public class FixedDepositProductsApiResource {
|
|||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = this.savingsDropdownReadPlatformService
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = this.savingsDropdownReadPlatformService
|
||||||
.retrievewithdrawalFeeTypeOptions();
|
.retrievewithdrawalFeeTypeOptions();
|
||||||
|
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
|
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = this.accountingDropdownReadPlatformService
|
final Collection<EnumOptionData> accountingRuleOptions = this.accountingDropdownReadPlatformService
|
||||||
.retrieveAccountingRuleTypeOptions();
|
.retrieveAccountingRuleTypeOptions();
|
||||||
|
|||||||
+7
-7
@@ -22,7 +22,6 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.mifosplatform.commands.domain.CommandWrapper;
|
import org.mifosplatform.commands.domain.CommandWrapper;
|
||||||
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
||||||
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
@@ -30,7 +29,8 @@ import org.mifosplatform.infrastructure.core.exception.UnrecognizedQueryParamExc
|
|||||||
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||||
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
||||||
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
|
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsApiConstants;
|
import org.mifosplatform.portfolio.savings.SavingsApiConstants;
|
||||||
@@ -53,6 +53,7 @@ public class RecurringDepositAccountTransactionsApiResource {
|
|||||||
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
||||||
private final DepositAccountReadPlatformService depositAccountReadPlatformService;
|
private final DepositAccountReadPlatformService depositAccountReadPlatformService;
|
||||||
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public RecurringDepositAccountTransactionsApiResource(final PlatformSecurityContext context,
|
public RecurringDepositAccountTransactionsApiResource(final PlatformSecurityContext context,
|
||||||
@@ -61,7 +62,7 @@ public class RecurringDepositAccountTransactionsApiResource {
|
|||||||
final ApiRequestParameterHelper apiRequestParameterHelper,
|
final ApiRequestParameterHelper apiRequestParameterHelper,
|
||||||
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
||||||
final DepositAccountReadPlatformService depositAccountReadPlatformService,
|
final DepositAccountReadPlatformService depositAccountReadPlatformService,
|
||||||
final CodeValueReadPlatformService codeValueReadPlatformService) {
|
final CodeValueReadPlatformService codeValueReadPlatformService, PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.toApiJsonSerializer = toApiJsonSerializer;
|
this.toApiJsonSerializer = toApiJsonSerializer;
|
||||||
this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
|
this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
|
||||||
@@ -69,6 +70,7 @@ public class RecurringDepositAccountTransactionsApiResource {
|
|||||||
this.savingsAccountReadPlatformService = savingsAccountReadPlatformService;
|
this.savingsAccountReadPlatformService = savingsAccountReadPlatformService;
|
||||||
this.depositAccountReadPlatformService = depositAccountReadPlatformService;
|
this.depositAccountReadPlatformService = depositAccountReadPlatformService;
|
||||||
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean is(final String commandParam, final String commandValue) {
|
private boolean is(final String commandParam, final String commandValue) {
|
||||||
@@ -105,8 +107,7 @@ public class RecurringDepositAccountTransactionsApiResource {
|
|||||||
savingsAccount = SavingsAccountTransactionData.withWithDrawalTransactionDetails(savingsAccount);
|
savingsAccount = SavingsAccountTransactionData.withWithDrawalTransactionDetails(savingsAccount);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
savingsAccount = SavingsAccountTransactionData.templateOnTop(savingsAccount, paymentTypeOptions);
|
savingsAccount = SavingsAccountTransactionData.templateOnTop(savingsAccount, paymentTypeOptions);
|
||||||
|
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
@@ -126,8 +127,7 @@ public class RecurringDepositAccountTransactionsApiResource {
|
|||||||
recurringDepositAccountId, transactionId, DepositAccountType.RECURRING_DEPOSIT);
|
recurringDepositAccountId, transactionId, DepositAccountType.RECURRING_DEPOSIT);
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
if (settings.isTemplate()) {
|
if (settings.isTemplate()) {
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
transactionData = SavingsAccountTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
transactionData = SavingsAccountTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-5
@@ -32,7 +32,6 @@ import org.mifosplatform.accounting.producttoaccountmapping.service.ProductToGLA
|
|||||||
import org.mifosplatform.commands.domain.CommandWrapper;
|
import org.mifosplatform.commands.domain.CommandWrapper;
|
||||||
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
||||||
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
@@ -47,7 +46,8 @@ import org.mifosplatform.portfolio.charge.service.ChargeReadPlatformService;
|
|||||||
import org.mifosplatform.portfolio.common.service.DropdownReadPlatformService;
|
import org.mifosplatform.portfolio.common.service.DropdownReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
||||||
import org.mifosplatform.portfolio.interestratechart.service.InterestRateChartReadPlatformService;
|
import org.mifosplatform.portfolio.interestratechart.service.InterestRateChartReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
||||||
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
|
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsCompoundingInterestPeriodType;
|
import org.mifosplatform.portfolio.savings.SavingsCompoundingInterestPeriodType;
|
||||||
@@ -84,6 +84,7 @@ public class RecurringDepositProductsApiResource {
|
|||||||
private final InterestRateChartReadPlatformService interestRateChartReadPlatformService;
|
private final InterestRateChartReadPlatformService interestRateChartReadPlatformService;
|
||||||
private final DepositsDropdownReadPlatformService depositsDropdownReadPlatformService;
|
private final DepositsDropdownReadPlatformService depositsDropdownReadPlatformService;
|
||||||
private final DropdownReadPlatformService dropdownReadPlatformService;
|
private final DropdownReadPlatformService dropdownReadPlatformService;
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public RecurringDepositProductsApiResource(final DepositProductReadPlatformService depositProductReadPlatformService,
|
public RecurringDepositProductsApiResource(final DepositProductReadPlatformService depositProductReadPlatformService,
|
||||||
@@ -97,7 +98,8 @@ public class RecurringDepositProductsApiResource {
|
|||||||
final ChargeReadPlatformService chargeReadPlatformService, final InterestRateChartReadPlatformService chartReadPlatformService,
|
final ChargeReadPlatformService chargeReadPlatformService, final InterestRateChartReadPlatformService chartReadPlatformService,
|
||||||
final InterestRateChartReadPlatformService interestRateChartReadPlatformService,
|
final InterestRateChartReadPlatformService interestRateChartReadPlatformService,
|
||||||
final DepositsDropdownReadPlatformService depositsDropdownReadPlatformService,
|
final DepositsDropdownReadPlatformService depositsDropdownReadPlatformService,
|
||||||
final DropdownReadPlatformService dropdownReadPlatformService) {
|
final DropdownReadPlatformService dropdownReadPlatformService,
|
||||||
|
final PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.depositProductReadPlatformService = depositProductReadPlatformService;
|
this.depositProductReadPlatformService = depositProductReadPlatformService;
|
||||||
this.savingsDropdownReadPlatformService = savingsDropdownReadPlatformService;
|
this.savingsDropdownReadPlatformService = savingsDropdownReadPlatformService;
|
||||||
this.currencyReadPlatformService = currencyReadPlatformService;
|
this.currencyReadPlatformService = currencyReadPlatformService;
|
||||||
@@ -113,6 +115,7 @@ public class RecurringDepositProductsApiResource {
|
|||||||
this.interestRateChartReadPlatformService = interestRateChartReadPlatformService;
|
this.interestRateChartReadPlatformService = interestRateChartReadPlatformService;
|
||||||
this.depositsDropdownReadPlatformService = depositsDropdownReadPlatformService;
|
this.depositsDropdownReadPlatformService = depositsDropdownReadPlatformService;
|
||||||
this.dropdownReadPlatformService = dropdownReadPlatformService;
|
this.dropdownReadPlatformService = dropdownReadPlatformService;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@@ -254,8 +257,7 @@ public class RecurringDepositProductsApiResource {
|
|||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = this.savingsDropdownReadPlatformService
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = this.savingsDropdownReadPlatformService
|
||||||
.retrievewithdrawalFeeTypeOptions();
|
.retrievewithdrawalFeeTypeOptions();
|
||||||
|
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = this.accountingDropdownReadPlatformService
|
final Collection<EnumOptionData> accountingRuleOptions = this.accountingDropdownReadPlatformService
|
||||||
.retrieveAccountingRuleTypeOptions();
|
.retrieveAccountingRuleTypeOptions();
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = this.accountingDropdownReadPlatformService
|
final Map<String, List<GLAccountData>> accountingMappingOptions = this.accountingDropdownReadPlatformService
|
||||||
|
|||||||
+8
-7
@@ -22,7 +22,6 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.mifosplatform.commands.domain.CommandWrapper;
|
import org.mifosplatform.commands.domain.CommandWrapper;
|
||||||
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
||||||
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
@@ -31,7 +30,8 @@ import org.mifosplatform.infrastructure.core.exception.UnrecognizedQueryParamExc
|
|||||||
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||||
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsApiConstants;
|
import org.mifosplatform.portfolio.savings.SavingsApiConstants;
|
||||||
import org.mifosplatform.portfolio.savings.data.SavingsAccountTransactionData;
|
import org.mifosplatform.portfolio.savings.data.SavingsAccountTransactionData;
|
||||||
@@ -53,6 +53,7 @@ public class SavingsAccountTransactionsApiResource {
|
|||||||
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
private final ApiRequestParameterHelper apiRequestParameterHelper;
|
||||||
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
||||||
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public SavingsAccountTransactionsApiResource(final PlatformSecurityContext context,
|
public SavingsAccountTransactionsApiResource(final PlatformSecurityContext context,
|
||||||
@@ -60,13 +61,14 @@ public class SavingsAccountTransactionsApiResource {
|
|||||||
final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
|
final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
|
||||||
final ApiRequestParameterHelper apiRequestParameterHelper,
|
final ApiRequestParameterHelper apiRequestParameterHelper,
|
||||||
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
||||||
final CodeValueReadPlatformService codeValueReadPlatformService) {
|
final CodeValueReadPlatformService codeValueReadPlatformService,PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.toApiJsonSerializer = toApiJsonSerializer;
|
this.toApiJsonSerializer = toApiJsonSerializer;
|
||||||
this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
|
this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
|
||||||
this.apiRequestParameterHelper = apiRequestParameterHelper;
|
this.apiRequestParameterHelper = apiRequestParameterHelper;
|
||||||
this.savingsAccountReadPlatformService = savingsAccountReadPlatformService;
|
this.savingsAccountReadPlatformService = savingsAccountReadPlatformService;
|
||||||
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean is(final String commandParam, final String commandValue) {
|
private boolean is(final String commandParam, final String commandValue) {
|
||||||
@@ -87,8 +89,8 @@ public class SavingsAccountTransactionsApiResource {
|
|||||||
// both deposit/withdrawal templates
|
// both deposit/withdrawal templates
|
||||||
SavingsAccountTransactionData savingsAccount = this.savingsAccountReadPlatformService.retrieveDepositTransactionTemplate(savingsId,
|
SavingsAccountTransactionData savingsAccount = this.savingsAccountReadPlatformService.retrieveDepositTransactionTemplate(savingsId,
|
||||||
DepositAccountType.SAVINGS_DEPOSIT);
|
DepositAccountType.SAVINGS_DEPOSIT);
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
.retrieveAllPaymentTypes();
|
||||||
savingsAccount = SavingsAccountTransactionData.templateOnTop(savingsAccount, paymentTypeOptions);
|
savingsAccount = SavingsAccountTransactionData.templateOnTop(savingsAccount, paymentTypeOptions);
|
||||||
|
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
@@ -108,8 +110,7 @@ public class SavingsAccountTransactionsApiResource {
|
|||||||
transactionId, DepositAccountType.SAVINGS_DEPOSIT);
|
transactionId, DepositAccountType.SAVINGS_DEPOSIT);
|
||||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||||
if (settings.isTemplate()) {
|
if (settings.isTemplate()) {
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
transactionData = SavingsAccountTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
transactionData = SavingsAccountTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-5
@@ -32,7 +32,6 @@ import org.mifosplatform.accounting.producttoaccountmapping.service.ProductToGLA
|
|||||||
import org.mifosplatform.commands.domain.CommandWrapper;
|
import org.mifosplatform.commands.domain.CommandWrapper;
|
||||||
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
import org.mifosplatform.commands.service.CommandWrapperBuilder;
|
||||||
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
import org.mifosplatform.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
import org.mifosplatform.infrastructure.core.api.ApiRequestParameterHelper;
|
||||||
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
|
||||||
@@ -44,7 +43,8 @@ import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
|||||||
import org.mifosplatform.organisation.monetary.service.CurrencyReadPlatformService;
|
import org.mifosplatform.organisation.monetary.service.CurrencyReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||||
import org.mifosplatform.portfolio.charge.service.ChargeReadPlatformService;
|
import org.mifosplatform.portfolio.charge.service.ChargeReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsApiConstants;
|
import org.mifosplatform.portfolio.savings.SavingsApiConstants;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsCompoundingInterestPeriodType;
|
import org.mifosplatform.portfolio.savings.SavingsCompoundingInterestPeriodType;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsInterestCalculationDaysInYearType;
|
import org.mifosplatform.portfolio.savings.SavingsInterestCalculationDaysInYearType;
|
||||||
@@ -75,6 +75,7 @@ public class SavingsProductsApiResource {
|
|||||||
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
||||||
private final ProductToGLAccountMappingReadPlatformService accountMappingReadPlatformService;
|
private final ProductToGLAccountMappingReadPlatformService accountMappingReadPlatformService;
|
||||||
private final ChargeReadPlatformService chargeReadPlatformService;
|
private final ChargeReadPlatformService chargeReadPlatformService;
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public SavingsProductsApiResource(final SavingsProductReadPlatformService savingProductReadPlatformService,
|
public SavingsProductsApiResource(final SavingsProductReadPlatformService savingProductReadPlatformService,
|
||||||
@@ -85,7 +86,7 @@ public class SavingsProductsApiResource {
|
|||||||
final ApiRequestParameterHelper apiRequestParameterHelper, final CodeValueReadPlatformService codeValueReadPlatformService,
|
final ApiRequestParameterHelper apiRequestParameterHelper, final CodeValueReadPlatformService codeValueReadPlatformService,
|
||||||
final AccountingDropdownReadPlatformService accountingDropdownReadPlatformService,
|
final AccountingDropdownReadPlatformService accountingDropdownReadPlatformService,
|
||||||
final ProductToGLAccountMappingReadPlatformService accountMappingReadPlatformService,
|
final ProductToGLAccountMappingReadPlatformService accountMappingReadPlatformService,
|
||||||
final ChargeReadPlatformService chargeReadPlatformService) {
|
final ChargeReadPlatformService chargeReadPlatformService, PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.savingProductReadPlatformService = savingProductReadPlatformService;
|
this.savingProductReadPlatformService = savingProductReadPlatformService;
|
||||||
this.dropdownReadPlatformService = dropdownReadPlatformService;
|
this.dropdownReadPlatformService = dropdownReadPlatformService;
|
||||||
this.currencyReadPlatformService = currencyReadPlatformService;
|
this.currencyReadPlatformService = currencyReadPlatformService;
|
||||||
@@ -97,6 +98,7 @@ public class SavingsProductsApiResource {
|
|||||||
this.accountingDropdownReadPlatformService = accountingDropdownReadPlatformService;
|
this.accountingDropdownReadPlatformService = accountingDropdownReadPlatformService;
|
||||||
this.accountMappingReadPlatformService = accountMappingReadPlatformService;
|
this.accountMappingReadPlatformService = accountMappingReadPlatformService;
|
||||||
this.chargeReadPlatformService = chargeReadPlatformService;
|
this.chargeReadPlatformService = chargeReadPlatformService;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@@ -229,8 +231,8 @@ public class SavingsProductsApiResource {
|
|||||||
|
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = this.dropdownReadPlatformService.retrievewithdrawalFeeTypeOptions();
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = this.dropdownReadPlatformService.retrievewithdrawalFeeTypeOptions();
|
||||||
|
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = this.accountingDropdownReadPlatformService
|
final Collection<EnumOptionData> accountingRuleOptions = this.accountingDropdownReadPlatformService
|
||||||
.retrieveAccountingRuleTypeOptions();
|
.retrieveAccountingRuleTypeOptions();
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = this.accountingDropdownReadPlatformService
|
final Map<String, List<GLAccountData>> accountingMappingOptions = this.accountingDropdownReadPlatformService
|
||||||
|
|||||||
+8
-8
@@ -14,11 +14,11 @@ import org.mifosplatform.accounting.common.AccountingRuleType;
|
|||||||
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||||
import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immutable data object represents a partial data of Deposit Proucts.
|
* Immutable data object represents a partial data of Deposit Proucts.
|
||||||
@@ -63,7 +63,7 @@ public class DepositProductData {
|
|||||||
protected final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions;
|
protected final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions;
|
||||||
protected final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions;
|
protected final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions;
|
||||||
protected final Collection<EnumOptionData> withdrawalFeeTypeOptions;
|
protected final Collection<EnumOptionData> withdrawalFeeTypeOptions;
|
||||||
protected final Collection<CodeValueData> paymentTypeOptions;
|
protected final Collection<PaymentTypeData> paymentTypeOptions;
|
||||||
protected final Collection<EnumOptionData> accountingRuleOptions;
|
protected final Collection<EnumOptionData> accountingRuleOptions;
|
||||||
protected final Map<String, List<GLAccountData>> accountingMappingOptions;
|
protected final Map<String, List<GLAccountData>> accountingMappingOptions;
|
||||||
protected final Collection<ChargeData> chargeOptions;
|
protected final Collection<ChargeData> chargeOptions;
|
||||||
@@ -78,7 +78,7 @@ public class DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
||||||
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate) {
|
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate) {
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ public class DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
||||||
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate) {
|
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate) {
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ public class DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> chargeOptions = null;
|
final Collection<ChargeData> chargeOptions = null;
|
||||||
@@ -198,7 +198,7 @@ public class DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> chargeOptions = null;
|
final Collection<ChargeData> chargeOptions = null;
|
||||||
@@ -243,7 +243,7 @@ public class DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> charges = null;
|
final Collection<ChargeData> charges = null;
|
||||||
@@ -292,7 +292,7 @@ public class DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> charges,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> charges,
|
||||||
final Collection<ChargeData> chargeOptions, final Collection<ChargeData> penaltyOptions,
|
final Collection<ChargeData> chargeOptions, final Collection<ChargeData> penaltyOptions,
|
||||||
final Collection<ChargeToGLAccountMapper> feeToIncomeAccountMappings,
|
final Collection<ChargeToGLAccountMapper> feeToIncomeAccountMappings,
|
||||||
|
|||||||
+7
-7
@@ -11,12 +11,12 @@ import java.util.Collection;
|
|||||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.organisation.staff.data.StaffData;
|
import org.mifosplatform.organisation.staff.data.StaffData;
|
||||||
import org.mifosplatform.portfolio.account.data.PortfolioAccountData;
|
import org.mifosplatform.portfolio.account.data.PortfolioAccountData;
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
||||||
import org.mifosplatform.portfolio.savings.service.SavingsEnumerations;
|
import org.mifosplatform.portfolio.savings.service.SavingsEnumerations;
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ public class FixedDepositAccountData extends DepositAccountData {
|
|||||||
|
|
||||||
// for account close
|
// for account close
|
||||||
private Collection<EnumOptionData> onAccountClosureOptions;
|
private Collection<EnumOptionData> onAccountClosureOptions;
|
||||||
private Collection<CodeValueData> paymentTypeOptions;
|
private Collection<PaymentTypeData> paymentTypeOptions;
|
||||||
|
|
||||||
public static FixedDepositAccountData instance(final DepositAccountData depositAccountData, final boolean preClosurePenalApplicable,
|
public static FixedDepositAccountData instance(final DepositAccountData depositAccountData, final boolean preClosurePenalApplicable,
|
||||||
final BigDecimal preClosurePenalInterest, final EnumOptionData preClosurePenalInterestOnType, final Integer minDepositTerm,
|
final BigDecimal preClosurePenalInterest, final EnumOptionData preClosurePenalInterestOnType, final Integer minDepositTerm,
|
||||||
@@ -67,7 +67,7 @@ public class FixedDepositAccountData extends DepositAccountData {
|
|||||||
|
|
||||||
final EnumOptionData depositType = SavingsEnumerations.depositType(DepositAccountType.FIXED_DEPOSIT.getValue());
|
final EnumOptionData depositType = SavingsEnumerations.depositType(DepositAccountType.FIXED_DEPOSIT.getValue());
|
||||||
final Collection<EnumOptionData> onAccountClosureOptions = null;
|
final Collection<EnumOptionData> onAccountClosureOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas = null;
|
final Collection<SavingsAccountData> savingsAccountDatas = null;
|
||||||
|
|
||||||
return new FixedDepositAccountData(depositAccountData.id, depositAccountData.accountNo, depositAccountData.externalId,
|
return new FixedDepositAccountData(depositAccountData.id, depositAccountData.accountNo, depositAccountData.externalId,
|
||||||
@@ -230,7 +230,7 @@ public class FixedDepositAccountData extends DepositAccountData {
|
|||||||
|
|
||||||
final EnumOptionData depositType = SavingsEnumerations.depositType(DepositAccountType.FIXED_DEPOSIT.getValue());
|
final EnumOptionData depositType = SavingsEnumerations.depositType(DepositAccountType.FIXED_DEPOSIT.getValue());
|
||||||
final Collection<EnumOptionData> onAccountClosureOptions = null;
|
final Collection<EnumOptionData> onAccountClosureOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas = null;
|
final Collection<SavingsAccountData> savingsAccountDatas = null;
|
||||||
|
|
||||||
return new FixedDepositAccountData(id, accountNo, externalId, groupId, groupName, clientId, clientName, productId, productName,
|
return new FixedDepositAccountData(id, accountNo, externalId, groupId, groupName, clientId, clientName, productId, productName,
|
||||||
@@ -248,7 +248,7 @@ public class FixedDepositAccountData extends DepositAccountData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static FixedDepositAccountData preClosureDetails(final Long accountId, BigDecimal maturityAmount,
|
public static FixedDepositAccountData preClosureDetails(final Long accountId, BigDecimal maturityAmount,
|
||||||
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<CodeValueData> paymentTypeOptions,
|
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<PaymentTypeData> paymentTypeOptions,
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas) {
|
final Collection<SavingsAccountData> savingsAccountDatas) {
|
||||||
|
|
||||||
final Long groupId = null;
|
final Long groupId = null;
|
||||||
@@ -327,7 +327,7 @@ public class FixedDepositAccountData extends DepositAccountData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static FixedDepositAccountData withClosureTemplateDetails(final FixedDepositAccountData account,
|
public static FixedDepositAccountData withClosureTemplateDetails(final FixedDepositAccountData account,
|
||||||
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<CodeValueData> paymentTypeOptions,
|
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<PaymentTypeData> paymentTypeOptions,
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas) {
|
final Collection<SavingsAccountData> savingsAccountDatas) {
|
||||||
|
|
||||||
return new FixedDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
return new FixedDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
||||||
@@ -375,7 +375,7 @@ public class FixedDepositAccountData extends DepositAccountData {
|
|||||||
final LocalDate maturityDate, final Integer depositPeriod, final EnumOptionData depositPeriodFrequency,
|
final LocalDate maturityDate, final Integer depositPeriod, final EnumOptionData depositPeriodFrequency,
|
||||||
final Collection<EnumOptionData> periodFrequencyTypeOptions, final EnumOptionData depositType,
|
final Collection<EnumOptionData> periodFrequencyTypeOptions, final EnumOptionData depositType,
|
||||||
final EnumOptionData onAccountClosure, final Collection<EnumOptionData> onAccountClosureOptions,
|
final EnumOptionData onAccountClosure, final Collection<EnumOptionData> onAccountClosureOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<SavingsAccountData> savingsAccountDatas,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<SavingsAccountData> savingsAccountDatas,
|
||||||
final PortfolioAccountData linkedAccount, final Boolean transferInterestToSavings) {
|
final PortfolioAccountData linkedAccount, final Boolean transferInterestToSavings) {
|
||||||
|
|
||||||
super(id, accountNo, externalId, groupId, groupName, clientId, clientName, productId, productName, fieldofficerId,
|
super(id, accountNo, externalId, groupId, groupName, clientId, clientName, productId, productName, fieldofficerId,
|
||||||
|
|||||||
+7
-7
@@ -13,11 +13,11 @@ import java.util.Map;
|
|||||||
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||||
import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immutable data object representing a Fixed Deposit product.
|
* Immutable data object representing a Fixed Deposit product.
|
||||||
@@ -49,7 +49,7 @@ public class FixedDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
||||||
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate,
|
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate,
|
||||||
final Collection<EnumOptionData> preClosurePenalInterestOnTypeOptions,
|
final Collection<EnumOptionData> preClosurePenalInterestOnTypeOptions,
|
||||||
@@ -129,7 +129,7 @@ public class FixedDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
||||||
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate,
|
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate,
|
||||||
final Collection<EnumOptionData> preClosurePenalInterestOnTypeOptions,
|
final Collection<EnumOptionData> preClosurePenalInterestOnTypeOptions,
|
||||||
@@ -167,7 +167,7 @@ public class FixedDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> chargeOptions = null;
|
final Collection<ChargeData> chargeOptions = null;
|
||||||
@@ -208,7 +208,7 @@ public class FixedDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> chargeOptions = null;
|
final Collection<ChargeData> chargeOptions = null;
|
||||||
@@ -261,7 +261,7 @@ public class FixedDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> charges = null;
|
final Collection<ChargeData> charges = null;
|
||||||
@@ -335,7 +335,7 @@ public class FixedDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> charges,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> charges,
|
||||||
final Collection<ChargeData> chargeOptions, final Collection<ChargeData> penaltyOptions,
|
final Collection<ChargeData> chargeOptions, final Collection<ChargeData> penaltyOptions,
|
||||||
final Collection<ChargeToGLAccountMapper> feeToIncomeAccountMappings,
|
final Collection<ChargeToGLAccountMapper> feeToIncomeAccountMappings,
|
||||||
|
|||||||
+7
-7
@@ -11,11 +11,11 @@ import java.util.Collection;
|
|||||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.organisation.staff.data.StaffData;
|
import org.mifosplatform.organisation.staff.data.StaffData;
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
||||||
import org.mifosplatform.portfolio.savings.service.SavingsEnumerations;
|
import org.mifosplatform.portfolio.savings.service.SavingsEnumerations;
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ public class RecurringDepositAccountData extends DepositAccountData {
|
|||||||
|
|
||||||
// for account close
|
// for account close
|
||||||
private final Collection<EnumOptionData> onAccountClosureOptions;
|
private final Collection<EnumOptionData> onAccountClosureOptions;
|
||||||
private final Collection<CodeValueData> paymentTypeOptions;
|
private final Collection<PaymentTypeData> paymentTypeOptions;
|
||||||
|
|
||||||
public static RecurringDepositAccountData instance(final DepositAccountData depositAccountData,
|
public static RecurringDepositAccountData instance(final DepositAccountData depositAccountData,
|
||||||
final boolean preClosurePenalApplicable, final BigDecimal preClosurePenalInterest,
|
final boolean preClosurePenalApplicable, final BigDecimal preClosurePenalInterest,
|
||||||
@@ -77,7 +77,7 @@ public class RecurringDepositAccountData extends DepositAccountData {
|
|||||||
|
|
||||||
final EnumOptionData depositType = SavingsEnumerations.depositType(DepositAccountType.FIXED_DEPOSIT.getValue());
|
final EnumOptionData depositType = SavingsEnumerations.depositType(DepositAccountType.FIXED_DEPOSIT.getValue());
|
||||||
final Collection<EnumOptionData> onAccountClosureOptions = null;
|
final Collection<EnumOptionData> onAccountClosureOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas = null;
|
final Collection<SavingsAccountData> savingsAccountDatas = null;
|
||||||
final Integer recurringFrequency = null;
|
final Integer recurringFrequency = null;
|
||||||
final EnumOptionData recurringFrequencyType = null;
|
final EnumOptionData recurringFrequencyType = null;
|
||||||
@@ -270,7 +270,7 @@ public class RecurringDepositAccountData extends DepositAccountData {
|
|||||||
|
|
||||||
final EnumOptionData depositType = SavingsEnumerations.depositType(DepositAccountType.RECURRING_DEPOSIT.getValue());
|
final EnumOptionData depositType = SavingsEnumerations.depositType(DepositAccountType.RECURRING_DEPOSIT.getValue());
|
||||||
final Collection<EnumOptionData> onAccountClosureOptions = null;
|
final Collection<EnumOptionData> onAccountClosureOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas = null;
|
final Collection<SavingsAccountData> savingsAccountDatas = null;
|
||||||
final LocalDate expectedFirstDepositOnDate = null;
|
final LocalDate expectedFirstDepositOnDate = null;
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ public class RecurringDepositAccountData extends DepositAccountData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static RecurringDepositAccountData preClosureDetails(final Long accountId, final BigDecimal maturityAmount,
|
public static RecurringDepositAccountData preClosureDetails(final Long accountId, final BigDecimal maturityAmount,
|
||||||
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<CodeValueData> paymentTypeOptions,
|
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<PaymentTypeData> paymentTypeOptions,
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas) {
|
final Collection<SavingsAccountData> savingsAccountDatas) {
|
||||||
|
|
||||||
final String accountNo = null;
|
final String accountNo = null;
|
||||||
@@ -389,7 +389,7 @@ public class RecurringDepositAccountData extends DepositAccountData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static RecurringDepositAccountData withClosureTemplateDetails(final RecurringDepositAccountData account,
|
public static RecurringDepositAccountData withClosureTemplateDetails(final RecurringDepositAccountData account,
|
||||||
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<CodeValueData> paymentTypeOptions,
|
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<PaymentTypeData> paymentTypeOptions,
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas) {
|
final Collection<SavingsAccountData> savingsAccountDatas) {
|
||||||
|
|
||||||
return new RecurringDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
return new RecurringDepositAccountData(account.id, account.accountNo, account.externalId, account.groupId, account.groupName,
|
||||||
@@ -439,7 +439,7 @@ public class RecurringDepositAccountData extends DepositAccountData {
|
|||||||
final LocalDate maturityDate, final Integer depositPeriod, final EnumOptionData depositPeriodFrequency,
|
final LocalDate maturityDate, final Integer depositPeriod, final EnumOptionData depositPeriodFrequency,
|
||||||
final BigDecimal mandatoryRecommendedDepositAmount, final Collection<EnumOptionData> periodFrequencyTypeOptions,
|
final BigDecimal mandatoryRecommendedDepositAmount, final Collection<EnumOptionData> periodFrequencyTypeOptions,
|
||||||
final EnumOptionData depositType, final EnumOptionData onAccountClosure,
|
final EnumOptionData depositType, final EnumOptionData onAccountClosure,
|
||||||
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<CodeValueData> paymentTypeOptions,
|
final Collection<EnumOptionData> onAccountClosureOptions, final Collection<PaymentTypeData> paymentTypeOptions,
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas, final LocalDate expectedFirstDepositOnDate,
|
final Collection<SavingsAccountData> savingsAccountDatas, final LocalDate expectedFirstDepositOnDate,
|
||||||
final BigDecimal totalOverdueAmount, final Integer noOfOverdueInstallments, final boolean isMandatoryDeposit,
|
final BigDecimal totalOverdueAmount, final Integer noOfOverdueInstallments, final boolean isMandatoryDeposit,
|
||||||
final boolean allowWithdrawal, final boolean adjustAdvanceTowardsFuturePayments, final boolean isCalendarInherited,
|
final boolean allowWithdrawal, final boolean adjustAdvanceTowardsFuturePayments, final boolean isCalendarInherited,
|
||||||
|
|||||||
+7
-7
@@ -13,11 +13,11 @@ import java.util.Map;
|
|||||||
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||||
import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immutable data object represent a Recurring Deposit product.
|
* Immutable data object represent a Recurring Deposit product.
|
||||||
@@ -51,7 +51,7 @@ public class RecurringDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
||||||
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate,
|
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate,
|
||||||
final Collection<EnumOptionData> preClosurePenalInterestOnTypeOptions,
|
final Collection<EnumOptionData> preClosurePenalInterestOnTypeOptions,
|
||||||
@@ -137,7 +137,7 @@ public class RecurringDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
||||||
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate,
|
final Collection<ChargeData> penaltyOptions, final InterestRateChartData chartTemplate,
|
||||||
final Collection<EnumOptionData> preClosurePenalInterestOnTypeOptions,
|
final Collection<EnumOptionData> preClosurePenalInterestOnTypeOptions,
|
||||||
@@ -177,7 +177,7 @@ public class RecurringDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> chargeOptions = null;
|
final Collection<ChargeData> chargeOptions = null;
|
||||||
@@ -221,7 +221,7 @@ public class RecurringDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> chargeOptions = null;
|
final Collection<ChargeData> chargeOptions = null;
|
||||||
@@ -276,7 +276,7 @@ public class RecurringDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> charges = null;
|
final Collection<ChargeData> charges = null;
|
||||||
@@ -350,7 +350,7 @@ public class RecurringDepositProductData extends DepositProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> charges,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> charges,
|
||||||
final Collection<ChargeData> chargeOptions, final Collection<ChargeData> penaltyOptions,
|
final Collection<ChargeData> chargeOptions, final Collection<ChargeData> penaltyOptions,
|
||||||
final Collection<ChargeToGLAccountMapper> feeToIncomeAccountMappings,
|
final Collection<ChargeToGLAccountMapper> feeToIncomeAccountMappings,
|
||||||
|
|||||||
+7
-6
@@ -14,6 +14,7 @@ import org.mifosplatform.infrastructure.core.service.DateUtils;
|
|||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.portfolio.account.data.AccountTransferData;
|
import org.mifosplatform.portfolio.account.data.AccountTransferData;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsAccountTransactionType;
|
import org.mifosplatform.portfolio.savings.SavingsAccountTransactionType;
|
||||||
import org.mifosplatform.portfolio.savings.service.SavingsEnumerations;
|
import org.mifosplatform.portfolio.savings.service.SavingsEnumerations;
|
||||||
|
|
||||||
@@ -37,13 +38,13 @@ public class SavingsAccountTransactionData {
|
|||||||
private final LocalDate submittedOnDate;
|
private final LocalDate submittedOnDate;
|
||||||
|
|
||||||
// templates
|
// templates
|
||||||
final Collection<CodeValueData> paymentTypeOptions;
|
final Collection<PaymentTypeData> paymentTypeOptions;
|
||||||
|
|
||||||
public static SavingsAccountTransactionData create(final Long id, final SavingsAccountTransactionEnumData transactionType,
|
public static SavingsAccountTransactionData create(final Long id, final SavingsAccountTransactionEnumData transactionType,
|
||||||
final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date,
|
final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date,
|
||||||
final CurrencyData currency, final BigDecimal amount, final BigDecimal runningBalance, final boolean reversed,
|
final CurrencyData currency, final BigDecimal amount, final BigDecimal runningBalance, final boolean reversed,
|
||||||
final AccountTransferData transfer) {
|
final AccountTransferData transfer) {
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
return new SavingsAccountTransactionData(id, transactionType, paymentDetailData, savingsId, savingsAccountNo, date, currency,
|
return new SavingsAccountTransactionData(id, transactionType, paymentDetailData, savingsId, savingsAccountNo, date, currency,
|
||||||
amount, runningBalance, reversed, transfer, paymentTypeOptions);
|
amount, runningBalance, reversed, transfer, paymentTypeOptions);
|
||||||
}
|
}
|
||||||
@@ -52,7 +53,7 @@ public class SavingsAccountTransactionData {
|
|||||||
final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date,
|
final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date,
|
||||||
final CurrencyData currency, final BigDecimal amount, final BigDecimal runningBalance, final boolean reversed,
|
final CurrencyData currency, final BigDecimal amount, final BigDecimal runningBalance, final boolean reversed,
|
||||||
final AccountTransferData transfer,final LocalDate submittedOnDate) {
|
final AccountTransferData transfer,final LocalDate submittedOnDate) {
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
return new SavingsAccountTransactionData(id, transactionType, paymentDetailData, savingsId, savingsAccountNo, date, currency,
|
return new SavingsAccountTransactionData(id, transactionType, paymentDetailData, savingsId, savingsAccountNo, date, currency,
|
||||||
amount, runningBalance, reversed, transfer, paymentTypeOptions,submittedOnDate);
|
amount, runningBalance, reversed, transfer, paymentTypeOptions,submittedOnDate);
|
||||||
}
|
}
|
||||||
@@ -71,7 +72,7 @@ public class SavingsAccountTransactionData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static SavingsAccountTransactionData templateOnTop(final SavingsAccountTransactionData savingsAccountTransactionData,
|
public static SavingsAccountTransactionData templateOnTop(final SavingsAccountTransactionData savingsAccountTransactionData,
|
||||||
final Collection<CodeValueData> paymentTypeOptions) {
|
final Collection<PaymentTypeData> paymentTypeOptions) {
|
||||||
return new SavingsAccountTransactionData(savingsAccountTransactionData.id, savingsAccountTransactionData.transactionType,
|
return new SavingsAccountTransactionData(savingsAccountTransactionData.id, savingsAccountTransactionData.transactionType,
|
||||||
savingsAccountTransactionData.paymentDetailData, savingsAccountTransactionData.accountId,
|
savingsAccountTransactionData.paymentDetailData, savingsAccountTransactionData.accountId,
|
||||||
savingsAccountTransactionData.accountNo, savingsAccountTransactionData.date, savingsAccountTransactionData.currency,
|
savingsAccountTransactionData.accountNo, savingsAccountTransactionData.date, savingsAccountTransactionData.currency,
|
||||||
@@ -82,7 +83,7 @@ public class SavingsAccountTransactionData {
|
|||||||
private SavingsAccountTransactionData(final Long id, final SavingsAccountTransactionEnumData transactionType,
|
private SavingsAccountTransactionData(final Long id, final SavingsAccountTransactionEnumData transactionType,
|
||||||
final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date,
|
final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date,
|
||||||
final CurrencyData currency, final BigDecimal amount, final BigDecimal runningBalance, final boolean reversed,
|
final CurrencyData currency, final BigDecimal amount, final BigDecimal runningBalance, final boolean reversed,
|
||||||
final AccountTransferData transfer, final Collection<CodeValueData> paymentTypeOptions) {
|
final AccountTransferData transfer, final Collection<PaymentTypeData> paymentTypeOptions) {
|
||||||
|
|
||||||
this(id,transactionType,paymentDetailData,savingsId, savingsAccountNo,date,
|
this(id,transactionType,paymentDetailData,savingsId, savingsAccountNo,date,
|
||||||
currency,amount,runningBalance, reversed,
|
currency,amount,runningBalance, reversed,
|
||||||
@@ -93,7 +94,7 @@ public class SavingsAccountTransactionData {
|
|||||||
private SavingsAccountTransactionData(final Long id, final SavingsAccountTransactionEnumData transactionType,
|
private SavingsAccountTransactionData(final Long id, final SavingsAccountTransactionEnumData transactionType,
|
||||||
final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date,
|
final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date,
|
||||||
final CurrencyData currency, final BigDecimal amount, final BigDecimal runningBalance, final boolean reversed,
|
final CurrencyData currency, final BigDecimal amount, final BigDecimal runningBalance, final boolean reversed,
|
||||||
final AccountTransferData transfer, final Collection<CodeValueData> paymentTypeOptions,final LocalDate submittedOnDate) {
|
final AccountTransferData transfer, final Collection<PaymentTypeData> paymentTypeOptions,final LocalDate submittedOnDate) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.transactionType = transactionType;
|
this.transactionType = transactionType;
|
||||||
this.paymentDetailData = paymentDetailData;
|
this.paymentDetailData = paymentDetailData;
|
||||||
|
|||||||
+8
-8
@@ -14,10 +14,10 @@ import org.mifosplatform.accounting.common.AccountingRuleType;
|
|||||||
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
import org.mifosplatform.accounting.glaccount.data.GLAccountData;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.ChargeToGLAccountMapper;
|
||||||
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
import org.mifosplatform.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
import org.mifosplatform.portfolio.charge.data.ChargeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immutable data object represent a savings product.
|
* Immutable data object represent a savings product.
|
||||||
@@ -62,7 +62,7 @@ public class SavingsProductData {
|
|||||||
private final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions;
|
private final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions;
|
||||||
private final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions;
|
private final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions;
|
||||||
private final Collection<EnumOptionData> withdrawalFeeTypeOptions;
|
private final Collection<EnumOptionData> withdrawalFeeTypeOptions;
|
||||||
private final Collection<CodeValueData> paymentTypeOptions;
|
private final Collection<PaymentTypeData> paymentTypeOptions;
|
||||||
private final Collection<EnumOptionData> accountingRuleOptions;
|
private final Collection<EnumOptionData> accountingRuleOptions;
|
||||||
private final Map<String, List<GLAccountData>> accountingMappingOptions;
|
private final Map<String, List<GLAccountData>> accountingMappingOptions;
|
||||||
private final Collection<ChargeData> chargeOptions;
|
private final Collection<ChargeData> chargeOptions;
|
||||||
@@ -76,7 +76,7 @@ public class SavingsProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
||||||
final Collection<ChargeData> penaltyOptions) {
|
final Collection<ChargeData> penaltyOptions) {
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ public class SavingsProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> chargeOptions,
|
||||||
final Collection<ChargeData> penaltyOptions) {
|
final Collection<ChargeData> penaltyOptions) {
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ public class SavingsProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> chargeOptions = null;
|
final Collection<ChargeData> chargeOptions = null;
|
||||||
@@ -206,7 +206,7 @@ public class SavingsProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> chargeOptions = null;
|
final Collection<ChargeData> chargeOptions = null;
|
||||||
@@ -256,7 +256,7 @@ public class SavingsProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions = null;
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions = null;
|
||||||
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
final Collection<EnumOptionData> withdrawalFeeTypeOptions = null;
|
||||||
final Collection<CodeValueData> paymentTypeOptions = null;
|
final Collection<PaymentTypeData> paymentTypeOptions = null;
|
||||||
final Collection<EnumOptionData> accountingRuleOptions = null;
|
final Collection<EnumOptionData> accountingRuleOptions = null;
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
final Map<String, List<GLAccountData>> accountingMappingOptions = null;
|
||||||
final Collection<ChargeData> charges = null;
|
final Collection<ChargeData> charges = null;
|
||||||
@@ -288,7 +288,7 @@ public class SavingsProductData {
|
|||||||
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
final Collection<EnumOptionData> interestCalculationTypeOptions,
|
||||||
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
final Collection<EnumOptionData> interestCalculationDaysInYearTypeOptions,
|
||||||
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
final Collection<EnumOptionData> lockinPeriodFrequencyTypeOptions, final Collection<EnumOptionData> withdrawalFeeTypeOptions,
|
||||||
final Collection<CodeValueData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
final Collection<PaymentTypeData> paymentTypeOptions, final Collection<EnumOptionData> accountingRuleOptions,
|
||||||
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> charges,
|
final Map<String, List<GLAccountData>> accountingMappingOptions, final Collection<ChargeData> charges,
|
||||||
final Collection<ChargeData> chargeOptions, final Collection<ChargeData> penaltyOptions,
|
final Collection<ChargeData> chargeOptions, final Collection<ChargeData> penaltyOptions,
|
||||||
final Collection<ChargeToGLAccountMapper> feeToIncomeAccountMappings,
|
final Collection<ChargeToGLAccountMapper> feeToIncomeAccountMappings,
|
||||||
|
|||||||
+17
-19
@@ -10,13 +10,13 @@ import static org.mifosplatform.portfolio.savings.DepositsApiConstants.closedOnD
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.configuration.domain.ConfigurationDomainService;
|
import org.mifosplatform.infrastructure.configuration.domain.ConfigurationDomainService;
|
||||||
import org.mifosplatform.infrastructure.core.api.JsonQuery;
|
import org.mifosplatform.infrastructure.core.api.JsonQuery;
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
import org.mifosplatform.infrastructure.core.serialization.FromJsonHelper;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountOnClosureType;
|
import org.mifosplatform.portfolio.savings.DepositAccountOnClosureType;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
||||||
import org.mifosplatform.portfolio.savings.data.DepositAccountData;
|
import org.mifosplatform.portfolio.savings.data.DepositAccountData;
|
||||||
@@ -43,19 +43,21 @@ public class DepositAccountPreMatureCalculationPlatformServiceImpl implements De
|
|||||||
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
||||||
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
||||||
private final ConfigurationDomainService configurationDomainService;
|
private final ConfigurationDomainService configurationDomainService;
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DepositAccountPreMatureCalculationPlatformServiceImpl(final FromJsonHelper fromJsonHelper,
|
public DepositAccountPreMatureCalculationPlatformServiceImpl(final FromJsonHelper fromJsonHelper,
|
||||||
final DepositAccountTransactionDataValidator depositAccountTransactionDataValidator,
|
final DepositAccountTransactionDataValidator depositAccountTransactionDataValidator,
|
||||||
final DepositAccountAssembler depositAccountAssembler, final CodeValueReadPlatformService codeValueReadPlatformService,
|
final DepositAccountAssembler depositAccountAssembler, final CodeValueReadPlatformService codeValueReadPlatformService,
|
||||||
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
||||||
final ConfigurationDomainService configurationDomainService) {
|
final ConfigurationDomainService configurationDomainService, PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.fromJsonHelper = fromJsonHelper;
|
this.fromJsonHelper = fromJsonHelper;
|
||||||
this.depositAccountTransactionDataValidator = depositAccountTransactionDataValidator;
|
this.depositAccountTransactionDataValidator = depositAccountTransactionDataValidator;
|
||||||
this.depositAccountAssembler = depositAccountAssembler;
|
this.depositAccountAssembler = depositAccountAssembler;
|
||||||
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
||||||
this.savingsAccountReadPlatformService = savingsAccountReadPlatformService;
|
this.savingsAccountReadPlatformService = savingsAccountReadPlatformService;
|
||||||
this.configurationDomainService = configurationDomainService;
|
this.configurationDomainService = configurationDomainService;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,12 +65,11 @@ public class DepositAccountPreMatureCalculationPlatformServiceImpl implements De
|
|||||||
@Override
|
@Override
|
||||||
public DepositAccountData calculatePreMatureAmount(final Long accountId, final JsonQuery query,
|
public DepositAccountData calculatePreMatureAmount(final Long accountId, final JsonQuery query,
|
||||||
final DepositAccountType depositAccountType) {
|
final DepositAccountType depositAccountType) {
|
||||||
|
|
||||||
final boolean isSavingsInterestPostingAtCurrentPeriodEnd = this.configurationDomainService
|
final boolean isSavingsInterestPostingAtCurrentPeriodEnd = this.configurationDomainService
|
||||||
.isSavingsInterestPostingAtCurrentPeriodEnd();
|
.isSavingsInterestPostingAtCurrentPeriodEnd();
|
||||||
final Integer financialYearBeginningMonth = this.configurationDomainService
|
final Integer financialYearBeginningMonth = this.configurationDomainService.retrieveFinancialYearBeginningMonth();
|
||||||
.retrieveFinancialYearBeginningMonth();
|
|
||||||
|
|
||||||
this.depositAccountTransactionDataValidator.validatePreMatureAmountCalculation(query.json(), depositAccountType);
|
this.depositAccountTransactionDataValidator.validatePreMatureAmountCalculation(query.json(), depositAccountType);
|
||||||
final SavingsAccount account = this.depositAccountAssembler.assembleFrom(accountId, depositAccountType);
|
final SavingsAccount account = this.depositAccountAssembler.assembleFrom(accountId, depositAccountType);
|
||||||
|
|
||||||
@@ -76,8 +77,7 @@ public class DepositAccountPreMatureCalculationPlatformServiceImpl implements De
|
|||||||
Collection<EnumOptionData> onAccountClosureOptions = SavingsEnumerations
|
Collection<EnumOptionData> onAccountClosureOptions = SavingsEnumerations
|
||||||
.depositAccountOnClosureType(new DepositAccountOnClosureType[] { DepositAccountOnClosureType.WITHDRAW_DEPOSIT,
|
.depositAccountOnClosureType(new DepositAccountOnClosureType[] { DepositAccountOnClosureType.WITHDRAW_DEPOSIT,
|
||||||
DepositAccountOnClosureType.TRANSFER_TO_SAVINGS });
|
DepositAccountOnClosureType.TRANSFER_TO_SAVINGS });
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas = this.savingsAccountReadPlatformService.retrieveActiveForLookup(
|
final Collection<SavingsAccountData> savingsAccountDatas = this.savingsAccountReadPlatformService.retrieveActiveForLookup(
|
||||||
account.clientId(), DepositAccountType.SAVINGS_DEPOSIT);
|
account.clientId(), DepositAccountType.SAVINGS_DEPOSIT);
|
||||||
final JsonElement element = this.fromJsonHelper.parse(query.json());
|
final JsonElement element = this.fromJsonHelper.parse(query.json());
|
||||||
@@ -88,16 +88,14 @@ public class DepositAccountPreMatureCalculationPlatformServiceImpl implements De
|
|||||||
|
|
||||||
if (depositAccountType.isFixedDeposit()) {
|
if (depositAccountType.isFixedDeposit()) {
|
||||||
final FixedDepositAccount fd = (FixedDepositAccount) account;
|
final FixedDepositAccount fd = (FixedDepositAccount) account;
|
||||||
accountData = FixedDepositAccountData.preClosureDetails(account.getId(),
|
accountData = FixedDepositAccountData.preClosureDetails(account.getId(), fd.calculatePreMatureAmount(interestCalculatedToDate,
|
||||||
fd.calculatePreMatureAmount(interestCalculatedToDate, isPreMatureClosure,
|
isPreMatureClosure, isSavingsInterestPostingAtCurrentPeriodEnd, financialYearBeginningMonth), onAccountClosureOptions,
|
||||||
isSavingsInterestPostingAtCurrentPeriodEnd, financialYearBeginningMonth),
|
paymentTypeOptions, savingsAccountDatas);
|
||||||
onAccountClosureOptions, paymentTypeOptions, savingsAccountDatas);
|
|
||||||
} else if (depositAccountType.isRecurringDeposit()) {
|
} else if (depositAccountType.isRecurringDeposit()) {
|
||||||
final RecurringDepositAccount rd = (RecurringDepositAccount) account;
|
final RecurringDepositAccount rd = (RecurringDepositAccount) account;
|
||||||
accountData = RecurringDepositAccountData.preClosureDetails(account.getId(),
|
accountData = RecurringDepositAccountData.preClosureDetails(account.getId(), rd.calculatePreMatureAmount(
|
||||||
rd.calculatePreMatureAmount(interestCalculatedToDate, isPreMatureClosure,
|
interestCalculatedToDate, isPreMatureClosure, isSavingsInterestPostingAtCurrentPeriodEnd, financialYearBeginningMonth),
|
||||||
isSavingsInterestPostingAtCurrentPeriodEnd, financialYearBeginningMonth),
|
onAccountClosureOptions, paymentTypeOptions, savingsAccountDatas);
|
||||||
onAccountClosureOptions, paymentTypeOptions, savingsAccountDatas);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return accountData;
|
return accountData;
|
||||||
|
|||||||
+11
-8
@@ -15,7 +15,6 @@ import java.util.Map;
|
|||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.joda.time.format.DateTimeFormat;
|
import org.joda.time.format.DateTimeFormat;
|
||||||
import org.joda.time.format.DateTimeFormatter;
|
import org.joda.time.format.DateTimeFormatter;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.mifosplatform.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.infrastructure.core.data.PaginationParameters;
|
import org.mifosplatform.infrastructure.core.data.PaginationParameters;
|
||||||
@@ -51,6 +50,8 @@ import org.mifosplatform.portfolio.interestratechart.data.InterestRateChartData;
|
|||||||
import org.mifosplatform.portfolio.interestratechart.service.InterestRateChartReadPlatformService;
|
import org.mifosplatform.portfolio.interestratechart.service.InterestRateChartReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
import org.mifosplatform.portfolio.paymentdetail.PaymentDetailConstants;
|
||||||
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountOnClosureType;
|
import org.mifosplatform.portfolio.savings.DepositAccountOnClosureType;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
||||||
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
|
import org.mifosplatform.portfolio.savings.DepositsApiConstants;
|
||||||
@@ -109,6 +110,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
|
|||||||
private final DropdownReadPlatformService dropdownReadPlatformService;
|
private final DropdownReadPlatformService dropdownReadPlatformService;
|
||||||
private final CalendarReadPlatformService calendarReadPlatformService;
|
private final CalendarReadPlatformService calendarReadPlatformService;
|
||||||
private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
|
private final DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
|
||||||
|
private final PaymentTypeReadPlatformService paymentTypeReadPlatformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DepositAccountReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
|
public DepositAccountReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
|
||||||
@@ -122,7 +124,8 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
|
|||||||
final InterestRateChartReadPlatformService productChartReadPlatformService,
|
final InterestRateChartReadPlatformService productChartReadPlatformService,
|
||||||
final CodeValueReadPlatformService codeValueReadPlatformService,
|
final CodeValueReadPlatformService codeValueReadPlatformService,
|
||||||
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
||||||
final DropdownReadPlatformService dropdownReadPlatformService, final CalendarReadPlatformService calendarReadPlatformService) {
|
final DropdownReadPlatformService dropdownReadPlatformService, final CalendarReadPlatformService calendarReadPlatformService,
|
||||||
|
PaymentTypeReadPlatformService paymentTypeReadPlatformService) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||||
this.accountChartReadPlatformService = chartReadPlatformService;
|
this.accountChartReadPlatformService = chartReadPlatformService;
|
||||||
@@ -141,6 +144,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
|
|||||||
this.rdTransactionTemplateMapper = new RecurringAccountDepositTransactionTemplateMapper();
|
this.rdTransactionTemplateMapper = new RecurringAccountDepositTransactionTemplateMapper();
|
||||||
this.dropdownReadPlatformService = dropdownReadPlatformService;
|
this.dropdownReadPlatformService = dropdownReadPlatformService;
|
||||||
this.calendarReadPlatformService = calendarReadPlatformService;
|
this.calendarReadPlatformService = calendarReadPlatformService;
|
||||||
|
this.paymentTypeReadPlatformService = paymentTypeReadPlatformService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -250,8 +254,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
|
|||||||
accountId, depositAccountType.getValue() });
|
accountId, depositAccountType.getValue() });
|
||||||
Collection<EnumOptionData> onAccountClosureOptions = SavingsEnumerations
|
Collection<EnumOptionData> onAccountClosureOptions = SavingsEnumerations
|
||||||
.depositAccountOnClosureType(DepositAccountOnClosureType.values());
|
.depositAccountOnClosureType(DepositAccountOnClosureType.values());
|
||||||
final Collection<CodeValueData> paymentTypeOptions = this.codeValueReadPlatformService
|
final Collection<PaymentTypeData> paymentTypeOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||||
.retrieveCodeValuesByCode(PaymentDetailConstants.paymentTypeCodeName);
|
|
||||||
final Collection<SavingsAccountData> savingsAccountDatas = this.savingsAccountReadPlatformService.retrieveActiveForLookup(
|
final Collection<SavingsAccountData> savingsAccountDatas = this.savingsAccountReadPlatformService.retrieveActiveForLookup(
|
||||||
account.clientId(), DepositAccountType.SAVINGS_DEPOSIT);
|
account.clientId(), DepositAccountType.SAVINGS_DEPOSIT);
|
||||||
if (depositAccountType.isFixedDeposit()) {
|
if (depositAccountType.isFixedDeposit()) {
|
||||||
@@ -941,20 +944,20 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
|
|||||||
sqlBuilder.append("totran.transaction_date as toTransferDate, totran.amount as toTransferAmount,");
|
sqlBuilder.append("totran.transaction_date as toTransferDate, totran.amount as toTransferAmount,");
|
||||||
sqlBuilder.append("totran.description as toTransferDescription,");
|
sqlBuilder.append("totran.description as toTransferDescription,");
|
||||||
sqlBuilder.append("sa.id as savingsId, sa.account_no as accountNo,");
|
sqlBuilder.append("sa.id as savingsId, sa.account_no as accountNo,");
|
||||||
sqlBuilder.append("pd.payment_type_cv_id as paymentType,pd.account_number as accountNumber,pd.check_number as checkNumber, ");
|
sqlBuilder.append("pd.payment_type_id as paymentType,pd.account_number as accountNumber,pd.check_number as checkNumber, ");
|
||||||
sqlBuilder.append("pd.receipt_number as receiptNumber, pd.bank_number as bankNumber,pd.routing_code as routingCode, ");
|
sqlBuilder.append("pd.receipt_number as receiptNumber, pd.bank_number as bankNumber,pd.routing_code as routingCode, ");
|
||||||
sqlBuilder
|
sqlBuilder
|
||||||
.append("sa.currency_code as currencyCode, sa.currency_digits as currencyDigits, sa.currency_multiplesof as inMultiplesOf, ");
|
.append("sa.currency_code as currencyCode, sa.currency_digits as currencyDigits, sa.currency_multiplesof as inMultiplesOf, ");
|
||||||
sqlBuilder.append("curr.name as currencyName, curr.internationalized_name_code as currencyNameCode, ");
|
sqlBuilder.append("curr.name as currencyName, curr.internationalized_name_code as currencyNameCode, ");
|
||||||
sqlBuilder.append("curr.display_symbol as currencyDisplaySymbol, ");
|
sqlBuilder.append("curr.display_symbol as currencyDisplaySymbol, ");
|
||||||
sqlBuilder.append("cv.code_value as paymentTypeName ");
|
sqlBuilder.append("pt.value as paymentTypeName ");
|
||||||
sqlBuilder.append("from m_savings_account sa ");
|
sqlBuilder.append("from m_savings_account sa ");
|
||||||
sqlBuilder.append("join m_savings_account_transaction tr on tr.savings_account_id = sa.id ");
|
sqlBuilder.append("join m_savings_account_transaction tr on tr.savings_account_id = sa.id ");
|
||||||
sqlBuilder.append("join m_currency curr on curr.code = sa.currency_code ");
|
sqlBuilder.append("join m_currency curr on curr.code = sa.currency_code ");
|
||||||
sqlBuilder.append("left join m_account_transfer_transaction fromtran on fromtran.from_savings_transaction_id = tr.id ");
|
sqlBuilder.append("left join m_account_transfer_transaction fromtran on fromtran.from_savings_transaction_id = tr.id ");
|
||||||
sqlBuilder.append("left join m_account_transfer_transaction totran on totran.to_savings_transaction_id = tr.id ");
|
sqlBuilder.append("left join m_account_transfer_transaction totran on totran.to_savings_transaction_id = tr.id ");
|
||||||
sqlBuilder.append("left join m_payment_detail pd on tr.payment_detail_id = pd.id ");
|
sqlBuilder.append("left join m_payment_detail pd on tr.payment_detail_id = pd.id ");
|
||||||
sqlBuilder.append("left join m_code_value cv on pd.payment_type_cv_id = cv.id ");
|
sqlBuilder.append("left join m_payment_type pt on pd.payment_type_id = pt.id ");
|
||||||
|
|
||||||
this.schemaSql = sqlBuilder.toString();
|
this.schemaSql = sqlBuilder.toString();
|
||||||
}
|
}
|
||||||
@@ -982,7 +985,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
|
|||||||
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentType");
|
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentType");
|
||||||
if (paymentTypeId != null) {
|
if (paymentTypeId != null) {
|
||||||
final String typeName = rs.getString("paymentTypeName");
|
final String typeName = rs.getString("paymentTypeName");
|
||||||
final CodeValueData paymentType = CodeValueData.instance(paymentTypeId, typeName);
|
final PaymentTypeData paymentType = PaymentTypeData.instance(paymentTypeId, typeName);
|
||||||
final String accountNumber = rs.getString("accountNumber");
|
final String accountNumber = rs.getString("accountNumber");
|
||||||
final String checkNumber = rs.getString("checkNumber");
|
final String checkNumber = rs.getString("checkNumber");
|
||||||
final String routingCode = rs.getString("routingCode");
|
final String routingCode = rs.getString("routingCode");
|
||||||
|
|||||||
+6
-6
@@ -14,13 +14,13 @@ import java.util.Collection;
|
|||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.mifosplatform.infrastructure.codes.data.CodeValueData;
|
|
||||||
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
import org.mifosplatform.infrastructure.core.data.EnumOptionData;
|
||||||
import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
|
import org.mifosplatform.infrastructure.core.domain.JdbcSupport;
|
||||||
import org.mifosplatform.infrastructure.core.service.DateUtils;
|
import org.mifosplatform.infrastructure.core.service.DateUtils;
|
||||||
import org.mifosplatform.infrastructure.core.service.Page;
|
import org.mifosplatform.infrastructure.core.service.Page;
|
||||||
import org.mifosplatform.infrastructure.core.service.PaginationHelper;
|
import org.mifosplatform.infrastructure.core.service.PaginationHelper;
|
||||||
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
import org.mifosplatform.infrastructure.core.service.RoutingDataSource;
|
||||||
|
import org.mifosplatform.infrastructure.core.service.SearchParameters;
|
||||||
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
|
||||||
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
import org.mifosplatform.organisation.monetary.data.CurrencyData;
|
||||||
import org.mifosplatform.organisation.staff.data.StaffData;
|
import org.mifosplatform.organisation.staff.data.StaffData;
|
||||||
@@ -32,8 +32,8 @@ import org.mifosplatform.portfolio.client.data.ClientData;
|
|||||||
import org.mifosplatform.portfolio.client.service.ClientReadPlatformService;
|
import org.mifosplatform.portfolio.client.service.ClientReadPlatformService;
|
||||||
import org.mifosplatform.portfolio.group.data.GroupGeneralData;
|
import org.mifosplatform.portfolio.group.data.GroupGeneralData;
|
||||||
import org.mifosplatform.portfolio.group.service.GroupReadPlatformService;
|
import org.mifosplatform.portfolio.group.service.GroupReadPlatformService;
|
||||||
import org.mifosplatform.infrastructure.core.service.SearchParameters;
|
|
||||||
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
import org.mifosplatform.portfolio.paymentdetail.data.PaymentDetailData;
|
||||||
|
import org.mifosplatform.portfolio.paymenttype.data.PaymentTypeData;
|
||||||
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
import org.mifosplatform.portfolio.savings.DepositAccountType;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsCompoundingInterestPeriodType;
|
import org.mifosplatform.portfolio.savings.SavingsCompoundingInterestPeriodType;
|
||||||
import org.mifosplatform.portfolio.savings.SavingsInterestCalculationDaysInYearType;
|
import org.mifosplatform.portfolio.savings.SavingsInterestCalculationDaysInYearType;
|
||||||
@@ -660,20 +660,20 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead
|
|||||||
sqlBuilder.append("totran.transaction_date as toTransferDate, totran.amount as toTransferAmount,");
|
sqlBuilder.append("totran.transaction_date as toTransferDate, totran.amount as toTransferAmount,");
|
||||||
sqlBuilder.append("totran.description as toTransferDescription,");
|
sqlBuilder.append("totran.description as toTransferDescription,");
|
||||||
sqlBuilder.append("sa.id as savingsId, sa.account_no as accountNo,");
|
sqlBuilder.append("sa.id as savingsId, sa.account_no as accountNo,");
|
||||||
sqlBuilder.append("pd.payment_type_cv_id as paymentType,pd.account_number as accountNumber,pd.check_number as checkNumber, ");
|
sqlBuilder.append("pd.payment_type_id as paymentType,pd.account_number as accountNumber,pd.check_number as checkNumber, ");
|
||||||
sqlBuilder.append("pd.receipt_number as receiptNumber, pd.bank_number as bankNumber,pd.routing_code as routingCode, ");
|
sqlBuilder.append("pd.receipt_number as receiptNumber, pd.bank_number as bankNumber,pd.routing_code as routingCode, ");
|
||||||
sqlBuilder
|
sqlBuilder
|
||||||
.append("sa.currency_code as currencyCode, sa.currency_digits as currencyDigits, sa.currency_multiplesof as inMultiplesOf, ");
|
.append("sa.currency_code as currencyCode, sa.currency_digits as currencyDigits, sa.currency_multiplesof as inMultiplesOf, ");
|
||||||
sqlBuilder.append("curr.name as currencyName, curr.internationalized_name_code as currencyNameCode, ");
|
sqlBuilder.append("curr.name as currencyName, curr.internationalized_name_code as currencyNameCode, ");
|
||||||
sqlBuilder.append("curr.display_symbol as currencyDisplaySymbol, ");
|
sqlBuilder.append("curr.display_symbol as currencyDisplaySymbol, ");
|
||||||
sqlBuilder.append("cv.code_value as paymentTypeName ");
|
sqlBuilder.append("pt.value as paymentTypeName ");
|
||||||
sqlBuilder.append("from m_savings_account sa ");
|
sqlBuilder.append("from m_savings_account sa ");
|
||||||
sqlBuilder.append("join m_savings_account_transaction tr on tr.savings_account_id = sa.id ");
|
sqlBuilder.append("join m_savings_account_transaction tr on tr.savings_account_id = sa.id ");
|
||||||
sqlBuilder.append("join m_currency curr on curr.code = sa.currency_code ");
|
sqlBuilder.append("join m_currency curr on curr.code = sa.currency_code ");
|
||||||
sqlBuilder.append("left join m_account_transfer_transaction fromtran on fromtran.from_savings_transaction_id = tr.id ");
|
sqlBuilder.append("left join m_account_transfer_transaction fromtran on fromtran.from_savings_transaction_id = tr.id ");
|
||||||
sqlBuilder.append("left join m_account_transfer_transaction totran on totran.to_savings_transaction_id = tr.id ");
|
sqlBuilder.append("left join m_account_transfer_transaction totran on totran.to_savings_transaction_id = tr.id ");
|
||||||
sqlBuilder.append("left join m_payment_detail pd on tr.payment_detail_id = pd.id ");
|
sqlBuilder.append("left join m_payment_detail pd on tr.payment_detail_id = pd.id ");
|
||||||
sqlBuilder.append("left join m_code_value cv on pd.payment_type_cv_id = cv.id ");
|
sqlBuilder.append("left join m_payment_type pt on pd.payment_type_id = pt.id ");
|
||||||
|
|
||||||
this.schemaSql = sqlBuilder.toString();
|
this.schemaSql = sqlBuilder.toString();
|
||||||
}
|
}
|
||||||
@@ -702,7 +702,7 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead
|
|||||||
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentType");
|
final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentType");
|
||||||
if (paymentTypeId != null) {
|
if (paymentTypeId != null) {
|
||||||
final String typeName = rs.getString("paymentTypeName");
|
final String typeName = rs.getString("paymentTypeName");
|
||||||
final CodeValueData paymentType = CodeValueData.instance(paymentTypeId, typeName);
|
final PaymentTypeData paymentType = PaymentTypeData.instance(paymentTypeId, typeName);
|
||||||
final String accountNumber = rs.getString("accountNumber");
|
final String accountNumber = rs.getString("accountNumber");
|
||||||
final String checkNumber = rs.getString("checkNumber");
|
final String checkNumber = rs.getString("checkNumber");
|
||||||
final String routingCode = rs.getString("routingCode");
|
final String routingCode = rs.getString("routingCode");
|
||||||
|
|||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
CREATE TABLE `m_payment_type` (
|
||||||
|
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`value` VARCHAR(100) NULL DEFAULT NULL,
|
||||||
|
`description` VARCHAR(500) NULL DEFAULT NULL,
|
||||||
|
`is_cash_payment` TINYINT(1) NULL DEFAULT '0',
|
||||||
|
`order_position` INT(11) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8_general_ci';
|
||||||
|
|
||||||
|
INSERT INTO m_payment_type (id,value,description,order_position)
|
||||||
|
SELECT id,code_value,code_description,order_position
|
||||||
|
FROM m_code_value
|
||||||
|
where code_id in
|
||||||
|
(select mc.id
|
||||||
|
from m_code mc where mc.code_name='PaymentType'
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE `m_payment_detail`
|
||||||
|
DROP FOREIGN KEY `FK_m_payment_detail_m_code_value`;
|
||||||
|
|
||||||
|
ALTER TABLE `m_payment_detail`
|
||||||
|
CHANGE COLUMN `payment_type_cv_id` `payment_type_id` INT(11) NULL DEFAULT NULL AFTER `id`;
|
||||||
|
|
||||||
|
ALTER TABLE `m_payment_detail`
|
||||||
|
ADD CONSTRAINT `FK_m_payment_detail_m_payment_type` FOREIGN KEY (`payment_type_id`) REFERENCES `m_payment_type` (`id`);
|
||||||
|
|
||||||
|
ALTER TABLE `acc_product_mapping`
|
||||||
|
DROP FOREIGN KEY `FK_acc_product_mapping_m_code_value`;
|
||||||
|
|
||||||
|
ALTER TABLE `acc_product_mapping`
|
||||||
|
ADD CONSTRAINT `FK_acc_product_mapping_m_payment_type` FOREIGN KEY (`payment_type`) REFERENCES `m_payment_type` (`id`);
|
||||||
|
|
||||||
|
DELETE from m_code_value
|
||||||
|
WHERE
|
||||||
|
m_code_value.code_id in
|
||||||
|
(SELECT mc.id
|
||||||
|
FROM m_code mc where mc.code_name='PaymentType' );
|
||||||
|
|
||||||
|
DELETE FROM m_code WHERE code_name="PaymentType";
|
||||||
|
|
||||||
|
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_PAYMENTTYPE', 'PAYMENTTYPE', 'CREATE', 0);
|
||||||
|
|
||||||
|
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_PAYMENTTYPE', 'PAYMENTTYPE', 'UPDATE', 0);
|
||||||
|
|
||||||
|
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_PAYMENTTYPE', 'PAYMENTTYPE', 'DELETE', 0);
|
||||||
Reference in New Issue
Block a user