mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 12:18:11 +00:00
feat(wagons): audited maintenance/availability toggle
This commit is contained in:
@@ -216,6 +216,7 @@ import {
|
||||
type Wagon,
|
||||
type WagonListFilters,
|
||||
type WagonMovementRecord,
|
||||
type WagonStatusLog,
|
||||
type WagonTransferRequest,
|
||||
type CreateTransferRequestPayload,
|
||||
type BulkFulfillResult,
|
||||
@@ -1795,15 +1796,23 @@ export const api = {
|
||||
),
|
||||
|
||||
bulkSetStatus: endpoint<
|
||||
{ wagonIds: string[]; status: Wagon["status"] },
|
||||
{ wagonIds: string[]; status: Wagon["status"]; note?: string },
|
||||
{ updated: number }
|
||||
>(
|
||||
"wagons",
|
||||
"bulkSetStatus",
|
||||
({ wagonIds, status }) =>
|
||||
wagonService.bulkSetStatus(wagonIds, status).then((r) => r.data),
|
||||
({ wagonIds, status, note }) =>
|
||||
wagonService.bulkSetStatus(wagonIds, status, note).then((r) => r.data),
|
||||
undefined,
|
||||
() => [["wagons"]],
|
||||
// The fleet desk lists wagons under the "fleet" key root, not "wagons".
|
||||
() => [["wagons"], QUERY_KEYS.FLEET.list("wagons")],
|
||||
),
|
||||
|
||||
statusHistory: endpoint<{ id: string }, WagonStatusLog[]>(
|
||||
"wagons",
|
||||
"statusHistory",
|
||||
({ id }) => wagonService.getStatusHistory(id).then((r) => r.data),
|
||||
({ id }) => ["wagons", "status-history", id],
|
||||
),
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user