✏️📋 shori-update-working-substates
Crea o actualiza los working substates (estados de trabajo) de un servicio (Primary Level). Permite configurar en masa los estados disponibles para los casos de un servicio.
Diagrama del nodo
Request (UpdateWorkingSubstatesPrimaryLevel)
interface UpdateWorkingSubstatesPrimaryLevel {
primaryLevelId: string;
workingSubStatePrimaryLevels: WorkingSubstatesPrimaryLevelRequest[];
}
Campos
| Campo | Tipo | Requerido | Fuente |
|---|---|---|---|
| primaryLevelId | string | ✅ | Formulario o msg.payload.primaryLevelId |
| workingSubStatePrimaryLevels | array | ✅ | Siempre desde msg.payload.workingSubStatePrimaryLevels |
Salidas
| Salida | Campo | Descripción |
|---|---|---|
| 1 (éxito) | msg.payload | Array de WorkingSubStatePrimaryLevelResponse |
| 2 (error) | msg.error | { message, name, stack } |
Ejemplo
Ejemplo de payload completo
msg.payload = {
primaryLevelId: "servicio-uuid",
workingSubStatePrimaryLevels: [
{
name: "Pendiente de revisión",
active: true,
finalist: false,
},
{
name: "Cerrado",
active: true,
finalist: true,
}
]
};
return msg;
Equivalente en código
const result = await client.caso().primaryLevel().updateWorkingSubstates({
primaryLevelId: "servicio-uuid",
workingSubStatePrimaryLevels: [
{ name: "Pendiente de revisión", active: true, finalist: false },
{ name: "Cerrado", active: true, finalist: true },
],
});