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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/fixeddepositproduct/FixedDepositProductCreateRequest.java:
##########
@@ -0,0 +1,298 @@
+/**
+ * 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.savings.data.fixeddepositproduct;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
+import java.io.Serial;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Builder
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class FixedDepositProductCreateRequest implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    @NotBlank(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.name.not-blank}")
+    @Size(max = 100, message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.name.size}")
+    private String name;
+
+    @NotBlank(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.short-name.not-blank}")
+    @Size(max = 4, message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.short-name.size}")
+    private String shortName;
+
+    @NotBlank(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.description.not-blank}")
+    private String description;
+
+    @NotBlank(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.currency-code.not-blank}")
+    private String currencyCode;
+
+    @NotNull(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.digits-after-decimal.not-null}")
+    private Integer digitsAfterDecimal;
+
+    @NotNull(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.in-multiples-of.not-null}")
+    private Integer inMultiplesOf;
+
+    private BigDecimal nominalAnnualInterestRate;
+
+    @NotNull(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.interest-compounding-period-type.not-null}")
+    private Integer interestCompoundingPeriodType;
+
+    @NotNull(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.interest-posting-period-type.not-null}")
+    private Integer interestPostingPeriodType;
+
+    @NotNull(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.interest-calculation-type.not-null}")
+    private Integer interestCalculationType;
+
+    @NotNull(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.interest-calculation-days-in-year-type.not-null}")
+    private Integer interestCalculationDaysInYearType;
+
+    private Integer lockinPeriodFrequency;
+
+    private Integer lockinPeriodFrequencyType;
+
+    @NotNull(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.accounting-rule.not-null}")
+    private Integer accountingRule;
+
+    private BigDecimal minBalanceForInterestCalculation;
+
+    private Boolean withHoldTax;
+
+    private Long taxGroupId;
+
+    // Pre-closure details
+    private Boolean preClosurePenalApplicable;
+
+    private BigDecimal preClosurePenalInterest;
+
+    private Integer preClosurePenalInterestOnTypeId;
+
+    // Deposit term details
+    @NotNull(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.min-deposit-term.not-null}")
+    private Integer minDepositTerm;
+
+    @NotNull(message = 
"{org.apache.fineract.portfolio.fixeddepositproduct.min-deposit-term-type-id.not-null}")
+    private Integer minDepositTermTypeId;
+
+    private Integer maxDepositTerm;
+
+    private Integer maxDepositTermTypeId;
+
+    private Integer inMultiplesOfDepositTerm;
+
+    private Integer inMultiplesOfDepositTermTypeId;
+
+    // Deposit amount details
+    private BigDecimal depositAmount;
+
+    private BigDecimal depositMinAmount;
+
+    private BigDecimal depositMaxAmount;
+
+    // Charges
+    private List<@Valid ChargeRequest> charges;
+
+    // Charts
+    private List<@Valid ChartRequest> charts;
+
+    private String locale;
+
+    private String dateFormat;
+
+    // Accounting fields
+    private Long savingsReferenceAccountId;
+
+    private Long savingsControlAccountId;
+
+    private Long transfersInSuspenseAccountId;
+
+    private Long interestOnSavingsAccountId;
+
+    private Long incomeFromFeeAccountId;
+
+    private Long incomeFromPenaltyAccountId;
+
+    private Long overdraftPortfolioControlId;
+
+    private Long incomeFromInterestId;
+
+    private Long writeOffAccountId;
+
+    private Long escheatLiabilityId;
+
+    // Accrual-specific accounting fields
+    private Long feesReceivableAccountId;
+
+    private Long penaltiesReceivableAccountId;
+
+    private Long interestPayableAccountId;
+
+    private List<PaymentChannelToFundSourceMapping> 
paymentChannelToFundSourceMappings;
+
+    private List<FeeToIncomeAccountMapping> feeToIncomeAccountMappings;
+
+    private List<PenaltyToIncomeAccountMapping> penaltyToIncomeAccountMappings;
+
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class PaymentChannelToFundSourceMapping implements 
Serializable {
+
+        @Serial
+        private static final long serialVersionUID = 1L;
+
+        private Long paymentTypeId;
+
+        private Long fundSourceAccountId;
+    }
+
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    public static class FeeToIncomeAccountMapping implements Serializable {

Review Comment:
   Why these nested classes? And suffix "Mapping" suggests something 
different... I know what you mean, but then we would have to call everything 
"Mapping", because we map data to Java objects. Classes like these fare "DTOs" 
(data transfer objects), so let's use the suffix "Data" and let's move them up 
to the folder level, not nested inside another class. That way fellow devs see 
immediately the types that are involved in this API exchange.
   
   But more importantly: same here, "savings" domain. Too much in this PR.



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