Get employee allocations

This endpoint retrieves the service associations of an employee.

GET /api/v1/businesses/{businessId}/employees/{employeeId}/employee-allocations?from={yyyy-MM-dd}&to={yyyy-MM-dd}

If the data included in the request is correct —both the businessId and the employeeId— the response will contain the list of service associations and cessions for the identified employee.

Response example

[
    {
        "from": "2021-10-01",
        "to": "2024-10-01",
        "ownerProduct": "0001-G",
        "product": "0001-G",
        "regularCessions": [
            {
                "daysOfWeek": [
                    "MONDAY"
                ],
                "product": "081818",
                "minutes": 360
            }
        ]
    }
]
Details
  • from: start date of the service association in yyyy-MM-dd format.

  • to: end date of the service association in yyyy-MM-dd format. Can be null, indicating no end date has been set.

  • ownerProduct: external identifier of the product or section the employee belongs to.

  • product: external identifier of the product or section where the employee works. It can be the same as ownerProduct; if different, it represents a cession.

  • regularCessions: employee’s regular cessions to another product or section. Contains the following fields:

    • daysOfWeek: list of day types on which the employee will work on cession.

    • product: external identifier of the destination product or section where the employee will work.

    • minutes: number of minutes the employee will work at the destination product or section.

In the example provided, the employee has a service association (product 0001-G) from 2021-10-01 to 2024-10-01. Additionally, there is a regular cession (product 081818) of six hours on Mondays.

Considerations

If the employee identifier specified in the URL does not exist in the business, the request will return a 404 Not Found error, indicating not exits.

If the employee has no service associations for the specified period, the request will return an empty array [].