Issue:
refactor(users): Populate optional fields in the user APIs

Currently
- list users in lineage
- get user role details
- list invitations
APIs send `null` for role_name, entity_name etc...

These fields should be populated with proper data.

Resolution:
<think>
PR Context:
- Title: refactor(user_roles): Populate role names and entity names in user role APIs
- Merged: 2024-09-13T13:21:52Z
- Files changed: 12 files
- Commits: 3 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
- Populate entity name in list invitations API.
- Add role name in the response of get user role details API.
- Populate role name in list users in lineage API.

### Additional Changes

- [x] This PR modifies the API contract
- [ ] This
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** refactor(user_roles): Populate role names and entity names in user role APIs (#5861)
Files to modify:


**crates/api_models/src/user.rs**
  Modify existing code

**crates/api_models/src/user_role/role.rs**
  Modify existing code

**crates/diesel_models/src/query/role.rs**
  Add:
    - function: pub::find_by_role_id_in_org_scope

**crates/router/src/analytics.rs**
  Modify existing code

**crates/router/src/core/user.rs**
  Modify existing code

**crates/router/src/core/user_role.rs**
  Modify existing code

**crates/router/src/core/user_role/role.rs**
  Modify existing code

**crates/router/src/db/kafka_store.rs**
  Add:
    - function: private::find_role_by_role_id_in_org_scope

**crates/router/src/db/role.rs**
  Add:
    - function: private::find_role_by_role_id_in_org_scope
    - function: private::find_role_by_role_id_in_org_scope

**crates/router/src/services/authorization/roles.rs**
  Add:
    - function: pub::from_role_id_in_merchant_scope

**crates/router/src/utils/user.rs**
  Modify existing code

**crates/router/src/utils/user_role.rs**
  Modify existing code