curl -X PUT https://api.cuido.com/api/employees/60d5ec49f1b2c72b8c8e4f1a \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"wellnessMetrics": {
"currentMoodScore": 4,
"averageWorkload": 5,
"riskLevel": "medio"
}
}'
{
"success": true,
"message": "Empleado actualizado exitosamente",
"data": {
"employee": {
"_id": "60d5ec49f1b2c72b8c8e4f1a",
"personalInfo": {
"name": "Dr. María García",
"email": "[email protected]",
"identification": "123456789",
"phoneNumber": "+57 300 123 4567"
},
"jobInfo": {
"position": "medico",
"department": "urgencias",
"startDate": "2024-01-15T00:00:00.000Z",
"shift": "noche"
},
"hospitalId": "HOSP001",
"wellnessMetrics": {
"currentMoodScore": 4,
"averageWorkload": 5,
"teamSupportScore": 3,
"satisfactionScore": 5,
"riskLevel": "medio"
},
"gamification": {
"totalPoints": 350,
"currentStreak": 7,
"maxStreak": 14,
"level": 4,
"badges": []
},
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-03-05T15:45:00.000Z"
}
}
}
Update employee information including wellness metrics and gamification data
curl -X PUT https://api.cuido.com/api/employees/60d5ec49f1b2c72b8c8e4f1a \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"wellnessMetrics": {
"currentMoodScore": 4,
"averageWorkload": 5,
"riskLevel": "medio"
}
}'
{
"success": true,
"message": "Empleado actualizado exitosamente",
"data": {
"employee": {
"_id": "60d5ec49f1b2c72b8c8e4f1a",
"personalInfo": {
"name": "Dr. María García",
"email": "[email protected]",
"identification": "123456789",
"phoneNumber": "+57 300 123 4567"
},
"jobInfo": {
"position": "medico",
"department": "urgencias",
"startDate": "2024-01-15T00:00:00.000Z",
"shift": "noche"
},
"hospitalId": "HOSP001",
"wellnessMetrics": {
"currentMoodScore": 4,
"averageWorkload": 5,
"teamSupportScore": 3,
"satisfactionScore": 5,
"riskLevel": "medio"
},
"gamification": {
"totalPoints": 350,
"currentStreak": 7,
"maxStreak": 14,
"level": 4,
"badges": []
},
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-03-05T15:45:00.000Z"
}
}
}
Show jobInfo properties
medico, enfermero, auxiliar_enfermeria, administrativo, otrourgencias, hospitalizacion, consulta_externa, administracion, otromañana, tarde, noche, rotativoShow wellnessMetrics properties
Show data properties
curl -X PUT https://api.cuido.com/api/employees/60d5ec49f1b2c72b8c8e4f1a \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"wellnessMetrics": {
"currentMoodScore": 4,
"averageWorkload": 5,
"riskLevel": "medio"
}
}'
{
"success": true,
"message": "Empleado actualizado exitosamente",
"data": {
"employee": {
"_id": "60d5ec49f1b2c72b8c8e4f1a",
"personalInfo": {
"name": "Dr. María García",
"email": "[email protected]",
"identification": "123456789",
"phoneNumber": "+57 300 123 4567"
},
"jobInfo": {
"position": "medico",
"department": "urgencias",
"startDate": "2024-01-15T00:00:00.000Z",
"shift": "noche"
},
"hospitalId": "HOSP001",
"wellnessMetrics": {
"currentMoodScore": 4,
"averageWorkload": 5,
"teamSupportScore": 3,
"satisfactionScore": 5,
"riskLevel": "medio"
},
"gamification": {
"totalPoints": 350,
"currentStreak": 7,
"maxStreak": 14,
"level": 4,
"badges": []
},
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-03-05T15:45:00.000Z"
}
}
}
await updateEmployee(employeeId, {
wellnessMetrics: {
currentMoodScore: 4,
averageWorkload: 5,
teamSupportScore: 4,
satisfactionScore: 7,
riskLevel: 'medio'
}
});
const employee = await getEmployee(employeeId);
const newPoints = employee.gamification.totalPoints + 50;
const newLevel = Math.floor(newPoints / 100) + 1;
await updateEmployee(employeeId, {
gamification: {
totalPoints: newPoints,
level: newLevel,
badges: [
...employee.gamification.badges,
{
name: 'Actividad Completada',
earnedAt: new Date().toISOString(),
description: 'Completó un ejercicio de mindfulness'
}
]
}
});
await updateEmployee(employeeId, {
jobInfo: {
department: 'hospitalizacion',
shift: 'mañana'
}
});
await updateEmployee(employeeId, {
isActive: false
});