Monica-CodingWorld commented on code in PR #5362:
URL: https://github.com/apache/fineract/pull/5362#discussion_r2726347126
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/account/data/StandingInstructionDataValidator.java:
##########
@@ -151,21 +155,26 @@ public void validateForCreate(final JsonCommand command) {
if (frequencyType.isMonthly() || frequencyType.isYearly()) {
final MonthDay monthDay = this.fromApiJsonHelper
.extractMonthDayNamed(StandingInstructionApiConstants.recurrenceOnMonthDayParamName,
element);
-
baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceOnMonthDayParamName).value(monthDay)
- .notNull();
+
+ if (standingInstructionType == null ||
!StandingInstructionType.fromInt(standingInstructionType).isDuesAmoutTransfer())
{
+
baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceOnMonthDayParamName).value(monthDay)
+ .notNull();
+ }
}
}
final Integer recurrenceInterval = this.fromApiJsonHelper
.extractIntegerNamed(StandingInstructionApiConstants.recurrenceIntervalParamName,
element, Locale.getDefault());
if (isPeriodic) {
-
baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceIntervalParamName).value(recurrenceInterval)
- .notNull();
-
baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceFrequencyParamName).value(recurrenceFrequency)
- .notNull();
+ if (standingInstructionType == null ||
!StandingInstructionType.fromInt(standingInstructionType).isDuesAmoutTransfer())
{
+
baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceIntervalParamName).value(recurrenceInterval)
Review Comment:
@Aman-Mittal Thank you so much for your guidance and suggestions. I will
improve the PR and update shortly.
--
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]