import { Injectable, Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';

@Injectable()
export class SteamService {
  private readonly logger = new Logger(SteamService.name);
  private apiKey: string;

  constructor(private config: ConfigService) {
    this.apiKey = this.config.get<string>('steam.apiKey') || '';
  }

  async checkForceWipe(): Promise<{ isForceWipe: boolean; expectedDate: string | null }> {
    this.logger.warn('Steam API not configured — checkForceWipe returning stub response');
    return { isForceWipe: false, expectedDate: null };
  }

  async getPlayerSummary(steamId: string): Promise<{ personaname: string; avatarfull: string } | null> {
    if (!this.apiKey) {
      this.logger.warn('Steam API not configured — getPlayerSummary returning null');
      return null;
    }
    this.logger.warn(`Steam API not configured — skipping profile fetch for ${steamId}`);
    return null;
  }
}
