import { Controller, Get, Query } from "@nestjs/common";
import { ApiOperation, ApiQuery, ApiResponse, ApiTags } from "@nestjs/swagger";
import { Public } from "../../common/decorators";
import { ValueBoardService } from "./value-board.service";

@ApiTags("Value Board")
@Controller("value-board")
export class ValueBoardController {
  constructor(private readonly valueBoardService: ValueBoardService) {}

  /**
   * GET /value-board
   * Upcoming matches with de-vigged (calibrated) probabilities — the honest,
   * transparent product board. No fabricated value; the bookmaker margin is
   * disclosed per match.
   */
  @Public()
  @Get()
  @ApiOperation({
    summary: "Upcoming matches with calibrated (de-vigged) probabilities",
  })
  @ApiQuery({ name: "sport", required: false, type: String })
  @ApiResponse({ status: 200, description: "Value board for upcoming matches" })
  async getBoard(@Query("sport") sport?: string) {
    return this.valueBoardService.getBoard(sport || "football");
  }
}
