Bookker API Documentation logo Bookker API Documentation

Editar evento de estado de trabajo del usuario

Versión documento: v1

Creación: 28/04/2020

Última modificación: 28/05/2020

Editar evento de estado de trabajo del usuario

Permite cambiar el estado de trabajo actual del usuario por uno de los que tenga creados su organización para cada fecha de inicio y fin indicada.

Tipos de eventos

Casos especiales

  1. Si se envía uno o más días, y estos días están comprendidos por un evento serie ya existente, se crearán EXCEPCIONES para cada uno de los días solicitados.

  2. Crear un evento serie cuyo fecha de inicio o fin “invada” a otro evento serie, causará el siguiente efecto:
    1. Creamos evento serie A con fecha de inicio 13/05/2020 y fecha de fin 17/05/2020. Existe otro evento serie B creado previamente con fecha de inicio 15/05/2020 y fecha de fin 19/05/2020. El resultado es el siguiente, el evento serie A se creará con las fechas indicadas, y el evento serie B se pasará a tener fecha de inicio 18/05/2020 y fecha de fin 19/05/2020.

    2. Creamos evento serie A con fecha de inicio 17/05/2020 y fecha de fin 22/05/2020. Existe otro evento serie B creado previamente con fecha de inicio 15/05/2020 y fecha de fin 19/05/2020. El resultado es el siguiente, el evento serie A se creará con las fechas indicadas, y el evento serie B se pasará a tener fecha de inicio 15/05/2020 y fecha de fin 16/05/2020.

    3. En caso de que en alguno de los días invadidos hubiese alguna excepción, estas se eliminarán.

    4. En caso de que el evento serie B pasase a ser de un sólo día, este se convertiría en SINGLE_INSTANCE, y se le eliminaría su ID de serie maestra.

  3. Crear evento serie que englobe a otros eventos, estos eventos englobados serán borrados.

  4. Crear evento serie que tenga misma fecha de inicio y fin que otro evento serie causará que el evento ya creado se borre (junto con sus excepciones, si tiene) y se cree el nuevo.

Request

HTTP request
PATCH /api/v1/users/me/workingstatus
PATCH /api/v1/users/{userId}/workingstatus
Body
{
	"newUserWorkingStatusExceptions":[
		{
			"workingStatus": {
				"id": "3be693d6-6bda-47cd-b8e7-ca7aade1e6c3"
			},
			"startDate": "2020-05-26",
			"endDate": "2020-05-28"
		},
		{
			"workingStatus": {
				"id": "440b0127-06cc-40b1-9440-ee19b484ae12"
			},
			"startDate": "2020-05-27",
			"endDate": "2020-05-27"
		}
	]
}

Response

Si se consigue cambiar el estado de trabajo del usuario, se devuelve un código 200 con los eventos creados y modificados (puede no haber modificaciones, se enviará la lista vacía en este caso).

Respuestas a los casos especiales

   {
       "createdList": [
           {
               "id": "838e9998-d236-4ed3-a27b-623c893ba448",
               "type": "EXCEPTION",
               "startDate": "2020-05-18",
               "endDate": "2020-05-18",
               "seriesMasterId": "9c2ba369-d71d-4462-a07e-ac5bcf9eabbe",
               "workingStatus": {
                   "id": "3be693d6-6bda-47cd-b8e7-ca7aade1e6c3",
                   "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                   "name": "TELEWORKING",
                   "description": "Teletrabajo",
               	"color": "444454"
               }
           },
           {
               "id": "b13efada-f063-40cd-997d-1351ffd54f40",
               "type": "EXCEPTION",
               "startDate": "2020-05-19",
               "endDate": "2020-05-19",
               "seriesMasterId": "9c2ba369-d71d-4462-a07e-ac5bcf9eabbe",
               "workingStatus": {
                   "id": "3be693d6-6bda-47cd-b8e7-ca7aade1e6c3",
                   "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                   "name": "TELEWORKING",
                   "description": "Teletrabajo",
               	"color": "444454"
               }
           },
           {
               "id": "cb3f5843-245e-4932-992e-3869b9a20b6a",
               "type": "EXCEPTION",
               "startDate": "2020-05-20",
               "endDate": "2020-05-20",
               "seriesMasterId": "9c2ba369-d71d-4462-a07e-ac5bcf9eabbe",
               "workingStatus": {
                   "id": "3be693d6-6bda-47cd-b8e7-ca7aade1e6c3",
                   "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                   "name": "TELEWORKING",
                   "description": "Teletrabajo",
               	"color": "444454"
               }
           }
       ],
    "updatedList": []
   }

2.1.

   {
       "createdList": [
           {
               "id": "6980225e-7722-4142-b248-3f57948cebbf",
               "type": "SERIES_MASTER",
               "startDate": "2020-05-13",
               "endDate": "2020-05-17",
               "seriesMasterId": "14f3a196-de06-474a-a053-a2bbfb00548c",
               "workingStatus": {
                   "id": "3be693d6-6bda-47cd-b8e7-ca7aade1e6c3",
                   "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                   "name": "TELEWORKING",
                   "description": "Teletrabajo",
               	"color": "444454"
               }
           }
       ],
       "updatedList": [
           {
               "id": "8eaa5268-dbaf-4ff5-952a-b9be11c54f08",
               "type": "SERIES_MASTER",
               "startDate": "2020-05-18",
               "endDate": "2020-05-19",
               "seriesMasterId": "a1b15b2d-47a6-4e6f-a442-acff36d67da8",
               "workingStatus": {
                   "id": "3be693d6-6bda-47cd-b8e7-ca7aade1e6c3",
                   "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                   "name": "TELEWORKING",
                   "description": "Teletrabajo",
               	"color": "444454"
            }
           }
    ]
   }

2.2.

   {
       "createdList": [
           {
               "id": "9c57c22f-6e68-4ea6-80a3-35248052ab0b",
               "type": "SERIES_MASTER",
               "startDate": "2020-05-17",
               "endDate": "2020-05-22",
               "seriesMasterId": "9c2ba369-d71d-4462-a07e-ac5bcf9eabbe",
               "workingStatus": {
                   "id": "3be693d6-6bda-47cd-b8e7-ca7aade1e6c3",
                   "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                   "name": "TELEWORKING",
                   "description": "Teletrabajo",
               	"color": "444454"
               }
           }
       ],
       "updatedList": [
           {
               "id": "615ef775-9929-4871-b129-8a8d634e08c5",
               "type": "SERIES_MASTER",
               "startDate": "2020-05-15",
               "endDate": "2020-05-16",
               "seriesMasterId": "c8104ac7-7c4a-46c3-acca-8184ab60cd84",
               "workingStatus": {
                   "id": "3be693d6-6bda-47cd-b8e7-ca7aade1e6c3",
                   "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                   "name": "TELEWORKING",
                "description": "Teletrabajo",
               	"color": "444454"
            }
           }
    ]
   }

2.3. Se recibe lo mismo que en el caso 2.1 y 2.2

2.4.

   {
       "createdList": [
           {
               "id": "23ca77d0-3771-4c5c-aeb3-6d6b8d6d5b85",
               "type": "SERIES_MASTER",
               "startDate": "2020-05-13",
               "endDate": "2020-05-15",
               "seriesMasterId": "0b660f0c-cf81-41b5-9b65-8fef67907d8f",
               "workingStatus": {
                   "id": "3be693d6-6bda-47cd-b8e7-ca7aade1e6c3",
                   "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                   "name": "TELEWORKING",
                   "description": "Teletrabajo",
               	"color": "444454"
               }
           }
       ],
       "updatedList": [
           {
               "id": "615ef775-9929-4871-b129-8a8d634e08c5",
               "type": "SINGLE_INSTANCE",
               "startDate": "2020-05-16",
               "endDate": "2020-05-16",
               "workingStatus": {
                   "id": "3be693d6-6bda-47cd-b8e7-ca7aade1e6c3",
                "organizationId": "8aee218a-fce2-4900-9410-00f485a2729e",
                   "name": "TELEWORKING",
                "description": "Teletrabajo",
               	"color": "444454"
               }
           }
       ]
   }
  1. Se recibe el nuevo evento serie creado.
  2. Se recibe el nuevo evento serie creado.