package dev.sonpx.loyalty.mcp.reward.client;

import dev.sonpx.loyalty.mcp.model.OperationResult;
import dev.sonpx.loyalty.mcp.reward.criteria.CampaignCriteria;
import dev.sonpx.loyalty.mcp.reward.model.Campaign;
import jakarta.validation.Valid;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;

/**
 * Created by SonPhung on Sunday, 19-Jul-2026
 **/
@HttpExchange
public interface CampaignClient {

    @GetExchange("/api/campaign/csr/list")
    List<Campaign> getAll(CampaignCriteria criteria, Pageable pageable);

    @GetExchange("/api/campaign/csr/count")
    Long count(CampaignCriteria criteria);

    @GetExchange("/api/campaign/csr/id/{id}")
    Campaign findActiveById(@PathVariable String id);

    @GetExchange("/api/campaign/list-by-ids")
    List<Campaign> findActiveByIds(@RequestParam("idList") List<String> idList);

    @GetExchange("/api/campaign/csr/id/generate")
    String generateId();

    @GetExchange("/api/campaign/csr/id/check/{id}")
    String checkId(@PathVariable String id);

    @PostExchange("/api/campaign/csr/create")
    OperationResult<Campaign> create(@Valid @RequestBody Campaign dto);
}
