package com.bonus.core.marketing.v2.rule.price.handler.subsidyfixed.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.subsidyfixed.dto.PriceSubsidyFixedDTO;

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

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