Issue:
refactor(users): Deprecate non-profile level user APIs

- Currently there are few APIs in Backend which are not at profile level. For example - Switch merchant.
- We have to remove those APIs.

- If there is any v2 counter part for those APIs, v1 APIs should be modified so that they will work the same way as v1.

Resolution:
<think>
PR Context:
- Title: refactor(users): Deprecate unused user APIs and stabilize v1 APIs
- Merged: 2024-10-04T11:53:51Z
- Files changed: 18 files
- Commits: 5 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 -->
Deletions
  - `/user/switch_merchant`
  - `/user/switch/list`
  - `/user/merchants/list`
  - `/user/merchant_select/list`
 
Modifications
  - `/user/user` will work same as `/user/user/v2`
  - `/user/user/list` will work same as `/user
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** refactor(users): Deprecate unused user APIs and stabilize v1 APIs (#6114)
Files to modify:


**crates/api_models/src/events/user.rs**
  Remove:
    - function: private::get_api_event_type
    - impl: impl ApiEventMetric for DashboardEntryResponse

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

**crates/api_models/src/user.rs**
  Remove:
    - struct: pub::DashboardEntryResponse
    - struct: pub::ListUsersResponse
    - struct: pub::UserDetails
    - struct: pub::GetUserRoleDetailsResponse
    - struct: pub::UserMerchantAccount

**crates/api_models/src/user_role.rs**
  Remove:
    - struct: pub::ModuleInfo
    - struct: pub::MerchantSelectRequest
    - struct: pub::AcceptInvitationRequest
    - enum: pub::PermissionModule

**crates/api_models/src/user_role/role.rs**
  Remove:
    - struct: pub::ListRolesResponse
    - struct: pub::RoleInfoWithPermissionsResponse

**crates/router/src/core/user.rs**
  Remove:
    - function: pub::switch_merchant_id
    - function: pub::list_merchants_for_user
    - function: pub::get_user_details_in_merchant_account
    - function: pub::list_users_for_merchant_account

**crates/router/src/core/user_role.rs**
  Remove:
    - function: pub::accept_invitation
    - function: pub::merchant_select_token_only_flow

**crates/router/src/core/user_role/role.rs**
  Remove:
    - function: pub::list_invitable_roles_with_groups

**crates/router/src/db/kafka_store.rs**
  Remove:
    - function: private::find_user_role_by_user_id
    - function: private::find_user_role_by_user_id_merchant_id
    - function: private::list_user_roles_by_user_id_and_version
    - function: private::list_user_roles_by_merchant_id

**crates/router/src/db/user_role.rs**
  Remove:
    - function: private::find_user_role_by_user_id
    - function: private::find_user_role_by_user_id_merchant_id
    - function: private::list_user_roles_by_user_id_and_version
    - function: private::list_user_roles_by_merchant_id
    - function: private::find_user_role_by_user_id
    - function: private::find_user_role_by_user_id_merchant_id
    - function: private::list_user_roles_by_user_id_and_version
    - function: private::list_user_roles_by_merchant_id

**crates/router/src/routes/app.rs**
  Modify existing code

**crates/router/src/routes/lock_utils.rs**
  Modify existing code

**crates/router/src/routes/user.rs**
  Remove:
    - function: pub::switch_merchant_id
    - function: pub::list_merchants_for_user
    - function: pub::get_user_role_details
    - function: pub::list_users_for_merchant_account

**crates/router/src/routes/user_role.rs**
  Remove:
    - function: pub::list_all_roles
    - function: pub::accept_invitation
    - function: pub::merchant_select

**crates/router/src/services/authorization/info.rs**
  Remove:
    - function: pub::get_module_authorization_info
    - function: pub::get_module_description
    - function: pub::new
    - struct: pub::ModuleInfo
    - enum: pub::PermissionModule
    - impl: impl PermissionModule
    - impl: impl ModuleInfo

**crates/router/src/types/domain/user.rs**
  Remove:
    - function: private::from
    - function: private::from
    - impl: impl From<info::ModuleInfo> for user_role_api::ModuleInfo
    - impl: impl From<info::PermissionModule> for user_role_api::PermissionModule

**crates/router/src/utils/user.rs**
  Remove:
    - function: pub::generate_jwt_auth_token_without_profile
    - function: pub::generate_jwt_auth_token_with_attributes_without_profile

**crates/router_env/src/logger/types.rs**
  Modify existing code