import { Injectable } from '@nestjs/common';
import { UsersService } from '../users/users.service';

@Injectable()
export class PresenceService {
  constructor(private readonly usersService: UsersService) {}

  getOnlineUsers(limit = 50) {
    return this.usersService.findOnline(limit);
  }

  getLastSeenUsers(limit = 50) {
    return this.usersService.findLastVisited(limit);
  }

  getTopRankedUsers(limit = 50) {
    return this.usersService.findTopRanked(limit);
  }

  markOnline(userId: string) {
    return this.usersService.updatePresence(userId, true);
  }

  markOffline(userId: string) {
    return this.usersService.updatePresence(userId, false);
  }
}
