package com.czg.account.service;

import cn.hutool.core.exceptions.ValidateException;
import com.czg.account.dto.PageDTO;
import com.czg.account.dto.shopinfo.*;
import com.czg.account.entity.ShopInfo;
import com.czg.constants.ShopSwitchTypeEnum;
import com.czg.exception.CzgException;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author Administrator
 */
public interface ShopInfoService extends IService<ShopInfo> {

    @Override
    ShopInfo getById(Serializable id) throws CzgException;

    /**
     * 检测开关
     *
     * @param shopId     店铺id
     * @param switchType ShopInfo的某列 开关 目前只支持Integer类型字段
     * @return true:开启 false:关闭
     */
    boolean checkSwitch(Long shopId, ShopSwitchTypeEnum switchType) throws ValidateException;

    Page<ShopDetailDTO> get(PageDTO pageDTO, String profiles, String phone, String shopName, Integer status, Integer isHeadShop);

    Page<ShopDetailDTO> getShopByMainId(PageDTO pageDTO, String shopName, Integer status);

    Boolean add(ShopInfoAddDTO shopInfoAddDTO);

    Boolean edit(ShopInfoEditDTO shopInfoEditDTO);

    ShopDetailDTO detail(Long id) throws CzgException;

    ShopInfoByCodeDTO getByCode(String tableCode, String lat, String lng, boolean checkState);

    ShopInfoDetailDTO getDetail(Long shopId);

    Page<ShopInfoSubVO> getSubList(String lat, String lng, float distance);

    List<ShopBranchSelectDTO> findShopBranch(Long shopId);

    Long getMainIdByShopId(Long shopId) throws CzgException;

    List<ShopInfo> getByMainIdOrList(Long mainShopId, List<Long> shopIdList, String shopName);

    BigDecimal updateAmount(Long id, BigDecimal amount);

    /**
     * 获取所有未删除的 过期时间>三天前  店铺id列表
     *
     * @return 店铺id列表
     */
    List<Long> getShopIdList();
}
