VictorPavfurious commented on code in PR #4638:
URL: https://github.com/apache/fineract/pull/4638#discussion_r2076289981


##########
fineract-core/src/main/java/org/apache/fineract/infrastructure/event/external/service/ExternalEventConfigurationWritePlatformServiceImpl.java:
##########
@@ -22,31 +22,28 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import lombok.AllArgsConstructor;
-import org.apache.fineract.infrastructure.core.api.JsonCommand;
-import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
-import 
org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder;
-import 
org.apache.fineract.infrastructure.event.external.command.ExternalEventConfigurationCommand;
+import lombok.RequiredArgsConstructor;
+import org.apache.fineract.command.core.Command;
+import 
org.apache.fineract.infrastructure.event.external.data.ExternalEventConfigKey;
+import 
org.apache.fineract.infrastructure.event.external.data.ExternalEventConfigurationRequest;
+import 
org.apache.fineract.infrastructure.event.external.data.ExternalEventConfigurationResponse;
 import 
org.apache.fineract.infrastructure.event.external.repository.ExternalEventConfigurationRepository;
 import 
org.apache.fineract.infrastructure.event.external.repository.domain.ExternalEventConfiguration;
-import 
org.apache.fineract.infrastructure.event.external.serialization.ExternalEventConfigurationCommandFromApiJsonDeserializer;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 @Service
-@AllArgsConstructor
+@RequiredArgsConstructor
 public class ExternalEventConfigurationWritePlatformServiceImpl implements 
ExternalEventConfigurationWritePlatformService {
 
     private final ExternalEventConfigurationRepository repository;
-    private final ExternalEventConfigurationCommandFromApiJsonDeserializer 
fromApiJsonDeserializer;
 
     @Transactional
     @Override
-    public CommandProcessingResult updateConfigurations(final JsonCommand 
command) {
-        final ExternalEventConfigurationCommand configurationCommand = 
fromApiJsonDeserializer.commandFromApiJson(command.json());
-        final Map<String, Boolean> commandConfigurations = 
configurationCommand.externalEventConfigurations();
-        final Map<String, Object> changes = new HashMap<>();
+    public ExternalEventConfigurationResponse 
updateConfigurations(Command<ExternalEventConfigurationRequest> command) {

Review Comment:
   I think, that the main issue - we have many class JsonCommand, custom 
JsonHelpers and custom JsonSerialization for request/response String, and 
biggest class in response which use everywhere is class 
CommandProccesingResult, which has many unnecessary fields and etc, we should 
stop use it and make our architecture more clearer... Because of using this 
"custom" serializations - make the logic more complicated... So, in this new 
concept, we want to use pattern command (via handlers) for our API and use 
concrete DTO's and Response for API (without any custom logic, need to remove 
it..), that way it will be clearer in my opinion. 
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to