export enum Role { ADMIN = "ADMIN", PLAYER = "PLAYER", } export class AuthPayload { constructor(username: string, gameId: string, userId: string, role: Role) { this.username = username; this.gameId = gameId; this.userId = userId; this.role = role; } public role: Role; public username: string; public gameId: string; public userId: string; toPlainObject(): AuthPayload { return { username: this.username, gameId: this.gameId, userId: this.userId, role: this.role, } as AuthPayload; } getAuthHeaders(): Record { return { "Content-Type": "application/json", username: this.username, gameId: this.gameId, userId: this.userId, role: this.role, }; } }