Skip to main content

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

AtributoRequeridoTipoDescripciónEjemplo
(sin parámetros de entrada)

JSON de ejemplo (entrada)

{}

Parámetros de salida

AtributoTipoDescripciónEjemplo
idintegerIdentificador único del turno.281
namestringNombre del turno."Turno general"
consider_holidaysbooleanIndica si se consideran los días festivos.true
defaultbooleanIndica si es el turno predeterminado.true
schedulearrayLista 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_datestringFecha de inicio del turno en formato YYYY-MM-DD."2024-10-28"
team_idintegerIdentificador del equipo asociado al turno.7429
created_atstringFecha y hora de creación en formato ISO 8601."2024-10-30T13:15:04.000Z"
updated_atstringFecha y hora de la última actualización en formato ISO 8601."2024-10-30T13:15:04.000Z"
in_usebooleanIndica si el turno está en uso.true
configobject/nullConfiguración personalizada del turno (puede ser nulo).null
config2objectConfiguración avanzada del turno, incluye tolerancias y límites de horas.{...}
typestring/nullTipo del turno (puede ser nulo).null
in_archivedbooleanIndica si el turno está archivado.false
tolerance_start_dayobjectTolerancia en minutos para el inicio del día.{"minutes": 15}
tolerance_end_dayobjectTolerancia en minutos para el final del día.{"minutes": 15}
minimum_hours_considerer_lunchobjectHoras mínimas requeridas para considerar el tiempo de almuerzo.{"hours": 6}
default_lunchobjectTiempo de almuerzo predeterminado en horas.{"hours": 1}
considered_shift_lunchbooleanIndica si el almuerzo está considerado en el turno.true
shift_cycle_daysintegerCantidad de días que dura el ciclo del turno.7
considers_paid_leaves_in_weekly_hoursbooleanIndica si los permisos pagados están considerados en las horas semanales.false
country_idintegerIdentificador 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
}
]