package es.uv.saic.feign;

import java.util.HashMap;
import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import es.uv.saic.domain.SupervisionSearchParams;

@FeignClient(value = "supervision-controller", url = "${saic.url.domain}")
public interface SupervisionClient {
    @PostMapping("/supervision")
	public HashMap<String, Object> supervisionForm(@RequestParam String usuari, @RequestParam(required = false) SupervisionSearchParams ssp);

    @PostMapping("/supervision/search")
	public HashMap<String, Object> supervisionSearch(
        @RequestParam(name="centers[]", required=false) List<Integer> centres,
        @RequestParam("years[]") List<Integer> cursos,
        @RequestParam("titulations[]") List<Integer> titulacions,
        @RequestParam(name="procedures[]", required=false) List<String> procediments,
        @RequestParam(name="evidences[]", required=false) List<String> evidencies,
        @RequestParam(name="searchType", required=false) String searchType,
        @RequestParam String usuari);
    
    @GetMapping("/supervision/search")
	public HashMap<String, Object> restoreSearch(@RequestBody String usuari, @RequestParam SupervisionSearchParams ssp);
}
