FINERACT-2326: Charges with Tax group Id ignored

This commit is contained in:
Jose Alberto Hernandez
2025-08-13 13:58:21 +02:00
committed by Adam Saghy
parent c55cfe9d08
commit 33fae09afb
9 changed files with 78 additions and 31 deletions
@@ -96,6 +96,16 @@ final class ChargesApiResourceSwagger {
public String description;
}
static final class GetChargesTaxGroup {
private GetChargesTaxGroup() {}
@Schema(example = "1")
public Long id;
@Schema(example = "tax")
public String name;
}
@Schema(example = "1")
public Long id;
@Schema(example = "Loan Service fee")
@@ -113,6 +123,7 @@ final class ChargesApiResourceSwagger {
public GetChargesPaymentModeResponse chargePaymentMode;
public BigDecimal minCap;
public BigDecimal maxCap;
public GetChargesTaxGroup taxGroup;
}
@Schema(description = "PostChargesRequest")
@@ -146,6 +157,8 @@ final class ChargesApiResourceSwagger {
public BigDecimal minCap;
@Schema(example = "45.56")
public BigDecimal maxCap;
@Schema(example = "1")
public Long taxGroupId;
}
@Schema(description = "PostChargesResponse")
@@ -206,6 +219,8 @@ final class ChargesApiResourceSwagger {
public BigDecimal minCap;
@Schema(example = "120.0")
public BigDecimal maxCap;
@Schema(example = "1")
public Long taxGroupId;
}
@Schema(description = "PutChargesChargeIdResponse")
@@ -18,30 +18,25 @@
*/
package org.apache.fineract.portfolio.charge.handler;
import lombok.RequiredArgsConstructor;
import org.apache.fineract.commands.annotation.CommandType;
import org.apache.fineract.commands.handler.NewCommandSourceHandler;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.portfolio.charge.service.ChargeWritePlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@RequiredArgsConstructor
@Service
@CommandType(entity = "CHARGE", action = "CREATE")
public class CreateChargeDefinitionCommandHandler implements NewCommandSourceHandler {
private final ChargeWritePlatformService clientWritePlatformService;
@Autowired
public CreateChargeDefinitionCommandHandler(final ChargeWritePlatformService clientWritePlatformService) {
this.clientWritePlatformService = clientWritePlatformService;
}
@Transactional
@Override
public CommandProcessingResult processCommand(final JsonCommand command) {
return this.clientWritePlatformService.createCharge(command);
}
}
@@ -18,30 +18,25 @@
*/
package org.apache.fineract.portfolio.charge.handler;
import lombok.RequiredArgsConstructor;
import org.apache.fineract.commands.annotation.CommandType;
import org.apache.fineract.commands.handler.NewCommandSourceHandler;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.portfolio.charge.service.ChargeWritePlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@RequiredArgsConstructor
@Service
@CommandType(entity = "CHARGE", action = "DELETE")
public class DeleteChargeDefinitionCommandHandler implements NewCommandSourceHandler {
private final ChargeWritePlatformService clientWritePlatformService;
@Autowired
public DeleteChargeDefinitionCommandHandler(final ChargeWritePlatformService clientWritePlatformService) {
this.clientWritePlatformService = clientWritePlatformService;
}
@Transactional
@Override
public CommandProcessingResult processCommand(final JsonCommand command) {
return this.clientWritePlatformService.deleteCharge(command.entityId());
}
}
@@ -18,30 +18,25 @@
*/
package org.apache.fineract.portfolio.charge.handler;
import lombok.RequiredArgsConstructor;
import org.apache.fineract.commands.annotation.CommandType;
import org.apache.fineract.commands.handler.NewCommandSourceHandler;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.portfolio.charge.service.ChargeWritePlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@RequiredArgsConstructor
@Service
@CommandType(entity = "CHARGE", action = "UPDATE")
public class UpdateChargeDefinitionCommandHandler implements NewCommandSourceHandler {
private final ChargeWritePlatformService clientWritePlatformService;
@Autowired
public UpdateChargeDefinitionCommandHandler(final ChargeWritePlatformService clientWritePlatformService) {
this.clientWritePlatformService = clientWritePlatformService;
}
@Transactional
@Override
public CommandProcessingResult processCommand(final JsonCommand command) {
return this.clientWritePlatformService.updateCharge(command.entityId(), command);
}
}
@@ -51,5 +51,6 @@ public class ChargeRequest implements Serializable {
private Boolean enablePaymentType;
private BigDecimal minCap;
private BigDecimal maxCap;
private Long taxGroupId;
}