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

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

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