ClientProject #2382
Updated by Nazmul Hossain Shovon 8 months ago
PR Description
What’s Changed
**Warehouse Permissions** : Added support for the read_all-warehouse permission. If a user has this permission, the /report-dependent-data endpoint now returns all warehouses; otherwise, it returns only the warehouses assigned to the user.
**User Selection Enhancement** : The user selection service now returns users along with an array of their assigned warehouse IDs (warehouses field).
**Refactoring** : Moved warehouse-fetching logic to a dedicated service file for better separation of concerns.
**Endpoint Update** : The /report-dependent-data endpoint now sends users with their warehouse assignments and returns warehouses based on the user's permissions.
**How to Test (Postman)**
Test /report-dependent-data endpoint:
With read_all-warehouse permission:
Use a user/token with this permission.
You should receive all warehouses in the response.
Without read_all-warehouse permission:
Use a user/token without this permission.
You should receive only the warehouses assigned to that user.
Check Users in Response:
Each user object should include a warehouses array containing their assigned warehouse IDs.