Actividades (Activities)
Routes
Method |
URI |
Action |
GET |
/activities |
index public |
GET |
/activities/{id} |
show public |
POST |
/activities |
store |
PATCH |
/activities/{id} |
update |
DELETE |
/activities/{id} |
soft delete |
Model Attributes
{
"id": 1,
"title": "Titulo de la Actividad",
"description": "Descripción de la actividad",
"observation": null, // (string)
"start_date": "2020-04-15",
"end_date": "2020-04-30", // nullable
"user_id": 1, // id de usuario que creo la actividad
"updated_at": "2020-04-15 20:04:46",
"created_at": "2020-04-15 20:04:46",
"deleted_at": null
}
Relations
Index
Route GET /activities
Policies
Filter |
Description |
search=value |
Busca a traves de titulo, descripción y observación |
start_date=date |
Filtra a traves de la fecha de inicio. Soporta operadores de busqueda > , < , >= , <= (se debe colocar al inicio del value) |
end_date=date |
Filtra a traves de la fecha de culminación. Soporta operadores de busqueda > , < , >= , <= (se debe colocar al inicio del value) |
Response 200
[
{
// Activity
}
]
Store
Route POST /activities
Policies
Request Body
{
"title": "required|string",
"description": "required|string",
"start_date": "required|date_format:Y-m-d|before:end_date",
"end_date": "nullable|date_format:Y-m-d|after:start_date",
"observation": "string" // opcional
}
Response 201
{
// Activity
}
Update
Route PATCH /activities/{id}
Policies
Request Body
{warning} No se sabe si se debe permitir actualizar todo
{
"title": "string",
"description": "string",
"observation": "string",
"start_date": "date_format:Y-m-d",
"end_date": "nullable|date_format:Y-m-d"
}
Response 200
{
// Activity
}
Soft Delete
Route DELETE /activities/{id}
Policies
Response 204
No Content