package com.purui.prims.headless.chat.query.rule.metric;

import com.purui.prims.headless.chat.query.rule.QueryMatchOption;
import org.springframework.stereotype.Component;

import static com.purui.prims.headless.api.pojo.SchemaElementType.DIMENSION;
import static com.purui.prims.headless.api.pojo.SchemaElementType.VALUE;

@Component
public class MetricGroupByQuery extends MetricSemanticQuery {

    public static final String QUERY_MODE = "METRIC_GROUPBY";

    public MetricGroupByQuery() {
        super();
        queryMatcher.addOption(DIMENSION, QueryMatchOption.OptionType.REQUIRED, QueryMatchOption.RequireNumberType.AT_LEAST, 1);
        queryMatcher.addOption(VALUE, QueryMatchOption.OptionType.OPTIONAL, QueryMatchOption.RequireNumberType.AT_LEAST, 0);
    }

    @Override
    public String getQueryMode() {
        return QUERY_MODE;
    }

}
