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

useDecommissionAsset

@mineflow/client-react


@mineflow/client-react / EAM / useDecommissionAsset

Function: useDecommissionAsset()

function useDecommissionAsset(): 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, {
body: {
coApprovedBy: string;
reason: string;
};
id: string;
}>;

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

Списание актива (double-approval). Синхронная операция — отдаёт 200, это НЕ сага. На успехе инвалидирует список активов.

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, { body: { coApprovedBy: string; reason: string; }; id: string; }>

UseMutationResult — mutate({ id, body: DecommissionAssetBody }).