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

useUpdateShiftReport

@mineflow/client-react


@mineflow/client-react / PRD / useUpdateShiftReport

Function: useUpdateShiftReport()

function useUpdateShiftReport(): UseMutationResult<{
approvedAt: string | null;
approvedBy: string | null;
approveSagaId: string | null;
createdAt: string;
id: string;
organizationId: string;
productionObjectId: string;
rejectedAt: string | null;
rejectedBy: string | null;
rejectReason: string | null;
shiftDate: string;
shiftStartedAt?: string | null;
shiftType: ShiftReportResponse_OutputShiftType;
status: ShiftReportResponse_OutputStatus;
submittedAt: string | null;
submittedBy: string | null;
updatedAt: string;
}, Error, {
body: {
productionObjectId?: string;
shiftDate?: string;
shiftType?: UpdateShiftReportBodyDtoShiftType;
};
id: string;
}>;

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

Правка шапки черновика (Q4): производственный объект / дата / тип смены — если рапорт завели по ошибке. Разрешено ТОЛЬКО в статусе draft (после формирования сервер вернёт 409). Частично: шли только изменённые поля. Синхронный @Idempotent; инвалидирует список + карточку рапорта.

Returns​

UseMutationResult<{ approvedAt: string | null; approvedBy: string | null; approveSagaId: string | null; createdAt: string; id: string; organizationId: string; productionObjectId: string; rejectedAt: string | null; rejectedBy: string | null; rejectReason: string | null; shiftDate: string; shiftStartedAt?: string | null; shiftType: ShiftReportResponse_OutputShiftType; status: ShiftReportResponse_OutputStatus; submittedAt: string | null; submittedBy: string | null; updatedAt: string; }, Error, { body: { productionObjectId?: string; shiftDate?: string; shiftType?: UpdateShiftReportBodyDtoShiftType; }; id: string; }>

UseMutationResult — mutate({ id, body }).