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


##########
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:
   It's not nice....
   
   `I think this is where the importance of typesafety comes in, as we are not 
dealing with JsonStrings which are then parsed and validated at a later stage. 
The request and response objects the filtering is happening right before the 
API logic is executed. Jakarta validation.` -> Not one of these sentences has 
any meaning...
   
   I have asked you to take a look at `BusinessDateUpdateRequest` and 
`BusinessDateDTO` where you will see why (correctly) the two DTOs are 
different! They have different purposes and different annotations. 
   
   `BusinessDateDTO` is used at service layer, all fields are using the 
relevant internal types (type is `BusinessDateType`). No Bean validation on it. 
No `@JsonLocalDateArrayFormat` to format the `LocalDate` field before 
serialization. (used in `BusinessDateUpdateResponse`)
   `BusinessDateUpdateRequest` is used at API layer, all fields are using 
simple data type (like String), including `date` and `type`. Bean Validation 
are enforced on this DTO and its values (see number of Bean validation 
annotations). 
   
   There are number of difference between the DTOs: data types, fields and 
annotations wise.



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