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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/productmix/data/ProductMixCommandRequest.java:
##########
@@ -0,0 +1,29 @@
+/**
+ * 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.loanproduct.productmix.data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.List;
+
+public record ProductMixCommandRequest(Long productId, List<Long> 
restrictedProducts) implements Serializable {

Review Comment:
   Let's make a separate pair of request/response DTOs for each command use 
case. Even if (in this case) create and update commands seem to have the exact 
same input parameters (they don't... at least the entity's ID is not necessary 
in the create command). I know that intuitively duplicated code seems to smell 
bad, but here it's actually an intended feature to keep both use cases 
physically independent of each other. Tomorrow we'll come with yet another 
parameter for one of those two commands and if we have separate 
request/response classes we don't have to worry that our changes have 
unintended consequences (e.g. changing the OpenAPI signature for both commands 
when in fact our changes might have been intended only for one). So let's 
create separate clase `ProductMixCreateRequest` and `ProductMixUpdateRequest` 
(and let's drop the `Command`, not needed).



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