package dev.sonpx.loyalty.mcp.web.rest;

import dev.sonpx.loyalty.mcp.model.Result;
import dev.sonpx.loyalty.mcp.reward.criteria.CampaignCriteria;
import dev.sonpx.loyalty.mcp.reward.dto.CampaignSummaryDto;
import dev.sonpx.loyalty.mcp.service.CampaignService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by SonPhung on Sunday, 19-Jul-2026
 **/
@RestController
@RequestMapping("/api/reward")
@RequiredArgsConstructor
public class RewardResource {

    private final CampaignService campaignService;

    @GetMapping
    public ResponseEntity<Result<List<CampaignSummaryDto>>> getAll(CampaignCriteria criteria) {
        return ResponseEntity.ok(campaignService.getAll(criteria));
    }


}