From 7e3cc71f3838b42eb6eb5429814cc3cd5be45df1 Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Thu, 20 Jul 2023 07:29:58 +0530 Subject: [PATCH 1/4] updated the api contract for batch update --- users-status/README.md | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/users-status/README.md b/users-status/README.md index 82488c1..ae5d698 100644 --- a/users-status/README.md +++ b/users-status/README.md @@ -194,11 +194,14 @@ Batch Updates the UserIds of the passed user list to Idle if the user is not OOO - **Body** - Attributes: - - users[] (required) : Specifies the user list of User ids to be updated. + - users (required, array): An array of objects, each representing a user with the following properties: + - userId (required, string): Specifies the unique identifier for the user. + - expectedState (required, string): Specifies the user's state, which must be one of the following values: idle or active. - **Success Response:** - - **Code** 200
+ - **Code** + - 200
- **Content**
```json { @@ -209,7 +212,25 @@ Batch Updates the UserIds of the passed user list to Idle if the user is not OOO "usersOnboardingOrAlreadyIdle": "Number" } } -``` + ``` + +```` + example + ```json + { + "message": "users status updated successfully.", + "data": { + "totalUsers": 7, + "totalUnprocessedUsers": 1, + "totalOnboardingUsersAltered": 1, + "totalOnboardingUsersUnAltered": 1, + "totalActiveUsersAltered": 1, + "totalActiveUsersUnAltered": 1, + "totalIdleUsersAltered": 1, + "totalIdleUsersUnAltered": 1 + } +} +```` - **Error Response:** - **Code:** 401 @@ -221,13 +242,13 @@ Batch Updates the UserIds of the passed user list to Idle if the user is not OOO Deletes the User Status data of the User with the given id. -- **Params** +- **Params** _Required:_ `userId=[string]` -- **Query** +- **Query** None -- **Headers** +- **Headers** Content-Type: application/json -- **Cookie** +- **Cookie** rds-session: `` - **Body** None @@ -241,3 +262,7 @@ Deletes the User Status data of the User with the given id. - **Content:** `{ 'statusCode': 404, 'id': null ,'userId':'userId',"message": "User Status to delete not found." }` - **Code:** 500 - **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }` + +``` + +``` From 3791a19f0faf3551db860e9ddf3a04d1952a7e0b Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Thu, 20 Jul 2023 07:35:59 +0530 Subject: [PATCH 2/4] fix formatting --- users-status/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/users-status/README.md b/users-status/README.md index ae5d698..176a6bc 100644 --- a/users-status/README.md +++ b/users-status/README.md @@ -203,7 +203,8 @@ Batch Updates the UserIds of the passed user list to Idle if the user is not OOO - **Code** - 200
- **Content**
- ```json + +``` { "message": "String", "data": { @@ -212,11 +213,11 @@ Batch Updates the UserIds of the passed user list to Idle if the user is not OOO "usersOnboardingOrAlreadyIdle": "Number" } } - ``` +``` -```` - example - ```json +- **Example** + +``` { "message": "users status updated successfully.", "data": { @@ -230,7 +231,7 @@ Batch Updates the UserIds of the passed user list to Idle if the user is not OOO "totalIdleUsersUnAltered": 1 } } -```` +``` - **Error Response:** - **Code:** 401 From 86b81dc0a9af998a1e5151bb53214c7d2d793aec Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Thu, 20 Jul 2023 07:39:34 +0530 Subject: [PATCH 3/4] Adds Example --- users-status/README.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/users-status/README.md b/users-status/README.md index 176a6bc..19b6e48 100644 --- a/users-status/README.md +++ b/users-status/README.md @@ -196,7 +196,23 @@ Batch Updates the UserIds of the passed user list to Idle if the user is not OOO - Attributes: - users (required, array): An array of objects, each representing a user with the following properties: - userId (required, string): Specifies the unique identifier for the user. - - expectedState (required, string): Specifies the user's state, which must be one of the following values: idle or active. + - expectedState (required, string): Specifies the user's state, which must be one of the following values: IDLE or ACTIVE. + - Example: + +``` + { + "users": [ + { + "userId": "4kAkRv9TBlOfR6WEUhoQ", + "expectedState": "IDLE" + }, + { + "userId": "SooJK37gzjIZfFNH0tlL", + "expectedState": "ACTIVE" + } + ] + } +``` - **Success Response:** @@ -209,8 +225,13 @@ Batch Updates the UserIds of the passed user list to Idle if the user is not OOO "message": "String", "data": { "totalUsers": "Number", - "usersWithStatusUpdated": "Number", - "usersOnboardingOrAlreadyIdle": "Number" + "totalUnprocessedUsers": "Number", + "totalOnboardingUsersAltered": "Number", + "totalOnboardingUsersUnAltered": "Number", + "totalActiveUsersAltered": "Number", + "totalActiveUsersUnAltered": "Number", + "totalIdleUsersAltered": "Number", + "totalIdleUsersUnAltered": "Number" } } ``` From 999b089b7d51e92b8880757420bb5c531f6f1b3e Mon Sep 17 00:00:00 2001 From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com> Date: Thu, 20 Jul 2023 07:44:30 +0530 Subject: [PATCH 4/4] add query param for get call --- users-status/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/users-status/README.md b/users-status/README.md index 19b6e48..f71583d 100644 --- a/users-status/README.md +++ b/users-status/README.md @@ -46,8 +46,11 @@ Returns the users status of all the users in the system. - **Params** None -- **Query** - state=[OOO | IDLE | ACTIVE] +- **Query** + + - state=[OOO | IDLE | ACTIVE] + - batch = boolean + - **Body** None - **Headers**