MokuLakshithReddy commented on code in PR #155: URL: https://github.com/apache/fineract-consumer-facing/pull/155#discussion_r4234270697
########## consumer/src/main/java/org/apache/fineract/consumer/savings/command/data/SubmitSavingsApplicationCommandRequest.java: ########## @@ -0,0 +1,47 @@ +/* + * 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.consumer.savings.command.data; + +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; +import java.math.BigDecimal; +import java.time.LocalDate; +import lombok.Builder; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.ToString; + +@Getter +@RequiredArgsConstructor +@Builder +@ToString(onlyExplicitlyIncluded = true) +public final class SubmitSavingsApplicationCommandRequest { + + @NotNull + @Positive + private final Long productId; + + @NotNull + private final LocalDate submittedOnDate; + + private final BigDecimal nominalAnnualInterestRate; Review Comment: Done. Removed ominalAnnualInterestRate from SubmitSavingsApplicationCommandRequest and SubmitSavingsApplicationCommand so Fineract applies product defaults as configured. ########## consumer/src/main/java/org/apache/fineract/consumer/savings/command/data/ModifySavingsApplicationCommandRequest.java: ########## @@ -0,0 +1,47 @@ +/* + * 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.consumer.savings.command.data; + +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; +import java.math.BigDecimal; +import java.time.LocalDate; +import lombok.Builder; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.ToString; + +@Getter +@RequiredArgsConstructor +@Builder +@ToString(onlyExplicitlyIncluded = true) +public final class ModifySavingsApplicationCommandRequest { + + @NotNull + @Positive + private final Long productId; + + @NotNull + private final LocalDate submittedOnDate; + + private final BigDecimal nominalAnnualInterestRate; Review Comment: Done. Removed ominalAnnualInterestRate from ModifySavingsApplicationCommandRequest and ModifySavingsApplicationCommand as well. ########## consumer/src/main/java/org/apache/fineract/consumer/savings/command/data/SubmitSavingsApplicationCommandRequest.java: ########## @@ -0,0 +1,47 @@ +/* + * 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.consumer.savings.command.data; + +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; +import java.math.BigDecimal; +import java.time.LocalDate; +import lombok.Builder; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.ToString; + +@Getter +@RequiredArgsConstructor +@Builder +@ToString(onlyExplicitlyIncluded = true) +public final class SubmitSavingsApplicationCommandRequest { + + @NotNull + @Positive + private final Long productId; + + @NotNull + private final LocalDate submittedOnDate; + + private final BigDecimal nominalAnnualInterestRate; + + private final String externalId; Review Comment: Done. Dropped externalId from both submit and modify request DTOs and commands. ########## consumer/src/main/java/org/apache/fineract/consumer/savings/command/data/WithdrawSavingsApplicationCommandRequest.java: ########## @@ -0,0 +1,39 @@ +/* + * 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.consumer.savings.command.data; + +import jakarta.validation.constraints.NotNull; +import java.time.LocalDate; +import lombok.Builder; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.ToString; + +@Getter +@RequiredArgsConstructor +@Builder +@ToString(onlyExplicitlyIncluded = true) +public final class WithdrawSavingsApplicationCommandRequest { + + @NotNull + private final LocalDate withdrawnOnDate; + + private final String note; Review Comment: Done. Added @Size(max = 1000) on ote in WithdrawSavingsApplicationCommandRequest and added @ToString.Exclude on ote in WithdrawSavingsApplicationCommand. ########## consumer/build.gradle: ########## @@ -307,6 +307,49 @@ def fixClientImageResponseShape(paths) { ]] } +def addMissingSavingsAccountCommandFields(schemas) { + def missingAccountFields = [ + withdrawnOnDate: [type: 'string'], + note : [type: 'string'] + ] + def properties = schemas.PostSavingsAccountsAccountIdRequest?.properties + if (properties == null) { + throw new GradleException("Fineract spec schema 'PostSavingsAccountsAccountIdRequest' missing — revisit addMissingSavingsAccountCommandFields") + } + missingAccountFields.each { propName, propDef -> + if (!properties.containsKey(propName)) { + properties[propName] = propDef + } + } + + def missingPostFields = [ + nominalAnnualInterestRate: [type: 'number'] + ] + def postProps = schemas.PostSavingsAccountsRequest?.properties + if (postProps != null) { Review Comment: Done. Replaced the silent return with GradleException if the schema is missing in consumer/build.gradle, removed the missingPostFields block, and documented the patch in docs/consumer/architecture/fineract-integration.adoc. ########## consumer/src/main/java/org/apache/fineract/consumer/infrastructure/fineractclient/spec/fineract.json: ########## Review Comment: Done. Fully reverted consumer/src/main/java/org/apache/fineract/consumer/infrastructure/fineractclient/spec/fineract.json to origin/main. -- 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]
