package com.infoepoch.pms.agent.tool.union.care;

import com.infoepoch.pms.agent.common.utils.LogHelper;
import com.infoepoch.pms.agent.domain.care.log.CareTraceLogSupport;
import com.infoepoch.pms.agent.domain.care.model.ActivitySummary;
import com.infoepoch.pms.agent.tool.union.care.provider.CareBusinessDataProvider;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 可参加活动查询工具
 */
@Component
@RequiredArgsConstructor
public class EligibleActivitiesTool {

    private final CareBusinessDataProvider careBusinessDataProvider;

    /**
     * 根据会话用户一次性查询可推荐活动列表。
     */
    public List<ActivitySummary> execute(String traceId, String sessionId) {
        LogHelper.info(this, CareTraceLogSupport.format(
                traceId,
                sessionId,
                "活动工具分发",
                "调用可推荐活动工具"
        ));
        return careBusinessDataProvider.searchEligibleActivities(traceId, sessionId);
    }
}

