68 lines
1.3 KiB
TypeScript
68 lines
1.3 KiB
TypeScript
export type SessionStatus = "lobby" | "active" | "ended";
|
|
export type PlayerRole = "banker" | "player";
|
|
|
|
export type Player = {
|
|
id: string;
|
|
name: string;
|
|
role: PlayerRole;
|
|
balance: number;
|
|
connected: boolean;
|
|
isDummy: boolean;
|
|
joinedAt: number;
|
|
lastActiveAt: number;
|
|
};
|
|
|
|
export type TransactionKind =
|
|
| "transfer"
|
|
| "banker_adjust"
|
|
| "banker_force_transfer";
|
|
|
|
export type Transaction = {
|
|
id: string;
|
|
kind: TransactionKind;
|
|
fromId: string | null;
|
|
toId: string | null;
|
|
amount: number;
|
|
note: string | null;
|
|
createdAt: number;
|
|
initiatedBy: PlayerRole;
|
|
};
|
|
|
|
export type ChatGroup = {
|
|
id: string;
|
|
name: string;
|
|
memberIds: string[];
|
|
createdAt: number;
|
|
createdBy: string;
|
|
};
|
|
|
|
export type ChatMessage = {
|
|
id: string;
|
|
fromId: string;
|
|
body: string;
|
|
createdAt: number;
|
|
groupId: string | null;
|
|
};
|
|
|
|
export type TakeoverRequest = {
|
|
id: string;
|
|
dummyId: string;
|
|
requesterId: string;
|
|
createdAt: number;
|
|
status: "pending" | "approved" | "rejected";
|
|
};
|
|
|
|
export type SessionSnapshot = {
|
|
id: string;
|
|
code: string;
|
|
status: SessionStatus;
|
|
createdAt: number;
|
|
bankerId: string;
|
|
blackoutActive: boolean;
|
|
blackoutReason: string | null;
|
|
players: Player[];
|
|
transactions: Transaction[];
|
|
chats: ChatMessage[];
|
|
groups: ChatGroup[];
|
|
takeoverRequests: TakeoverRequest[];
|
|
};
|