nidhiii128 commented on PR #5410:
URL: https://github.com/apache/fineract/pull/5410#issuecomment-3823706360

   > @nidhiii128 the PR and the commit must follow the title conventions, 
please use 
"[Fineract-2460](https://issues.apache.org/jira/browse/FINERACT-2460): Add 
Client Performance API for real-time financial metrics"
   > 
   > Squash and commit your changes because only 1 commit per PR is required.
   > 
   > Why not to use the 
https://{URL_BASE}/fineract-provider/api/v1/clients/{CLIENT_ID}/accounts 
endpoint ?
   
   /accounts returns a large array of objects (full account summaries for every 
loan). my peformance endpoint returns exactly two numbers. Calculating the 
total on the database side (via SUM and COALESCE query) is significantly faster 
than fetching 50 loan objects and summing them in the Java frontend or mobile 
app. By returning exactly two numbers instead of a large object tree, we reduce 
the time-to-first-render for the Client Profile summary, which is critical for 
performance in low-bandwidth environments.
   
   <img width="1839" height="538" alt="image" 
src="https://github.com/user-attachments/assets/32af0b11-ccb5-4ef5-9a70-bbbf58747c28";
 />
   
   The endpoint returns groupLoanIndividualMonitoringAccounts and 
guarantorAccounts. If the user just wants to see their "Total Balance," they 
don't need to know about guarantor status. Even if these arrays were full of 
loans, the user would still be seeing 0.00$ for "Performance" because this 
endpoint doesn't sum up the totals for them.


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