Перейти к основному содержимому

useSendToMaintenance

@mineflow/client-react


@mineflow/client-react / EAM / useSendToMaintenance

Function: useSendToMaintenance()

function useSendToMaintenance(): UseMutationResult<{
assetClassId: string;
commissionedAt: string;
currentObjectId: string;
id: string;
inventoryNumber: string;
name: string;
passport: {
manufacturer: string | null;
model: string | null;
productionYear: number | null;
specifications: {
[key: string]: unknown;
};
techPassportNumber: string | null;
warrantyMonths: number | null;
warrantyTermsText: string | null;
warrantyUntil: string | null;
};
responsibleMechanicId: string | null;
status: AssetResponse_OutputStatus;
}, Error, {
id: string;
reason: string;
}>;

Defined in: client-react/src/domain-hooks/eam.ts:194

Отправка актива в ТО: FSM operational → maintenance (событие SEND_TO_MAINTENANCE). ADR-0045: dedicated PATCH /eam/assets/:id/send-to-maintenance. reason обязателен. Открытая запись MaintenanceRecord заводится реактивно по событию eam.asset.status-changed. На успехе инвалидируется список активов.

Returns​

UseMutationResult<{ assetClassId: string; commissionedAt: string; currentObjectId: string; id: string; inventoryNumber: string; name: string; passport: { manufacturer: string | null; model: string | null; productionYear: number | null; specifications: { [key: string]: unknown; }; techPassportNumber: string | null; warrantyMonths: number | null; warrantyTermsText: string | null; warrantyUntil: string | null; }; responsibleMechanicId: string | null; status: AssetResponse_OutputStatus; }, Error, { id: string; reason: string; }>

UseMutationResult — mutate({ id, reason }).