You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Submitting a Tax Group without any tax components previously failed only on the generic integerGreaterThanZero check, without a clear message.
This adds an explicit validation error (validation.msg.at.least.one.tax.component.required) with a user-friendly message ("Please add at least
one Tax Component before submitting the Tax Group.") when the taxComponents array is empty.
What went wrong:
Execution failed for task ':fineract-tax:spotlessJavaCheck'.
The following files had format violations:
src/main/java/org/apache/fineract/portfolio/tax/serialization/TaxValidator.java
@@ -193,13 +193,8 @@
········if·(topLevelJsonElement.get(TaxApiConstants.taxComponentsParamName).isJsonArray())·{
············final·JsonArray·array·=·topLevelJsonElement.get(TaxApiConstants.taxComponentsParamName).getAsJsonArray();
············if·(array.isEmpty())·{
-················dataValidationErrors.add(
-························ApiParameterError.parameterError(
-································"validation.msg.at.least.one.tax.component.required",
-································"Please·add·at·least·one·Tax·Component·before·submitting·the·Tax·Group.",
-································TaxApiConstants.taxComponentsParamName
-························)
-················);
+················dataValidationErrors.add(ApiParameterError.parameterError("validation.msg.at.least.one.tax.component.required",
+························"Please·add·at·least·one·Tax·Component·before·submitting·the·Tax·Group.",·TaxApiConstants.taxComponentsParamName));
············}
············baseDataValidator.reset().parameter(TaxApiConstants.taxComponentsParamName).value(array.size()).integerGreaterThanZero();
[Incubating] Problems report is available at: file:///home/runner/work/fineract/fineract/build/reports/problems/problems-report.html
············for·(int·i·=·1;·i·<=·array.size();·i++)·{
Run './gradlew :fineract-tax:spotlessApply' to fix these violations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Submitting a Tax Group without any tax components previously failed only on the generic integerGreaterThanZero check, without a clear message.
This adds an explicit validation error (validation.msg.at.least.one.tax.component.required) with a user-friendly message ("Please add at least
one Tax Component before submitting the Tax Group.") when the taxComponents array is empty.
Added an integration test (TaxesTest#createTaxGroupWithoutTaxComponent_shouldReturnValidationError) covering the new validation path.
PR:(https://issues.apache.org/jira/browse/FINERACT-2748)