increase auto formatting comment line length from 80 to 120

This commit is contained in:
Michael Vorburger
2020-06-23 10:01:12 +02:00
committed by Michael Vorburger ⛑️
parent 9542e35702
commit c529fdf58c
541 changed files with 1995 additions and 3177 deletions
+1 -1
View File
@@ -79,7 +79,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
@@ -112,8 +112,7 @@ public class AccountNumberPreferencesTest {
this.deleteAllAccountNumberPreferences();
/*
* Validate the default account number generation rules for clients,
* loans and savings accounts.
* Validate the default account number generation rules for clients, loans and savings accounts.
*/
this.validateDefaultAccountNumberGeneration();
@@ -121,8 +120,7 @@ public class AccountNumberPreferencesTest {
this.createAccountNumberPreference();
/*
* Validate account number preference rules apply to Clients,Loans and
* Saving Accounts
* Validate account number preference rules apply to Clients,Loans and Saving Accounts
*/
this.validateAccountNumberGenerationWithPreferences();
@@ -130,8 +128,7 @@ public class AccountNumberPreferencesTest {
this.updateAccountNumberPreference();
/*
* Validate account number preference rules apply to Clients,Loans and
* Saving Accounts after Updation
* Validate account number preference rules apply to Clients,Loans and Saving Accounts after Updation
*/
this.validateAccountNumberGenerationWithPreferences();
@@ -41,10 +41,8 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* Test class for
* {@link org.apache.fineract.batch.command.CommandStrategyProvider}. This tests
* the response provided by commandStrategy by injecting it with a
* {@code BatchRequest}.
* Test class for {@link org.apache.fineract.batch.command.CommandStrategyProvider}. This tests the response provided by
* commandStrategy by injecting it with a {@code BatchRequest}.
*
* @author RishabhShukla
*
@@ -57,9 +55,8 @@ public class BatchApiTest {
private RequestSpecification requestSpec;
/**
* Sets up the essential settings for the TEST like contentType,
* expectedStatusCode. It uses the '@BeforeEach' annotation provided by
* jUnit.
* Sets up the essential settings for the TEST like contentType, expectedStatusCode. It uses the '@BeforeEach'
* annotation provided by jUnit.
*/
@BeforeEach
public void setup() {
@@ -70,9 +67,8 @@ public class BatchApiTest {
}
/**
* Tests for the unimplemented command Strategies by returning 501 status
* code. For a unknownRequest a statusCode 501 is returned back with
* response.
* Tests for the unimplemented command Strategies by returning 501 status code. For a unknownRequest a statusCode
* 501 is returned back with response.
*
* @see org.apache.fineract.batch.command.internal.UnknownCommandStrategy
*/
@@ -93,9 +89,8 @@ public class BatchApiTest {
}
/**
* Tests for the successful response for a createClient request from
* createClientCommand. A successful response with statusCode '200' is
* returned back.
* Tests for the successful response for a createClient request from createClientCommand. A successful response with
* statusCode '200' is returned back.
*
* @see org.apache.fineract.batch.command.internal.CreateClientCommandStrategy
*/
@@ -113,10 +108,9 @@ public class BatchApiTest {
}
/**
* Tests for an erroneous response with statusCode '501' if transaction
* fails. If Query Parameter 'enclosingTransaction' is set to 'true' and if
* one of the request in BatchRequest fails then all transactions are rolled
* back.
* Tests for an erroneous response with statusCode '501' if transaction fails. If Query Parameter
* 'enclosingTransaction' is set to 'true' and if one of the request in BatchRequest fails then all transactions are
* rolled back.
*
* @see org.apache.fineract.batch.command.internal.CreateClientCommandStrategy
* @see org.apache.fineract.batch.api.BatchApiResource
@@ -156,9 +150,8 @@ public class BatchApiTest {
}
/**
* Tests that a client information was successfully updated through
* updateClientCommand. A 'changes' parameter is returned in the response
* after successful update of client information.
* Tests that a client information was successfully updated through updateClientCommand. A 'changes' parameter is
* returned in the response after successful update of client information.
*
* @see org.apache.fineract.batch.command.internal.UpdateClientCommandStrategy
*/
@@ -190,10 +183,8 @@ public class BatchApiTest {
}
/**
* Tests that a ApplyLoanCommand was successfully executed and returned a
* 200(OK) status. It creates a new client and apply a loan to that client.
* This also verifies the successful resolution of dependencies among two
* requests.
* Tests that a ApplyLoanCommand was successfully executed and returned a 200(OK) status. It creates a new client
* and apply a loan to that client. This also verifies the successful resolution of dependencies among two requests.
*
* @see org.apache.fineract.batch.command.internal.ApplyLoanCommandStrategy
*/
@@ -240,9 +231,8 @@ public class BatchApiTest {
}
/**
* Tests that a new savings accounts was applied to an existing client and a
* 200(OK) status was returned. It first creates a new client and a savings
* product, then uses the cliendId and ProductId to apply a savings account.
* Tests that a new savings accounts was applied to an existing client and a 200(OK) status was returned. It first
* creates a new client and a savings product, then uses the cliendId and ProductId to apply a savings account.
*
* @see org.apache.fineract.batch.command.internal.ApplySavingsCommandStrategy
*/
@@ -282,10 +272,9 @@ public class BatchApiTest {
}
/**
* Tests that a new charge was added to a newly created loan and charges are
* Collected properly 200(OK) status was returned for successful responses.
* It first creates a new client and apply a loan, then creates a new charge
* for the create loan and then fetches all the applied charges
* Tests that a new charge was added to a newly created loan and charges are Collected properly 200(OK) status was
* returned for successful responses. It first creates a new client and apply a loan, then creates a new charge for
* the create loan and then fetches all the applied charges
*
* @see org.apache.fineract.batch.command.internal.CollectChargesCommandStrategy
* @see org.apache.fineract.batch.command.internal.CreateChargeCommandStrategy
@@ -334,10 +323,9 @@ public class BatchApiTest {
}
/**
* Tests that batch repayment for loans is happening properly. Collected
* properly 200(OK) status was returned for successful responses. It first
* creates a new loan and then makes two repayments for it and then verifies
* that 200(OK) is returned for the repayment requests.
* Tests that batch repayment for loans is happening properly. Collected properly 200(OK) status was returned for
* successful responses. It first creates a new loan and then makes two repayments for it and then verifies that
* 200(OK) is returned for the repayment requests.
*
* @see org.apache.fineract.batch.command.internal.RepayLoanCommandStrategy
*/
@@ -398,9 +386,8 @@ public class BatchApiTest {
}
/**
* Test for the successful activation of a pending client using
* 'ActivateClientCommandStrategy'. A '200' status code is expected on
* successful activation.
* Test for the successful activation of a pending client using 'ActivateClientCommandStrategy'. A '200' status code
* is expected on successful activation.
*
* @see org.apache.fineract.batch.command.internal.ActivateClientCommandStrategy
*/
@@ -428,9 +415,8 @@ public class BatchApiTest {
}
/**
* Test for the successful approval and disbursal of a loan using
* 'ApproveLoanCommandStrategy' and 'DisburseLoanCommandStrategy'. A '200'
* status code is expected on successful activation.
* Test for the successful approval and disbursal of a loan using 'ApproveLoanCommandStrategy' and
* 'DisburseLoanCommandStrategy'. A '200' status code is expected on successful activation.
*
* @see org.apache.fineract.batch.command.internal.ApproveLoanCommandStrategy
* @see org.apache.fineract.batch.command.internal.DisburseLoanCommandStrategy
@@ -483,9 +469,8 @@ public class BatchApiTest {
}
/**
* Test for the successful create client, apply loan,approval and disbursal
* of a loan using Batch API with enclosingTransaction. A '200' status code
* is expected on successful activation.
* Test for the successful create client, apply loan,approval and disbursal of a loan using Batch API with
* enclosingTransaction. A '200' status code is expected on successful activation.
*
* @see org.apache.fineract.batch.command.internal.ApproveLoanCommandStrategy
* @see org.apache.fineract.batch.command.internal.DisburseLoanCommandStrategy
@@ -40,9 +40,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Test class for testing the integration of Batch API with custom batch
* requests and various user defined workflow. Like in the case of mifos
* community-app
* Test class for testing the integration of Batch API with custom batch requests and various user defined workflow.
* Like in the case of mifos community-app
*
* @author Rishabh Shukla
*/
@@ -57,9 +56,8 @@ public class BatchRequestsIntegrationTest {
}
/**
* Sets up the essential settings for the TEST like contentType,
* expectedStatusCode. It uses the '@BeforeEach' annotation provided by
* jUnit.
* Sets up the essential settings for the TEST like contentType, expectedStatusCode. It uses the '@BeforeEach'
* annotation provided by jUnit.
*/
@BeforeEach
public void setup() {
@@ -72,12 +70,10 @@ public class BatchRequestsIntegrationTest {
@Test
/**
* Tests that a loan is successfully applied to client members of a group.
* Firstly, it'll create a few new clients and then will add those clients
* to the group. Then a few loans will be created and one of those loans
* will be chosen at random and similarily a few of the created clients will
* be chosen on random. Now, the selected loan will be applied to these
* clients through Batch - API ApplyLoanCommandStrategy.
* Tests that a loan is successfully applied to client members of a group. Firstly, it'll create a few new clients
* and then will add those clients to the group. Then a few loans will be created and one of those loans will be
* chosen at random and similarily a few of the created clients will be chosen on random. Now, the selected loan
* will be applied to these clients through Batch - API ApplyLoanCommandStrategy.
*/
public void shouldReturnOkStatusForLoansAppliedToSelectedClients() {
@@ -62,9 +62,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Client Loan Integration Test for checking Loan Application Repayments
* Schedule, loan charges, penalties, loan repayments and verifying accounting
* transactions
* Client Loan Integration Test for checking Loan Application Repayments Schedule, loan charges, penalties, loan
* repayments and verifying accounting transactions
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public class ClientLoanIntegrationTest {
@@ -1249,8 +1248,7 @@ public class ClientLoanIntegrationTest {
}
/***
* Test case for checking CashBasedAccounting functionality adding charges
* with calculation type flat
* Test case for checking CashBasedAccounting functionality adding charges with calculation type flat
*/
@Test
public void loanWithFlatCahargesAndCashBasedAccountingEnabled() {
@@ -1426,8 +1424,8 @@ public class ClientLoanIntegrationTest {
}
/***
* Test case for checking CashBasedAccounting functionality adding charges
* with calculation type percentage of amount
* Test case for checking CashBasedAccounting functionality adding charges with calculation type percentage of
* amount
*/
@Test
public void loanWithCahargesOfTypeAmountPercentageAndCashBasedAccountingEnabled() {
@@ -1606,8 +1604,8 @@ public class ClientLoanIntegrationTest {
}
/***
* Test case for checking CashBasedAccounting functionality adding charges
* with calculation type percentage of amount plus interest
* Test case for checking CashBasedAccounting functionality adding charges with calculation type percentage of
* amount plus interest
*/
@Test
public void loanWithCahargesOfTypeAmountPlusInterestPercentageAndCashBasedAccountingEnabled() {
@@ -1787,8 +1785,7 @@ public class ClientLoanIntegrationTest {
}
/***
* Test case for checking AccuralUpfrontAccounting functionality adding
* charges with calculation type flat
* Test case for checking AccuralUpfrontAccounting functionality adding charges with calculation type flat
*/
@Test
public void loanWithFlatCahargesAndUpfrontAccrualAccountingEnabled() {
@@ -1981,8 +1978,8 @@ public class ClientLoanIntegrationTest {
}
/***
* Test case for checking AccuralUpfrontAccounting functionality adding
* charges with calculation type percentage of amount
* Test case for checking AccuralUpfrontAccounting functionality adding charges with calculation type percentage of
* amount
*/
@Test
public void loanWithCahargesAndUpfrontAccrualAccountingEnabled() {
@@ -2171,8 +2168,8 @@ public class ClientLoanIntegrationTest {
}
/***
* Test case for checking AccuralUpfrontAccounting functionality adding
* charges with calculation type percentage of amount plus interest
* Test case for checking AccuralUpfrontAccounting functionality adding charges with calculation type percentage of
* amount plus interest
*/
@Test
public void loanWithCahargesOfTypeAmountPlusInterestPercentageAndUpfrontAccrualAccountingEnabled() {
@@ -2368,8 +2365,7 @@ public class ClientLoanIntegrationTest {
}
/***
* Test case for checking AccuralPeriodicAccounting functionality adding
* charges with calculation type flat
* Test case for checking AccuralPeriodicAccounting functionality adding charges with calculation type flat
*/
@Test
public void loanWithFlatChargesAndPeriodicAccrualAccountingEnabled() throws InterruptedException {
@@ -2467,14 +2463,10 @@ public class ClientLoanIntegrationTest {
validateCharge(flatInstallmentFee, loanCharges, "50", "100.00", "50.0", "50.0");
/*
* this.journalEntryHelper.checkJournalEntryForAssetAccount(
* assetAccount, "20 September 2011", new
* JournalEntry(Float.valueOf("50.0"),
* JournalEntry.TransactionType.CREDIT));
* this.journalEntryHelper.checkJournalEntryForExpenseAccount
* (expenseAccount, "20 September 2011", new
* JournalEntry(Float.valueOf("50.0"),
* JournalEntry.TransactionType.DEBIT));
* this.journalEntryHelper.checkJournalEntryForAssetAccount( assetAccount, "20 September 2011", new
* JournalEntry(Float.valueOf("50.0"), JournalEntry.TransactionType.CREDIT));
* this.journalEntryHelper.checkJournalEntryForExpenseAccount (expenseAccount, "20 September 2011", new
* JournalEntry(Float.valueOf("50.0"), JournalEntry.TransactionType.DEBIT));
*/
final String jobName = "Add Accrual Transactions";
@@ -2561,8 +2553,8 @@ public class ClientLoanIntegrationTest {
}
/**
* Test case for checking AccuralPeriodicAccounting functionality adding
* charges with calculation type percentage of amount
* Test case for checking AccuralPeriodicAccounting functionality adding charges with calculation type percentage of
* amount
*/
@Test
public void loanWithChargesOfTypeAmountPercentageAndPeriodicAccrualAccountingEnabled() throws InterruptedException {
@@ -2663,14 +2655,10 @@ public class ClientLoanIntegrationTest {
validateCharge(percentageInstallmentFee, loanCharges, "1", "61.19", "29.11", "29.70");
/*
* this.journalEntryHelper.checkJournalEntryForAssetAccount(
* assetAccount, "20 September 2011", new
* JournalEntry(Float.valueOf("29.7"),
* JournalEntry.TransactionType.CREDIT));
* this.journalEntryHelper.checkJournalEntryForExpenseAccount
* (expenseAccount, "20 September 2011", new
* JournalEntry(Float.valueOf("29.7"),
* JournalEntry.TransactionType.DEBIT));
* this.journalEntryHelper.checkJournalEntryForAssetAccount( assetAccount, "20 September 2011", new
* JournalEntry(Float.valueOf("29.7"), JournalEntry.TransactionType.CREDIT));
* this.journalEntryHelper.checkJournalEntryForExpenseAccount (expenseAccount, "20 September 2011", new
* JournalEntry(Float.valueOf("29.7"), JournalEntry.TransactionType.DEBIT));
*/
final String jobName = "Add Accrual Transactions";
@@ -2758,8 +2746,8 @@ public class ClientLoanIntegrationTest {
}
/***
* Test case for checking AccuralPeriodicAccounting functionality adding
* charges with calculation type percentage of amount and interest
* Test case for checking AccuralPeriodicAccounting functionality adding charges with calculation type percentage of
* amount and interest
*/
@Test
public void loanWithChargesOfTypeAmountPlusInterestPercentageAndPeriodicAccrualAccountingEnabled() throws InterruptedException {
@@ -2861,13 +2849,10 @@ public class ClientLoanIntegrationTest {
validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, "1", "63.02", "31.51", "31.51");
/*
* this.journalEntryHelper.checkJournalEntryForAssetAccount(
* assetAccount, "20 September 2011", new JournalEntry(
* Float.valueOf("31.51"), JournalEntry.TransactionType.CREDIT));
* this.journalEntryHelper.checkJournalEntryForExpenseAccount
* (expenseAccount, "20 September 2011", new
* JournalEntry(Float.valueOf("31.51"),
* JournalEntry.TransactionType.DEBIT));
* this.journalEntryHelper.checkJournalEntryForAssetAccount( assetAccount, "20 September 2011", new
* JournalEntry( Float.valueOf("31.51"), JournalEntry.TransactionType.CREDIT));
* this.journalEntryHelper.checkJournalEntryForExpenseAccount (expenseAccount, "20 September 2011", new
* JournalEntry(Float.valueOf("31.51"), JournalEntry.TransactionType.DEBIT));
*/
final String jobName = "Add Accrual Transactions";
@@ -3032,8 +3017,7 @@ public class ClientLoanIntegrationTest {
validateNumberForEqual("0.00", String.valueOf(firstInstallment.get("totalOutstandingForPeriod")));
/***
* Verify 2nd and 3rd repayments dues before making excess payment for
* installment no 2
* Verify 2nd and 3rd repayments dues before making excess payment for installment no 2
*/
HashMap secondInstallment = loanSchedule.get(2);
HashMap thirdInstallment = loanSchedule.get(3);
@@ -3051,18 +3035,15 @@ public class ClientLoanIntegrationTest {
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
/***
* Verify 2nd and 3rd repayments after making excess payment for
* installment no 2
* Verify 2nd and 3rd repayments after making excess payment for installment no 2
*/
secondInstallment = loanSchedule.get(2);
validateNumberForEqual("0.00", String.valueOf(secondInstallment.get("totalOutstandingForPeriod")));
/***
* According to RBI Excess payment should go to principal portion of
* next installment, but as interest recalculation is not implemented,
* it wont make any difference to schedule even though if we made excess
* payment, so excess payments will behave the same as regular payment
* with the excess amount
* According to RBI Excess payment should go to principal portion of next installment, but as interest
* recalculation is not implemented, it wont make any difference to schedule even though if we made excess
* payment, so excess payments will behave the same as regular payment with the excess amount
*/
thirdInstallment = loanSchedule.get(3);
validateNumberForEqual("3200", String.valueOf(thirdInstallment.get("totalOutstandingForPeriod")));
@@ -3072,16 +3053,14 @@ public class ClientLoanIntegrationTest {
validateNumberForEqual("100.00", String.valueOf(thirdInstallment.get("interestOutstanding")));
/***
* Make payment with due amount of 3rd installment on 4th installment
* date
* Make payment with due amount of 3rd installment on 4th installment date
*/
this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3200"), loanID);
loanSchedule.clear();
loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID);
/***
* Verify overdue interests are deducted first and then remaining amount
* for interest portion of due installment
* Verify overdue interests are deducted first and then remaining amount for interest portion of due installment
*/
thirdInstallment = loanSchedule.get(3);
HashMap fourthInstallment = loanSchedule.get(4);
@@ -4948,8 +4927,8 @@ public class ClientLoanIntegrationTest {
.withMoratorium("2", "3").withLoanProductConfiguration(loanProductConfigurationAsFalse).build(null));
LOG.info("-------------------LOAN PRODUCT CREATED WITH ATTRIBUTE CONFIGURATION AS FALSE---------------------- {}", loanProductID);
/*
* Try to override attribute values in loan account when attribute
* configurations are set to false at product level
* Try to override attribute values in loan account when attribute configurations are set to false at product
* level
*/
loanID = applyForLoanApplicationWithProductConfigurationAsFalse(clientID, loanProductID, proposedAmount);
LOG.info("--------------------------LOAN CREATED WITH ID------------------------- {}", loanID);
@@ -656,9 +656,8 @@ public class ClientSavingsIntegrationTest {
}
/***
* Test case for overdraft account functionality. Open account with zero
* balance, perform transactions then post interest and verify posted
* interest
* Test case for overdraft account functionality. Open account with zero balance, perform transactions then post
* interest and verify posted interest
*/
@SuppressWarnings("unchecked")
@Test
@@ -675,8 +674,7 @@ public class ClientSavingsIntegrationTest {
final String minBalanceForInterestCalculation = null;
/***
* Create savings product with zero opening balance and overdraft
* enabled
* Create savings product with zero opening balance and overdraft enabled
*/
final String zeroOpeningBalance = "0.0";
final String minRequiredBalance = null;
@@ -734,9 +732,8 @@ public class ClientSavingsIntegrationTest {
Float balance = Float.valueOf(zeroOpeningBalance);
/***
* Perform withdraw transaction, verify account balance(account balance
* will go to negative as no deposits are there prior to this
* transaction)
* Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are
* there prior to this transaction)
*/
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -746,8 +743,7 @@ public class ClientSavingsIntegrationTest {
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
/***
* Perform Deposit transaction on last day of month and verify account
* balance.
* Perform Deposit transaction on last day of month and verify account balance.
*
* @param transactionDate
* this value is every time last day of previous month
@@ -768,9 +764,8 @@ public class ClientSavingsIntegrationTest {
Float actualInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
/***
* Calculate expected interest to be posted, interest should be posted
* for one day only because deposit transaction happened on last day of
* month before this account balance is negative.
* Calculate expected interest to be posted, interest should be posted for one day only because deposit
* transaction happened on last day of month before this account balance is negative.
*/
final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
@@ -781,8 +776,7 @@ public class ClientSavingsIntegrationTest {
Float interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -812,8 +806,7 @@ public class ClientSavingsIntegrationTest {
final String minBalanceForInterestCalculation = null;
/***
* Create savings product with zero opening balance and overdraft
* enabled
* Create savings product with zero opening balance and overdraft enabled
*/
final String zeroOpeningBalance = "0.0";
final String minRequiredBalance = null;
@@ -876,8 +869,7 @@ public class ClientSavingsIntegrationTest {
String TRANSACTION_DATE = dateFormat.format(transactionDate.getTime());
/***
* Perform Deposit transaction on last day of month and verify account
* balance.
* Perform Deposit transaction on last day of month and verify account balance.
*
* @param transactionDate
* this value is every time last day of previous month
@@ -890,9 +882,8 @@ public class ClientSavingsIntegrationTest {
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
/***
* Calculate expected interest to be posted, interest should be posted
* for one day only because deposit transaction happened on last day of
* month before this account balance is negative.
* Calculate expected interest to be posted, interest should be posted for one day only because deposit
* transaction happened on last day of month before this account balance is negative.
*/
this.savingsAccountHelper.postInterestForSavings(savingsId);
HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
@@ -908,8 +899,7 @@ public class ClientSavingsIntegrationTest {
Float interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -931,8 +921,7 @@ public class ClientSavingsIntegrationTest {
interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -958,8 +947,7 @@ public class ClientSavingsIntegrationTest {
interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -989,8 +977,7 @@ public class ClientSavingsIntegrationTest {
interestPosted = (float) (interestPerDay * balance * 19);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1020,8 +1007,7 @@ public class ClientSavingsIntegrationTest {
interestPosted = (float) (interestPerDay * balance * 8);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1047,8 +1033,7 @@ public class ClientSavingsIntegrationTest {
interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1072,8 +1057,7 @@ public class ClientSavingsIntegrationTest {
final String minBalanceForInterestCalculation = null;
/***
* Create savings product with zero opening balance and overdraft
* enabled
* Create savings product with zero opening balance and overdraft enabled
*/
final String zeroOpeningBalance = "0.0";
final String minRequiredBalance = null;
@@ -1136,9 +1120,8 @@ public class ClientSavingsIntegrationTest {
String TRANSACTION_DATE = dateFormat.format(transactionDate.getTime());
/***
* Perform withdraw transaction, verify account balance(account balance
* will go to negative as no deposits are there prior to this
* transaction)
* Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are
* there prior to this transaction)
*/
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -1148,8 +1131,7 @@ public class ClientSavingsIntegrationTest {
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
/***
* Perform Deposit transaction on last day of month and verify account
* balance.
* Perform Deposit transaction on last day of month and verify account balance.
*
* @param transactionDate
* this value is every time last day of previous month
@@ -1162,9 +1144,8 @@ public class ClientSavingsIntegrationTest {
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
/***
* Calculate expected interest to be posted, interest should be posted
* for one day only because deposit transaction happened on last day of
* month before this account balance is negative.
* Calculate expected interest to be posted, interest should be posted for one day only because deposit
* transaction happened on last day of month before this account balance is negative.
*/
this.savingsAccountHelper.postInterestForSavings(savingsId);
HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
@@ -1180,8 +1161,7 @@ public class ClientSavingsIntegrationTest {
Float interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1203,8 +1183,7 @@ public class ClientSavingsIntegrationTest {
interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1230,8 +1209,7 @@ public class ClientSavingsIntegrationTest {
interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1261,8 +1239,7 @@ public class ClientSavingsIntegrationTest {
interestPosted = (float) (interestPerDay * balance * 19);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1292,8 +1269,7 @@ public class ClientSavingsIntegrationTest {
interestPosted = (float) (interestPerDay * balance * 8);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1319,8 +1295,7 @@ public class ClientSavingsIntegrationTest {
interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1344,8 +1319,7 @@ public class ClientSavingsIntegrationTest {
final String minBalanceForInterestCalculation = null;
/***
* Create savings product with zero opening balance and overdraft
* enabled
* Create savings product with zero opening balance and overdraft enabled
*/
final String zeroOpeningBalance = "0.0";
final String minRequiredBalance = null;
@@ -1408,9 +1382,8 @@ public class ClientSavingsIntegrationTest {
Float balance = Float.valueOf(zeroOpeningBalance);
/***
* Perform withdraw transaction, verify account balance(account balance
* will go to negative as no deposits are there prior to this
* transaction)
* Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are
* there prior to this transaction)
*/
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -1420,8 +1393,7 @@ public class ClientSavingsIntegrationTest {
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
/***
* Perform Deposit transaction on last day of month and verify account
* balance.
* Perform Deposit transaction on last day of month and verify account balance.
*
* @param transactionDate
* this value is every time last day of previous month
@@ -1442,9 +1414,8 @@ public class ClientSavingsIntegrationTest {
Float actualInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
/***
* Calculate expected interest to be posted, interest should be posted
* for one day only because deposit transaction happened on last day of
* month before this account balance is negative.
* Calculate expected interest to be posted, interest should be posted for one day only because deposit
* transaction happened on last day of month before this account balance is negative.
*/
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, POSTED_TRANSACTION_DATE);
HashMap accountDetailsPostInterest = this.savingsAccountHelper.getSavingsDetails(savingsId);
@@ -1453,9 +1424,8 @@ public class ClientSavingsIntegrationTest {
Float accountDetailsPostInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
/***
* Calculate expected interest to be posted, interest should be posted
* for one day only because deposit transaction happened on last day of
* month before this account balance is negative.
* Calculate expected interest to be posted, interest should be posted for one day only because deposit
* transaction happened on last day of month before this account balance is negative.
*/
final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
@@ -1466,8 +1436,7 @@ public class ClientSavingsIntegrationTest {
Float interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1518,8 +1487,7 @@ public class ClientSavingsIntegrationTest {
final String minBalanceForInterestCalculation = null;
/***
* Create savings product with zero opening balance and overdraft
* enabled
* Create savings product with zero opening balance and overdraft enabled
*/
final String zeroOpeningBalance = "0.0";
final String minRequiredBalance = null;
@@ -1587,9 +1555,8 @@ public class ClientSavingsIntegrationTest {
Float balance = Float.valueOf(zeroOpeningBalance);
/***
* Perform withdraw transaction, verify account balance(account balance
* will go to negative as no deposits are there prior to this
* transaction)
* Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are
* there prior to this transaction)
*/
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -1599,8 +1566,7 @@ public class ClientSavingsIntegrationTest {
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
/***
* Perform Deposit transaction on last day of month and verify account
* balance.
* Perform Deposit transaction on last day of month and verify account balance.
*
* @param transactionDate
* this value is every time last day of previous month
@@ -1621,9 +1587,8 @@ public class ClientSavingsIntegrationTest {
Float actualInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
/***
* Calculate expected interest to be posted, interest should be posted
* for one day only because deposit transaction happened on last day of
* month before this account balance is negative.
* Calculate expected interest to be posted, interest should be posted for one day only because deposit
* transaction happened on last day of month before this account balance is negative.
*/
final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
@@ -1634,8 +1599,7 @@ public class ClientSavingsIntegrationTest {
Float interestPosted = (float) (interestPerDay * balance * 1);
/***
* Apply rounding on interestPosted, actualInterestPosted and verify
* both are same
* Apply rounding on interestPosted, actualInterestPosted and verify both are same
*/
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
@@ -1957,13 +1921,10 @@ public class ClientSavingsIntegrationTest {
}
/*
* private void verifySavingsInterest(final Object savingsInterest) {
* LOG.info(
* "--------------------VERIFYING THE BALANCE, INTEREST --------------------------"
* );
* private void verifySavingsInterest(final Object savingsInterest) { LOG.info(
* "--------------------VERIFYING THE BALANCE, INTEREST --------------------------" );
*
* assertEquals("Verifying Interest Calculation", Float.valueOf("238.3399"),
* savingsInterest); }
* assertEquals("Verifying Interest Calculation", Float.valueOf("238.3399"), savingsInterest); }
*/
@SuppressWarnings("unchecked")
@@ -2082,8 +2043,8 @@ public class ClientSavingsIntegrationTest {
}
/**
* incorrect savings account balance when charge transaction is reversed
* during an overdraft recalculate Daily Balances
* incorrect savings account balance when charge transaction is reversed during an overdraft recalculate Daily
* Balances
*/
@Test
@@ -46,8 +46,7 @@ import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Tests loan schedule change based on group meeting changes and loan
* rescheduling
* Tests loan schedule change based on group meeting changes and loan rescheduling
**/
@SuppressWarnings({ "rawtypes" })
@Disabled
@@ -83,15 +83,13 @@ public class FinancialActivityAccountsTest {
Assertions.assertNotNull(financialActivityAccountId);
/***
* Fetch Created Financial Activity to Account Mapping and validate
* created values
* Fetch Created Financial Activity to Account Mapping and validate created values
**/
assertFinancialActivityAccountCreation(financialActivityAccountId, LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID,
liabilityTransferAccount);
/**
* Update Existing Financial Activity to Account Mapping and assert
* changes
* Update Existing Financial Activity to Account Mapping and assert changes
**/
Account newLiabilityTransferAccount = accountHelper.createLiabilityAccount();
Assertions.assertNotNull(newLiabilityTransferAccount);
@@ -120,8 +118,7 @@ public class FinancialActivityAccountsTest {
duplicateFinancialActivityAccountError.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
/**
* Associating incorrect GL account types with a financial activity
* should fail
* Associating incorrect GL account types with a financial activity should fail
**/
List<HashMap> invalidFinancialActivityAccountError = (List<HashMap>) financialActivityAccountHelper.updateFinancialActivityAccount(
financialActivityAccountId, assetTransferFinancialActivityId, newLiabilityTransferAccount.getAccountID(),
@@ -121,8 +121,8 @@ public class FixedDepositTest {
}
/***
* Test case for Fixed Deposit Account premature closure with transaction
* type withdrawal and Cash Based accounting enabled
* Test case for Fixed Deposit Account premature closure with transaction type withdrawal and Cash Based accounting
* enabled
*/
@Test
public void testFixedDepositAccountWithPrematureClosureTypeWithdrawal() {
@@ -202,8 +202,7 @@ public class FixedDepositTest {
Float depositAmount = (Float) accountSummary.get("totalDeposits");
/***
* Verify journal entries posted for initial deposit transaction which
* happened at activation time
* Verify journal entries posted for initial deposit transaction which happened at activation time
*/
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
@@ -336,8 +335,7 @@ public class FixedDepositTest {
Float depositAmount = (Float) accountSummary.get("totalDeposits");
/***
* Verify journal entries posted for initial deposit transaction which
* happened at activation time
* Verify journal entries posted for initial deposit transaction which happened at activation time
*/
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
@@ -479,8 +477,7 @@ public class FixedDepositTest {
Float depositAmount = (Float) accountSummary.get("totalDeposits");
/***
* Verify journal entries posted for initial deposit transaction which
* happened at activation time
* Verify journal entries posted for initial deposit transaction which happened at activation time
*/
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
@@ -686,8 +683,8 @@ public class FixedDepositTest {
}
/***
* Test case for FD Account premature closure with transaction transfers to
* savings account and Cash Based accounting enabled
* Test case for FD Account premature closure with transaction transfers to savings account and Cash Based
* accounting enabled
*/
@Test
public void testFixedDepositAccountWithPrematureClosureTypeTransferToSavings() {
@@ -777,8 +774,7 @@ public class FixedDepositTest {
Float depositAmount = (Float) accountSummary.get("totalDeposits");
/***
* Verify journal entries posted for initial deposit transaction which
* happened at activation time
* Verify journal entries posted for initial deposit transaction which happened at activation time
*/
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
@@ -834,9 +830,8 @@ public class FixedDepositTest {
Float prematurityAmount = (Float) fixedDepositData.get("maturityAmount");
/***
* Verify journal entry transactions for preclosure transaction As this
* transaction is an account transfer you should get financial account
* mapping details and verify amounts
* Verify journal entry transactions for preclosure transaction As this transaction is an account transfer you
* should get financial account mapping details and verify amounts
*/
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE,
new JournalEntry(prematurityAmount, JournalEntry.TransactionType.CREDIT),
@@ -855,8 +850,8 @@ public class FixedDepositTest {
}
/***
* Test case for Fixed Deposit Account premature closure with transaction
* type ReInvest and Cash Based accounting enabled
* Test case for Fixed Deposit Account premature closure with transaction type ReInvest and Cash Based accounting
* enabled
*/
@Test
public void testFixedDepositAccountWithPrematureClosureTypeReinvest() {
@@ -930,8 +925,7 @@ public class FixedDepositTest {
Float depositAmount = (Float) accountSummary.get("totalDeposits");
/***
* Verify journal entries posted for initial deposit transaction which
* happened at activation time
* Verify journal entries posted for initial deposit transaction which happened at activation time
*/
final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.DEBIT) };
final JournalEntry[] liablilityAccountInitialEntry = { new JournalEntry(depositAmount, JournalEntry.TransactionType.CREDIT) };
@@ -2376,8 +2370,8 @@ public class FixedDepositTest {
}
/***
* Test case for Fixed Deposit Account rollover with maturity instruction as
* re invest maturity amount(principal+interest)
* Test case for Fixed Deposit Account rollover with maturity instruction as re invest maturity
* amount(principal+interest)
*/
@Test
public void testFixedDepositAccountWithRolloverMaturityAmount() {
@@ -2457,8 +2451,7 @@ public class FixedDepositTest {
}
/***
* Test case for Fixed Deposit Account rollover with maturity instruction as
* re invest principal only
* Test case for Fixed Deposit Account rollover with maturity instruction as re invest principal only
*/
@Test
public void testFixedDepositAccountWithRolloverPrincipal() {
@@ -2648,8 +2641,7 @@ public class FixedDepositTest {
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
final Account financialAccount;
/***
* if no financial activities are defined for account transfers, create
* liability financial accounting mappings
* if no financial activities are defined for account transfers, create liability financial accounting mappings
*/
if (financialActivities.isEmpty()) {
financialAccount = createLiabilityFinancialAccountTransferType(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID);
@@ -78,8 +78,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
this.savingsAccountHelper.depositToSavingsAccount(savingsId, "1000", startDate, CommonConstants.RESPONSE_RESOURCE_ID);
/***
* Perform Post interest transaction and verify the posted transaction
* date
* Perform Post interest transaction and verify the posted transaction date
*/
this.savingsAccountHelper.postInterestForSavings(savingsId);
HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
@@ -160,8 +160,7 @@ public class GlobalConfigurationTest {
Assertions.assertNotNull(configId);
/*
* Update force-password-reset-days with value as 0 and Enable
* as true - failure case
* Update force-password-reset-days with value as 0 and Enable as true - failure case
*/
ArrayList error = (ArrayList) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(this.requestSpec,
this.httpStatusForidden, configId, newValue, newBooleanValue, CommonConstants.RESPONSE_ERROR);
@@ -172,8 +171,7 @@ public class GlobalConfigurationTest {
"Force Password Reset days value must be greater than zero.");
/*
* Update force-password-reset-days with value as 50 and Enable
* as true - success case
* Update force-password-reset-days with value as 50 and Enable as true - success case
*/
final HashMap updateSuccess = (HashMap) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(
this.requestSpec, this.responseSpec, configId, "50", newBooleanValue, "changes");
@@ -185,8 +183,7 @@ public class GlobalConfigurationTest {
Assertions.assertNotNull(updateSuccess1);
/*
* Update without sending value and Enable as true - failure
* case
* Update without sending value and Enable as true - failure case
*/
ArrayList failure = (ArrayList) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(this.requestSpec,
this.httpStatusForidden, configId, null, newBooleanValue, CommonConstants.RESPONSE_ERROR);
@@ -41,8 +41,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Group Test for checking Group: Creation, Activation, Client Association,
* Updating & Deletion
* Group Test for checking Group: Creation, Activation, Client Association, Updating & Deletion
*/
public class GroupTest {
@@ -70,8 +70,8 @@ public class HookIntegrationTest {
try {
/**
* sleep for a three seconds after each failure to increase the
* likelihood of the previous request for creating office completing
* sleep for a three seconds after each failure to increase the likelihood of the previous request for
* creating office completing
**/
for (int i = 0; i < 6; i++) {
@@ -87,8 +87,7 @@ public class LoanApplicationApprovalTest {
}
/*
* Negative test case: Approved amount non zero is greater than proposed
* amount
* Negative test case: Approved amount non zero is greater than proposed amount
*/
@Test
public void loanApplicationApprovedAmountGreaterThanProposedAmount() {
@@ -236,10 +235,8 @@ public class LoanApplicationApprovalTest {
/* If tranches are not specified for a multi-disburse loan */
/**
* error =
* this.loanTransactionHelper.approveLoanForTranches(approveDate,
* expectedDisbursementDate, approvalAmount5, loanID, approveTranche5,
* CommonConstants.RESPONSE_ERROR);
* error = this.loanTransactionHelper.approveLoanForTranches(approveDate, expectedDisbursementDate,
* approvalAmount5, loanID, approveTranche5, CommonConstants.RESPONSE_ERROR);
* assertEquals("error.msg.disbursementData.required",
* error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
**/
@@ -232,113 +232,79 @@ public class LoanDisbursementDetailsIntegrationTest {
/* Uncomment and modify test builder values once MIFOSX-2006 is closed. */
/*
* private void validateRepaymentScheduleWithoutEMI(ArrayList<HashMap>
* periods){ LoanDisbursementTestBuilder expectedRepaymentSchedule0 = new
* LoanDisbursementTestBuilder( "[2015, 6, 1]", 0.0f, 0.0f, null, null,
* 5000.0f, null, null, null);
* private void validateRepaymentScheduleWithoutEMI(ArrayList<HashMap> periods){ LoanDisbursementTestBuilder
* expectedRepaymentSchedule0 = new LoanDisbursementTestBuilder( "[2015, 6, 1]", 0.0f, 0.0f, null, null, 5000.0f,
* null, null, null);
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule1 = new
* LoanDisbursementTestBuilder( "[2015, 7, 1]", 800.0f, 800.0f, 50.0f,
* 750.0f, 4250.0f, 750.0f, 750.0f, "[2015, 6, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule1 = new LoanDisbursementTestBuilder( "[2015, 7, 1]", 800.0f,
* 800.0f, 50.0f, 750.0f, 4250.0f, 750.0f, 750.0f, "[2015, 6, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule2 = new
* LoanDisbursementTestBuilder( "[2015, 8, 1]", 800.0f, 800.0f, 42.5f,
* 757.5f, 3492.5f, 757.5f, 757.5f, "[2015, 7, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule2 = new LoanDisbursementTestBuilder( "[2015, 8, 1]", 800.0f,
* 800.0f, 42.5f, 757.5f, 3492.5f, 757.5f, 757.5f, "[2015, 7, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule3 = new
* LoanDisbursementTestBuilder( "[2015, 9, 1]", 0.0f, 0.0f, null, null,
* 5000.0f, null, null, null);
* LoanDisbursementTestBuilder expectedRepaymentSchedule3 = new LoanDisbursementTestBuilder( "[2015, 9, 1]", 0.0f,
* 0.0f, null, null, 5000.0f, null, null, null);
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule4 = new
* LoanDisbursementTestBuilder( "[2015, 9, 1]", 800.0f, 800.0f, 34.92f,
* 765.08f, 7727.42f, 765.08f, 765.08f, "[2015, 8, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule4 = new LoanDisbursementTestBuilder( "[2015, 9, 1]", 800.0f,
* 800.0f, 34.92f, 765.08f, 7727.42f, 765.08f, 765.08f, "[2015, 8, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule5 = new
* LoanDisbursementTestBuilder( "[2015, 10, 1]", 800.0f, 800.0f, 77.27f,
* 722.73f, 7004.69f, 722.73f, 722.73f, "[2015, 9, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule5 = new LoanDisbursementTestBuilder( "[2015, 10, 1]",
* 800.0f, 800.0f, 77.27f, 722.73f, 7004.69f, 722.73f, 722.73f, "[2015, 9, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule6 = new
* LoanDisbursementTestBuilder( "[2015, 11, 1]", 800.0f, 800.0f, 70.05f,
* 729.95f, 6274.74f, 729.95f, 729.95f, "[2015, 10, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule6 = new LoanDisbursementTestBuilder( "[2015, 11, 1]",
* 800.0f, 800.0f, 70.05f, 729.95f, 6274.74f, 729.95f, 729.95f, "[2015, 10, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule7 = new
* LoanDisbursementTestBuilder( "[2015, 12, 1]", 800.0f, 800.0f, 62.75f,
* 737.25f, 5537.49f, 737.25f, 737.25f, "[2015, 11, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule7 = new LoanDisbursementTestBuilder( "[2015, 12, 1]",
* 800.0f, 800.0f, 62.75f, 737.25f, 5537.49f, 737.25f, 737.25f, "[2015, 11, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule8 = new
* LoanDisbursementTestBuilder( "[2016, 1, 1]", 800.0f, 800.0f, 55.37f,
* 744.63f, 4792.86f, 744.63f, 744.63f, "[2015, 12, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule8 = new LoanDisbursementTestBuilder( "[2016, 1, 1]", 800.0f,
* 800.0f, 55.37f, 744.63f, 4792.86f, 744.63f, 744.63f, "[2015, 12, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule9 = new
* LoanDisbursementTestBuilder( "[2016, 2, 1]", 800.0f, 800.0f, 47.93f,
* 752.07f, 4040.79f, 752.07f, 752.07f, "[2016, 1, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule9 = new LoanDisbursementTestBuilder( "[2016, 2, 1]", 800.0f,
* 800.0f, 47.93f, 752.07f, 4040.79f, 752.07f, 752.07f, "[2016, 1, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule10 = new
* LoanDisbursementTestBuilder( "[2016, 3, 1]", 800.0f, 800.0f, 40.41f,
* 759.59f, 3281.2f, 759.59f, 759.59f, "[2016, 2, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule10 = new LoanDisbursementTestBuilder( "[2016, 3, 1]",
* 800.0f, 800.0f, 40.41f, 759.59f, 3281.2f, 759.59f, 759.59f, "[2016, 2, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule11 = new
* LoanDisbursementTestBuilder( "[2016, 4, 1]", 800.0f, 800.0f, 32.81f,
* 767.19f, 2514.01f, 767.19f, 767.19f, "[2016, 3, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule11 = new LoanDisbursementTestBuilder( "[2016, 4, 1]",
* 800.0f, 800.0f, 32.81f, 767.19f, 2514.01f, 767.19f, 767.19f, "[2016, 3, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule12 = new
* LoanDisbursementTestBuilder( "[2016, 5, 1]", 800.0f, 800.0f, 25.14f,
* 774.86f, 1739.15f, 774.86f, 774.86f, "[2016, 4, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule12 = new LoanDisbursementTestBuilder( "[2016, 5, 1]",
* 800.0f, 800.0f, 25.14f, 774.86f, 1739.15f, 774.86f, 774.86f, "[2016, 4, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule13 = new
* LoanDisbursementTestBuilder( "[2016, 6, 1]", 800.0f, 800.0f, 17.39f,
* 782.61f, 956.54f, 782.61f, 782.61f, "[2016, 5, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule13 = new LoanDisbursementTestBuilder( "[2016, 6, 1]",
* 800.0f, 800.0f, 17.39f, 782.61f, 956.54f, 782.61f, 782.61f, "[2016, 5, 1]");
*
* LoanDisbursementTestBuilder expectedRepaymentSchedule14 = new
* LoanDisbursementTestBuilder( "[2016, 7, 1]", 966.11f, 966.11f, 9.57f,
* 956.54f, 0.0f, 956.54f, 956.54f, "[2016, 6, 1]");
* LoanDisbursementTestBuilder expectedRepaymentSchedule14 = new LoanDisbursementTestBuilder( "[2016, 7, 1]",
* 966.11f, 966.11f, 9.57f, 956.54f, 0.0f, 956.54f, 956.54f, "[2016, 6, 1]");
*
* ArrayList<LoanDisbursementTestBuilder> list = new
* ArrayList<LoanDisbursementTestBuilder>();
* list.add(expectedRepaymentSchedule0);
* list.add(expectedRepaymentSchedule1);
* list.add(expectedRepaymentSchedule2);
* list.add(expectedRepaymentSchedule3);
* list.add(expectedRepaymentSchedule4);
* list.add(expectedRepaymentSchedule5);
* list.add(expectedRepaymentSchedule6);
* list.add(expectedRepaymentSchedule7);
* list.add(expectedRepaymentSchedule8);
* list.add(expectedRepaymentSchedule9);
* list.add(expectedRepaymentSchedule10);
* list.add(expectedRepaymentSchedule11);
* list.add(expectedRepaymentSchedule12);
* list.add(expectedRepaymentSchedule13);
* list.add(expectedRepaymentSchedule14);
* ArrayList<LoanDisbursementTestBuilder> list = new ArrayList<LoanDisbursementTestBuilder>();
* list.add(expectedRepaymentSchedule0); list.add(expectedRepaymentSchedule1); list.add(expectedRepaymentSchedule2);
* list.add(expectedRepaymentSchedule3); list.add(expectedRepaymentSchedule4); list.add(expectedRepaymentSchedule5);
* list.add(expectedRepaymentSchedule6); list.add(expectedRepaymentSchedule7); list.add(expectedRepaymentSchedule8);
* list.add(expectedRepaymentSchedule9); list.add(expectedRepaymentSchedule10);
* list.add(expectedRepaymentSchedule11); list.add(expectedRepaymentSchedule12);
* list.add(expectedRepaymentSchedule13); list.add(expectedRepaymentSchedule14);
*
* for (int i = 0; i < list.size(); i++) {
* this.assertRepaymentScheduleValuesWithoutEMI(periods.get(i), list.get(i),
* for (int i = 0; i < list.size(); i++) { this.assertRepaymentScheduleValuesWithoutEMI(periods.get(i), list.get(i),
* i); } }
*
* private void assertRepaymentScheduleValuesWithoutEMI(HashMap period,
* LoanDisbursementTestBuilder expectedRepaymentSchedule, int position) {
* private void assertRepaymentScheduleValuesWithoutEMI(HashMap period, LoanDisbursementTestBuilder
* expectedRepaymentSchedule, int position) {
*
* assertEquals(period.get("dueDate").toString(),
* expectedRepaymentSchedule.getDueDate());
* assertEquals(period.get("dueDate").toString(), expectedRepaymentSchedule.getDueDate());
* assertEquals(period.get("principalLoanBalanceOutstanding"),
* expectedRepaymentSchedule.getPrincipalLoanBalanceOutstanding());
* assertEquals(period.get("totalOriginalDueForPeriod"),
* expectedRepaymentSchedule.getTotalOriginalDueForPeriod());
* assertEquals(period.get("totalOutstandingForPeriod"),
* expectedRepaymentSchedule.getTotalOutstandingForPeriod());
* assertEquals(period.get("totalOriginalDueForPeriod"), expectedRepaymentSchedule.getTotalOriginalDueForPeriod());
* assertEquals(period.get("totalOutstandingForPeriod"), expectedRepaymentSchedule.getTotalOutstandingForPeriod());
*
* if (position != 0 && position != 3) {
*
* assertEquals(period.get("interestOutstanding"),
* expectedRepaymentSchedule.getInterestOutstanding());
* assertEquals(period.get("principalOutstanding"),
* expectedRepaymentSchedule.getPrincipalOutstanding());
* assertEquals(period.get("principalDue"),
* expectedRepaymentSchedule.getPrincipalDue());
* assertEquals(period.get("principalOriginalDue"),
* expectedRepaymentSchedule.getPrincipalOriginalDue());
* assertEquals(period.get("fromDate").toString(),
* expectedRepaymentSchedule.getFromDate()); } }
* assertEquals(period.get("interestOutstanding"), expectedRepaymentSchedule.getInterestOutstanding());
* assertEquals(period.get("principalOutstanding"), expectedRepaymentSchedule.getPrincipalOutstanding());
* assertEquals(period.get("principalDue"), expectedRepaymentSchedule.getPrincipalDue());
* assertEquals(period.get("principalOriginalDue"), expectedRepaymentSchedule.getPrincipalOriginalDue());
* assertEquals(period.get("fromDate").toString(), expectedRepaymentSchedule.getFromDate()); } }
*/
private Integer applyForLoanApplicationWithEmiAmount(final Integer clientID, final Integer loanProductID, final String proposedAmount,
List<HashMap> tranches, final String installmentAmount) {
@@ -37,8 +37,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Client Loan Integration Test for checking Loan Disbursement with Waive
* Interest and Write-Off.
* Client Loan Integration Test for checking Loan Disbursement with Waive Interest and Write-Off.
*/
@SuppressWarnings({ "rawtypes" })
public class LoanWithWaiveInterestAndWriteOffIntegrationTest {
@@ -66,9 +66,8 @@ public class MinimumDaysBetweenDisbursalAndFirstRepaymentTest {
}
/*
* MinimumDaysBetweenDisbursalAndFirstRepayment is set to 7 days and days
* between disbursal date and first repayment is set as 7. system should
* allow to create this loan and allow to disburse
* MinimumDaysBetweenDisbursalAndFirstRepayment is set to 7 days and days between disbursal date and first repayment
* is set as 7. system should allow to create this loan and allow to disburse
*/
@Test
public void createLoanEntity_WITH_DAY_BETWEEN_DISB_DATE_AND_REPAY_START_DATE_GREATER_THAN_MIN_DAY_CRITERIA() {
@@ -112,9 +111,8 @@ public class MinimumDaysBetweenDisbursalAndFirstRepaymentTest {
}
/*
* MinimumDaysBetweenDisbursalAndFirstRepayment is set to 7 days and days
* between disbursal date and first repayment is set as 7. system should
* allow to create this loan and allow to disburse
* MinimumDaysBetweenDisbursalAndFirstRepayment is set to 7 days and days between disbursal date and first repayment
* is set as 7. system should allow to create this loan and allow to disburse
*/
@SuppressWarnings("unchecked")
@Test
@@ -122,8 +122,8 @@ public class RecurringDepositTest {
}
/***
* Test case for Recurring Deposit Account premature closure with
* transaction type withdrawal and Cash Based accounting enabled
* Test case for Recurring Deposit Account premature closure with transaction type withdrawal and Cash Based
* accounting enabled
*/
@Test
public void testRecurringDepositAccountWithPrematureClosureTypeWithdrawal() {
@@ -208,8 +208,7 @@ public class RecurringDepositTest {
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
/***
* Perform Deposit transaction and verify journal entries are posted for
* the transaction
* Perform Deposit transaction and verify journal entries are posted for the transaction
*/
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE);
@@ -272,9 +271,8 @@ public class RecurringDepositTest {
}
/***
* Test case for Recurring Deposit Account premature closure with
* transaction transfers to savings account and Cash Based accounting
* enabled
* Test case for Recurring Deposit Account premature closure with transaction transfers to savings account and Cash
* Based accounting enabled
*/
@Test
public void testRecurringDepositAccountWithPrematureClosureTypeTransferToSavings() {
@@ -388,8 +386,7 @@ public class RecurringDepositTest {
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
/***
* Perform Deposit transaction and verify journal entries are posted for
* the transaction
* Perform Deposit transaction and verify journal entries are posted for the transaction
*/
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE);
@@ -451,9 +448,8 @@ public class RecurringDepositTest {
recurringDepositAccountId);
Float maturityAmount = Float.valueOf(recurringDepositAccountData.get("maturityAmount").toString());
/***
* Verify journal entry transactions for preclosure transaction As this
* transaction is an account transfer you should get financial account
* mapping details and verify amounts
* Verify journal entry transactions for preclosure transaction As this transaction is an account transfer you
* should get financial account mapping details and verify amounts
*/
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE,
new JournalEntry(maturityAmount, JournalEntry.TransactionType.CREDIT),
@@ -592,8 +588,7 @@ public class RecurringDepositTest {
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
/***
* Perform Deposit transaction and verify journal entries are posted for
* the transaction
* Perform Deposit transaction and verify journal entries are posted for the transaction
*/
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
depositAmount, EXPECTED_FIRST_DEPOSIT_ON_DATE);
@@ -656,9 +651,8 @@ public class RecurringDepositTest {
recurringDepositAccountId);
Float maturityAmount = Float.valueOf(recurringDepositAccountData.get("maturityAmount").toString());
/***
* Verify journal entry transactions for preclosure transaction As this
* transaction is an account transfer you should get financial account
* mapping details and verify amounts
* Verify journal entry transactions for preclosure transaction As this transaction is an account transfer you
* should get financial account mapping details and verify amounts
*/
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(liabilityAccount, CLOSED_ON_DATE,
new JournalEntry(maturityAmount, JournalEntry.TransactionType.CREDIT),
@@ -804,8 +798,7 @@ public class RecurringDepositTest {
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
/***
* Perform Deposit transaction and verify journal entries are posted for
* the transaction
* Perform Deposit transaction and verify journal entries are posted for the transaction
*/
todaysDate = Calendar.getInstance();
todaysDate.add(Calendar.MONTH, -20);
@@ -846,8 +839,8 @@ public class RecurringDepositTest {
}
/***
* Test case for Recurring Deposit Account premature closure with
* transaction type ReInvest and Cash Based accounting enabled
* Test case for Recurring Deposit Account premature closure with transaction type ReInvest and Cash Based
* accounting enabled
*/
@Test
public void testRecurringDepositAccountWithPrematureClosureTypeReinvest() {
@@ -941,8 +934,7 @@ public class RecurringDepositTest {
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
/***
* Perform Deposit transaction and verify journal entries are posted for
* the transaction
* Perform Deposit transaction and verify journal entries are posted for the transaction
*/
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
DEPOSIT_AMOUNT, EXPECTED_FIRST_DEPOSIT_ON_DATE);
@@ -981,8 +973,7 @@ public class RecurringDepositTest {
.calculatePrematureAmountForRecurringDeposit(recurringDepositAccountId, CLOSED_ON_DATE);
/***
* Expected to get an error response from api because re-invest option
* is not supported for account preClosure
* Expected to get an error response from api because re-invest option is not supported for account preClosure
*/
ArrayList<HashMap> errorResponse = (ArrayList<HashMap>) recurringDepositAccountHelperValidationError
.prematureCloseForRecurringDeposit(recurringDepositAccountId, CLOSED_ON_DATE, CLOSURE_TYPE_REINVEST, null,
@@ -1130,8 +1121,7 @@ public class RecurringDepositTest {
}
/***
* Test case for Closure of Recurring Deposit Account(Withdrawn by
* applicant)
* Test case for Closure of Recurring Deposit Account(Withdrawn by applicant)
*/
@Test
public void testRecurringDepositAccountWithdrawnByClientAndClosed() {
@@ -1298,8 +1288,7 @@ public class RecurringDepositTest {
Float balanceBefore = (Float) recurringDepositSummaryBefore.get("accountBalance");
/***
* Perform Deposit transaction and verify journal entries are posted for
* the transaction
* Perform Deposit transaction and verify journal entries are posted for the transaction
*/
Integer transactionIdForDeposit = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
DEPOSIT_AMOUNT, DEPOSIT_DATE);
@@ -1351,8 +1340,7 @@ public class RecurringDepositTest {
}
/***
* Test case for verify maturity amount with monthly compounding and monthly
* posting with 365 days in year
* Test case for verify maturity amount with monthly compounding and monthly posting with 365 days in year
*/
@Test
public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_365_Days() {
@@ -1429,8 +1417,7 @@ public class RecurringDepositTest {
}
/***
* Test case for verify maturity amount with monthly compounding and monthly
* posting with 360 days in year
* Test case for verify maturity amount with monthly compounding and monthly posting with 360 days in year
*/
@Test
public void testMaturityAmountForMonthlyCompoundingAndMonthlyPosting_With_360_Days() {
@@ -1606,8 +1593,8 @@ public class RecurringDepositTest {
}
/***
* Test case for verify premature closure amount with penal interest for
* whole term with closure transaction type withdrawal and 365 days in year
* Test case for verify premature closure amount with penal interest for whole term with closure transaction type
* withdrawal and 365 days in year
*/
@Test
public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_365_Days() {
@@ -1731,8 +1718,8 @@ public class RecurringDepositTest {
}
/***
* Test case for verify premature closure amount with penal interest for
* whole term with closure transaction type withdrawal and 360 days in year
* Test case for verify premature closure amount with penal interest for whole term with closure transaction type
* withdrawal and 360 days in year
*/
@Test
public void testPrematureClosureAmountWithPenalInterestForWholeTerm_With_360_Days() {
@@ -1861,9 +1848,8 @@ public class RecurringDepositTest {
}
/***
* Test case for verify premature closure amount with penal interest till
* maturity date with closure transaction type withdrawal and 365 days in
* year
* Test case for verify premature closure amount with penal interest till maturity date with closure transaction
* type withdrawal and 365 days in year
*/
@Test
public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_With_365_Days() {
@@ -1999,9 +1985,8 @@ public class RecurringDepositTest {
}
/***
* Test case verify premature closure amount with penal interest till
* maturity date with closure transaction type withdrawal and 360 days in
* year
* Test case verify premature closure amount with penal interest till maturity date with closure transaction type
* withdrawal and 360 days in year
*/
@Test
public void testPrematureClosureAmountWithPenalInterestTillPrematureWithdrawal_With_360_Days() {
@@ -2142,8 +2127,7 @@ public class RecurringDepositTest {
}
/***
* Test case for verify maturity amount with daily compounding and monthly
* posting with 365 days in year
* Test case for verify maturity amount with daily compounding and monthly posting with 365 days in year
*/
@Test
public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_365_Days() {
@@ -2224,8 +2208,7 @@ public class RecurringDepositTest {
}
/***
* Test case for verify maturity amount with daily compounding and monthly
* posting with 360 days in year
* Test case for verify maturity amount with daily compounding and monthly posting with 360 days in year
*/
@Test
public void testMaturityAmountForDailyCompoundingAndMonthlyPosting_With_360_Days() {
@@ -2307,8 +2290,8 @@ public class RecurringDepositTest {
}
/***
* Test case for verify premature closure amount with Bi-annual interest
* compounding and Bi-annual interest posting with 365 days in year
* Test case for verify premature closure amount with Bi-annual interest compounding and Bi-annual interest posting
* with 365 days in year
*/
@Test
public void testRecurringDepositWithBi_AnnualCompoundingAndPosting_365_Days() {
@@ -2397,8 +2380,8 @@ public class RecurringDepositTest {
}
/***
* Test case for verify premature closure amount with Bi-annual interest
* compounding and Bi-annual interest posting with 360 days in year
* Test case for verify premature closure amount with Bi-annual interest compounding and Bi-annual interest posting
* with 360 days in year
*/
@Test
public void testRecurringDepositWithBi_AnnualCompoundingAndPosting_360_Days() {
@@ -2487,8 +2470,8 @@ public class RecurringDepositTest {
}
/***
* Test case for verify maturity amount with Daily interest compounding and
* annual interest posting with 365 days in year
* Test case for verify maturity amount with Daily interest compounding and annual interest posting with 365 days in
* year
*/
@Test
public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_365_Days() {
@@ -2577,8 +2560,8 @@ public class RecurringDepositTest {
}
/***
* Test case for verify maturity amount with Daily interest compounding and
* annual interest posting with 360 days in year
* Test case for verify maturity amount with Daily interest compounding and annual interest posting with 360 days in
* year
*/
@Test
public void testMaturityAmountForDailyCompoundingAndAnnuallyPosting_With_360_Days() {
@@ -2667,8 +2650,8 @@ public class RecurringDepositTest {
}
/***
* Test case for verify premature closure amount with Quarterly interest
* compounding and Quarterly interest posting with 365 days in year
* Test case for verify premature closure amount with Quarterly interest compounding and Quarterly interest posting
* with 365 days in year
*/
@Test
public void testRecurringDepositQuarterlyCompoundingAndQuarterlyPosting_365_Days() {
@@ -2757,8 +2740,8 @@ public class RecurringDepositTest {
}
/***
* Test case for verify premature closure amount with Quarterly interest
* compounding and Quarterly interest posting with 360 days in year
* Test case for verify premature closure amount with Quarterly interest compounding and Quarterly interest posting
* with 360 days in year
*/
@Test
public void testRecurringDepositQuarterlyCompoundingAndQuarterlyPosting_360_Days() {
@@ -3112,8 +3095,7 @@ public class RecurringDepositTest {
List<HashMap> financialActivities = this.financialActivityAccountHelper.getAllFinancialActivityAccounts(this.responseSpec);
final Account financialAccount;
/***
* if no financial activities are defined for account transfers, create
* liability financial accounting mappings
* if no financial activities are defined for account transfers, create liability financial accounting mappings
*/
if (financialActivities.isEmpty()) {
financialAccount = createLiabilityFinancialAccountTransferType(LIABILITY_TRANSFER_FINANCIAL_ACTIVITY_ID);
@@ -28,8 +28,7 @@ import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.junit.jupiter.api.BeforeEach;
/**
* Client Loan Integration Test for checking Loan Application Repayment
* Schedule.
* Client Loan Integration Test for checking Loan Application Repayment Schedule.
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public class SurveyIntegrationTest {
@@ -32,9 +32,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Helper class for {@link org.apache.fineract.integrationtests.BatchApiTest}.
* It takes care of creation of {@code BatchRequest} list and posting this list
* to the server.
* Helper class for {@link org.apache.fineract.integrationtests.BatchApiTest}. It takes care of creation of
* {@code BatchRequest} list and posting this list to the server.
*
* @author Rishabh Shukla
*
@@ -81,9 +80,8 @@ public final class BatchHelper {
}
/**
* Returns a list of BatchResponse with query parameter enclosing
* transaction set to false by posting the jsonified BatchRequest to the
* server.
* Returns a list of BatchResponse with query parameter enclosing transaction set to false by posting the jsonified
* BatchRequest to the server.
*
* @param requestSpec
* @param responseSpec
@@ -97,9 +95,8 @@ public final class BatchHelper {
}
/**
* Returns a list of BatchResponse with query parameter enclosing
* transaction set to true by posting the jsonified BatchRequest to the
* server.
* Returns a list of BatchResponse with query parameter enclosing transaction set to true by posting the jsonified
* BatchRequest to the server.
*
* @param requestSpec
* @param responseSpec
@@ -113,8 +110,7 @@ public final class BatchHelper {
}
/**
* Returns a BatchResponse based on the given BatchRequest, by posting the
* request to the server.
* Returns a BatchResponse based on the given BatchRequest, by posting the request to the server.
*
* @param BatchRequest
* @return List<BatchResponse>
@@ -137,9 +133,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.CreateClientCommandStrategy}
* Request as one of the request in Batch.
* Creates and returns a {@link org.apache.fineract.batch.command.internal.CreateClientCommandStrategy} Request as
* one of the request in Batch.
*
* @param reqId
* @param externalId
@@ -168,9 +163,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.CreateClientCommandStrategy}
* Request as one of the request in Batch.
* Creates and returns a {@link org.apache.fineract.batch.command.internal.CreateClientCommandStrategy} Request as
* one of the request in Batch.
*
* @param reqId
* @param externalId
@@ -200,9 +194,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.UpdateClientCommandStrategy}
* Request with given requestId and reference.
* Creates and returns a {@link org.apache.fineract.batch.command.internal.UpdateClientCommandStrategy} Request with
* given requestId and reference.
*
* @param reqId
* @param clientId
@@ -222,9 +215,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.ApplyLoanCommandStrategy}
* Request with given requestId and reference.
* Creates and returns a {@link org.apache.fineract.batch.command.internal.ApplyLoanCommandStrategy} Request with
* given requestId and reference.
*
* @param requestId
* @param reference
@@ -253,9 +245,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.ApplySavingsCommandStrategy}
* Request with given requestId and reference.
* Creates and returns a {@link org.apache.fineract.batch.command.internal.ApplySavingsCommandStrategy} Request with
* given requestId and reference.
*
* @param requestId
* @param reference
@@ -279,9 +270,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.CreateChargeCommandStrategy}
* Request with given requestId and reference
* Creates and returns a {@link org.apache.fineract.batch.command.internal.CreateChargeCommandStrategy} Request with
* given requestId and reference
*
* @param requestId
* @param reference
@@ -303,9 +293,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.CollectChargesCommandStrategy}
* Request with given requestId and reference.
* Creates and returns a {@link org.apache.fineract.batch.command.internal.CollectChargesCommandStrategy} Request
* with given requestId and reference.
*
* @param requestId
* @param reference
@@ -325,9 +314,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.ActivateClientCommandStrategy}
* Request with given requestId and reference.
* Creates and returns a {@link org.apache.fineract.batch.command.internal.ActivateClientCommandStrategy} Request
* with given requestId and reference.
*
*
* @param requestId
@@ -348,9 +336,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.ApproveLoanCommandStrategy}
* Request with given requestId and reference.
* Creates and returns a {@link org.apache.fineract.batch.command.internal.ApproveLoanCommandStrategy} Request with
* given requestId and reference.
*
*
* @param requestId
@@ -371,9 +358,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.DisburseLoanCommandStrategy}
* Request with given requestId and reference.
* Creates and returns a {@link org.apache.fineract.batch.command.internal.DisburseLoanCommandStrategy} Request with
* given requestId and reference.
*
*
* @param requestId
@@ -393,9 +379,8 @@ public final class BatchHelper {
}
/**
* Creates and returns a
* {@link org.apache.fineract.batch.command.internal.RepayLoanCommandStrategy}
* Request with given requestId.
* Creates and returns a {@link org.apache.fineract.batch.command.internal.RepayLoanCommandStrategy} Request with
* given requestId.
*
*
* @param requestId
@@ -416,8 +401,7 @@ public final class BatchHelper {
}
/**
* Checks that the client with given externalId is not created on the
* server.
* Checks that the client with given externalId is not created on the server.
*
* @param requestSpec
* @param responseSpec
@@ -66,9 +66,8 @@ public class ClientChargesTest {
Assertions.assertNotNull(clientId);
/**
* create a charge for loan and try to associate to client created in
* the above lines.it will be an invalid scenario the reason is client
* is not allowed to have only client charge.
* create a charge for loan and try to associate to client created in the above lines.it will be an invalid
* scenario the reason is client is not allowed to have only client charge.
*
*/
final Integer loanChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
@@ -80,8 +79,7 @@ public class ClientChargesTest {
Assertions.assertNull(clientLoanChargeId);
/**
* associates a clientCharge to a client and pay client charge for 10
* USD--success scenario
* associates a clientCharge to a client and pay client charge for 10 USD--success scenario
**/
final Integer clientChargeId = ClientHelper.addChargesForClient(this.requestSpec, this.responseSpec, clientId,
ClientHelper.getSpecifiedDueDateChargesClientAsJSON(chargeId.toString(), "29 October 2011"));
@@ -93,16 +91,15 @@ public class ClientChargesTest {
(float) 190.0);
/**
* Revert the paid client charge transaction by passing the
* clientChargePaidTransactionId and ensure the same is reverted.
* Revert the paid client charge transaction by passing the clientChargePaidTransactionId and ensure the same is
* reverted.
*/
final Integer undoTrxnId = ClientHelper.revertClientChargeTransaction(this.requestSpec, this.responseSpec, clientId.toString(),
clientChargePaidTransactionId);
Assertions.assertNotNull(undoTrxnId);
isReversedTransaction(clientId.toString(), undoTrxnId.toString());
/**
* Now pay client charge for 20 USD and ensure the outstanding amount is
* updated properly
* Now pay client charge for 20 USD and ensure the outstanding amount is updated properly
*/
ResponseSpecification responseSpecFailure = new ResponseSpecBuilder().expectStatusCode(400).build();
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy");
@@ -119,32 +116,28 @@ public class ClientChargesTest {
Assertions.assertNotNull(waiveOffClientChargeTransactionId);
/**
* Revert the waived off client charge transaction by passing the
* waiveOffClientChargeTransactionId and ensured the transaction is
* reversed.
* Revert the waived off client charge transaction by passing the waiveOffClientChargeTransactionId and ensured
* the transaction is reversed.
*/
final Integer undoWaiveTrxnId = ClientHelper.revertClientChargeTransaction(this.requestSpec, this.responseSpec, clientId.toString(),
waiveOffClientChargeTransactionId);
Assertions.assertNotNull(undoWaiveTrxnId);
isReversedTransaction(clientId.toString(), undoWaiveTrxnId.toString());
/**
* pay client charge before client activation date and ensured its a
* failure test case
* pay client charge before client activation date and ensured its a failure test case
*/
final String responseId_activationDate_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("30 September 2011", "20"));
Assertions.assertNull(responseId_activationDate_failure);
/**
* pay client charge more than outstanding amount amount and ensured its
* a failure test case
* pay client charge more than outstanding amount amount and ensured its a failure test case
*/
final String responseId_moreAmount_failure = ClientHelper.payChargesForClients(this.requestSpec, responseSpecFailure, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "300"));
Assertions.assertNull(responseId_moreAmount_failure);
/**
* pay client charge for 10 USD and ensure outstanding amount is updated
* properly
* pay client charge for 10 USD and ensure outstanding amount is updated properly
*/
final String chargePaid_responseId = ClientHelper.payChargesForClients(this.requestSpec, this.responseSpec, clientId,
clientChargeId, ClientHelper.getPayChargeJSON("25 AUGUST 2015", "100"));
@@ -168,8 +161,8 @@ public class ClientChargesTest {
}
/**
* Check whether the outStandingAmount is equal to expected Amount or not
* after paying or after waiving off the client charge.
* Check whether the outStandingAmount is equal to expected Amount or not after paying or after waiving off the
* client charge.
*
* @param outStandingAmount
* @param expectedAmount
@@ -110,16 +110,13 @@ public class GlobalConfigurationHelper {
}
/**
* Helper method to get the current default instance data of the
* /configurations endpoint. Used to reset and verify that no global
* configuration affects state between integration tests.
* Helper method to get the current default instance data of the /configurations endpoint. Used to reset and verify
* that no global configuration affects state between integration tests.
*
* @see <a href=
* "https://issues.apache.org/jira/browse/FINERACT-722">FINERACT-722</a>
* This is a quick, fail fast and early implementation to resolve this
* issue. TODO: A more robust future solution would be isolating all
* integration test state using Spring Framework's integration test
* infrastructure for transaction commits and rollbacks.
* @see <a href= "https://issues.apache.org/jira/browse/FINERACT-722">FINERACT-722</a> This is a quick, fail fast
* and early implementation to resolve this issue. TODO: A more robust future solution would be isolating all
* integration test state using Spring Framework's integration test infrastructure for transaction commits and
* rollbacks.
*/
private static ArrayList<HashMap> getAllDefaultGlobalConfigurations() {
@@ -142,9 +142,7 @@ public class SchedulerJobHelper {
* Launches a Job and awaits its completion.
*
* @param jobName
* displayName (see
* {@link org.apache.fineract.infrastructure.jobs.service.JobName})
* of Scheduler Job
* displayName (see {@link org.apache.fineract.infrastructure.jobs.service.JobName}) of Scheduler Job
*
* @author Michael Vorburger.ch
*/
@@ -45,8 +45,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Util for RestAssured tests. This class here in src/integrationTest is
* copy/pasted to src/test; please keep them in sync.
* Util for RestAssured tests. This class here in src/integrationTest is copy/pasted to src/test; please keep them in
* sync.
*/
@SuppressWarnings("unchecked")
public class Utils {
@@ -334,12 +334,10 @@ public class LoanApplicationTestBuilder {
}
/**
* calendarID parameter is used to sync repayments with group meetings,
* especially when using jlg loans
* calendarID parameter is used to sync repayments with group meetings, especially when using jlg loans
*
* @param calendarId
* the id of the calender record of the group meeting from
* m_calendar table
* the id of the calender record of the group meeting from m_calendar table
* @return
*/
public LoanApplicationTestBuilder withCalendarID(String calendarId) {
@@ -348,10 +346,8 @@ public class LoanApplicationTestBuilder {
}
/**
* This indicator is used mainly for jlg loans when we want to sync
* disbursement with the group meetings (it seems that if we do use this
* parameter we should also use calendarID to sync repayment with group
* meetings)
* This indicator is used mainly for jlg loans when we want to sync disbursement with the group meetings (it seems
* that if we do use this parameter we should also use calendarID to sync repayment with group meetings)
*
* @return
*/
@@ -81,27 +81,18 @@ public class LoanDisbursementTestBuilder {
}
/*
* public HashMap<String, String> build(String dueDate,String
* totalOriginalDueForPeriod,String totalOutstandingForPeriod, String
* interestOutstanding, String principalOutstanding, String
* principalLoanBalanceOutstanding, String principalDue, String
* principalOriginalDue, String fromDate) { HashMap<String, String>
* expectedRepaymentSchedule = new HashMap<String, String>();
* expectedRepaymentSchedule.put("dueDate", dueDate);
* expectedRepaymentSchedule.put("totalOriginalDueForPeriod",
* totalOriginalDueForPeriod);
* expectedRepaymentSchedule.put("totalOutstandingForPeriod",
* totalOutstandingForPeriod);
* expectedRepaymentSchedule.put("interestOutstanding",
* interestOutstanding);
* expectedRepaymentSchedule.put("principalOutstanding",
* principalOutstanding);
* expectedRepaymentSchedule.put("principalLoanBalanceOutstanding",
* principalLoanBalanceOutstanding);
* public HashMap<String, String> build(String dueDate,String totalOriginalDueForPeriod,String
* totalOutstandingForPeriod, String interestOutstanding, String principalOutstanding, String
* principalLoanBalanceOutstanding, String principalDue, String principalOriginalDue, String fromDate) {
* HashMap<String, String> expectedRepaymentSchedule = new HashMap<String, String>();
* expectedRepaymentSchedule.put("dueDate", dueDate); expectedRepaymentSchedule.put("totalOriginalDueForPeriod",
* totalOriginalDueForPeriod); expectedRepaymentSchedule.put("totalOutstandingForPeriod",
* totalOutstandingForPeriod); expectedRepaymentSchedule.put("interestOutstanding", interestOutstanding);
* expectedRepaymentSchedule.put("principalOutstanding", principalOutstanding);
* expectedRepaymentSchedule.put("principalLoanBalanceOutstanding", principalLoanBalanceOutstanding);
* expectedRepaymentSchedule.put("principalDue", principalDue);
* expectedRepaymentSchedule.put("principalOriginalDue",
* principalOriginalDue); expectedRepaymentSchedule.put("fromDate",
* fromDate);
* expectedRepaymentSchedule.put("principalOriginalDue", principalOriginalDue);
* expectedRepaymentSchedule.put("fromDate", fromDate);
*
* return expectedRepaymentSchedule; }
*/
@@ -46,8 +46,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Entity Datatable Checks Integration Test for checking Creation, Deletion and
* Retrieval of Entity-Datatable Check
* Entity Datatable Checks Integration Test for checking Creation, Deletion and Retrieval of Entity-Datatable Check
*/
public class EntityDatatableChecksIntegrationTest {
@@ -29,16 +29,13 @@ import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;
/**
* Fineract main() application which launches Fineract in an embedded Tomcat
* HTTP (using Spring Boot).
* Fineract main() application which launches Fineract in an embedded Tomcat HTTP (using Spring Boot).
*
* The DataSource used is a to a "normal" external database (not use MariaDB4j).
* This DataSource can be configured with parameters, see
* {@link DataSourceProperties}.
* The DataSource used is a to a "normal" external database (not use MariaDB4j). This DataSource can be configured with
* parameters, see {@link DataSourceProperties}.
*
* You can easily launch this via Debug as Java Application in your IDE -
* without needing command line Gradle stuff, no need to build and deploy a WAR,
* remote attachment etc.
* You can easily launch this via Debug as Java Application in your IDE - without needing command line Gradle stuff, no
* need to build and deploy a WAR, remote attachment etc.
*
* It's the old/classic Mifos (non-X) Workspace 2.0 reborn for Fineract! ;-)
*
@@ -45,8 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implementation of {@link FromApiJsonDeserializer} for
* {@link GuarantorCommand}'s.
* Implementation of {@link FromApiJsonDeserializer} for {@link GuarantorCommand}'s.
*/
@Component
public final class AccrualAccountingDataValidator {
@@ -29,8 +29,7 @@ final class GLClosuresApiResourceSwagger {
}
/**
* TODO: describe where this belongs: {@link GLClosuresApiResource }
* {@Link GLClosuresApiResource}
* TODO: describe where this belongs: {@link GLClosuresApiResource } {@Link GLClosuresApiResource}
*/
// Check !!
@@ -26,8 +26,7 @@ import org.joda.time.LocalDate;
/**
* Immutable object representing a General Ledger Account
*
* Note: no getter/setters required as google-gson will produce json from fields
* of object.
* Note: no getter/setters required as google-gson will produce json from fields of object.
*/
public class GLClosureData {
@@ -22,8 +22,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
import org.joda.time.LocalDate;
/**
* A {@link RuntimeException} thrown when a GL Closure for a given date and
* Office combination is already present
* A {@link RuntimeException} thrown when a GL Closure for a given date and Office combination is already present
*/
public class GLClosureDuplicateException extends AbstractPlatformDomainRuleException {
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.closure.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
/**
* A {@link RuntimeException} thrown when GL account closure resources are not
* found.
* A {@link RuntimeException} thrown when GL account closure resources are not found.
*/
public class GLClosureNotFoundException extends AbstractPlatformResourceNotFoundException {
@@ -36,8 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implementation of {@link FromApiJsonDeserializer} for
* {@link GuarantorCommand}'s.
* Implementation of {@link FromApiJsonDeserializer} for {@link GuarantorCommand}'s.
*/
@Component
public final class GLClosureCommandFromApiJsonDeserializer extends AbstractFromApiJsonDeserializer<GLClosureCommand> {
@@ -124,8 +124,7 @@ public class GLClosureWritePlatformServiceJpaRepositoryImpl implements GLClosure
.orElseThrow(() -> new GLClosureNotFoundException(glClosureId));
/**
* check if any closures are present for this branch at a later date
* than this closure date
* check if any closures are present for this branch at a later date than this closure date
**/
final Date closureDate = glClosure.getClosingDate();
final GLClosure latestGLClosure = this.glClosureRepository.getLatestGLClosureByBranch(glClosure.getOffice().getId());
@@ -102,8 +102,7 @@ public class AccountingConstants {
}
/***
* Enum of all accounting related input parameter names used while
* creating/updating a loan product
* Enum of all accounting related input parameter names used while creating/updating a loan product
***/
public static enum LoanProductAccountingParams {
@@ -201,8 +200,7 @@ public class AccountingConstants {
}
/***
* Enum of all accounting related input parameter names used while
* creating/updating a savings product
* Enum of all accounting related input parameter names used while creating/updating a savings product
***/
public static enum SavingProductAccountingParams {
@@ -374,8 +372,7 @@ public class AccountingConstants {
}
/***
* Enum of all accounting related input parameter names used while
* creating/updating a savings product
* Enum of all accounting related input parameter names used while creating/updating a savings product
***/
public static enum SharesProductAccountingParams {
@@ -25,8 +25,7 @@ import org.springframework.stereotype.Service;
/**
* <p>
* Wrapper for {@link FinancialActivityAccountRepository} that adds NULL
* checking and Error handling capabilities
* Wrapper for {@link FinancialActivityAccountRepository} that adds NULL checking and Error handling capabilities
* </p>
*/
@Service
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.financialactivityaccount.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
/**
* A {@link RuntimeException} thrown when product to GL account mapping are not
* found.
* A {@link RuntimeException} thrown when product to GL account mapping are not found.
*/
public class DuplicateFinancialActivityAccountFoundException extends AbstractPlatformDomainRuleException {
@@ -23,8 +23,7 @@ import org.apache.fineract.accounting.glaccount.domain.GLAccount;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
/**
* A {@link RuntimeException} thrown when product to GL account mapping are not
* found.
* A {@link RuntimeException} thrown when product to GL account mapping are not found.
*/
public class FinancialActivityAccountInvalidException extends AbstractPlatformDomainRuleException {
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.financialactivityaccount.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
/**
* A {@link RuntimeException} thrown when product to GL account mapping are not
* found.
* A {@link RuntimeException} thrown when product to GL account mapping are not found.
*/
public class FinancialActivityAccountNotFoundException extends AbstractPlatformResourceNotFoundException {
@@ -89,8 +89,7 @@ public class FinancialActivityAccountWritePlatformServiceImpl implements Financi
}
/**
* Validate that the GL Account is appropriate for the particular Financial
* Activity Type
* Validate that the GL Account is appropriate for the particular Financial Activity Type
**/
private void validateFinancialActivityAndAccountMapping(FinancialActivityAccount financialActivityAccount) {
FinancialActivity financialActivity = FinancialActivity.fromInt(financialActivityAccount.getFinancialActivityType());
@@ -30,8 +30,7 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData;
/**
* Immutable object representing a General Ledger Account
*
* Note: no getter/setters required as google-gson will produce json from fields
* of object.
* Note: no getter/setters required as google-gson will produce json from fields of object.
*/
public class GLAccountData implements Serializable {
@@ -22,8 +22,7 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainR
/**
*
* when gl account is attached with any product(loan/saving) then we can not
* disable the gl account
* when gl account is attached with any product(loan/saving) then we can not disable the gl account
*/
public class GLAccountDisableException extends AbstractPlatformDomainRuleException {
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
/**
* A {@link RuntimeException} thrown when a GL Account with a given GL Code of
* the particular type is already present
* A {@link RuntimeException} thrown when a GL Account with a given GL Code of the particular type is already present
*/
public class GLAccountDuplicateException extends AbstractPlatformDomainRuleException {
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
/**
* A {@link RuntimeException} thrown when trying to fetch accounts belonging to
* an Invalid Usage Type
* A {@link RuntimeException} thrown when trying to fetch accounts belonging to an Invalid Usage Type
*/
public class GLAccountInvalidClassificationException extends AbstractPlatformDomainRuleException {
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
/**
* A {@link RuntimeException} thrown when a GL Account with a given GL Code of
* the particular type is already present
* A {@link RuntimeException} thrown when a GL Account with a given GL Code of the particular type is already present
*/
public class GLAccountInvalidDeleteException extends AbstractPlatformDomainRuleException {
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
/**
* A {@link RuntimeException} thrown when trying to map invalid parents to a GL
* account
* A {@link RuntimeException} thrown when trying to map invalid parents to a GL account
*/
public class GLAccountInvalidParentException extends AbstractPlatformDomainRuleException {
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
/**
* A {@link RuntimeException} thrown when an error is encountered during
* updating a GL Account
* A {@link RuntimeException} thrown when an error is encountered during updating a GL Account
*/
public class GLAccountInvalidUpdateException extends AbstractPlatformDomainRuleException {
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.glaccount.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
/**
* A {@link RuntimeException} thrown when trying to fetch accounts belonging to
* an Invalid Type
* A {@link RuntimeException} thrown when trying to fetch accounts belonging to an Invalid Type
*/
public class GLAccountInvalidUsageException extends AbstractPlatformDomainRuleException {
@@ -35,8 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implementation of {@link FromApiJsonDeserializer} for
* {@link GuarantorCommand}'s.
* Implementation of {@link FromApiJsonDeserializer} for {@link GuarantorCommand}'s.
*/
@Component
public final class GLAccountCommandFromApiJsonDeserializer extends AbstractFromApiJsonDeserializer<GLAccountCommand> {
@@ -151,8 +151,7 @@ public class GLAccountWritePlatformServiceJpaRepositoryImpl implements GLAccount
}
/**
* a detail account cannot be changed to a header account if
* transactions are already logged against it
* a detail account cannot be changed to a header account if transactions are already logged against it
**/
if (changesOnly.containsKey(GLAccountJsonInputParams.USAGE.getValue())) {
if (glAccount.isHeaderAccount()) {
@@ -28,8 +28,7 @@ import org.joda.time.LocalDate;
/**
* Immutable object representing a General Ledger Account
*
* Note: no getter/setters required as google will produce json from fields of
* object.
* Note: no getter/setters required as google will produce json from fields of object.
*/
public class JournalEntryData {
@@ -46,13 +46,11 @@ public interface JournalEntryRepository
* @Query("select journalEntry from JournalEntry journalEntry where glAccount.id= :accountId and transactionId= :transactionId and transactionDate= :transactionDate"
* +
* " and type= :journalEntryType and entityType=1 and entityId= :loanId and loanTransaction.id= :loanTransactionId"
* ) JournalEntry findLOANJournalEntryWith(@Param("accountId") Long
* accountId, @Param("transactionId") String transactionId,
* ) JournalEntry findLOANJournalEntryWith(@Param("accountId") Long accountId, @Param("transactionId") String
* transactionId,
*
* @Param("transactionDate") Date
* transactionDate, @Param("journalEntryType") Integer journalEntryType,
* @Param("transactionDate") Date transactionDate, @Param("journalEntryType") Integer journalEntryType,
*
* @Param("loanId") Long loanId, @Param("loanTransactionId") Long
* loanTransactionId);
* @Param("loanId") Long loanId, @Param("loanTransactionId") Long loanTransactionId);
*/
}
@@ -41,8 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implementation of {@link FromApiJsonDeserializer} for
* {@link JournalEntryCommand}'s.
* Implementation of {@link FromApiJsonDeserializer} for {@link JournalEntryCommand}'s.
*/
@Component
public final class JournalEntryCommandFromApiJsonDeserializer extends AbstractFromApiJsonDeserializer<JournalEntryCommand> {
@@ -34,9 +34,8 @@ public class AccountingProcessorForSavingsFactory {
}
/***
* Looks like overkill for now, but wanted to keep the savings side of
* accounting identical to that of Loans (would we need an Accrual based
* accounting in the future?)
* Looks like overkill for now, but wanted to keep the savings side of accounting identical to that of Loans (would
* we need an Accrual based accounting in the future?)
***/
public AccountingProcessorForSavings determineProcessor(final SavingsDTO savingsDTO) {
@@ -338,11 +338,9 @@ public class AccountingProcessorHelper {
}
/**
* Convenience method that creates a pair of related Debits and Credits for
* Accrual Based accounting.
* Convenience method that creates a pair of related Debits and Credits for Accrual Based accounting.
*
* The target accounts for debits and credits are switched in case of a
* reversal
* The target accounts for debits and credits are switched in case of a reversal
*
* @param office
* @param accountTypeToBeDebited
@@ -372,11 +370,9 @@ public class AccountingProcessorHelper {
}
/**
* Convenience method that creates a pair of related Debits and Credits for
* Accrual Based accounting.
* Convenience method that creates a pair of related Debits and Credits for Accrual Based accounting.
*
* The target accounts for debits and credits are switched in case of a
* reversal
* The target accounts for debits and credits are switched in case of a reversal
*
* @param office
* office
@@ -445,11 +441,9 @@ public class AccountingProcessorHelper {
}
/**
* Convenience method that creates a pair of related Debits and Credits for
* Cash Based accounting.
* Convenience method that creates a pair of related Debits and Credits for Cash Based accounting.
*
* The target accounts for debits and credits are switched in case of a
* reversal
* The target accounts for debits and credits are switched in case of a reversal
*
* @param office
* @param accountTypeToBeDebited
@@ -480,11 +474,9 @@ public class AccountingProcessorHelper {
}
/**
* Convenience method that creates a pair of related Debits and Credits for
* Cash Based accounting.
* Convenience method that creates a pair of related Debits and Credits for Cash Based accounting.
*
* The target accounts for debits and credits are switched in case of a
* reversal
* The target accounts for debits and credits are switched in case of a reversal
*
* @param office
* @param accountTypeToBeDebited
@@ -535,8 +527,7 @@ public class AccountingProcessorHelper {
*/
public void checkForBranchClosures(final GLClosure latestGLClosure, final Date transactionDate) {
/**
* check if an accounting closure has happened for this branch after the
* transaction Date
* check if an accounting closure has happened for this branch after the transaction Date
**/
if (latestGLClosure != null) {
if (latestGLClosure.getClosingDate().after(transactionDate) || latestGLClosure.getClosingDate().equals(transactionDate)) {
@@ -573,11 +564,9 @@ public class AccountingProcessorHelper {
}
/**
* Convenience method that creates a pair of related Debits and Credits for
* Cash Based accounting.
* Convenience method that creates a pair of related Debits and Credits for Cash Based accounting.
*
* The target accounts for debits and credits are switched in case of a
* reversal
* The target accounts for debits and credits are switched in case of a reversal
*
* @param office
* @param currencyCode
@@ -695,8 +684,7 @@ public class AccountingProcessorHelper {
final Date transactionDate, final BigDecimal totalAmount, final Boolean isReversal,
final List<ChargePaymentDTO> chargePaymentDTOs) {
/***
* Map to track each account and the net credit to be made for a
* particular account
* Map to track each account and the net credit to be made for a particular account
***/
final Map<GLAccount, BigDecimal> creditDetailsMap = new LinkedHashMap<>();
for (final ChargePaymentDTO chargePaymentDTO : chargePaymentDTOs) {
@@ -736,11 +724,9 @@ public class AccountingProcessorHelper {
}
/**
* Convenience method that creates a pair of related Debits and Credits for
* Cash Based accounting.
* Convenience method that creates a pair of related Debits and Credits for Cash Based accounting.
*
* The target accounts for debits and credits are switched in case of a
* reversal
* The target accounts for debits and credits are switched in case of a reversal
*
* @param office
* office
@@ -775,10 +761,9 @@ public class AccountingProcessorHelper {
// TODO Vishwas: Remove this validation, as and when appropriate Junit
// tests are written for accounting
/**
* Accounting module currently supports a single charge per transaction,
* throw an error if this is not the case here so any developers
* changing the expected portfolio behavior would also take care of
* modifying the accounting code appropriately
* Accounting module currently supports a single charge per transaction, throw an error if this is not the case
* here so any developers changing the expected portfolio behavior would also take care of modifying the
* accounting code appropriately
**/
if (chargePaymentDTOs.size() != 1) {
throw new PlatformDataIntegrityException("Recent Portfolio changes w.r.t Charges for Savings have Broken the accounting code",
@@ -1124,9 +1109,8 @@ public class AccountingProcessorHelper {
PortfolioProductType.LOAN.getValue(), accountMappingTypeId);
/****
* Get more specific mapping for FUND source accounts (based on
* payment channels). Note that fund source placeholder ID would be
* same for both cash and accrual accounts
* Get more specific mapping for FUND source accounts (based on payment channels). Note that fund source
* placeholder ID would be same for both cash and accrual accounts
***/
if (accountMappingTypeId == CashAccountsForLoan.FUND_SOURCE.getValue()) {
final ProductToGLAccountMapping paymentChannelSpecificAccountMapping = this.accountMappingRepository
@@ -1150,10 +1134,9 @@ public class AccountingProcessorHelper {
ProductToGLAccountMapping accountMapping = this.accountMappingRepository.findCoreProductToFinAccountMapping(loanProductId,
PortfolioProductType.LOAN.getValue(), accountMappingTypeId);
/*****
* Get more specific mappings for Charges and penalties (based on the
* actual charge /penalty coupled with the loan product). Note the
* income from fees and income from penalties placeholder ID would be
* the same for both cash and accrual based accounts
* Get more specific mappings for Charges and penalties (based on the actual charge /penalty coupled with the
* loan product). Note the income from fees and income from penalties placeholder ID would be the same for both
* cash and accrual based accounts
*****/
// Vishwas TODO: remove this condition as it should always be true
@@ -1174,10 +1157,9 @@ public class AccountingProcessorHelper {
ProductToGLAccountMapping accountMapping = this.accountMappingRepository.findCoreProductToFinAccountMapping(savingsProductId,
PortfolioProductType.SAVING.getValue(), accountMappingTypeId);
/*****
* Get more specific mappings for Charges and penalties (based on the
* actual charge /penalty coupled with the loan product). Note the
* income from fees and income from penalties placeholder ID would be
* the same for both cash and accrual based accounts
* Get more specific mappings for Charges and penalties (based on the actual charge /penalty coupled with the
* loan product). Note the income from fees and income from penalties placeholder ID would be the same for both
* cash and accrual based accounts
*****/
// Vishwas TODO: remove this condition as it should always be true
@@ -1204,9 +1186,8 @@ public class AccountingProcessorHelper {
ProductToGLAccountMapping accountMapping = this.accountMappingRepository.findCoreProductToFinAccountMapping(savingsProductId,
PortfolioProductType.SAVING.getValue(), accountMappingTypeId);
/****
* Get more specific mapping for FUND source accounts (based on
* payment channels). Note that fund source placeholder ID would be
* same for both cash and accrual accounts
* Get more specific mapping for FUND source accounts (based on payment channels). Note that fund source
* placeholder ID would be same for both cash and accrual accounts
***/
if (accountMappingTypeId == CashAccountsForSavings.SAVINGS_REFERENCE.getValue()) {
final ProductToGLAccountMapping paymentChannelSpecificAccountMapping = this.accountMappingRepository
@@ -1249,10 +1230,9 @@ public class AccountingProcessorHelper {
ProductToGLAccountMapping accountMapping = this.accountMappingRepository.findCoreProductToFinAccountMapping(shareProductId,
PortfolioProductType.SHARES.getValue(), accountMappingTypeId);
/*****
* Get more specific mappings for Charges and penalties (based on the
* actual charge /penalty coupled with the loan product). Note the
* income from fees and income from penalties placeholder ID would be
* the same for both cash and accrual based accounts
* Get more specific mappings for Charges and penalties (based on the actual charge /penalty coupled with the
* loan product). Note the income from fees and income from penalties placeholder ID would be the same for both
* cash and accrual based accounts
*****/
final ProductToGLAccountMapping chargeSpecificIncomeAccountMapping = this.accountMappingRepository
@@ -1276,8 +1256,7 @@ public class AccountingProcessorHelper {
final Long clientId, final Long transactionId, final Date transactionDate, final Boolean isReversal,
final List<ClientChargePaymentDTO> clientChargePaymentDTOs) {
/***
* Map to track each account affected and the net credit to be made for
* a particular account
* Map to track each account affected and the net credit to be made for a particular account
***/
final Map<GLAccount, BigDecimal> creditDetailsMap = new LinkedHashMap<>();
for (final ClientChargePaymentDTO clientChargePaymentDTO : clientChargePaymentDTOs) {
@@ -65,8 +65,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
}
/***
* Handle repayments, repayments at disbursement and reversal of
* Repayments and Repayments at disbursement
* Handle repayments, repayments at disbursement and reversal of Repayments and Repayments at disbursement
***/
else if (loanTransactionDTO.getTransactionType().isRepayment()
|| loanTransactionDTO.getTransactionType().isRepaymentAtDisbursement()
@@ -144,35 +143,27 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
* <br/>
* <br/>
*
* <b>Principal Repayment</b>: Debits "Fund Source" and Credits "Loan
* Portfolio"<br/>
* <b>Principal Repayment</b>: Debits "Fund Source" and Credits "Loan Portfolio"<br/>
*
* <b>Interest Repayment</b>:Debits "Fund Source" and and Credits
* "Receivable Interest" <br/>
* <b>Interest Repayment</b>:Debits "Fund Source" and and Credits "Receivable Interest" <br/>
*
* <b>Fee Repayment</b>:Debits "Fund Source" (or "Interest on Loans" in case
* of repayment at disbursement) and and Credits "Receivable Fees" <br/>
* <b>Fee Repayment</b>:Debits "Fund Source" (or "Interest on Loans" in case of repayment at disbursement) and and
* Credits "Receivable Fees" <br/>
*
* <b>Penalty Repayment</b>: Debits "Fund Source" and and Credits
* "Receivable Penalties" <br/>
* <b>Penalty Repayment</b>: Debits "Fund Source" and and Credits "Receivable Penalties" <br/>
* <br/>
* Handles write offs using the following posting rules <br/>
* <br/>
* <b>Principal Write off</b>: Debits "Losses Written Off" and Credits "Loan
* Portfolio"<br/>
* <b>Principal Write off</b>: Debits "Losses Written Off" and Credits "Loan Portfolio"<br/>
*
* <b>Interest Write off</b>:Debits "Losses Written off" and and Credits
* "Receivable Interest" <br/>
* <b>Interest Write off</b>:Debits "Losses Written off" and and Credits "Receivable Interest" <br/>
*
* <b>Fee Write off</b>:Debits "Losses Written off" and and Credits
* "Receivable Fees" <br/>
* <b>Fee Write off</b>:Debits "Losses Written off" and and Credits "Receivable Fees" <br/>
*
* <b>Penalty Write off</b>: Debits "Losses Written off" and and Credits
* "Receivable Penalties" <br/>
* <b>Penalty Write off</b>: Debits "Losses Written off" and and Credits "Receivable Penalties" <br/>
* <br/>
* <br/>
* In case the loan transaction has been reversed, all debits are turned
* into credits and vice versa
* In case the loan transaction has been reversed, all debits are turned into credits and vice versa
*
* @param loanTransactionDTO
* @param loanDTO
@@ -289,8 +280,7 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
}
/**
* Single DEBIT transaction for write-offs or Repayments (and their
* reversals)
* Single DEBIT transaction for write-offs or Repayments (and their reversals)
***/
if (!(totalDebitAmount.compareTo(BigDecimal.ZERO) == 0)) {
if (writeOff) {
@@ -315,11 +305,9 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
}
/**
* Create a single Debit to fund source and a single credit to "Income from
* Recovery"
* Create a single Debit to fund source and a single credit to "Income from Recovery"
*
* In case the loan transaction is a reversal, all debits are turned into
* credits and vice versa
* In case the loan transaction is a reversal, all debits are turned into credits and vice versa
*/
private void createJournalEntriesForRecoveryRepayments(final LoanDTO loanDTO, final LoanTransactionDTO loanTransactionDTO,
final Office office) {
@@ -345,11 +333,9 @@ public class AccrualBasedAccountingProcessorForLoan implements AccountingProcess
* Recognize the receivable interest <br/>
* Debit "Interest Receivable" and Credit "Income from Interest"
*
* <b>Fees:</b> Debit <i>Fees Receivable</i> and credit <i>Income from
* Fees</i> <br/>
* <b>Fees:</b> Debit <i>Fees Receivable</i> and credit <i>Income from Fees</i> <br/>
*
* <b>Penalties:</b> Debit <i>Penalties Receivable</i> and credit <i>Income
* from Penalties</i>
* <b>Penalties:</b> Debit <i>Penalties Receivable</i> and credit <i>Income from Penalties</i>
*
* Also handles reversals for both fees and payment applications
*
@@ -52,11 +52,10 @@ public class CashBasedAccountingProcessorForClientTransactions implements Accoun
}
/**
* Create a single debit to fund source and multiple credits for the income
* account mapped with each charge this payment pays off
* Create a single debit to fund source and multiple credits for the income account mapped with each charge this
* payment pays off
*
* In case the loan transaction is a reversal, all debits are turned into
* credits and vice versa
* In case the loan transaction is a reversal, all debits are turned into credits and vice versa
*/
private void createJournalEntriesForChargePayments(final ClientTransactionDTO clientTransactionDTO, final Office office) {
// client properties
@@ -74,9 +73,8 @@ public class CashBasedAccountingProcessorForClientTransactions implements Accoun
transactionId, transactionDate, isReversal, clientTransactionDTO.getChargePayments());
/***
* create a single Debit entry (or reversal) for the entire amount
* that was credited (accounting is turned on at the level of for
* each charge that has been paid by this transaction)
* create a single Debit entry (or reversal) for the entire amount that was credited (accounting is turned
* on at the level of for each charge that has been paid by this transaction)
**/
this.helper.createDebitJournalEntryOrReversalForClientChargePayments(office, currencyCode, clientId, transactionId,
transactionDate, totalCreditedAmount, isReversal);
@@ -63,8 +63,8 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
createJournalEntriesForDisbursements(loanDTO, loanTransactionDTO, office);
}
/***
* Logic for repayments, repayments at disbursement and reversal of
* Repayments and Repayments at disbursement
* Logic for repayments, repayments at disbursement and reversal of Repayments and Repayments at
* disbursement
***/
else if (loanTransactionDTO.getTransactionType().isRepayment()
|| loanTransactionDTO.getTransactionType().isRepaymentAtDisbursement()
@@ -82,9 +82,8 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
createJournalEntriesForRefund(loanDTO, loanTransactionDTO, office);
}
/***
* Only principal write off affects cash based accounting (interest
* and fee write off need not be considered). Debit losses written
* off and credit Loan Portfolio
* Only principal write off affects cash based accounting (interest and fee write off need not be
* considered). Debit losses written off and credit Loan Portfolio
**/
else if (loanTransactionDTO.getTransactionType().isWriteOff()) {
final BigDecimal principalAmount = loanTransactionDTO.getPrincipal();
@@ -109,8 +108,7 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
/**
* Debit loan Portfolio and credit Fund source for a Disbursement <br/>
*
* All debits are turned into credits and vice versa in case of disbursement
* reversals
* All debits are turned into credits and vice versa in case of disbursement reversals
*
*
* @param loanDTO
@@ -149,8 +147,7 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
/**
* Debit loan Portfolio and credit Fund source for a Disbursement <br/>
*
* All debits are turned into credits and vice versa in case of disbursement
* reversals
* All debits are turned into credits and vice versa in case of disbursement reversals
*
*
* @param loanDTO
@@ -182,13 +179,11 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
}
/**
* Create a single Debit to fund source and multiple credits if applicable
* (loan portfolio for principal repayments, Interest on loans for interest
* repayments, Income from fees for fees payment and Income from penalties
* for penalty payment)
* Create a single Debit to fund source and multiple credits if applicable (loan portfolio for principal repayments,
* Interest on loans for interest repayments, Income from fees for fees payment and Income from penalties for
* penalty payment)
*
* In case the loan transaction is a reversal, all debits are turned into
* credits and vice versa
* In case the loan transaction is a reversal, all debits are turned into credits and vice versa
*/
private void createJournalEntriesForRepayments(final LoanDTO loanDTO, final LoanTransactionDTO loanTransactionDTO,
final Office office) {
@@ -256,11 +251,9 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
}
/**
* Create a single Debit to fund source and a single credit to "Income from
* Recovery"
* Create a single Debit to fund source and a single credit to "Income from Recovery"
*
* In case the loan transaction is a reversal, all debits are turned into
* credits and vice versa
* In case the loan transaction is a reversal, all debits are turned into credits and vice versa
*/
private void createJournalEntriesForRecoveryRepayments(final LoanDTO loanDTO, final LoanTransactionDTO loanTransactionDTO,
final Office office) {
@@ -283,12 +276,10 @@ public class CashBasedAccountingProcessorForLoan implements AccountingProcessorF
}
/**
* Credit loan Portfolio and Debit Suspense Account for a Transfer
* Initiation. A Transfer acceptance would be treated the opposite i.e Debit
* Loan Portfolio and Credit Suspense Account <br/>
* Credit loan Portfolio and Debit Suspense Account for a Transfer Initiation. A Transfer acceptance would be
* treated the opposite i.e Debit Loan Portfolio and Credit Suspense Account <br/>
*
* All debits are turned into credits and vice versa in case of Transfer
* Initiation disbursals
* All debits are turned into credits and vice versa in case of Transfer Initiation disbursals
*
*
* @param loanDTO
@@ -146,8 +146,7 @@ public class CashBasedAccountingProcessorForSavings implements AccountingProcess
savingsProductId, paymentTypeId, savingsId, transactionId, transactionDate, amount, isReversal);
}
/**
* Handle Interest Applications and reversals of Interest
* Applications
* Handle Interest Applications and reversals of Interest Applications
**/
else if (savingsTransactionDTO.getTransactionType().isInterestPosting() && savingsTransactionDTO.isOverdraftTransaction()) {
// Post journal entry if earned interest amount is greater than
@@ -226,8 +226,8 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
private void validateDebitOrCreditArrayForExistingGLAccount(final GLAccount glaccount,
final SingleDebitOrCreditEntryCommand[] creditOrDebits) {
/**
* If a glaccount is assigned for a rule the credits or debits array
* should have only one entry and it must be same as existing account
* If a glaccount is assigned for a rule the credits or debits array should have only one entry and it must be
* same as existing account
*/
if (creditOrDebits.length != 1) {
throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.INVALID_DEBIT_OR_CREDIT_ACCOUNTS, null, null, null);
@@ -305,8 +305,7 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
private void validateGLAccountForTransaction(final GLAccount creditOrDebitAccountHead) {
/***
* validate that the account allows manual adjustments and is not
* disabled
* validate that the account allows manual adjustments and is not disabled
**/
if (creditOrDebitAccountHead.isDisabled()) {
throw new JournalEntryInvalidException(GlJournalEntryInvalidReason.GL_ACCOUNT_DISABLED, null,
@@ -644,8 +643,8 @@ public class JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
}
/**
* TODO: Need a better implementation with guaranteed uniqueness (but not a
* long UUID)...maybe something tied to system clock..
* TODO: Need a better implementation with guaranteed uniqueness (but not a long UUID)...maybe something tied to
* system clock..
*/
private String generateTransactionId(final Long officeId) {
final AppUser user = this.context.authenticatedUser();
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.producttoaccountmapping.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
/**
* A {@link RuntimeException} thrown when product to GL account mapping are not
* found.
* A {@link RuntimeException} thrown when product to GL account mapping are not found.
*/
public class ProductToGLAccountMappingInvalidException extends AbstractPlatformDomainRuleException {
@@ -22,8 +22,7 @@ import org.apache.fineract.accounting.producttoaccountmapping.domain.PortfolioPr
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
/**
* A {@link RuntimeException} thrown when product to GL account mapping are not
* found.
* A {@link RuntimeException} thrown when product to GL account mapping are not found.
*/
public class ProductToGLAccountMappingNotFoundException extends AbstractPlatformResourceNotFoundException {
@@ -47,25 +47,21 @@ import org.springframework.stereotype.Component;
/**
* TODO Vishwas find a better approach for validation
*
* Currently, validation of the passed in JSON is done before calling save or
* update method on the target resource (in our case the loan Product)
* Currently, validation of the passed in JSON is done before calling save or update method on the target resource (in
* our case the loan Product)
*
* However, in the case of a loan product it would be difficult to validate the
* passed in JSON for valid {@link LoanProduct} to {@link GLAccount} mappings
* during update because of the following scenario
* However, in the case of a loan product it would be difficult to validate the passed in JSON for valid
* {@link LoanProduct} to {@link GLAccount} mappings during update because of the following scenario
*
* The accounting rule type may be changed in the update command, so we would
* have to validate if all required account heads for a particular account type
* have been passed in (would be different for CASH and Accrual based). However,
* till we have access to the domain object it would not be possible to detect
* if an accounting rule has actually been changed
* The accounting rule type may be changed in the update command, so we would have to validate if all required account
* heads for a particular account type have been passed in (would be different for CASH and Accrual based). However,
* till we have access to the domain object it would not be possible to detect if an accounting rule has actually been
* changed
*
* Hence, method {@link #validateForLoanProductCreate(String)} from this class
* is called separately for validation only if an accounting rule change is
* detected by {@link ProductToGLAccountMappingWritePlatformService}
* Hence, method {@link #validateForLoanProductCreate(String)} from this class is called separately for validation only
* if an accounting rule change is detected by {@link ProductToGLAccountMappingWritePlatformService}
*
* Also, the class is probably named wrong (*FromApiJsonDeserializer) should
* probably be named as (*Validator) instead
* Also, the class is probably named wrong (*FromApiJsonDeserializer) should probably be named as (*Validator) instead
*
*/
@Component
@@ -212,8 +212,7 @@ public class LoanProductToGLAccountMappingHelper extends ProductToGLAccountMappi
}
/**
* Examines and updates each account mapping for given loan product with
* changes passed in from the Json element
* Examines and updates each account mapping for given loan product with changes passed in from the Json element
*
* @param loanProductId
* @param changes
@@ -127,8 +127,8 @@ public class ProductToGLAccountMappingHelper {
}
/**
* Saves the payment type to Fund source mappings for a particular
* product/product type (also populates the changes array if passed in)
* Saves the payment type to Fund source mappings for a particular product/product type (also populates the changes
* array if passed in)
*
* @param command
* @param element
@@ -154,8 +154,8 @@ public class ProductToGLAccountMappingHelper {
}
/**
* Saves the Charge to Income / Liability account mappings for a particular
* product/product type (also populates the changes array if passed in)
* Saves the Charge to Income / Liability account mappings for a particular product/product type (also populates the
* changes array if passed in)
*
* @param command
* @param element
@@ -210,14 +210,12 @@ public class ProductToGLAccountMappingHelper {
final JsonArray chargeToIncomeAccountMappingArray = this.fromApiJsonHelper.extractJsonArrayNamed(arrayFragmentName, element);
/**
* Variable stores a map representation of charges (key) and their
* associated income Id's (value) extracted from the passed in
* Jsoncommand
* Variable stores a map representation of charges (key) and their associated income Id's (value) extracted from
* the passed in Jsoncommand
**/
final Map<Long, Long> inputChargeToIncomeAccountMap = new HashMap<>();
/***
* Variable stores all charges which have already been mapped to Income
* Accounts in the system
* Variable stores all charges which have already been mapped to Income Accounts in the system
**/
final Set<Long> existingCharges = new HashSet<>();
if (chargeToIncomeAccountMappingArray != null) {
@@ -238,10 +236,8 @@ public class ProductToGLAccountMappingHelper {
} /**
* Else, <br/>
* update existing mappings OR <br/>
* delete old mappings (which are already present, but not passed
* in as a part of Jsoncommand)<br/>
* Create new mappings for charges that are passed in as a part of
* the Jsoncommand but not already present
* delete old mappings (which are already present, but not passed in as a part of Jsoncommand)<br/>
* Create new mappings for charges that are passed in as a part of the Jsoncommand but not already present
*
**/
else {
@@ -296,13 +292,12 @@ public class ProductToGLAccountMappingHelper {
final JsonArray paymentChannelMappingArray = this.fromApiJsonHelper
.extractJsonArrayNamed(LoanProductAccountingParams.PAYMENT_CHANNEL_FUND_SOURCE_MAPPING.getValue(), element);
/**
* Variable stores a map representation of Payment channels (key) and
* their fund sources (value) extracted from the passed in Jsoncommand
* Variable stores a map representation of Payment channels (key) and their fund sources (value) extracted from
* the passed in Jsoncommand
**/
final Map<Long, Long> inputPaymentChannelFundSourceMap = new HashMap<>();
/***
* Variable stores all payment types which have already been mapped to
* Fund Sources in the system
* Variable stores all payment types which have already been mapped to Fund Sources in the system
**/
final Set<Long> existingPaymentTypes = new HashSet<>();
if (paymentChannelMappingArray != null) {
@@ -324,10 +319,9 @@ public class ProductToGLAccountMappingHelper {
} /**
* Else, <br/>
* update existing mappings OR <br/>
* delete old mappings (which re already present, but not passed
* in as a part of Jsoncommand)<br/>
* Create new mappings for payment types that are passed in as a
* part of the Jsoncommand but not already present
* delete old mappings (which re already present, but not passed in as a part of Jsoncommand)<br/>
* Create new mappings for payment types that are passed in as a part of the Jsoncommand but not already
* present
*
**/
else {
@@ -388,8 +382,7 @@ public class ProductToGLAccountMappingHelper {
GLAccount glAccount;
/**
* Both CASH and Accrual placeholders have the same value for income
* from Interest and penalties
* Both CASH and Accrual placeholders have the same value for income from Interest and penalties
**/
CashAccountsForLoan placeHolderAccountType;
if (isPenalty) {
@@ -415,8 +408,8 @@ public class ProductToGLAccountMappingHelper {
}
/**
* Fetches account with a particular Id and throws and Exception it is not
* of the expected Account Category ('ASSET','liability' etc)
* Fetches account with a particular Id and throws and Exception it is not of the expected Account Category
* ('ASSET','liability' etc)
*
* @param paramName
* @param expectedAccountType
@@ -288,16 +288,15 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
public Map<String, Object> updateLoanProductToGLAccountMapping(final Long loanProductId, final JsonCommand command,
final boolean accountingRuleChanged, final int accountingRuleTypeId) {
/***
* Variable tracks all accounting mapping properties that have been
* updated
* Variable tracks all accounting mapping properties that have been updated
***/
Map<String, Object> changes = new HashMap<>();
final JsonElement element = this.fromApiJsonHelper.parse(command.json());
final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId);
/***
* If the accounting rule has been changed, delete all existing mapping
* for the product and recreate a new set of mappings
* If the accounting rule has been changed, delete all existing mapping for the product and recreate a new set
* of mappings
***/
if (accountingRuleChanged) {
this.deserializer.validateForLoanProductCreate(command.json());
@@ -319,16 +318,15 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
public Map<String, Object> updateSavingsProductToGLAccountMapping(final Long savingsProductId, final JsonCommand command,
final boolean accountingRuleChanged, final int accountingRuleTypeId, final DepositAccountType accountType) {
/***
* Variable tracks all accounting mapping properties that have been
* updated
* Variable tracks all accounting mapping properties that have been updated
***/
Map<String, Object> changes = new HashMap<>();
final JsonElement element = this.fromApiJsonHelper.parse(command.json());
final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId);
/***
* If the accounting rule has been changed, delete all existing mapping
* for the product and recreate a new set of mappings
* If the accounting rule has been changed, delete all existing mapping for the product and recreate a new set
* of mappings
***/
if (accountingRuleChanged) {
this.deserializer.validateForSavingsProductCreate(command.json(), accountType);
@@ -351,16 +349,15 @@ public class ProductToGLAccountMappingWritePlatformServiceImpl implements Produc
public Map<String, Object> updateShareProductToGLAccountMapping(final Long shareProductId, final JsonCommand command,
final boolean accountingRuleChanged, final int accountingRuleTypeId) {
/***
* Variable tracks all accounting mapping properties that have been
* updated
* Variable tracks all accounting mapping properties that have been updated
***/
Map<String, Object> changes = new HashMap<>();
final JsonElement element = this.fromApiJsonHelper.parse(command.json());
final AccountingRuleType accountingRuleType = AccountingRuleType.fromInt(accountingRuleTypeId);
/***
* If the accounting rule has been changed, delete all existing mapping
* for the product and recreate a new set of mappings
* If the accounting rule has been changed, delete all existing mapping for the product and recreate a new set
* of mappings
***/
if (accountingRuleChanged) {
this.shareProductToGLAccountMappingHelper.deleteSharesProductToGLAccountMapping(shareProductId);
@@ -177,8 +177,7 @@ public class SavingsProductToGLAccountMappingHelper extends ProductToGLAccountMa
}
/**
* Examines and updates each account mapping for given loan product with
* changes passed in from the Json element
* Examines and updates each account mapping for given loan product with changes passed in from the Json element
*
* @param savingsProductId
* @param changes
@@ -154,8 +154,7 @@ public class ShareProductToGLAccountMappingHelper extends ProductToGLAccountMapp
}
/**
* Examines and updates each account mapping for given loan product with
* changes passed in from the Json element
* Examines and updates each account mapping for given loan product with changes passed in from the Json element
*
* @param sharesProductId
* @param changes
@@ -29,8 +29,7 @@ import org.apache.fineract.organisation.office.data.OfficeData;
/**
* Immutable object representing a General Ledger Account
*
* Note: no getter/setters required as google-gson will produce json from fields
* of object.
* Note: no getter/setters required as google-gson will produce json from fields of object.
*/
public class AccountingRuleData {
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.rule.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
/**
* A {@link RuntimeException} thrown when an Accounting rule with a given name
* already exists
* A {@link RuntimeException} thrown when an Accounting rule with a given name already exists
*/
public class AccountingRuleDuplicateException extends AbstractPlatformDomainRuleException {
@@ -21,8 +21,7 @@ package org.apache.fineract.accounting.rule.exception;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
/**
* A {@link RuntimeException} thrown when Accounting rule resources are not
* found.
* A {@link RuntimeException} thrown when Accounting rule resources are not found.
*/
public class AccountingRuleNotFoundException extends AbstractPlatformResourceNotFoundException {
@@ -59,8 +59,7 @@ import org.springframework.stereotype.Component;
public class AdHocApiResource {
/**
* The set of parameters that are supported in response for
* {@link AdhocData}
* The set of parameters that are supported in response for {@link AdhocData}
*/
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "query", "tableName", "tableField",
"isActive", "createdBy", "createdOn", "createdById", "updatedById", "updatedOn", "email"));
@@ -139,12 +139,9 @@ public final class AdHocDataValidator {
baseDataValidator.reset().parameter("reportRunEvery").value(reportRunEvery).integerGreaterThanZero();
}
/*
* if (this.fromApiJsonHelper.parameterExists("isActive", element)) {
* final Integer isActive =
* this.fromApiJsonHelper.extractIntegerNamed("isActive", element,
* Locale.getDefault());
* baseDataValidator.reset().parameter("isActive").value(isActive).
* notNull().inMinMaxRange(1, 2); }
* if (this.fromApiJsonHelper.parameterExists("isActive", element)) { final Integer isActive =
* this.fromApiJsonHelper.extractIntegerNamed("isActive", element, Locale.getDefault());
* baseDataValidator.reset().parameter("isActive").value(isActive). notNull().inMinMaxRange(1, 2); }
*/
throwExceptionIfValidationWarningsExist(dataValidationErrors);
@@ -73,8 +73,7 @@ public class AdHocWritePlatformServiceJpaRepositoryImpl implements AdHocWritePla
}
/*
* Guaranteed to throw an exception no matter what the data integrity issue
* is.
* Guaranteed to throw an exception no matter what the data integrity issue is.
*/
private void handleDataIntegrityIssues(final JsonCommand command, final DataIntegrityViolationException dve) {
@@ -50,12 +50,10 @@ import org.springframework.stereotype.Component;
/**
* Provides a REST resource for Batch Requests. This class acts as a proxy to
* {@link org.apache.fineract.batch.service.BatchApiService} and de-serializes
* the incoming JSON string to a list of
* {@link org.apache.fineract.batch.domain .BatchRequest} type. This list is
* forwarded to BatchApiService which finally returns a list of
* {@link org.apache.fineract.batch.domain.BatchResponse} type which is then
* serialized into JSON response by this Resource class.
* {@link org.apache.fineract.batch.service.BatchApiService} and de-serializes the incoming JSON string to a list of
* {@link org.apache.fineract.batch.domain .BatchRequest} type. This list is forwarded to BatchApiService which finally
* returns a list of {@link org.apache.fineract.batch.domain.BatchResponse} type which is then serialized into JSON
* response by this Resource class.
*
* @author Rishabh Shukla
*
@@ -83,8 +81,7 @@ public class BatchApiResource {
private final BatchRequestJsonHelper batchRequestJsonHelper;
/**
* Constructs a 'BatchApiService' with context, toApiJsonSerializer, service
* and batchRequestJsonHelper.
* Constructs a 'BatchApiService' with context, toApiJsonSerializer, service and batchRequestJsonHelper.
*
* @param context
* @param toApiJsonSerializer
@@ -102,8 +99,7 @@ public class BatchApiResource {
}
/**
* Rest assured POST method to get {@link BatchRequest} and returns back the
* consolidated {@link BatchResponse}
* Rest assured POST method to get {@link BatchRequest} and returns back the consolidated {@link BatchResponse}
*
* @param jsonRequestString
* @param enclosingTransaction
@@ -19,10 +19,8 @@
package org.apache.fineract.batch.command;
/**
* Provides an object to
* {@link org.apache.fineract.batch.service.BatchApiService} to get the proper
* commandStrategy for each request in BatchRequest. It uses Builder pattern to
* create object of this type.
* Provides an object to {@link org.apache.fineract.batch.service.BatchApiService} to get the proper commandStrategy for
* each request in BatchRequest. It uses Builder pattern to create object of this type.
*
* @author Rishabh Shukla
*
@@ -69,9 +67,8 @@ public final class CommandContext {
}
/**
* Returns a boolean value if the relativeUrl 'matches' one of the regex
* keys in the available commandStrategies. It take CommandContext object as
* parameter which contains a 'resource' member as a regex key for available
* Returns a boolean value if the relativeUrl 'matches' one of the regex keys in the available commandStrategies. It
* take CommandContext object as parameter which contains a 'resource' member as a regex key for available
* commandStrategies.
*
* @param other
@@ -23,8 +23,8 @@ import org.apache.fineract.batch.domain.BatchRequest;
import org.apache.fineract.batch.domain.BatchResponse;
/**
* An interface for various Command Strategies. It contains a single function
* which returns appropriate response from a particular command strategy.
* An interface for various Command Strategies. It contains a single function which returns appropriate response from a
* particular command strategy.
*
* @author Rishabh Shukla
*
@@ -33,10 +33,8 @@ import org.apache.fineract.batch.domain.BatchResponse;
public interface CommandStrategy {
/**
* Returns an object of type
* {@link org.apache.fineract.batch.domain.BatchResponse}. This takes
* {@link org.apache.fineract.batch.domain.BatchRequest} as it's single
* argument and provides appropriate response.
* Returns an object of type {@link org.apache.fineract.batch.domain.BatchResponse}. This takes
* {@link org.apache.fineract.batch.domain.BatchRequest} as it's single argument and provides appropriate response.
*
* @param batchRequest
* @param uriInfo
@@ -25,8 +25,8 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
/**
* Provides an appropriate CommandStrategy using the 'method' and 'resourceUrl'.
* CommandStrategy bean is created using Spring Application Context.
* Provides an appropriate CommandStrategy using the 'method' and 'resourceUrl'. CommandStrategy bean is created using
* Spring Application Context.
*
* @author Rishabh Shukla
*
@@ -39,9 +39,8 @@ public class CommandStrategyProvider {
private final ConcurrentHashMap<CommandContext, String> commandStrategies = new ConcurrentHashMap<>();
/**
* Constructs a CommandStrategyProvider with argument of ApplicationContext
* type. It also initialize commandStrategies using init() function by
* filling it with available CommandStrategies in
* Constructs a CommandStrategyProvider with argument of ApplicationContext type. It also initialize
* commandStrategies using init() function by filling it with available CommandStrategies in
* {@link org.apache.fineract.batch.command.internal}.
*
* @param applicationContext
@@ -56,9 +55,8 @@ public class CommandStrategyProvider {
}
/**
* Returns an appropriate commandStrategy after determining it using the
* CommandContext of the request. If no such Strategy is found then a
* default strategy is returned back.
* Returns an appropriate commandStrategy after determining it using the CommandContext of the request. If no such
* Strategy is found then a default strategy is returned back.
*
* @param commandContext
* @return CommandStrategy
@@ -80,10 +78,8 @@ public class CommandStrategyProvider {
}
/**
* Contains various available command strategies in
* {@link org.apache.fineract.batch.command.internal}. Any new command
* Strategy will have to be added within this function in order to initiate
* it within the constructor.
* Contains various available command strategies in {@link org.apache.fineract.batch.command.internal}. Any new
* command Strategy will have to be added within this function in order to initiate it within the constructor.
*/
private void init() {
this.commandStrategies.put(CommandContext.resource("clients").method("POST").build(), "createClientCommandStrategy");
@@ -31,13 +31,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} to
* handle activation of a pending client. It passes the contents of the body
* from the BatchRequest to
* {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and gets
* back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map
* those errors to appropriate status codes in BatchResponse.
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} to handle activation of a pending client. It
* passes the contents of the body from the BatchRequest to
* {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and gets back the response. This class will also
* catch any errors raised by {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map those errors
* to appropriate status codes in BatchResponse.
*
* @author Rishabh Shukla
*
@@ -29,13 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} and
* applies a new loan on an existing client. It passes the contents of the body
* from the BatchRequest to
* {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and
* gets back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and
* map those errors to appropriate status codes in BatchResponse.
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} and applies a new loan on an existing client. It
* passes the contents of the body from the BatchRequest to
* {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and gets back the response. This class will
* also catch any errors raised by {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and map those
* errors to appropriate status codes in BatchResponse.
*
* @author Rishabh Shukla
*
@@ -29,13 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} and
* applies a new savings on an existing client. It passes the contents of the
* body from the BatchRequest to
* {@link org.apache.fineract.portfolio.savings.api.SavingsAccountsApiResource}
* and gets back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.savings.api.SavingsAccountsApiResource}
* and map those errors to appropriate status codes in BatchResponse.
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} and applies a new savings on an existing client.
* It passes the contents of the body from the BatchRequest to
* {@link org.apache.fineract.portfolio.savings.api.SavingsAccountsApiResource} and gets back the response. This class
* will also catch any errors raised by {@link org.apache.fineract.portfolio.savings.api.SavingsAccountsApiResource} and
* map those errors to appropriate status codes in BatchResponse.
*
* @author Rishabh Shukla
*
@@ -31,13 +31,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} to
* handle approval of a pending loan. It passes the contents of the body from
* the BatchRequest to
* {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and
* gets back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and
* map those errors to appropriate status codes in BatchResponse.
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} to handle approval of a pending loan. It passes
* the contents of the body from the BatchRequest to
* {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and gets back the response. This class will
* also catch any errors raised by {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and map those
* errors to appropriate status codes in BatchResponse.
*
* @author Rishabh Shukla
*
@@ -31,13 +31,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} and
* Collect Charges for a Loan. It passes the contents of the body from the
* BatchRequest to
* {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource}
* and gets back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource}
* and map those errors to appropriate status codes in BatchResponse.
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} and Collect Charges for a Loan. It passes the
* contents of the body from the BatchRequest to
* {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} and gets back the response. This class
* will also catch any errors raised by {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} and
* map those errors to appropriate status codes in BatchResponse.
*
* @author Rishabh Shukla
*
@@ -31,13 +31,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} and
* Create Charge for a Loan. It passes the contents of the body from the
* BatchRequest to
* {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource}
* and gets back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource}
* and map those errors to appropriate status codes in BatchResponse.
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} and Create Charge for a Loan. It passes the
* contents of the body from the BatchRequest to
* {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} and gets back the response. This class
* will also catch any errors raised by {@link org.apache.fineract.portfolio.loanaccount.api.LoanChargesApiResource} and
* map those errors to appropriate status codes in BatchResponse.
*
* @author Rishabh Shukla
*
@@ -29,13 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} to
* handle creation of a new client. It passes the contents of the body from the
* BatchRequest to
* {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and gets
* back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map
* those errors to appropriate status codes in BatchResponse.
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} to handle creation of a new client. It passes
* the contents of the body from the BatchRequest to {@link org.apache.fineract.portfolio.client.api.ClientsApiResource}
* and gets back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map those errors to appropriate status codes
* in BatchResponse.
*
* @author Rishabh Shukla
*
@@ -31,13 +31,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} to
* handle disburse of a loan. It passes the contents of the body from the
* BatchRequest to
* {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and
* gets back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and
* map those errors to appropriate status codes in BatchResponse.
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} to handle disburse of a loan. It passes the
* contents of the body from the BatchRequest to {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource}
* and gets back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.loanaccount.api.LoansApiResource} and map those errors to appropriate status
* codes in BatchResponse.
*
* @author Rishabh Shukla
*
@@ -31,11 +31,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implements {@link CommandStrategy} and handles repayment for a Loan. It
* passes the contents of the body from the BatchRequest to
* {@link LoanTransactionsApiResource} and gets back the response. This class
* will also catch any errors raised by {@link LoanTransactionsApiResource} and
* map those errors to appropriate status codes in BatchResponse.
* Implements {@link CommandStrategy} and handles repayment for a Loan. It passes the contents of the body from the
* BatchRequest to {@link LoanTransactionsApiResource} and gets back the response. This class will also catch any errors
* raised by {@link LoanTransactionsApiResource} and map those errors to appropriate status codes in BatchResponse.
*
* @author Mohit Sinha
*
@@ -25,9 +25,8 @@ import org.apache.fineract.batch.domain.BatchResponse;
import org.springframework.stereotype.Component;
/**
* Provides a default CommandStrategy by implementing
* {@link org.apache.fineract.batch.command.CommandStrategy} in case there is no
* appropriate command strategy with requested 'method' and 'resoureUrl'.
* Provides a default CommandStrategy by implementing {@link org.apache.fineract.batch.command.CommandStrategy} in case
* there is no appropriate command strategy with requested 'method' and 'resoureUrl'.
*
* @author Rishabh Shukla
*/
@@ -29,13 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} and
* updates the information of an existing client. It passes the contents of the
* body from the BatchRequest to
* {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and gets
* back the response. This class will also catch any errors raised by
* {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map
* those errors to appropriate status codes in BatchResponse.
* Implements {@link org.apache.fineract.batch.command.CommandStrategy} and updates the information of an existing
* client. It passes the contents of the body from the BatchRequest to
* {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and gets back the response. This class will also
* catch any errors raised by {@link org.apache.fineract.portfolio.client.api.ClientsApiResource} and map those errors
* to appropriate status codes in BatchResponse.
*
* @author Rishabh Shukla
*
@@ -21,10 +21,9 @@ package org.apache.fineract.batch.domain;
import java.util.Set;
/**
* Provides an object for separate HTTP requests in the Batch Request for Batch
* API. A requestId is also included as data field which takes care of
* dependency issues among various requests. This class also provides getter and
* setter functions to access Batch Request data fields.
* Provides an object for separate HTTP requests in the Batch Request for Batch API. A requestId is also included as
* data field which takes care of dependency issues among various requests. This class also provides getter and setter
* functions to access Batch Request data fields.
*
* @author Rishabh Shukla
*
@@ -41,8 +40,8 @@ public class BatchRequest {
private String body;
/**
* Constructs a 'BatchRequest' with requestId, relativeUrl, method, headers,
* reference and body of the incoming request.
* Constructs a 'BatchRequest' with requestId, relativeUrl, method, headers, reference and body of the incoming
* request.
*
* @param requestId
* of HTTP request.
@@ -131,8 +130,7 @@ public class BatchRequest {
}
/**
* Returns the values of 'headers' of {@link Header} type of an object of
* this class.
* Returns the values of 'headers' of {@link Header} type of an object of this class.
*
* @return headers of the HTTP request.
* @see Header
@@ -142,8 +140,7 @@ public class BatchRequest {
}
/**
* Sets the values of 'headers' of {@link Header} type of an object of this
* class.
* Sets the values of 'headers' of {@link Header} type of an object of this class.
*
* @param headers
* @see Header
@@ -21,10 +21,9 @@ package org.apache.fineract.batch.domain;
import java.util.Set;
/**
* Provides an object for separate HTTP responses in the Batch Response for
* Batch API. It contains all the information about a particular HTTP response
* in the Batch Response. Getter and Setter functions are also included to
* access response data fields.
* Provides an object for separate HTTP responses in the Batch Response for Batch API. It contains all the information
* about a particular HTTP response in the Batch Response. Getter and Setter functions are also included to access
* response data fields.
*
* @author Rishabh Shukla
*
@@ -40,8 +39,7 @@ public class BatchResponse {
private String body;
/**
* Constructs a 'BatchResponse' with requestId, statusCode, headers and body
* of the HTTP requests.
* Constructs a 'BatchResponse' with requestId, statusCode, headers and body of the HTTP requests.
*
* @param requestId
* @param statusCode
@@ -110,8 +108,7 @@ public class BatchResponse {
}
/**
* Sets the value of 'headers' of {@link Header} type of an object of this
* class.
* Sets the value of 'headers' of {@link Header} type of an object of this class.
*
* @param headers
* of {@link Header} Type
@@ -19,9 +19,8 @@
package org.apache.fineract.batch.domain;
/**
* Provides an object to handle HTTP headers as name and value pairs for Batch
* API. It is used in {@link BatchRequest} and {@link BatchResponse} to store
* the information regarding the headers in incoming and outgoing JSON Strings.
* Provides an object to handle HTTP headers as name and value pairs for Batch API. It is used in {@link BatchRequest}
* and {@link BatchResponse} to store the information regarding the headers in incoming and outgoing JSON Strings.
*
* @author Rishabh Shukla
*
@@ -38,11 +38,9 @@ import org.springframework.dao.NonTransientDataAccessException;
import org.springframework.transaction.TransactionException;
/**
* Provides an Error Handler method that returns an object of type
* {@link ErrorInfo} to the CommandStrategy which raised the exception. This
* class uses various subclasses of RuntimeException to check the kind of
* exception raised and provide appropriate status and error codes for each one
* of the raised exception.
* Provides an Error Handler method that returns an object of type {@link ErrorInfo} to the CommandStrategy which raised
* the exception. This class uses various subclasses of RuntimeException to check the kind of exception raised and
* provide appropriate status and error codes for each one of the raised exception.
*
* @author Rishabh Shukla
*
@@ -61,8 +59,7 @@ public class ErrorHandler extends RuntimeException {
}
/**
* Returns an object of ErrorInfo type containing the information regarding
* the raised error.
* Returns an object of ErrorInfo type containing the information regarding the raised error.
*
* @param exception
* @return ErrorInfo
@@ -19,8 +19,7 @@
package org.apache.fineract.batch.exception;
/**
* Provides members to hold the basic information about the exceptions raised in
* commandStrategy classes.
* Provides members to hold the basic information about the exceptions raised in commandStrategy classes.
*
* @author Rishabh Shukla
*
@@ -90,8 +89,7 @@ public final class ErrorInfo {
}
/**
* Getter method to provide the message of the error for an object of this
* type.
* Getter method to provide the message of the error for an object of this type.
*
* @return String
*/
@@ -26,10 +26,8 @@ import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.springframework.stereotype.Component;
/**
* Extends
* {@link org.apache.fineract.infrastructure.core.serialization.FromJsonHelper}
* to de-serialize the incoming String into a JSON List of type
* {@link org.apache.fineract.batch.domain.BatchRequest}
* Extends {@link org.apache.fineract.infrastructure.core.serialization.FromJsonHelper} to de-serialize the incoming
* String into a JSON List of type {@link org.apache.fineract.batch.domain.BatchRequest}
*
* @author Rishabh Shukla
*
@@ -40,8 +38,7 @@ import org.springframework.stereotype.Component;
public class BatchRequestJsonHelper extends FromJsonHelper {
/**
* Returns a list of batchRequests after de-serializing it from the input
* JSON string.
* Returns a list of batchRequests after de-serializing it from the input JSON string.
*
* @param json
* @return List&lt;BatchRequest&gt;
@@ -24,8 +24,7 @@ import org.apache.fineract.batch.domain.BatchRequest;
import org.apache.fineract.batch.domain.BatchResponse;
/**
* Provides an interface for service class, that implements the method to handle
* separate Batch Requests.
* Provides an interface for service class, that implements the method to handle separate Batch Requests.
*
* @author Rishabh Shukla
*
@@ -36,10 +35,9 @@ import org.apache.fineract.batch.domain.BatchResponse;
public interface BatchApiService {
/**
* Returns a list of {@link org.apache.fineract.batch.domain.BatchResponse}s
* by getting the appropriate CommandStrategy for every
* {@link org.apache.fineract.batch.domain.BatchRequest}. It will be used
* when the Query Parameter "enclosingTransaction "is set to 'false'.
* Returns a list of {@link org.apache.fineract.batch.domain.BatchResponse}s by getting the appropriate
* CommandStrategy for every {@link org.apache.fineract.batch.domain.BatchRequest}. It will be used when the Query
* Parameter "enclosingTransaction "is set to 'false'.
*
* @param requestList
* @param uriInfo
@@ -48,12 +46,10 @@ public interface BatchApiService {
List<BatchResponse> handleBatchRequestsWithoutEnclosingTransaction(List<BatchRequest> requestList, UriInfo uriInfo);
/**
* returns a list of {@link org.apache.fineract.batch.domain.BatchResponse}s
* by getting the appropriate CommandStrategy for every
* {@link org.apache.fineract.batch.domain.BatchRequest}. It will be used
* when the Query Parameter "enclosingTransaction "is set to 'true'. If one
* or more of the requests are not completed properly then whole of the
* transaction will be rolled back properly.
* returns a list of {@link org.apache.fineract.batch.domain.BatchResponse}s by getting the appropriate
* CommandStrategy for every {@link org.apache.fineract.batch.domain.BatchRequest}. It will be used when the Query
* Parameter "enclosingTransaction "is set to 'true'. If one or more of the requests are not completed properly then
* whole of the transaction will be rolled back properly.
*
* @param requestList
* @param uriInfo
@@ -44,9 +44,8 @@ import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
/**
* Implementation for {@link BatchApiService} to iterate through all the
* incoming requests and obtain the appropriate CommandStrategy from
* CommandStrategyProvider.
* Implementation for {@link BatchApiService} to iterate through all the incoming requests and obtain the appropriate
* CommandStrategy from CommandStrategyProvider.
*
* @author Rishabh Shukla
*
@@ -78,10 +77,8 @@ public class BatchApiServiceImpl implements BatchApiService {
}
/**
* Returns the response list by getting a proper
* {@link org.apache.fineract.batch.command.CommandStrategy}. execute()
* method of acquired commandStrategy is then provided with the separate
* Request.
* Returns the response list by getting a proper {@link org.apache.fineract.batch.command.CommandStrategy}.
* execute() method of acquired commandStrategy is then provided with the separate Request.
*
* @param requestList
* @param uriInfo
@@ -34,9 +34,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Provides methods to create dependency map among the various batchRequests. It
* also provides method that takes care of dependency resolution among related
* requests.
* Provides methods to create dependency map among the various batchRequests. It also provides method that takes care of
* dependency resolution among related requests.
*
* @author Rishabh Shukla
* @see BatchApiServiceImpl
@@ -85,10 +84,9 @@ public class ResolutionHelper {
}
/**
* Returns a map containing requests that are divided in accordance of
* dependency relations among them. Each different list is identified with a
* "Key" which is the "requestId" of the request at topmost level in
* dependency hierarchy of that particular list.
* Returns a map containing requests that are divided in accordance of dependency relations among them. Each
* different list is identified with a "Key" which is the "requestId" of the request at topmost level in dependency
* hierarchy of that particular list.
*
* @param batchRequests
* @return List&lt;ArrayList&lt;BatchRequestNode&gt;&gt;
@@ -122,10 +120,8 @@ public class ResolutionHelper {
}
/**
* Returns a BatchRequest after dependency resolution. It takes a request
* and the response of the request it is dependent upon as its arguments and
* change the body or relativeUrl of the request according to parent
* Request.
* Returns a BatchRequest after dependency resolution. It takes a request and the response of the request it is
* dependent upon as its arguments and change the body or relativeUrl of the request according to parent Request.
*
* @param request
* @param parentResponse
@@ -27,8 +27,7 @@ import java.lang.annotation.Target;
/**
* Specifies the command type for the annotated class.<br>
* <br>
* The entity name (e.g. CLIENT, SAVINGSACCOUNT, LOANPRODUCT) and the action
* (e.g. CREATE, DELETE) must be given.
* The entity name (e.g. CLIENT, SAVINGSACCOUNT, LOANPRODUCT) and the action (e.g. CREATE, DELETE) must be given.
*
* @author Markus Geiss
* @version 1.0

Some files were not shown because too many files have changed in this diff Show More