package com.yida.data.school.transaction.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yida.data.common.core.entity.apply.EduProduct;
import com.yida.data.school.dto.transaction.ListBuyStudentDTO;
import com.yida.data.school.dto.transaction.ProductSelectDTO;
import com.yida.data.school.vo.transcation.EduProductListVO;
import com.yida.data.school.vo.transcation.EduProductNoticeVO;

import java.util.List;


public interface EduProductService extends IService<EduProduct> {
    /**
     * 商品分页查询
     *
     * @return
     */
    IPage<EduProduct> selectPageEduProductService(Page page, ProductSelectDTO productSelectDTO);

    /**
     * 商品查询详情
     *
     * @return
     */
    EduProduct getInfo(Long productId);

    /**
     * 商品新增
     *
     * @return
     */
    void insertEduProductService(EduProduct eduProduct);


    /**
     * 商品删除
     *
     * @return
     */
    void removeEduProductService(Long productId);

    /**
     * 商品修改
     *
     * @param eduProduct
     * @return
     */

    void upDataEduProductService(EduProduct eduProduct);

    /**
     * 手机端查询商品列表
     *
     * @param phone
     * @param schoolId
     * @return
     */
    EduProductListVO selectProductList(String phone, Long schoolId);


    /**
     * @param eduProductId
     * @return
     */
    EduProduct selectProductAndApply(Long eduProductId);

    /**
     * 下架
     *
     * @param eduProduct
     */
    void soldOutProduct(EduProduct eduProduct);

    /**
     * 查询包含单个商品品类实体的商品
     *
     * @param category
     * @param schoolId
     * @return
     */
    List<EduProduct> listOneCategoryProduct(String firstCategory, String secondCategory, Long schoolId);


    Page<EduProductNoticeVO> listBuyStudent(Page page, ListBuyStudentDTO listBuyStudentDTO);

    Page<EduProductNoticeVO> listNotBuyStudent(ListBuyStudentDTO listBuyStudentDTO);

    /**
     * 商品上架
     *
     * @param eduProduct
     */
    void upDateProductById(EduProduct eduProduct);

}
