FINERACT-2489: Fix NPE for missing charts in Recurring Deposit Product
This commit is contained in:
committed by
Adam Saghy
parent
85bd81b6ae
commit
fe98aa6a58
+2
-2
@@ -115,9 +115,9 @@ public class RecurringDepositProductsApiResource {
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@Operation(summary = "Create a Recurring Deposit Product", description = "Creates a Recurring Deposit Product\n\n"
|
||||
+ "Mandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, interestCompoundingPeriodType, interestPostingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minDepositTerm, minDepositTermTypeId, accountingRule, depositAmount\n\n"
|
||||
+ "Mandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, interestCompoundingPeriodType, interestPostingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minDepositTerm, minDepositTermTypeId, accountingRule, depositAmount, charts\n\n"
|
||||
+ "Mandatory Fields for Cash based accounting (accountingRule = 2): savingsReferenceAccountId, savingsControlAccountId, interestOnSavingsAccountId, incomeFromFeeAccountId, transfersInSuspenseAccountId, incomeFromPenaltyAccountId\n\n"
|
||||
+ "Optional Fields: lockinPeriodFrequency, lockinPeriodFrequencyType, maxDepositTerm, maxDepositTermTypeId, inMultiplesOfDepositTerm, inMultiplesOfDepositTermTypeId, preClosurePenalApplicable, preClosurePenalInterest, preClosurePenalInterestOnTypeId, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, charges, charts, minDepositAmount, maxDepositAmount, withHoldTax, taxGroupId")
|
||||
+ "Optional Fields: lockinPeriodFrequency, lockinPeriodFrequencyType, maxDepositTerm, maxDepositTermTypeId, inMultiplesOfDepositTerm, inMultiplesOfDepositTermTypeId, preClosurePenalApplicable, preClosurePenalInterest, preClosurePenalInterestOnTypeId, feeToIncomeAccountMappings, penaltyToIncomeAccountMappings, charges, minDepositAmount, maxDepositAmount, withHoldTax, taxGroupId")
|
||||
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PostRecurringDepositProductsRequest.class)))
|
||||
@ApiResponses({
|
||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PostRecurringDepositProductsResponse.class))) })
|
||||
|
||||
+4
@@ -366,6 +366,10 @@ public class DepositProductDataValidator {
|
||||
final JsonArray array = this.fromApiJsonHelper.extractJsonArrayNamed(chartsParamName, element);
|
||||
baseDataValidator.reset().parameter(chartsParamName).value(array).notNull().jsonArrayNotEmpty();
|
||||
|
||||
if (array == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
final JsonObject interestRateChartElement = array.get(i).getAsJsonObject();
|
||||
final String json = this.fromApiJsonHelper.toJson(interestRateChartElement);
|
||||
|
||||
Reference in New Issue
Block a user