Files
kickkingsadmin/src/types/database.ts
T
2026-05-11 04:30:39 +00:00

47 lines
1.3 KiB
TypeScript

/** Mirrors `public.users` (see schemas/users.md). */
export type DbUser = {
id: number;
created_at: string;
username: string | null;
password: string | null;
cc: number | null;
rc: number | null;
last_logged_at: string | null;
};
/** Mirrors `public.matches` (see schemas/matches.md). */
export type DbMatch = {
id: number;
created_at: string;
/** BIGINT may deserialize as string over JSON. */
user_red: number | string | null;
user_blue: number | string | null;
entry_fee: number | null;
prize_cc: number | null;
red_joined_at: string | null;
blue_joined_at: string | null;
status: number | null;
/** BIGINT may deserialize as string over JSON. */
winner_id: number | string | null;
};
/** Mirrors `public.settings` (key/value config rows). */
export type DbSetting = {
key: string;
value: string | null;
};
/** Mirrors `public.transactions` (see schemas/transactions.md). */
export type DbTransaction = {
id: number;
created_at: string;
/** Payer; null — e.g. mint / supply (no debit account). */
from: number | null;
/** Payee; null — e.g. burn (credits nowhere). */
to: number | null;
/** BIGINT; may deserialize as string over JSON. */
amount: number | string;
remarks: string | null;
match_id: number | null;
};