diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResource.java index 8562c92dd23..74f01befae0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResource.java @@ -115,7 +115,7 @@ 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, interestCalculationType, interestCalculationDaysInYearType, minDepositTerm, minDepositTermTypeId, recurringDepositFrequency, recurringDepositFrequencyTypeId, accountingRule, depositAmount\n\n" + + "Mandatory Fields: name, shortName, description, currencyCode, digitsAfterDecimal,inMultiplesOf, interestCompoundingPeriodType, interestCalculationType, interestCalculationDaysInYearType, minDepositTerm, minDepositTermTypeId, accountingRule, depositAmount\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") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = RecurringDepositProductsApiResourceSwagger.PostRecurringDepositProductsRequest.class))) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResourceSwagger.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResourceSwagger.java index 42b7c761dda..e99136d7c08 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResourceSwagger.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/RecurringDepositProductsApiResourceSwagger.java @@ -87,10 +87,6 @@ private PostRecurringDepositProductsChartSlabs() {} public Integer interestCalculationDaysInYearType; @Schema(example = "1") public Integer accountingRule; - @Schema(example = "1") - public Integer recurringDepositFrequency; - @Schema(example = "2") - public Integer recurringDepositFrequencyTypeId; @Schema(example = "true") public Boolean preClosurePenalApplicable; @Schema(example = "1.75") @@ -267,18 +263,6 @@ private GetRecurringDepositProductsAccountingRule() {} public String description; } - static final class GetRecurringDepositProductsRecurringDepositFrequencyType { - - private GetRecurringDepositProductsRecurringDepositFrequencyType() {} - - @Schema(example = "1") - public Integer id; - @Schema(example = "recurring.deposit.savingsPeriodFrequencyType.months") - public String code; - @Schema(example = "Months") - public String description; - } - @Schema(example = "3") public Long id; @Schema(example = "RD01") @@ -288,9 +272,6 @@ private GetRecurringDepositProductsRecurringDepositFrequencyType() {} @Schema(example = "RD01") public String description; public GetRecurringDepositProductsCurrency currency; - @Schema(example = "1") - public Integer recurringDepositFrequency; - public GetRecurringDepositProductsRecurringDepositFrequencyType recurringDepositFrequencyType; @Schema(example = "false") public Boolean preClosurePenalApplicable; @Schema(example = "3") @@ -523,10 +504,6 @@ private GetRecurringDepositProductsProductIdPeriodType() {} public GetRecurringDepositProductsProductIdAccountingMappings accountingMappings; public Set feeToIncomeAccountMappings; public Set penaltyToIncomeAccountMappings; - @Schema(example = "1") - public Integer recurringDepositFrequency; - public GetRecurringDepositProductsResponse.GetRecurringDepositProductsRecurringDepositFrequencyType recurringDepositFrequencyType; - @Schema(example = "true") public Boolean preClosurePenalApplicable; @Schema(example = "1.75") public Double preClosurePenalInterest; diff --git a/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/mapper/GLAccountTypeMapper.java b/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/mapper/GLAccountTypeMapper.java new file mode 100644 index 00000000000..4a05a323d4f --- /dev/null +++ b/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/mapper/GLAccountTypeMapper.java @@ -0,0 +1,38 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.tax.mapper; + +import org.apache.fineract.accounting.glaccount.domain.GLAccountType; +import org.apache.fineract.infrastructure.core.config.MapstructMapperConfig; +import org.mapstruct.Mapper; +import org.mapstruct.Named; + +@Mapper(config = MapstructMapperConfig.class) +public interface GLAccountTypeMapper { + + @Named("intToGLAccountType") + default GLAccountType map(Integer value) { + return GLAccountType.fromInt(value); + } + + @Named("glAccountTypeToInt") + default Integer map(GLAccountType type) { + return type == null ? null : type.getValue(); + } +} diff --git a/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/mapper/TaxComponentMapper.java b/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/mapper/TaxComponentMapper.java index 939d4e83875..031e1d53e5f 100644 --- a/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/mapper/TaxComponentMapper.java +++ b/fineract-tax/src/main/java/org/apache/fineract/portfolio/tax/mapper/TaxComponentMapper.java @@ -27,13 +27,13 @@ import org.mapstruct.Mapper; import org.mapstruct.Mapping; -@Mapper(config = MapstructMapperConfig.class, uses = { GlAccountMapper.class, GlAccountTypeMapper.class }) +@Mapper(config = MapstructMapperConfig.class, uses = { GlAccountMapper.class, GlAccountTypeMapper.class, GLAccountTypeMapper.class }) public interface TaxComponentMapper { - @Mapping(target = "creditAccount", source = "taxComponent.creditAccount") - @Mapping(target = "debitAccount", source = "taxComponent.debitAccount") - @Mapping(target = "creditAccountType", source = "taxComponent.creditAccountType") - @Mapping(target = "debitAccountType", source = "taxComponent.debitAccountType") + @Mapping(target = "creditAccount", source = "creditAccount") + @Mapping(target = "debitAccount", source = "debitAccount") + @Mapping(target = "creditAccountType", source = "creditAccountType", qualifiedByName = "intToGLAccountType") + @Mapping(target = "debitAccountType", source = "debitAccountType", qualifiedByName = "intToGLAccountType") @Mapping(target = "glAccountOptions", ignore = true) @Mapping(target = "glAccountTypeOptions", ignore = true) @Mapping(target = "taxComponentHistories", ignore = true)