kapilpanchal123 commented on code in PR #5126:
URL: https://github.com/apache/fineract/pull/5126#discussion_r2465398018


##########
fineract-core/src/main/java/org/apache/fineract/portfolio/account/data/AccountTransferRequest.java:
##########
@@ -0,0 +1,79 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.portfolio.account.data;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Size;
+import java.io.Serial;
+import java.io.Serializable;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.apache.fineract.validation.constraints.Locale;
+
+@Getter
+@Setter
+@NoArgsConstructor
+public class AccountTransferRequest implements Serializable {

Review Comment:
   This is what I am also suggesting
   
   @POST
       @Consumes({ MediaType.APPLICATION_JSON })
       @Produces({ MediaType.APPLICATION_JSON })
       @Operation(summary = "Update Business Date", description = "")
       public BusinessDateUpdateResponse 
updateBusinessDate(@HeaderParam("Idempotency-Key") String idempotencyKey,
               @Valid BusinessDateUpdateRequest request) {
   
           final BusinessDateUpdateCommand command = new 
BusinessDateUpdateCommand();
   
           command.setId(UUID.randomUUID());
           command.setIdempotencyKey(idempotencyKey);
           command.setCreatedAt(DateUtils.getAuditOffsetDateTime());
           command.setPayload(request);
   
           final Supplier<BusinessDateUpdateResponse> response = 
commandPipeline.send(command);
   
           return response.get();
       } and @Slf4j
   @Component
   @RequiredArgsConstructor
   public class BusinessDateUpdateHandler implements 
CommandHandler<BusinessDateUpdateRequest, BusinessDateUpdateResponse> {
   
       private final BusinessDateWritePlatformService 
businessDateWritePlatformService;
       private final BusinessDateMapper businessDateMapper;
   
       @Transactional
       @Override
       public BusinessDateUpdateResponse 
handle(Command<BusinessDateUpdateRequest> command) {
           **BusinessDateDTO businessDateDto = 
businessDateMapper.mapUpdateRequest(command.getPayload());**
           businessDateDto = 
businessDateWritePlatformService.updateBusinessDate(businessDateDto);
           return businessDateMapper.mapUpdateResponse(businessDateDto);
       }
   } the business date Mapper is a mapstruct interface. Here in this example 
there is no Entity class, but if there were an entity class it would have been 
mapped here and then saved in the repository. I am agreeing to this logic.



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