Turnos de trabajo
GET: Obtener turnos de trabajo
Descripción del API
Obtiene una lista de turnos de trabajo y su detalle.
Método HTTP
GET /api/shifts
Parámetros de entrada
Atributo | Requerido | Tipo | Descripción | Ejemplo |
---|---|---|---|---|
(sin parámetros de entrada) |
JSON de ejemplo (entrada)
{}
Parámetros de salida
Atributo | Tipo | Descripción | Ejemplo |
---|---|---|---|
id | integer | Identificador único del turno. | 281 |
name | string | Nombre del turno. | "Turno general" |
consider_holidays | boolean | Indica si se consideran los días festivos. | true |
default | boolean | Indica si es el turno predeterminado. | true |
schedule | array | Lista de horarios por día, incluye hora de inicio, fin y tiempo de almuerzo en minutos. | [{"start": "09:00", "end": "18:00", "lunch": 60}] |
start_date | string | Fecha de inicio del turno en formato YYYY-MM-DD . | "2024-10-28" |
team_id | integer | Identificador del equipo asociado al turno. | 7429 |
created_at | string | Fecha y hora de creación en formato ISO 8601. | "2024-10-30T13:15:04.000Z" |
updated_at | string | Fecha y hora de la última actualización en formato ISO 8601. | "2024-10-30T13:15:04.000Z" |
in_use | boolean | Indica si el turno está en uso. | true |
config | object/null | Configuración personalizada del turno (puede ser nulo). | null |
config2 | object | Configuración avanzada del turno, incluye tolerancias y límites de horas. | {...} |
type | string/null | Tipo del turno (puede ser nulo). | null |
in_archived | boolean | Indica si el turno está archivado. | false |
tolerance_start_day | object | Tolerancia en minutos para el inicio del día. | {"minutes": 15} |
tolerance_end_day | object | Tolerancia en minutos para el final del día. | {"minutes": 15} |
minimum_hours_considerer_lunch | object | Horas mínimas requeridas para considerar el tiempo de almuerzo. | {"hours": 6} |
default_lunch | object | Tiempo de almuerzo predeterminado en horas. | {"hours": 1} |
considered_shift_lunch | boolean | Indica si el almuerzo está considerado en el turno. | true |
shift_cycle_days | integer | Cantidad de días que dura el ciclo del turno. | 7 |
considers_paid_leaves_in_weekly_hours | boolean | Indica si los permisos pagados están considerados en las horas semanales. | false |
country_id | integer | Identificador del país asociado al turno. | 184 |
JSON de ejemplo (salida)
- Respuesta 200 OK:
[
{
"id": 281,
"name": "Turno general",
"consider_holidays": true,
"default": true,
"schedule": [
{
"start": "09:00",
"end": "18:00",
"lunch": 60
},
{
"start": "09:00",
"end": "18:00",
"lunch": 60
},
{
"start": "09:00",
"end": "18:00",
"lunch": 60
},
{
"start": "09:00",
"end": "18:00",
"lunch": 60
},
{
"start": "09:00",
"end": "18:00",
"lunch": 60
},
[],
[]
],
"start_date": "2024-10-28",
"team_id": 7429,
"created_at": "2024-10-30T13:15:04.000Z",
"updated_at": "2024-10-30T13:15:04.000Z",
"in_use": true,
"config": null,
"config2": {
"ordinary_hours_maximum_amount_daily": {
"active": false,
"time": null,
"time_default": "10:00"
},
"ordinary_hours_maximum_amount_weekly": {
"active": false,
"time": null,
"time_default": "45:00"
},
"extraordinary_hours_maximum_amount_daily": {
"active": false,
"time": null,
"time_default": "02:00"
},
"extraordinary_hours_maximum_amount_weekly": {
"active": false,
"time": null,
"time_default": "12:00"
},
"extraordinary_hours_maximum_amount_6th_day": {
"active": false,
"time": null,
"time_default": "07:30"
},
"minimum_amount_rest_between_days": {
"active": false,
"time": null,
"time_default": "10:00"
},
"tolerance_start_day": {
"active": false,
"time": null,
"time_default": "00:15"
},
"tolerance_end_day": {
"active": false,
"time": null,
"time_default": "00:15"
},
"start_night_time": {
"active": false,
"time": null,
"time_default": "19:00"
},
"end_night_time": {
"active": false,
"time": null,
"time_default": "06:00"
}
},
"type": null,
"in_archived": false,
"tolerance_start_day": {
"minutes": 15
},
"tolerance_end_day": {
"minutes": 15
},
"minimum_hours_considerer_lunch": {
"hours": 6
},
"default_lunch": {
"hours": 1
},
"considered_shift_lunch": true,
"shift_cycle_days": 7,
"considers_paid_leaves_in_weekly_hours": false,
"country_id": 184
},
{
"id": 282,
"name": "Nuevo turno país existente",
"consider_holidays": true,
"default": false,
"schedule": [
{
"start": "08:00",
"end": "17:00",
"lunch": 60
},
{
"start": "08:00",
"end": "17:00",
"lunch": 60,
"is_day_off": false
},
{
"start": "08:00",
"end": "17:00",
"lunch": 60,
"is_day_off": false
},
{
"start": "08:00",
"end": "17:00",
"lunch": 60,
"is_day_off": false
},
{
"start": "08:00",
"end": "17:00",
"lunch": 60,
"is_day_off": false
},
{
"start": "08:00",
"end": "12:00",
"lunch": 0,
"is_day_off": false
},
{
"start": null,
"end": null,
"lunch": null,
"is_day_off": true
}
],
"start_date": "2024-11-04",
"team_id": 7429,
"created_at": "2024-11-06T15:11:01.000Z",
"updated_at": "2024-11-06T15:12:07.000Z",
"in_use": true,
"config": null,
"config2": {
"ordinary_hours_maximum_amount_daily": {
"active": false,
"time": null,
"time_default": "10:00"
},
"ordinary_hours_maximum_amount_weekly": {
"active": false,
"time": null,
"time_default": "45:00"
},
"extraordinary_hours_maximum_amount_daily": {
"active": false,
"time": null,
"time_default": "02:00"
},
"extraordinary_hours_maximum_amount_weekly": {
"active": false,
"time": null,
"time_default": "12:00"
},
"extraordinary_hours_maximum_amount_6th_day": {
"active": false,
"time": null,
"time_default": "07:30"
},
"minimum_amount_rest_between_days": {
"active": false,
"time": null,
"time_default": "10:00"
},
"tolerance_start_day": {
"active": false,
"time": null,
"time_default": "00:15"
},
"tolerance_end_day": {
"active": false,
"time": null,
"time_default": "00:15"
},
"start_night_time": {
"active": false,
"time": null,
"time_default": "19:00"
},
"end_night_time": {
"active": false,
"time": null,
"time_default": "06:00"
}
},
"type": null,
"in_archived": false,
"tolerance_start_day": {
"minutes": 5
},
"tolerance_end_day": {
"minutes": 20
},
"minimum_hours_considerer_lunch": {
"hours": 4
},
"default_lunch": {
"hours": 1
},
"considered_shift_lunch": true,
"shift_cycle_days": 7,
"considers_paid_leaves_in_weekly_hours": true,
"country_id": 184
}
]