Ralph Hopman created FINERACT-2603:
--------------------------------------

             Summary: Add staffId filter parameter to the Retrieve All Clients 
API
                 Key: FINERACT-2603
                 URL: https://issues.apache.org/jira/browse/FINERACT-2603
             Project: Apache Fineract
          Issue Type: Improvement
          Components: Client
            Reporter: Ralph Hopman
            Assignee: Ralph Hopman


As a Fineract API consumer, I want to be able to filter the _Retrieve All 
Clients_ endpoint by {{{}staffId{}}}, so that I can retrieve only the clients 
assigned to a specific staff member without having to filter results 
client-side.
h2. Background

The {{GET /clients}} endpoint ({{{}ClientsApiResource#retrieveAll{}}}) 
currently supports filtering by office, legal form, status, name, and other 
fields. There is no way to narrow results by the staff member assigned to a 
client. This forces callers to fetch large result sets and discard unneeded 
records.
h2. Acceptance Criteria
 * The {{GET /clients}} endpoint accepts an optional {{staffId}} query 
parameter (type: {{{}Long{}}}).
 * When {{staffId}} is provided, only clients whose {{staff_id}} matches the 
given value are returned.
 * When {{staffId}} is omitted or {{{}null{}}}, the existing behaviour is 
preserved and no additional filtering is applied.
 * {{staffId}} is passed through the call chain: {{ClientsApiResource}} -> 
{{SearchParameters}} -> {{{}ClientReadPlatformServiceImpl{}}}, where it is 
applied as a SQL predicate {{{}c.staff_id = ?{}}}.
 * The generated {{ClientApi}} client (retrofit) exposes the new parameter so 
that integration-test call sites compile and pass {{null}} when the filter is 
not needed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to