package com.czg.market.service;

import com.czg.enums.ShopUserFlowBizEnum;
import com.czg.exception.CzgException;
import com.czg.market.dto.MkShopRechargeDTO;
import com.czg.market.vo.MkShopRechargeShopListVO;
import com.czg.market.vo.MkShopRechargeVO;
import com.czg.market.vo.RechargeListVO;
import com.mybatisflex.core.service.IService;
import com.czg.market.entity.MkShopRecharge;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotNull;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 充值配置表 服务层。
 *
 * @author zs
 * @since 2025-09-16
 */
public interface MkShopRechargeService extends IService<MkShopRecharge> {

    MkShopRechargeVO detail(Long shopId) throws CzgException;

    MkShopRechargeVO detailApp(Long shopId);

    Boolean edit(Long shopId, MkShopRechargeDTO shopRechargeDTO);

    BigDecimal checkRecharge(Long mainShopId, @NotNull(message = "店铺不能为空") Long shopId, Long userId, Long rechargeDetailId, @DecimalMin("0.01") BigDecimal money);

    /**
     * 充值
     *
     * @param isNoJoin 是否没有执行 加入会员的方法
     *                 会员如果是条件开通 则 需要统计
     */
    void recharge(Long shopId, Long shopUserId, Long rechargeDetailId, BigDecimal amount, Long paymentId,
                  String payType, LocalDateTime payTime, ShopUserFlowBizEnum bizEnum, boolean isNoJoin, String operator);

    List<RechargeListVO> getList(long loginIdAsLong);

    List<MkShopRechargeShopListVO> shopList(Long shopId, String shopName);
}
