package es.uv.saic.feing;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RequestParam;

import es.uv.saic.domain.IndicadorEnquestaTmp;
import es.uv.saic.dto.EmailDTO;
import es.uv.saic.dto.IndicadorEnquestaTmpDup;
import es.uv.saic.dto.OrganDTO;

@FeignClient(name = "saic-core-service")
public interface CoreClient {
    
    @GetMapping("/getOrgByRuct/{ruct}")
    public OrganDTO getOrgByRuct(@PathVariable Integer ruct);
    
    @GetMapping("/existsOrg/{tlugar}/{idTitulacio}")
    public boolean existsOrg(@PathVariable String tlugar,  @PathVariable Integer idTitulacio);

    @DeleteMapping("/delete/by/{enquesta}")
    public Integer deleteByEnquestaC(@PathVariable String enquesta);

    @PostMapping("/save")
    public void save(@RequestBody IndicadorEnquestaTmp ie);

    @GetMapping("/checkDuplicates/{enquesta}")
    public List<IndicadorEnquestaTmpDup> checkDuplicates(@PathVariable String enquesta);

    @DeleteMapping("/delete/current/{enquesta}")
    public Integer deleteFromCurrent(@PathVariable String enquesta);
    
    @DeleteMapping("/delete/pending/{enquesta}")
    public Integer deleteFromPending(@PathVariable String enquesta);

    @GetMapping("/checkIntegrity/{enquesta}")
    public List<IndicadorEnquestaTmpDup> checkIntegrity(@PathVariable String enquesta);

    @GetMapping("/consolidateByEnquesta/{enquesta}")
    public Integer consolidateByEnquesta(@PathVariable String enquesta);

    @GetMapping("/countByEnquesta/{enquesta}")
    public Integer countByEnquesta(@RequestParam String enquesta);

    @PostMapping("/sendEmail")
    public void sendEmail(@RequestBody EmailDTO email);
}
