package com.yonge.cooleshow.biz.dal.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yonge.cooleshow.auth.api.entity.SysUser;
import com.yonge.cooleshow.biz.dal.dao.SysUserContractRecordDao;
import com.yonge.cooleshow.biz.dal.dto.search.SysUserContractRecordSearch;
import com.yonge.cooleshow.biz.dal.entity.SysUserContractRecord;
import com.yonge.cooleshow.biz.dal.vo.SysUserContractRecordVo;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import com.yonge.cooleshow.common.enums.ContractTemplateTypeEnum;
import com.yonge.cooleshow.common.enums.SysUserType;

/**
 * 用户协议记录表-一个用户一种协议一个版本一条记录(SysUserContractRecord)表服务接口
 *
 * @author hgw
 * @since 2022-05-07 15:04:06
 */
public interface SysUserContractRecordService extends IService<SysUserContractRecord> {

    SysUserContractRecordDao getDao();
    /**
     * 查询详情
     * @author liweifan
     * @date 2022-06-16
     */
    SysUserContractRecordVo detail(Long id);
    /**
     * 分页查询
     * @author liweifan
     * @date 2022-06-16
     */
    IPage<SysUserContractRecordVo> selectPage(IPage<SysUserContractRecordVo> page, SysUserContractRecordSearch query);
    /**
     * 查询用户是否签署协议
     * @param userId
     * @param contractType
     * @return
     */
    Boolean checkContractSign(Long userId, SysUserType userType, ContractTemplateTypeEnum contractType);
    /**
     * 获取用户最新版签署中的协议
     * @param userId
     * @param contractType
     * @return
     */
    SysUserContractRecord queryLatestContract(Long userId, SysUserType userType, ContractTemplateTypeEnum contractType);

    HttpResponseResult<Boolean> sign(ContractTemplateTypeEnum contractType, SysUserType userType, SysUser user);
}

