package co.yixiang.yshop.module.product.service.teamworkinfo;

import java.util.*;
import javax.validation.*;

import co.yixiang.yshop.module.product.controller.admin.teamworkinfo.param.TeamworkRefundParam;
import co.yixiang.yshop.module.product.controller.admin.teamworkinfo.vo.*;
import co.yixiang.yshop.framework.common.pojo.PageResult;
import co.yixiang.yshop.module.product.controller.app.teamworkinfo.vo.AppTeamworkProductDetailRespVO;
import co.yixiang.yshop.module.product.controller.app.teamworkinfo.vo.AppWaitTeamworkReqVO;
import co.yixiang.yshop.module.product.controller.app.teamworkinfo.vo.AppWaitTeamworkRespVO;
import co.yixiang.yshop.module.product.controller.app.teamworkinfo.vo.AppWaitTeamworkUserRespVO;
import co.yixiang.yshop.module.product.dal.dataobject.campaigninfo.CampaignInfoDO;
import co.yixiang.yshop.module.product.dal.dataobject.teamworkinfo.TeamworkInfoDO;

/**
 * 拼团信息 Service 接口
 *
 * @author moxiangrong
 */
public interface TeamworkInfoService {

    /**
     * 去成团
     *
     * @param createReqVO 创建信息
     * @return
     */
    Long toTeamwork(TeamworkInfoCreateVO createReqVO);


    /**
     * 获得拼团信息分页
     *
     * @param pageReqVO 分页查询
     * @return 拼团信息分页
     */
    PageResult<TeamworkInfoRespVO> getTeamworkInfoPage(TeamworkInfoPageReqVO pageReqVO);


    /**
     * 获得拼团订单信息分页
     *
     * @param pageReqVO 分页查询
     * @return 拼团信息分页
     */
    PageResult<TeamworkOrderInfoRespVO> getTeamworkOrderInfoPage(TeamworkOrderInfoPageReqVO pageReqVO);

    /**
     * 获取未成团的订单id
     *
     * @param campaignId
     * @return
     */
    List<Long> getNotTeamwork(Long campaignId);

    /**
     * 修改拼团为失败
     *
     * @param campaignId
     * @return
     */
    void updateTeamworkFail(Long campaignId);

    /**
     * 拼团失败
     *
     * @param teamworkId
     * @param number
     * @return
     */
    void teamworkFail(Long teamworkId, Integer number);

    /**
     * 拼团成功
     *
     * @param teamworkId
     * @return
     */
    void teamworkSuccess(Long teamworkId);

    /**
     * 拼团结束时间
     *
     * @param teamworkId
     * @return
     */
    Long teamworkEndTime(Long teamworkId);

    /**
     * 获取拼团状态
     *
     * @param teamworkId
     * @return
     */
    Integer getTeamworkState(Long teamworkId);

    /**
     * 获取待成团列表
     *
     * @param reqVO
     * @return
     */
    List<AppWaitTeamworkRespVO> getWaitTeamworkList(AppWaitTeamworkReqVO reqVO);

    List<AppWaitTeamworkUserRespVO> getUserTeamworkList(Long id);

    AppTeamworkProductDetailRespVO getProductDetail(Long id);

    /**
     * 参团判断
     *
     * @param uid
     * @param teamworkId
     * @return
     */
    void joinJudge(Long uid, Long teamworkId);

    /**
     * 拼团查询
     *
     * @param id
     * @return
     */
    TeamworkInfoDO get(Long id);

    /**
     * 活动信息查询
     *
     * @param id
     * @return
     */
    CampaignInfoDO getCampaignInfoById(Long id);

    /**
     * 拼团售后处理
     *
     * @param param
     * @return
     */
    void refundHandle(TeamworkRefundParam param);

}
