package com.bonus.core.marketing.v2.rule.price.handler.reductiontotal.extension;

import com.alibaba.fastjson.JSONObject;
import com.bonus.core.marketing.v2.rule.price.constants.RulePriceEnum;
import com.bonus.core.marketing.v2.rule.price.handler.RulePriceHandler;
import com.bonus.core.marketing.v2.rule.price.handler.reductiontotal.dto.PriceReductionTotalDTO;

public interface PriceReductionTotalHandlerExtension extends RulePriceHandler {
   default Integer getRuleType() {
      return RulePriceEnum.RULE_REDUCTION_TOTAL.getKey();
   }

   default String checkRuleInfo(String ruleInfo) {
      PriceReductionTotalDTO rule = (PriceReductionTotalDTO)JSONObject.parseObject(ruleInfo, PriceReductionTotalDTO.class);
      return rule.toString();
   }
}
