}) =>
+ editMissionAPI(id, mission),
+ mutationKey: ["missions"],
+ onSuccess: () => {
+ queryClient.invalidateQueries({
+ queryKey: ["missions"],
+ });
+ },
+ });
+
+ return (
+ } className="flex flex-row">
+
+
Inaktiver Einsatz wurde automatisch geschlossen
+
{event.message}
+
+
+
+
+
+
+ );
+};
diff --git a/apps/dispatch/app/_components/map/_components/MissionMarkerTabs.tsx b/apps/dispatch/app/_components/map/_components/MissionMarkerTabs.tsx
index a50a8564..d3a0c640 100644
--- a/apps/dispatch/app/_components/map/_components/MissionMarkerTabs.tsx
+++ b/apps/dispatch/app/_components/map/_components/MissionMarkerTabs.tsx
@@ -735,10 +735,15 @@ const FMSStatusHistory = ({ mission }: { mission: Mission }) => {
{entry.data.message}
);
- if (entry.type === "alert-log") {
- const alertReceiver = entry.auto
- ? null
- : entry.data.station?.bosCallsignShort || entry.data.vehicle;
+ if (
+ entry.type === "alert-log" ||
+ entry.type === "completed-log" ||
+ entry.type === "reopened-log"
+ ) {
+ const alertReceiver =
+ entry.auto || entry.type !== "alert-log"
+ ? null
+ : entry.data.station?.bosCallsignShort || entry.data.vehicle;
return (
@@ -755,8 +760,8 @@ const FMSStatusHistory = ({ mission }: { mission: Mission }) => {
>
{!entry.auto && (
<>
- {entry.data.user.firstname?.[0]?.toUpperCase() ?? "?"}
- {entry.data.user.lastname?.[0]?.toUpperCase() ?? "?"}
+ {entry.data.user?.firstname?.[0]?.toUpperCase() ?? "?"}
+ {entry.data.user?.lastname?.[0]?.toUpperCase() ?? "?"}
>
)}
{entry.auto && "AUTO"}
@@ -781,7 +786,15 @@ const FMSStatusHistory = ({ mission }: { mission: Mission }) => {
>
)}
- Einsatz alarmiert
+ {entry.type === "alert-log" && (
+ Einsatz alarmiert
+ )}
+ {entry.type === "completed-log" && (
+ Einsatz abgeschlossen
+ )}
+ {entry.type === "reopened-log" && (
+ Einsatz wiedereröffnet
+ )}
);
}
diff --git a/packages/database/prisma/json/MissionVehicleLog.ts b/packages/database/prisma/json/MissionVehicleLog.ts
index 63646be9..7bceda67 100644
--- a/packages/database/prisma/json/MissionVehicleLog.ts
+++ b/packages/database/prisma/json/MissionVehicleLog.ts
@@ -73,6 +73,15 @@ export interface MissionCompletedLog {
};
}
+export interface MissionReopenedLog {
+ type: "reopened-log";
+ auto: false;
+ timeStamp: string;
+ data: {
+ user?: PublicUser;
+ };
+}
+
export type MissionLog =
| MissionStationLog
| MissionMessageLog
@@ -80,4 +89,5 @@ export type MissionLog =
| MissionAlertLog
| MissionAlertLogAuto
| MissionCompletedLog
- | MissionVehicleLog;
+ | MissionVehicleLog
+ | MissionReopenedLog;
diff --git a/packages/database/prisma/json/SocketEvents.ts b/packages/database/prisma/json/SocketEvents.ts
index 9c524dfe..dc0e6497 100644
--- a/packages/database/prisma/json/SocketEvents.ts
+++ b/packages/database/prisma/json/SocketEvents.ts
@@ -39,8 +39,19 @@ export interface StationStatus {
};
}
+export type MissionAutoClose = {
+ type: "mission-auto-close";
+ status: "chron";
+ message: string;
+ data: {
+ missionId: number;
+ publicMissionId: string;
+ };
+};
+
export type NotificationPayload =
| ValidationFailed
| ValidationSuccess
| AdminMessage
- | StationStatus;
+ | StationStatus
+ | MissionAutoClose;