FINERACT-2181: Remove command param lower casing

This commit is contained in:
Adam Saghy
2025-06-04 21:23:59 +02:00
parent 9e39ecb279
commit f383ee7c17
2 changed files with 10 additions and 12 deletions
@@ -41,7 +41,6 @@ import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.MediaType;
import java.util.Map; import java.util.Map;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.batch.command.CommandHandlerRegistry; import org.apache.fineract.batch.command.CommandHandlerRegistry;
import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.domain.CommandWrapper;
import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.CommandWrapperBuilder;
@@ -100,8 +99,8 @@ public class ExternalAssetOwnersApiResource {
@Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) { @Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) {
platformUserRightsContext.isAuthenticated(); platformUserRightsContext.isAuthenticated();
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq); final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(StringUtils.toRootLowerCase(commandParam), loanId, final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, loanId, serializedAssetRequest,
serializedAssetRequest, new UnrecognizedQueryParamException("command", commandParam)); new UnrecognizedQueryParamException("command", commandParam));
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest); return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
} }
@@ -119,8 +118,8 @@ public class ExternalAssetOwnersApiResource {
platformUserRightsContext.isAuthenticated(); platformUserRightsContext.isAuthenticated();
final Long loanId = loanReadPlatformService.getLoanIdByLoanExternalId(externalLoanId); final Long loanId = loanReadPlatformService.getLoanIdByLoanExternalId(externalLoanId);
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq); final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(StringUtils.toRootLowerCase(commandParam), loanId, final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, loanId, serializedAssetRequest,
serializedAssetRequest, new UnrecognizedQueryParamException("command", commandParam)); new UnrecognizedQueryParamException("command", commandParam));
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest); return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
} }
@@ -137,8 +136,8 @@ public class ExternalAssetOwnersApiResource {
@Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) { @Parameter(hidden = true) ExternalAssetOwnerRequest assetOwnerReq) {
platformUserRightsContext.isAuthenticated(); platformUserRightsContext.isAuthenticated();
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq); final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(StringUtils.toRootLowerCase(commandParam), id, final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, id, serializedAssetRequest,
serializedAssetRequest, new UnrecognizedQueryParamException("command", commandParam)); new UnrecognizedQueryParamException("command", commandParam));
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest); return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
} }
@@ -155,8 +154,8 @@ public class ExternalAssetOwnersApiResource {
platformUserRightsContext.isAuthenticated(); platformUserRightsContext.isAuthenticated();
final Long id = externalAssetOwnersReadService.retrieveLastTransferIdByExternalId(new ExternalId(externalId)); final Long id = externalAssetOwnersReadService.retrieveLastTransferIdByExternalId(new ExternalId(externalId));
final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq); final String serializedAssetRequest = postApiJsonSerializerService.serialize(assetOwnerReq);
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(StringUtils.toRootLowerCase(commandParam), id, final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, id, serializedAssetRequest,
serializedAssetRequest, new UnrecognizedQueryParamException("command", commandParam)); new UnrecognizedQueryParamException("command", commandParam));
return this.commandsSourceWritePlatformService.logCommandSource(commandRequest); return this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
} }
@@ -43,7 +43,6 @@ import java.util.Arrays;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.batch.command.CommandHandlerRegistry; import org.apache.fineract.batch.command.CommandHandlerRegistry;
import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.domain.CommandWrapper;
import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.CommandWrapperBuilder;
@@ -138,8 +137,8 @@ public class StandingInstructionApiResource {
@QueryParam("command") @Parameter(description = "command") final String commandParam) { @QueryParam("command") @Parameter(description = "command") final String commandParam) {
final String serializedUpdatesRequest = toApiJsonSerializer.serialize(updatesRequest); final String serializedUpdatesRequest = toApiJsonSerializer.serialize(updatesRequest);
final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(StringUtils.toRootLowerCase(commandParam), final CommandWrapper commandRequest = COMMAND_HANDLER_REGISTRY.execute(commandParam, standingInstructionId,
standingInstructionId, serializedUpdatesRequest, new UnrecognizedQueryParamException("command", commandParam)); serializedUpdatesRequest, new UnrecognizedQueryParamException("command", commandParam));
return commandsSourceWritePlatformService.logCommandSource(commandRequest); return commandsSourceWritePlatformService.logCommandSource(commandRequest);
} }