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

export interface ValidationFailed {
	type: "hpg-validation";
	status: "failed";
	message: string;
	data: {
		mission: Mission;
	};
}

export interface ValidationSuccess {
	type: "hpg-validation";
	status: "success";
	message: string;
	data: {
		mission: Mission;
	};
}

export interface AdminMessage {
	type: "admin-message";
	status: "kick" | "ban";
	message: string;
	data?: {
		admin: PublicUser;
		reason: string;
	};
}

export interface StationStatus {
	type: "station-status";
	status: string;
	message: string;
	data?: {
		stationId: number;
		aircraftId: number;
		userId?: string;
	};
}

export type MissionAutoClose = {
	type: "mission-auto-close";
	status: "chron";
	message: string;
	data: {
		missionId: number;
		publicMissionId: string;
	};
};

export type MissionClosed = {
	type: "mission-closed";
	status: "closed";
	message: string;
	data: {
		missionId: number;
		publicMissionId: string;
	};
};

export type NotificationPayload =
	| ValidationFailed
	| ValidationSuccess
	| AdminMessage
	| StationStatus
	| MissionAutoClose
	| MissionClosed;
