package com.iformall.service;

import com.iformall.domain.po.WxScoreHistory;
import com.iformall.domain.po.WxScoreRules;
import com.iformall.enums.EnumScoreType;

import java.util.List;

public interface WxScoreRulesService {

    /**
     * 获取租户的ScoreRules
     * @param tenantId
     * @return
     */
    WxScoreRules getScoreRules(String tenantId);

    /**
     * 获取租户的积分规则
     * @param tenantId
     * @return
     */
    WxScoreRules getCreditRules(String tenantId);
    /**
     * 保存或更新实体
     *
     * @param record
     */
    void saveOrUpdate(WxScoreRules record);

    /**
     * 成长值回退
     *
     * @param record
     */
    int cancelScore(WxScoreHistory record);

    /**
     * 增加成长值
     */
    int addScore(EnumScoreType scoreType, Object param);

    /**
     * 增加成长值
     */
    int addScore2(EnumScoreType scoreType, Object param1, Object param2);

    /**
     * 扣减成长值
     */
    int reduceScore(EnumScoreType scoreType, Object param1, Object param2, Object param3);

    List<WxScoreRules> findList(WxScoreRules wxScoreRules);

    void updateCreditLocked(WxScoreRules wxScoreRules);

}
