budaidev commented on code in PR #5907:
URL: https://github.com/apache/fineract/pull/5907#discussion_r3326522964


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/modules/SavingsRequestBuilders.java:
##########
@@ -0,0 +1,104 @@
+/**
+ * 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.integrationtests.client.feign.modules;
+
+import java.math.BigDecimal;
+import org.apache.fineract.client.models.PostSavingsAccountTransactionsRequest;
+import org.apache.fineract.client.models.PostSavingsAccountsAccountIdRequest;
+import org.apache.fineract.client.models.PostSavingsAccountsRequest;
+import org.apache.fineract.client.models.PostSavingsProductsRequest;
+import org.apache.fineract.integrationtests.common.Utils;
+
+public final class SavingsRequestBuilders {
+
+    private SavingsRequestBuilders() {}
+
+    public static PostSavingsProductsRequest defaultSavingsProduct() {
+        return new PostSavingsProductsRequest()//
+                .name("Savings Product " + System.currentTimeMillis())//
+                .shortName(Utils.uniqueRandomStringGenerator("", 4))//
+                .description("Test savings product")//
+                .currencyCode("USD")//
+                .digitsAfterDecimal(4)//

Review Comment:
   Based on other tests on the project, this is usually 2. 



##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/modules/FeignTestConstants.java:
##########
@@ -0,0 +1,28 @@
+/**
+ * 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.integrationtests.client.feign.modules;
+
+public final class FeignTestConstants {
+
+    public static final String DATETIME_PATTERN = "dd MMMM yyyy";
+    public static final String LOCALE = "en";
+    public static final String DATE_FORMAT = DATETIME_PATTERN;

Review Comment:
   do we use this anywhere? What's the role of this field?



##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/modules/SavingsRequestBuilders.java:
##########
@@ -0,0 +1,104 @@
+/**
+ * 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.integrationtests.client.feign.modules;
+
+import java.math.BigDecimal;
+import org.apache.fineract.client.models.PostSavingsAccountTransactionsRequest;
+import org.apache.fineract.client.models.PostSavingsAccountsAccountIdRequest;
+import org.apache.fineract.client.models.PostSavingsAccountsRequest;
+import org.apache.fineract.client.models.PostSavingsProductsRequest;
+import org.apache.fineract.integrationtests.common.Utils;
+
+public final class SavingsRequestBuilders {
+
+    private SavingsRequestBuilders() {}
+
+    public static PostSavingsProductsRequest defaultSavingsProduct() {
+        return new PostSavingsProductsRequest()//
+                .name("Savings Product " + System.currentTimeMillis())//
+                .shortName(Utils.uniqueRandomStringGenerator("", 4))//
+                .description("Test savings product")//
+                .currencyCode("USD")//
+                .digitsAfterDecimal(4)//
+                .inMultiplesOf(0)//
+                .nominalAnnualInterestRate(10.0)//
+                
.interestCompoundingPeriodType(SavingsTestData.InterestCompoundingPeriodType.DAILY)//
+                
.interestPostingPeriodType(SavingsTestData.InterestPostingPeriodType.MONTHLY)//
+                
.interestCalculationType(SavingsTestData.InterestCalculationType.DAILY_BALANCE)//
+                
.interestCalculationDaysInYearType(SavingsTestData.InterestCalculationDaysInYearType.DAYS_365)//
+                .accountingRule(SavingsTestData.AccountingRule.NONE)//
+                .locale(SavingsTestData.LOCALE);
+    }
+
+    public static PostSavingsAccountsRequest submitSavingsApplication(Long 
clientId, Long productId, String submittedOnDate) {
+        return new PostSavingsAccountsRequest()//
+                .clientId(clientId)//
+                .productId(productId)//
+                .submittedOnDate(submittedOnDate)//
+                .dateFormat(SavingsTestData.DATETIME_PATTERN)//
+                .locale(SavingsTestData.LOCALE);
+    }
+
+    public static PostSavingsAccountsAccountIdRequest approveSavings(String 
approvedOnDate) {
+        return new PostSavingsAccountsAccountIdRequest()//
+                .approvedOnDate(approvedOnDate)//
+                .dateFormat(SavingsTestData.DATETIME_PATTERN)//
+                .locale(SavingsTestData.LOCALE);
+    }
+
+    public static PostSavingsAccountsAccountIdRequest activateSavings(String 
activatedOnDate) {
+        return new PostSavingsAccountsAccountIdRequest()//
+                .activatedOnDate(activatedOnDate)//
+                .dateFormat(SavingsTestData.DATETIME_PATTERN)//
+                .locale(SavingsTestData.LOCALE);
+    }
+
+    public static PostSavingsAccountsAccountIdRequest closeSavings(String 
closedOnDate, boolean withdrawBalance) {
+        return new PostSavingsAccountsAccountIdRequest()//
+                .closedOnDate(closedOnDate)//
+                .withdrawBalance(withdrawBalance)//
+                .dateFormat(SavingsTestData.DATETIME_PATTERN)//
+                .locale(SavingsTestData.LOCALE);
+    }
+
+    public static PostSavingsAccountsAccountIdRequest rejectSavings(String 
rejectedOnDate) {
+        return new PostSavingsAccountsAccountIdRequest()//
+                .closedOnDate(rejectedOnDate)//

Review Comment:
   Strange that we use closedOnDate here, but as I checked it is probably a 
swagger model problem. Anyway, I don't think it's the right way to send 
rejectedOnDate on other parameter



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