package com.sonymusic.dx.dxuiservice.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sonymusic.dx.dxuiservice.dto.ParticipantDTO;
import com.sonymusic.dx.dxuiservice.service.ParticipantService;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;

@Tag(name = "Participant", description = "Participant UI Service")
@RestController
@RequestMapping("participant")
public class ParticipantController {

	@Autowired
	private ParticipantService participantService;

	@Operation(summary = "Get Participant details by Participant Number", responses = {
			@ApiResponse(responseCode = "200", description = "OK"),
			@ApiResponse(responseCode = "400", description = "Bad request") })
	@GetMapping("/{participantNo}")
	public ParticipantDTO getParticipantById(@PathVariable("participantNo") Long participantNo) {
		return participantService.getParticipantById(participantNo);
	}
}
