package com.fuint.common.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.common.dto.ext.PageResult;
import com.fuint.common.vo.ShopDetailVO;
import com.fuint.common.vo.ShopVO;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.repository.model.MtStore;

import java.math.BigDecimal;


/**
 * @author Survive
 * @date 2025/3/12
 * @description TODO 店铺预警相关接口
 */
public interface ShopAlertService extends IService<MtStore> {
    /**
     * 新增店铺预警信息
     * @param id
     * @param mail
     * @param threshold
     * @throws BusinessCheckException
     */
    void addShopAlert(Long id, String mail, BigDecimal threshold) throws BusinessCheckException;

    /**
     * 更新店铺预警信息
     * @param shopId
     * @param mail
     * @param threshold
     * @return
     */
    MtStore updateShopAlert(Long shopId, String mail, BigDecimal threshold) throws BusinessCheckException;


    /**
     * 清空预警信息
     * @param shopId
     * @return
     */
    MtStore clearAlertConfig(Long shopId) throws BusinessCheckException ;

    /**
     * 详情
     * @param shopId
     * @param withOrders
     */
    ShopDetailVO getShopDetail(Long shopId, Boolean withOrders) throws BusinessCheckException ;

    /**
     * 分页查询
     * @param page
     * @param size
     * @param name
     * @return
     */
    PageResult<ShopVO> listShops(Integer page, Integer size, String name) throws BusinessCheckException;
}
