package com.czg.market.service;

import com.czg.account.entity.ShopUser;
import com.czg.market.vo.MkConsumeDiscountVO;
import com.mybatisflex.core.service.IService;
import com.czg.market.entity.MkShopConsumeDiscountRecord;

import java.math.BigDecimal;

/**
 * 新客立减减免记录 服务层。
 *
 * @author zs
 * @since 2025-09-17
 */
public interface MkShopConsumeDiscountRecordService extends IService<MkShopConsumeDiscountRecord> {
    /**
     * 获取减免金额
     * @param shopId 门店id
     * @param userId 用户id
     * @param orderId 订单id
     * @return 减免信息
     */
    MkShopConsumeDiscountRecord getDiscount(Long shopId, Long userId, Long orderId);

    /**
     * 是否可用新客立减
     *
     * @param shopId 店铺id
     * @param userId 用户id
     */
    void checkDiscount(Long shopId, Long userId,  Long orderId, BigDecimal amount);

    /**
     * 修改记录状态
     * @param shopUserId 店铺用户id
     * @param orderId 订单id
     * @param amount 减免金额
     */
    void useDiscount(Long shopUserId, Long orderId, BigDecimal amount);

    boolean isNewUser(ShopUser shopUser, Long shopId);
}
