Saltar al contenido principal

✏️📋 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

CampoTipoRequeridoFuente
primaryLevelIdstringFormulario o msg.payload.primaryLevelId
workingSubStatePrimaryLevelsarraySiempre desde msg.payload.workingSubStatePrimaryLevels

Salidas

SalidaCampoDescripción
1 (éxito)msg.payloadArray 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 },
],
});