pkgs/api/src/types.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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
export type User = {
id: string;
name: string;
avatarUrl: string;
isModerator: boolean;
};
export type Ticket = {
number: string;
status: "open" | "closed" | "archived";
closedBy: User | null;
closedAt: Date | null;
/** the reason the ticket was opened if it was not opened by the subject */
topic: string | null;
closeReason: string | null;
privateReason: string | null;
/** the user who opened the ticket, if it was not opened by the subject */
openedBy: User | null;
/** the user who is the subject of the ticket, i.e. the reporter */
subject: User;
};
export type Message = {
id: number;
messageId: string | null;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
author: User;
authorType: "user" | "staff" | "system";
content: string;
attachments: Attachment[];
mentions: User[];
};
export type Attachment = {
id: string;
ownerType: "ticket" | "ticket_message" | "bug";
owner: User | null;
fileName: string;
contentType: string;
size: number;
bucket: string;
key: string;
url: string;
uploadedAt: Date;
};
|