import { Station } from "../../generated/client";
import { PublicUser } from "./User";

export interface MissionStationLog {
	type: "station-log";
	auto: true;
	timeStamp: string;
	data: {
		stationId: number;
		oldFMSstatus: string;
		newFMSstatus: string;
		station: Station;
		user: PublicUser;
	};
}

export interface MissionSdsLog {
	type: "sds-log";
	auto: false;
	timeStamp: string;
	data: {
		station: Station;
		user: PublicUser;
		stationId: number;
		message: string;
	};
}

export interface MissionMessageLog {
	type: "message-log";
	auto: false;
	timeStamp: string;

	data: {
		message: string;
		user: PublicUser;
	};
}

export interface MissionAlertLog {
	type: "alert-log";
	auto: false;
	timeStamp: string;
	data: {
		station?: Station;
		vehicle?: string;
		user: PublicUser;
	};
}

export interface MissionCompletedLog {
	type: "completed-log";
	auto: boolean;
	timeStamp: string;
	data: {
		user?: PublicUser;
	};
}

export type MissionLog =
	| MissionStationLog
	| MissionMessageLog
	| MissionSdsLog
	| MissionAlertLog
	| MissionCompletedLog;
