Departments
Employee departments (departamentos de empleado).
📄️ Get department by ID
Returns a single employee department by its primary key.
📄️ Update department
Full replacement of an existing employee department.
📄️ Delete department
Deletes an employee department.
📄️ Merge-patch department
RFC 7396 merge-patch over `application/merge-patch+json`. Send only the fields you want to change; include a field with value `null` to remove it. Use the `If-Match` header for optimistic concurrency control.
📄️ List departments
Returns a paginated list of employee departments with envelope `{data, totalCount, skip, limit, hasMore}`. Default sort is `name:asc`. Limit is capped at 200; skip is clamped to >= 0.
📄️ Create department
Creates a new employee department. Business logic runs in the legacy WAR via the internal commands gateway.
📄️ Bulk delete departments
Removes every id in `ids` as a single all-or-nothing transaction. If any id is missing or outside the user's company scope the whole operation is rolled back. There is no `If-Match` header on this endpoint.
📄️ Bulk patch departments
Applies the same `patch` to every id in `ids` as a single all-or-nothing transaction. Editable fields are restricted to a whitelist (`enabled`, `blockType`, `description`); identity (`code`, `name`), multi-tenant scope (`companyId`) and audit fields are rejected. If any id is missing or outside the user's company scope the whole operation is rolled back.
📄️ Prototype department for a creation form
Returns a non-persisted department pre-populated with backend defaults (current company, next numeric `code`, `enabled=true`). Optional hints: `companyId`, `copyFromId`. Call `POST /api/v2/departments` afterwards to persist.