The following validations must be implemented on the task's entity list when the task reserves the entities:
/validateReservedEntitiesList
POST
TDM_ReserveEntities
Validate each input entity ID if it is reserved for another user in the input environment. If the entity is reserved for another user in the environment, return a failure on the entity.
The request body contains the following attributes:
{
"beID": "1",
"envID": "2",
"listOfEntities": [
{
"target_entity_id": "1"
},
{
"target_entity_id": "3"
},
{
"target_entity_id": "4"
}
]
}
The API returns the list of entities that are reserved in the environment by another user and therefore cannot be reserved by the user.
{
"result": {
"listOfEntities": [
{
"start_datetime": "2022-01-23 01:00:00.000",
"end_datetime": "2022-02-10 00:00:00.000",
"entity_id": "3",
"reserve_owner": "admin"
},
{
"start_datetime": "2022-02-06 01:00:00.000",
"end_datetime": "2022-02-16 01:00:00.000",
"entity_id": "4",
"reserve_owner": "taha"
}
]
},
"errorCode": "SUCCESS",
"message": null
}
/validatenoofreserved
GET
TDM_ReserveEntities
A tester user can reserve a limited number of entities per Business Entity and environment. The maximum number of reserved entities is set in the Environment permission set attached to the user. Admin and environment owners can reserve an unlimited number of entities in the environment. The API performs the following validation if the user is not an admin user and is not the owner of the environment:
Get the Write permission set attached to the user. If the user does not have a Write permission set in the environment, an exception is thrown by the API.
Sum the input number of entities with the number of entities that are already reserved by the user in the environment (if they exist). Validate that the the total number of reserved entities does not exceed the user's permissions.
Example:
The user can reserve up to 70 customers on ST1.
The user already has 40 customers reserved on ST1.
The user asks to reserve 35 entities in the task:
40+35 = 75.
The API returns an error since the user cannot exceed a total of 70 customers (40 + 30) in the task.
http://localhost:3213/api/validatenoofreserved?noOfEntities=10&envName=ENV1&beName=Customer
{
"result": {
},
"errorCode": "SUCCESS",
"message": null
}
{
"result": {
},
"errorCode": "FAILED",
"message": "The number of entities to be reserved exceeds the number of entities allowed for the user"
}
The following validations must be implemented on the task's entity list when the task reserves the entities:
/validateReservedEntitiesList
POST
TDM_ReserveEntities
Validate each input entity ID if it is reserved for another user in the input environment. If the entity is reserved for another user in the environment, return a failure on the entity.
The request body contains the following attributes:
{
"beID": "1",
"envID": "2",
"listOfEntities": [
{
"target_entity_id": "1"
},
{
"target_entity_id": "3"
},
{
"target_entity_id": "4"
}
]
}
The API returns the list of entities that are reserved in the environment by another user and therefore cannot be reserved by the user.
{
"result": {
"listOfEntities": [
{
"start_datetime": "2022-01-23 01:00:00.000",
"end_datetime": "2022-02-10 00:00:00.000",
"entity_id": "3",
"reserve_owner": "admin"
},
{
"start_datetime": "2022-02-06 01:00:00.000",
"end_datetime": "2022-02-16 01:00:00.000",
"entity_id": "4",
"reserve_owner": "taha"
}
]
},
"errorCode": "SUCCESS",
"message": null
}
/validatenoofreserved
GET
TDM_ReserveEntities
A tester user can reserve a limited number of entities per Business Entity and environment. The maximum number of reserved entities is set in the Environment permission set attached to the user. Admin and environment owners can reserve an unlimited number of entities in the environment. The API performs the following validation if the user is not an admin user and is not the owner of the environment:
Get the Write permission set attached to the user. If the user does not have a Write permission set in the environment, an exception is thrown by the API.
Sum the input number of entities with the number of entities that are already reserved by the user in the environment (if they exist). Validate that the the total number of reserved entities does not exceed the user's permissions.
Example:
The user can reserve up to 70 customers on ST1.
The user already has 40 customers reserved on ST1.
The user asks to reserve 35 entities in the task:
40+35 = 75.
The API returns an error since the user cannot exceed a total of 70 customers (40 + 30) in the task.
http://localhost:3213/api/validatenoofreserved?noOfEntities=10&envName=ENV1&beName=Customer
{
"result": {
},
"errorCode": "SUCCESS",
"message": null
}
{
"result": {
},
"errorCode": "FAILED",
"message": "The number of entities to be reserved exceeds the number of entities allowed for the user"
}