Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3e03a0c
Merge pull request #153 from ELEVATE-Project/develop
priyanka-TL Jun 6, 2025
b253c46
Merge pull request #156 from ELEVATE-Project/develop
Prajwal17Tunerlabs Jun 18, 2025
744b71e
Merge pull request #158 from ELEVATE-Project/develop
VISHNUDAS-tunerlabs Jun 19, 2025
5846882
Merge pull request #161 from ELEVATE-Project/develop
VISHNUDAS-tunerlabs Jun 27, 2025
3eb84ad
updated ansible
priyanka-TL Jun 28, 2025
ac8ca79
Merge pull request #162 from ELEVATE-Project/ansibleChange
priyanka-TL Jun 28, 2025
4b1856e
Merge pull request #165 from ELEVATE-Project/develop
VISHNUDAS-tunerlabs Jul 2, 2025
e464934
Merge pull request #167 from ELEVATE-Project/develop
VISHNUDAS-tunerlabs Jul 7, 2025
edb7749
Merge pull request #169 from ELEVATE-Project/develop
priyanka-TL Jul 16, 2025
9d4f072
Merge branch 'develop' of https://github.com/ELEVATE-Project/entity-m…
priyanka-TL Aug 18, 2025
3b15565
targeted Role
priyanka-TL Aug 18, 2025
4d6f9e6
targeted role and sub entity list
priyanka-TL Aug 18, 2025
d592f0e
Use externalId instead of code
priyanka-TL Aug 28, 2025
e2cf65b
Merge branch 'develop' of https://github.com/ELEVATE-Project/entity-m…
priyanka-TL Sep 17, 2025
848d255
Pr comments addressed
priyanka-TL Sep 17, 2025
517e32b
Refactor entity mapping data processing for improved readability and …
priyanka-TL Sep 19, 2025
25c0986
Remove console log for error handling in UserProjectsHelper
priyanka-TL Sep 19, 2025
501afd6
Refactor variable name for clarity in entity type matching logic
priyanka-TL Sep 19, 2025
7383e36
Merge branch 'develop' of https://github.com/ELEVATE-Project/entity-m…
priyanka-TL Sep 22, 2025
b336137
PR comments addressed
priyanka-TL Sep 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 36 additions & 37 deletions src/api-doc/api-doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2428,7 +2428,7 @@ paths:
description: Please pass entity type value for the entity
schema: *ref_12
- in: path
name: serach
name: search
description: ''
schema: *ref_12
- in: header
Expand All @@ -2441,6 +2441,12 @@ paths:
description: Please append a valid entity id
schema: *ref_13
required: true
- in: query
name: parentInfoRequired
description: Pass this paramater as true if need parents details
default: false
schema: *ref_14
required: false
responses:
'200':
description: ok
Expand Down Expand Up @@ -2490,6 +2496,9 @@ paths:
externalId: entity123
label: undefined - entity123
value: 627a13928ce12806f5803f57
district: BAGALKOT,
block: BADAMI,
cluster: CHOLACHAGUDDA
count: 1
'400':
description: 'Bad Request. '
Expand Down Expand Up @@ -2697,6 +2706,21 @@ paths:
schema:
type: string
required: true
- in: query
name: paginate
description: >-
The data will be paginated and that will include count as well
schema:
type: string
default: true
required: false
- in: query
name: roleLevel
description: >-
Role level to filter roles
schema:
type: string
required: false
responses:
'200':
description: Accepted
Expand All @@ -2720,23 +2744,17 @@ paths:
properties:
id:
type: number
title:
value:
type: string
user_type:
type: number
visibility:
type: string
status:
code:
type: string
organization_id:
type: number
required:
- id
- title
- user_type
- visibility
- status
- organization_id
- value
- label
- code
count:
type: number
examples:
Expand All @@ -2746,31 +2764,12 @@ paths:
status: 200
result:
data:
- id: 13
title: AMO
user_type: 1
visibility: PUBLIC
status: ACTIVE
organization_id: 1
- id: 15
title: TEACHER
user_type: 1
visibility: PUBLIC
status: ACTIVE
organization_id: 1
- id: 10
title: headmaster
user_type: 1
visibility: PUBLIC
status: ACTIVE
organization_id: 1
- id: 14
title: BEO
user_type: 1
visibility: PUBLIC
status: ACTIVE
organization_id: 1
count: 4
- _id: 682301254e2812081f34266c
value: teacher-class-11-12
label: Teacher (Class 11-12)
code: -class-11-12

count: 1
'400':
description: Bad Request.
content:
Expand Down
46 changes: 19 additions & 27 deletions src/controllers/v1/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ module.exports = class Entities extends Abstract {

/**
* Handles the request to fetch targeted roles based on the provided entity IDs in the request parameters.
* @api {GET} v1/entities/targetedRoles/5f33c3d85f637784791cd831
* @api {GET} v1/entities/targetedRoles/5f33c3d85f637784791cd831?roleLevel=professional_subroles&entityType=state&language=en&paginate=true all the API based on projection
* @apiVersion 1.0.0
* @apiName targetedRoles
* @apiGroup Entities
Expand All @@ -382,32 +382,20 @@ module.exports = class Entities extends Abstract {
"message": "ROLES_FETCHED_SUCCESSFULLY",
"status": 200,
"result": [
{
"_id": "66a8df494efa6ccce9113da6",
"userRoleId": 10,
"title": "headmaster",
"userType": 1
},
{
"_id": "66a8df824efa6ccce9113dac",
"userRoleId": 12,
"title": "BEO",
"userType": 1
{
"_id": "682301254e2812081f34266c",
"value": "teacher-class-11-12",
"label": "Teacher (Class 11-12)",
"code": "teacher-class-11-12"
},
{
"_id": "66a8df654efa6ccce9113da9",
"userRoleId": 11,
"title": "AMO",
"userType": 1
},
{
"_id": "66a8dfc44efa6ccce9113db5",
"userRoleId": 13,
"title": "EducationMinister",
"userType": 1
"_id": "682301424e2812081f342670",
"value": "special-educators",
"label": "Special Educators",
"code": "special-educators"
}
],
"count": 5
"count": 2
}
*/
targetedRoles(req) {
Expand All @@ -421,6 +409,7 @@ module.exports = class Entities extends Abstract {
req?.query?.paginate?.toLowerCase() == 'true' ? true : false,
req.query.entityType ? req.query.entityType : '',
req.query.language ? req.query.language : '',
req.query.roleLevel ? req.query.roleLevel : '',
req.userDetails.userInformation.tenantId
)
// Resolves the promise with the retrieved entity data
Expand Down Expand Up @@ -855,12 +844,12 @@ module.exports = class Entities extends Abstract {
}

/**
* @api {GET} v1/entities/subEntityList/663339bc0cb19f01c459853b?type=school&search=&page=1&limit=100
* @api {GET} v1/entities/subEntityList/663339bc0cb19f01c459853b?type=school&search=&page=1&limit=100&parentInfoRequired=true
* Get sub entity list for the given entity.
* @apiVersion 1.0.0
* @apiGroup Entities
* @apiHeader {String} X-authenticated-user-token Authenticity token
* @apiSampleRequest v1/entities/subEntityList/663339bc0cb19f01c459853b?type=school&search=&page=1&limit=100
* @apiSampleRequest v1/entities/subEntityList/663339bc0cb19f01c459853b?type=school&search=&page=1&limit=100&parentInfoRequired=true
* @apiUse successBody
* @apiUse errorBody
* @apiParamExample {json} Response:
Expand All @@ -873,7 +862,9 @@ module.exports = class Entities extends Abstract {
"entityType": "school",
"externalId": "entity123",
"label": "undefined - entity123",
"value": "627a13928ce12806f5803f57"
"value": "627a13928ce12806f5803f57",
"cluster": "CHOLACHAGUDDA",
"district": "BAGALKOT",
}
],
"count": 1
Expand Down Expand Up @@ -911,7 +902,8 @@ module.exports = class Entities extends Abstract {
req.pageSize,
req.pageNo,
req.query.language ? req.query.language : '',
req.userDetails
req.userDetails,
req.query.parentInfoRequired ? req.query.parentInfoRequired : false
)
return resolve(entityDocuments)
} catch (error) {
Expand Down
1 change: 1 addition & 0 deletions src/generics/constants/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ module.exports = {
SERVER_TIME_OUT: 5000,
GUEST_URLS: ['/entities/details', '/entities/entityListBasedOnEntityType', 'entities/subEntityList'],
ALL: 'ALL',
SUBROLE_ENTITY_TYPE: 'professional_subroles',
}
Loading