diff --git a/routes/shift.py b/routes/shift.py index 2889460..40fd45f 100644 --- a/routes/shift.py +++ b/routes/shift.py @@ -106,8 +106,9 @@ def list_shifts(): "interval_end": shift.interval_end.strftime("%H:%M") if shift.interval_end else None, 'type_interval': shift.type_interval, 'service_instance_id': shift.service_instance_id, - 'description': shift.description, # Adicionando a descrição - 'tolerance': shift.tolerance, # Adicionando a tolerância + 'description': shift.description, + 'tolerance': shift.tolerance, + # Adicionando a tolerância # Adicionando os dias associados (TimeSchedules) @@ -129,12 +130,17 @@ def get_shift_id(shift_id): return jsonify({ 'id': shift.id, 'name': shift.name, - 'day': shift.day, + #'day': shift.day, "start_time": shift.start_time.strftime("%H:%M"), "end_time": shift.end_time.strftime("%H:%M"), "interval_start": shift.interval_start.strftime("%H:%M") if shift.interval_start else None, "interval_end": shift.interval_end.strftime("%H:%M") if shift.interval_end else None, 'type_interval' : shift.type_interval, + 'description': shift.description, + 'tolerance': shift.tolerance, + 'time_schedules': [ + {'id': ts.id, 'name': ts.name} for ts in shift.time_schedules + ], 'service_instance_id': shift.service_instance_id}),200