JebronLames32 commented on code in PR #4546:
URL: https://github.com/apache/fineract/pull/4546#discussion_r2042279733


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsApplicationProcessWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -168,7 +168,9 @@ public CommandProcessingResult submitApplication(final 
JsonCommand command) {
 
                     Group group = 
this.groupRepositoryWrapper.findOneWithNotFoundDetection(groupId);
 
-                    if 
(command.booleanObjectValueOfParameterNamed("isParentAccount") != null) {
+                    if 
(command.booleanObjectValueOfParameterNamed("isParentAccount") != null

Review Comment:
   
   ![Screenshot From 2025-04-14 
19-42-35](https://github.com/user-attachments/assets/b3562440-bc26-4664-9727-dd7f34831058)
   
   Originally documented as “1”
   In the legacy documentation, isParentAccount is being indicated using 1 to 
represent true (and possibly 0 or omission for false). However, the current 
Fineract implementation (i.e., 
`command.booleanObjectValueOfParameterNamed("isParentAccount"))` uses a Boolean 
for logic.
   
   I added 
(`"1".equals(command.stringValueOfParameterNamed("isParentAccount"))`) to 
handle the documentation scenario where consumers send the value as "1" instead 
of "true".
   Meanwhile, `command.booleanObjectValueOfParameterNamed("isParentAccount")` 
properly interprets JSON booleans (true/false).
   
   I felt we could accommodate both forms of input:
   
   - Boolean: true/false (which booleanObjectValueOfParameterNamed 
understands), and
   - Legacy string: "1" for true.
   
   The intended usage going forward could be to be a boolean field in the API.
   The code allows for backward compatibility by also accepting the string "1" 
as an equivalent to true.



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