pkgs/api/src/responses.ts (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import type { Message, Ticket, User } from "./types";
export type TicketResponse = {
ticket: Ticket;
messages: Message[];
};
export type TicketsResponse = {
tickets: Ticket[];
// todo)) type pagination
};
export type MeResponse = User;
export type ModeratorsResponse = User[];
export type Statistic = {
mean: number;
median: number;
count: number;
};
export type OverallStatsResponse = {
global: Statistic;
hourly: (Statistic & { hour: number })[];
};
export type LeaderboardStat = Statistic & {
user: User;
rank: number;
};
export type LeaderboardResponse = LeaderboardStat[];
|