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

import dev.sonpx.loyalty.mcp.model.OperationResult;
import dev.sonpx.loyalty.mcp.reward.criteria.CampaignRuleCriteria;
import dev.sonpx.loyalty.mcp.reward.model.CampaignRule;
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 CampaignRuleClient {

    @GetExchange("/api/campaign-rule/csr/list")
    List<CampaignRule> getAll(CampaignRuleCriteria criteria, Pageable pageable);

    @GetExchange("/api/campaign-rule/csr/count")
    Long count(CampaignRuleCriteria criteria);

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

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

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

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

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