package org.springblade.modules.martial.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.martial.pojo.dto.MiniScoreModifyDTO;
import org.springblade.modules.martial.pojo.entity.MartialScore;
import org.springblade.modules.martial.pojo.vo.MartialScoreVO;
import org.springblade.modules.martial.pojo.vo.MiniScoreDetailVO;

import java.math.BigDecimal;
import java.util.List;

/**
 * Score 服务类
 *
 * @author BladeX
 */
public interface IMartialScoreService extends IService<MartialScore> {

	/**
	 * 分页查询评分记录（包含关联字段）
	 */
	IPage<MartialScoreVO> selectScoreVOPage(IPage<MartialScoreVO> page, MartialScore score);

	/**
	 * Task 2.2: 分数范围验证
	 */
	boolean validateScore(BigDecimal score);

	/**
	 * Task 2.2: 批量分数验证
	 */
	boolean validateScores(Long athleteId, Long projectId);

	/**
	 * Task 2.3: 异常评分检测
	 */
	void checkAnomalyScore(MartialScore score);

	/**
	 * Task 2.3: 获取异常评分列表
	 */
	List<MartialScore> getAnomalyScores(Long athleteId, Long projectId);

	/**
	 * 小程序接口：获取评分详情
	 */
	MiniScoreDetailVO getScoreDetailForMini(Long athleteId);

	/**
	 * 小程序接口：修改评分（主裁判）
	 */
	boolean modifyScoreByAdmin(MiniScoreModifyDTO dto);

}
