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

import com.iqser.red.service.persistence.service.v1.api.shared.model.DossierTemplateModel;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
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.ResponseStatus;

import java.util.List;

@ApiResponses(value = {@ApiResponse(responseCode = "429", description = "Too many requests.")})
@ResponseStatus(HttpStatus.OK)
public interface DossierTemplateResource {

    String DOSSIER_TEMPLATE_PATH = "/dossier-templates";
    String PATH = ExternalApiConstants.BASE_PATH + DOSSIER_TEMPLATE_PATH;
    String DOSSIER_TEMPLATE_ID_PARAM = "dossierTemplateId";
    String DOSSIER_TEMPLATE_ID_PATH_VARIABLE = "/{" + DOSSIER_TEMPLATE_ID_PARAM + "}";


    @GetMapping(value = PATH, produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "Lists all existing DossierTemplates.", description = "None")
    @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "List of all existing DossierTemplates.")})
    List<DossierTemplateModel> getAllDossierTemplates();


    @GetMapping(value = PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
    @Operation(summary = "Get a specific DossierTemplate by its identifier.", description = "None")
    @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Get a specific DossierTemplate by its identifier."), @ApiResponse(responseCode = "404", description = "The DossierTemplate is not found.")})
    DossierTemplateModel getDossierTemplate(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId);



}
