vidakovic commented on code in PR #5622:
URL: https://github.com/apache/fineract/pull/5622#discussion_r3004075327


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/handler/DeleteProductMixCommandHandler.java:
##########
@@ -18,32 +18,33 @@
  */
 package org.apache.fineract.portfolio.loanproduct.productmix.handler;
 
-import org.apache.fineract.commands.annotation.CommandType;
-import org.apache.fineract.commands.handler.NewCommandSourceHandler;
-import org.apache.fineract.infrastructure.core.api.JsonCommand;
+import io.github.resilience4j.retry.annotation.Retry;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.fineract.command.core.Command;
+import org.apache.fineract.command.core.CommandHandler;
 import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
+import 
org.apache.fineract.portfolio.loanproduct.productmix.data.ProductMixDeleteRequest;
 import 
org.apache.fineract.portfolio.loanproduct.productmix.service.ProductMixWritePlatformService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
+import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
-@Service
-@CommandType(entity = "PRODUCTMIX", action = "DELETE")
-public class DeleteProductMixCommandHandler implements NewCommandSourceHandler 
{
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class DeleteProductMixCommandHandler implements 
CommandHandler<ProductMixDeleteRequest, CommandProcessingResult> {
 
-    private final ProductMixWritePlatformService 
productMixWritePlatformService;
+    private final ProductMixWritePlatformService writePlatformService;
 
-    @Autowired
-    public DeleteProductMixCommandHandler(final ProductMixWritePlatformService 
productMixWritePlatformService) {
-
-        this.productMixWritePlatformService = productMixWritePlatformService;
+    @Retry(name = "commandDeleteProductMix", fallbackMethod = "fallback")
+    @Override
+    @Transactional
+    public CommandProcessingResult handle(Command<ProductMixDeleteRequest> 
command) {

Review Comment:
   See previous comment on return type and type-safety.



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/handler/UpdateProductMixCommandHandler.java:
##########
@@ -18,32 +18,33 @@
  */
 package org.apache.fineract.portfolio.loanproduct.productmix.handler;
 
-import org.apache.fineract.commands.annotation.CommandType;
-import org.apache.fineract.commands.handler.NewCommandSourceHandler;
-import org.apache.fineract.infrastructure.core.api.JsonCommand;
+import io.github.resilience4j.retry.annotation.Retry;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.fineract.command.core.Command;
+import org.apache.fineract.command.core.CommandHandler;
 import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
+import 
org.apache.fineract.portfolio.loanproduct.productmix.data.ProductMixCommandRequest;
 import 
org.apache.fineract.portfolio.loanproduct.productmix.service.ProductMixWritePlatformService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
+import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
-@Service
-@CommandType(entity = "PRODUCTMIX", action = "UPDATE")
-public class UpdateProductMixCommandHandler implements NewCommandSourceHandler 
{
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class UpdateProductMixCommandHandler implements 
CommandHandler<ProductMixCommandRequest, CommandProcessingResult> {

Review Comment:
   See previous comment on naming conventions.



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