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

useUpdateAssetPassport

@mineflow/client-react


@mineflow/client-react / EAM / useUpdateAssetPassport

Function: useUpdateAssetPassport()

function useUpdateAssetPassport(): 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: {
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;
};
id: string;
}>;

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

Редактирование паспорта актива (EAM 1.2 доработка, Задача 3a/3c): паспортная табличка, типизированные характеристики (по классу) и гарантия. PATCH /eam/assets/:id/passport, частичное обновление. Авто-Idempotency-Key; на успехе инвалидирует карточку и список активов.

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: { 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; }; id: string; }>

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