package es.uv.saic.feign;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
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 es.uv.saic.domain.Datasource;
import es.uv.saic.dto.ImportDTO;
import es.uv.saic.dto.IndicadorEnquestaTmpDup;
import es.uv.saic.dto.TablaDTO;

@FeignClient(name = "saic-data-service")
public interface DataClient {

    @GetMapping("/data/import")
    public List<Datasource> renderImport();

    @PostMapping("/data/import")
    public String uploadFile(@RequestBody ImportDTO importDto);

    @PostMapping("/data/view/columns")
    public List<String> listTableColumns(@RequestBody TablaDTO tablaDTO);

    @PostMapping("/data/check/{type}")
    public List<IndicadorEnquestaTmpDup> check(@RequestBody String enquesta, @PathVariable Integer type);

    @GetMapping("/data/sources")
	public List<Datasource> getDatasources();

    @PostMapping("/data/count")
	public Integer countByEnquesta(@RequestBody String enquesta);

    @PostMapping("/data/consolidate")
	public Integer consolidate(@RequestBody String enquesta);
    
}