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

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

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