package com.iqser.red.service.persistence.service.v1.api.external.resource;

import java.util.List;
import java.util.Set;

import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.iqser.red.service.persistence.service.v1.api.shared.model.DossierStats;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;

@ResponseStatus(HttpStatus.OK)
public interface DossierStatsResource {

    String DOSSIER_STATS_REST_PATH = ExternalApi.BASE_PATH + "/dossier-stats";
    String DOSSIER_ID_PARAM = "dossierId";
    String DOSSIER_ID_PATH_PARAM = "/{" + DOSSIER_ID_PARAM + "}";


    @ResponseBody
    @ResponseStatus(value = HttpStatus.OK)
    @GetMapping(value = DOSSIER_STATS_REST_PATH + DOSSIER_ID_PATH_PARAM, produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "Get stats for a specific Dossier ID", description = "None")
    @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "The Dossier Stats."), @ApiResponse(responseCode = "404", description = "The Dossier  is not found.")})
    DossierStats getDossierStats(@PathVariable(DOSSIER_ID_PARAM) String dossierId);


    @ResponseBody
    @ResponseStatus(value = HttpStatus.OK)
    @PostMapping(value = DOSSIER_STATS_REST_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "Get stats for a specific list of Dossier IDs", description = "None")
    @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "The Dossier Stats Map."), @ApiResponse(responseCode = "404", description = "The Dossier  is not found.")})
    List<DossierStats> getDossierStats(@RequestBody Set<String> dossierIds);

}
