feat(wagons): audited maintenance/availability toggle

This commit is contained in:
Marshal
2026-08-07 12:10:43 +00:00
parent 756325c814
commit 70215a9f37
12 changed files with 419 additions and 31 deletions

View File

@@ -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],
),
},