export type Stream = {
    id: string;
    name: string;
    createdAt: string;
};

export type Role = "admin" | "viewer";

export type Token = {
    id: string;
    streamId: string;
    role: Role;
    tokenHash: string;
    createdAt: string;
    revokedAt: string | null;
};

export type ChatMessage = {
    id: string;
    streamId: string;
    platform: string;
    author: string;
    message: string;
    createdAt: string;
};

export type Poll = {
    id: string;
    streamId: string;
    question: string;
    isOpen: boolean;
    votesYes: number;
    votesNo: number;
    createdAt: string;
    updatedAt: string;
    closedAt: string | null;
};

export type AppData = {
    streams: Stream[];
    tokens: Token[];
    chat_messages: ChatMessage[];
    polls: Poll[];
    setupCompletedAt: string | null;
    usedSetupKeyHashes: string[];
    setupLocked: boolean;
};
