package shop.alien.store.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import shop.alien.entity.result.R;
import org.springframework.web.bind.annotation.RequestParam;
import shop.alien.entity.store.EssentialHolidayComparison;
import shop.alien.entity.store.LifeCoupon;
import shop.alien.entity.store.vo.LifeCouponStatusVo;

import java.util.Map;

/**
 * 优惠券
 */
public interface LifeCouponService extends IService<LifeCoupon> {

    LifeCoupon addOrUpdateCoupon(LifeCoupon lifeCoupon);

    /**
     * 修改库存数量
     *
     * @param id        主键
     * @param singleQty 库存数量
     * @return boolean
     */
    boolean updateCouponSingleQty(Integer id, Integer singleQty);

    IPage<LifeCoupon> getCouponList(int page, int size, String storeId, String status, String name, Integer dataType);

    int updateCoupon(String id, Integer status);

    Map<String, String> couponVerify(String storeId, String quanCode);

    Map<String, String> newCouponVerify(String storeId, String quanCode);

    /**
     * 获取代金券状态
     */
    public LifeCouponStatusVo getCouponStatus(String couponId);

    IPage<EssentialHolidayComparison> getHolidayList(int page, int size, String year, String openFlag, String holidayName);

    boolean saveHoliday(EssentialHolidayComparison essentialHolidayComparison);

    boolean delHoliday(String id);

    boolean delHolidayByYear(String year);

    boolean openCloseHoliday(String id);

    /**
     * 核销订单前效验
     * @param orderCode
     * @return
     */
    R<String> orderVerify(String orderCode);

    /**
     * 获取代金券详情（包含商铺信息）
     * @param id 代金券ID
     * @return LifeCouponVo
     */
    shop.alien.entity.store.vo.LifeCouponVo getNewCouponDetail(String id);

    /**
     * 导入假期管理
     * @param file Excel文件
     * @return 导入结果
     */
    R<String> importHolidayFromExcel(MultipartFile file);

    /**
     *  删除代金券
     * @param id
     * @return
     */
    boolean deleteCoupon(Integer id);
}