package com.mcwl.memberCenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.core.page.PageDomain;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.memberCenter.domain.Member;
import com.mcwl.memberCenter.domain.vo.MemberVo;
import com.mcwl.memberCenter.domain.vo.RechargeRecordVO;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

public interface MemberService extends IService<Member> {

    /**
     * 创建用户会员
     *
     * @param userId   用户id
     * @param memberLevelId 会员等级id
     * @param paymentMethod 支付方式
     * @param promotionId 活动id
     * @return 用户会员
     */
    Member createUserMember(Long userId, Long memberLevelId, String paymentMethod, Long promotionId);

    /**
     *
     * @return 获取正常的正在使用的用户会员集合
     */
    List<Member> getUseUserMember();

    /**
     *
     * @return 按用户id获取正常的会员集合
     */
    List<MemberVo> getValidMemberById(Long userId);

    /**
    /**
     * 根据用户id获取正常的正在使用的用户会员
     * @param userId 用户id
     * @return 用户会员
     */
    Member getUseUserMemberByUserId(Long userId);


    Member rechargePoints(Long userId, Double points);

    Member latestSubscription(Long userId);

    /**
     * 消费积分
     * @param consumePoints 消费积分
     */
    void consumePoints(Double consumePoints);

    Double calculatePayment(Double unitPrice, Long promotionId);

    TableDataInfo getRechargePoints(PageDomain pageDomain);
}
