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


##########
fineract-charge/src/main/java/org/apache/fineract/portfolio/charge/data/ChargeCreateRequest.java:
##########
@@ -0,0 +1,89 @@
+/**
+ * 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.charge.data;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Positive;
+import jakarta.validation.constraints.Size;
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.MonthDay;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.fineract.portfolio.charge.domain.ChargeUtils;
+import org.apache.fineract.portfolio.charge.validation.ValidChargeCreate;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ValidChargeCreate
+public class ChargeCreateRequest implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    @NotNull(message = 
"{org.apache.fineract.portfolio.charge.charge-applies-to.not-null}")
+    private Integer chargeAppliesTo;
+    @NotBlank(message = 
"{org.apache.fineract.portfolio.charge.name.not-blank}")
+    @Size(max = 100, message = 
"{org.apache.fineract.portfolio.charge.name.max}")
+    private String name;
+    @NotBlank(message = 
"{org.apache.fineract.portfolio.charge.currency-code.not-blank}")
+    @Size(max = 3, message = 
"{org.apache.fineract.portfolio.charge.currency-code.max}")
+    private String currencyCode;
+    private Integer chargeTimeType;
+    @NotNull(message = 
"{org.apache.fineract.portfolio.charge.charge-calculation-type.not-null}")
+    private Integer chargeCalculationType;
+    @NotNull(message = 
"{org.apache.fineract.portfolio.charge.amount.not-null}")
+    @Positive(message = 
"{org.apache.fineract.portfolio.charge.amount.positive}")
+    private Double amount;
+    private Boolean active;
+    private Boolean penalty;
+    private Integer chargePaymentMode;
+    private String monthDayFormat;
+    private String locale;
+    private String feeOnMonthDay;
+    // documented as string to preserve the published API contract (legacy 
ChargeRequest exposed these as strings)
+    @Schema(type = "string", example = "1")

Review Comment:
   I think we should not use the Swagger annotations here. We have now a lot of 
information with the Jakarta Validation annotations (more than we can have with 
Swagger anyway), and usually we provide(d) very trivial examples like this one 
here that provide no added value. Please remove all @Schema annotations from 
the `XXXRequest` and `XXXResponse` classes (not only here, see other commands 
in this PR, but also your other PRs).



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