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


##########
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'm not sure I'm getting this and all these "new concept" changes.
   
   The original issue was that the API level things (JSON, etc) are sinking 
into the business logic. 
   
   Here the same things happens but instead of the raw JsonCommand class, we 
are dealing with the respective Request and Response classes. How is this any 
different than the original impl?
   
   In my mind there should be a 3 layered structure in place to avoid leaking 
implementation details (as adivsed by the Dependency Inversion principle in 
SOLID).
   
   API DTOs (Request/Response) -> Service (Business objects) -> Repository (DB 
level objects).
   
   This means transformation in every layer and the arrows are intentionally 
the way they are, so no implementation depends on the upper layer.
   
   @vidakovic @adamsaghy thoughts? what am I missing here?



-- 
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