package dev.sonpx.loyalty.mcp.tool;

import dev.sonpx.loyalty.mcp.model.Result;
import dev.sonpx.loyalty.mcp.reward.model.CounterDefinition;
import dev.sonpx.loyalty.mcp.service.CounterDefinitionService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.ai.mcp.annotation.McpTool;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class CounterDefinitionTools {

    private final CounterDefinitionService counterDefinitionService;

    @McpTool(description = "Lấy thông tin chi tiết một Counter theo ID.")
    public Result<CounterDefinition> getCounterDefinitionById(String counterId) {
        return counterDefinitionService.findById(counterId);
    }

    @McpTool(description = "Lấy thông tin nhiều Counter theo danh sách ID, phân tách bằng dấu phẩy.")
    public Result<List<CounterDefinition>> getCounterDefinitionsByIds(String ids) {
        return counterDefinitionService.findActiveByIds(ids);
    }
}
