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

useAddShiftAssetUsage

@mineflow/client-react


@mineflow/client-react / PRD / useAddShiftAssetUsage

Function: useAddShiftAssetUsage()

function useAddShiftAssetUsage(): UseMutationResult<{
acceptedAt: string | null;
acceptedBy: string | null;
assetId: string;
createdAt: string;
hoursWorked: number | null;
id: string;
intakeStatus: ShiftAssetUsageResponse_OutputIntakeStatus;
meterReadingEnd: number | null;
meterReadingStart: number | null;
operatorPersonnelId: string | null;
organizationId: string;
shiftReportId: string;
submittedAt: string | null;
submittedBy: string | null;
updatedAt: string;
}, Error, AddEntryVars<{
assetId: string;
hoursWorked?: number | null;
meterReadingEnd?: number | null;
meterReadingStart?: number | null;
operatorPersonnelId?: string | null;
}>>;

Defined in: client-react/src/domain-hooks/prd.ts:127

Использование техники (anchor): возвращает id, на который ссылаются drilling/fuel (assetUsageId) — добавляй asset-usage ДО них. Offline-устойчив; FIFO-replay сохраняет порядок энкью.

Returns​

UseMutationResult<{ acceptedAt: string | null; acceptedBy: string | null; assetId: string; createdAt: string; hoursWorked: number | null; id: string; intakeStatus: ShiftAssetUsageResponse_OutputIntakeStatus; meterReadingEnd: number | null; meterReadingStart: number | null; operatorPersonnelId: string | null; organizationId: string; shiftReportId: string; submittedAt: string | null; submittedBy: string | null; updatedAt: string; }, Error, AddEntryVars<{ assetId: string; hoursWorked?: number | null; meterReadingEnd?: number | null; meterReadingStart?: number | null; operatorPersonnelId?: string | null; }>>

UseMutationResult — mutate({ id, body, idempotencyKey }).