DepartmentService::getHierarchicalTreePaginated(). Organization-scoped: filters users by current tenant.curl --location 'https://api-dev.commandroom.ai/api/api/departments/tree/paginated?org_chart_id=15&page=1&per_page=10&include_users=true' \
--header 'Authorization: Bearer {{token}}' \
--header 'X-Tenant-UUID: '{
"success": true,
"data": [
{
"id": 1,
"type": "department",
"name": "Sample Name",
"description": "Sample description text.",
"original_id": 1,
"teams_count": 10,
"users_count": 10,
"pagination": {
"teams": {
"loaded": 1,
"total": 10,
"has_more": true,
"per_page": 1,
"current_page": 1
}
},
"children": [
{}
]
}
],
"pagination": {
"current_page": 1,
"per_page": 1,
"total": 10,
"last_page": 1,
"has_more": true
}
}