FINERACT-2232: Capitalized income adjustment
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.business.domain.loan.transaction;
|
||||
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
|
||||
public class LoanCapitalizedIncomeAdjustmentTransactionCreatedBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
|
||||
private static final String TYPE = "LoanCapitalizedIncomeAdjustmentTransactionCreatedBusinessEvent";
|
||||
|
||||
public LoanCapitalizedIncomeAdjustmentTransactionCreatedBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return TYPE;
|
||||
}
|
||||
}
|
||||
+2
@@ -69,6 +69,7 @@ public class LoanTransactionEnumData implements Serializable {
|
||||
private final boolean accrualAdjustment;
|
||||
private final boolean capitalizedIncome;
|
||||
private final boolean capitalizedIncomeAmortization;
|
||||
private final boolean capitalizedIncomeAdjustment;
|
||||
|
||||
public LoanTransactionEnumData(final Long id, final String code, final String value) {
|
||||
this.id = id;
|
||||
@@ -107,6 +108,7 @@ public class LoanTransactionEnumData implements Serializable {
|
||||
this.accrualAdjustment = Long.valueOf(LoanTransactionType.ACCRUAL_ADJUSTMENT.getValue()).equals(this.id);
|
||||
this.capitalizedIncome = Long.valueOf(LoanTransactionType.CAPITALIZED_INCOME.getValue()).equals(this.id);
|
||||
this.capitalizedIncomeAmortization = Long.valueOf(LoanTransactionType.CAPITALIZED_INCOME_AMORTIZATION.getValue()).equals(this.id);
|
||||
this.capitalizedIncomeAdjustment = Long.valueOf(LoanTransactionType.CAPITALIZED_INCOME_ADJUSTMENT.getValue()).equals(this.id);
|
||||
}
|
||||
|
||||
public boolean isRepaymentType() {
|
||||
|
||||
+8
-1
@@ -322,6 +322,12 @@ public class LoanTransaction extends AbstractAuditableWithUTCDateTimeCustom<Long
|
||||
};
|
||||
}
|
||||
|
||||
public static LoanTransaction capitalizedIncomeAdjustment(final Loan loan, final Money amount, final PaymentDetail paymentDetail,
|
||||
final LocalDate transactionDate, final ExternalId externalId) {
|
||||
return new LoanTransaction(loan, loan.getOffice(), LoanTransactionType.CAPITALIZED_INCOME_ADJUSTMENT, transactionDate,
|
||||
amount.getAmount(), amount.getAmount(), null, null, null, null, false, paymentDetail, externalId);
|
||||
}
|
||||
|
||||
public LoanTransaction copyTransactionPropertiesAndMappings() {
|
||||
LoanTransaction newTransaction = copyTransactionProperties(this);
|
||||
newTransaction.updateLoanTransactionToRepaymentScheduleMappings(loanTransactionToRepaymentScheduleMappings);
|
||||
@@ -570,7 +576,8 @@ public class LoanTransaction extends AbstractAuditableWithUTCDateTimeCustom<Long
|
||||
|
||||
public boolean isRepaymentLikeType() {
|
||||
return isRepayment() || isMerchantIssuedRefund() || isPayoutRefund() || isGoodwillCredit() || isChargeRefund()
|
||||
|| isChargeAdjustment() || isDownPayment() || isInterestPaymentWaiver() || isInterestRefund();
|
||||
|| isChargeAdjustment() || isDownPayment() || isInterestPaymentWaiver() || isInterestRefund()
|
||||
|| isCapitalizedIncomeAdjustment();
|
||||
}
|
||||
|
||||
public boolean isTypeAllowedForChargeback() {
|
||||
|
||||
+3
-1
@@ -24,7 +24,9 @@ public enum LoanTransactionRelationTypeEnum {
|
||||
CHARGEBACK(1, "loanTransactionRelationType.chargeback"), //
|
||||
CHARGE_ADJUSTMENT(2, "loanTransactionRelationType.chargeAdjustment"), //
|
||||
REPLAYED(3, "loanTransactionRelationType.replayed"), //
|
||||
RELATED(4, "loanTransactionRelationType.related");
|
||||
RELATED(4, "loanTransactionRelationType.related"), //
|
||||
ADJUSTMENT(5, "loanTransactionRelationType.adjustment"), //
|
||||
;
|
||||
|
||||
private final Integer value;
|
||||
private final String code;
|
||||
|
||||
+3
@@ -27,5 +27,8 @@ public interface CapitalizedIncomePlatformService {
|
||||
@Transactional
|
||||
CommandProcessingResult addCapitalizedIncome(Long loanId, JsonCommand command);
|
||||
|
||||
@Transactional
|
||||
CommandProcessingResult capitalizedIncomeAdjustment(Long loanId, Long capitalizedIncomeTransactionId, JsonCommand command);
|
||||
|
||||
void resetBalance(Long loanId);
|
||||
}
|
||||
|
||||
+2
-1
@@ -42,7 +42,8 @@ public enum PaymentAllocationTransactionType {
|
||||
CHARGE_PAYMENT(LoanTransactionType.CHARGE_PAYMENT, "Charge payment"), //
|
||||
REFUND_FOR_ACTIVE_LOAN(LoanTransactionType.REFUND_FOR_ACTIVE_LOAN, "Refund for active loan"), //
|
||||
INTEREST_PAYMENT_WAIVER(LoanTransactionType.INTEREST_PAYMENT_WAIVER, "Interest payment waiver"), //
|
||||
INTEREST_REFUND(LoanTransactionType.INTEREST_REFUND, "Interest refund");
|
||||
INTEREST_REFUND(LoanTransactionType.INTEREST_REFUND, "Interest refund"), //
|
||||
CAPITALIZED_INCOME_ADJUSTMENT(LoanTransactionType.CAPITALIZED_INCOME_ADJUSTMENT, "Capitalized income adjustment");
|
||||
|
||||
private final LoanTransactionType loanTransactionType;
|
||||
private final String humanReadableName;
|
||||
|
||||
Reference in New Issue
Block a user