games_app/backend/dist/dto/user.dto.d.ts
2026-06-29 15:01:23 +02:00

80 lines
2.6 KiB
TypeScript

/**
* User-related query projections for admin lists, admin detail, and profile endpoints.
* These are not full entity models; they combine selected `users` columns with joined or decrypted fields.
*/
/** Admin paginated list row from `users` joined with `roles` and aggregated wallet / activity stats. */
export interface UserListRow {
id: string;
email_hash: string;
email_encrypted: string | null;
first_name: string | null;
middle_name: string | null;
last_name: string | null;
date_of_birth: string | null;
role_id: number;
role_name: string;
email_verified: boolean;
totp_enabled: boolean;
is_enabled: boolean;
is_account_non_expired: boolean;
is_account_non_locked: boolean;
is_credentials_non_expired: boolean;
country_of_residence: string | null;
nationality: string | null;
gender: string | null;
referral_code: string | null;
first_deposit_at: Date | null;
first_deposit_transaction_id: string | null;
withdrawals_suspended: boolean;
under_surveillance: boolean;
security_suspended_at: Date | null;
created_at: Date;
updated_at: Date;
main_balance_raw: string;
bonus_balance_raw: string;
total_bonus_received_raw: string;
prediction_count: number;
total_stake_raw: string;
total_payout_raw: string;
net_pnl_raw: string;
last_login_at: Date | null;
last_activity_at: Date;
}
/** Admin user detail row from `users` joined with `roles` (account metadata without list-only fields). */
export interface AdminUserDetailRow {
id: string;
email_encrypted: string | null;
role_id: number;
role_name: string;
email_verified: boolean;
totp_enabled: boolean;
is_enabled: boolean;
is_account_non_expired: boolean;
is_account_non_locked: boolean;
is_credentials_non_expired: boolean;
withdrawals_suspended: boolean;
under_surveillance: boolean;
security_suspended_at: Date | null;
created_at: Date;
}
/** Self-service profile projection from selected `users` columns (PII fields for the authenticated user). */
export interface ProfileRow {
id: string;
first_name: string | null;
middle_name: string | null;
last_name: string | null;
date_of_birth: string | null;
email_encrypted: string | null;
phone_encrypted: string | null;
gender: string | null;
}
/** Extended self profile with account metadata for GET /me. */
export interface SelfProfileRow extends ProfileRow {
country_of_residence: string | null;
nationality: string | null;
role_name: string;
email_verified: boolean;
totp_enabled: boolean;
created_at: Date;
}
//# sourceMappingURL=user.dto.d.ts.map