// Prisma Entity Types - 用于Mapper转换
export interface UserAccountEntity {
  userId: bigint;
  accountSequence: string; // 格式: D + YYMMDD + 5位序号
  phoneNumber: string | null;
  passwordHash: string | null; // bcrypt 哈希密码
  nickname: string;
  avatarUrl: string | null;
  inviterSequence: string | null; // 格式: D + YYMMDD + 5位序号
  referralCode: string;
  kycStatus: string;
  realName: string | null;
  idCardNumber: string | null;
  idCardFrontUrl: string | null;
  idCardBackUrl: string | null;
  kycVerifiedAt: Date | null;
  status: string;
  registeredAt: Date;
  lastLoginAt: Date | null;
  updatedAt: Date;
  devices?: UserDeviceEntity[];
  walletAddresses?: WalletAddressEntity[];
}

export interface UserDeviceEntity {
  id: bigint;
  userId: bigint;
  deviceId: string;
  deviceName: string | null;
  deviceInfo: Record<string, unknown> | null; // 完整的设备信息 JSON
  // Hardware Info (冗余字段，便于查询)
  platform: string | null;
  deviceModel: string | null;
  osVersion: string | null;
  appVersion: string | null;
  screenWidth: number | null;
  screenHeight: number | null;
  locale: string | null;
  timezone: string | null;
  // Timestamps
  addedAt: Date;
  lastActiveAt: Date;
}

export interface WalletAddressEntity {
  addressId: bigint;
  userId: bigint;
  chainType: string;
  address: string;
  publicKey: string;
  addressDigest: string;
  mpcSignatureR: string;
  mpcSignatureS: string;
  mpcSignatureV: number;
  status: string;
  boundAt: Date;
}
