package com.ym.mec.biz.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.ym.mec.biz.dal.entity.MemberRankSetting;
import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
import com.ym.mec.biz.dal.enums.PeriodEnum;
import com.ym.mec.common.service.BaseService;

public interface MemberRankSettingService extends BaseService<Integer, MemberRankSetting> {

	void add(MemberRankSetting memberRankSetting);

	MemberRankSetting getDetail(Integer memberRankSettingId);

	void updateSetting(MemberRankSetting memberRankSetting);

	List<MemberRankSetting> queryListByIsDefault(Boolean isDefault);

	/**
	 * 会员购买
	 * @param userId 会员编号
	 * @param memberRankId 会员等级编号
	 * @param periodEnum 会员周期
	 * @param amount 金额
	 * @param isUseBalance 是否使用余额
	 * @return
	 */
	Map buy(Integer userId, Integer memberRankId, PeriodEnum periodEnum, BigDecimal amount, boolean isUseBalance) throws Exception;
	
	/**
	 * 订单回调
	 * @param studentPaymentOrder
	 * @return
	 */
	boolean orderCallback(StudentPaymentOrder studentPaymentOrder);
}