package com.zioinfo.kintex.rules;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.List;
import java.util.Map;

/**
 * 규정 룰셋 데이터 모델 — compliance-vN.json 역직렬화 대상.
 * 검증 리포트에 {@code rulesetVersion} 을 기록해 감사 추적·면책 근거로 남긴다(PLANNING R2).
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public record ComplianceRuleSet(
        String rulesetVersion,
        String effectiveDate,
        String disclaimer,
        List<Rule> rules
) {

    @JsonIgnoreProperties(ignoreUnknown = true)
    public record Rule(
            String code,
            String group,
            String label,
            List<String> module,
            String severity,      // "block" | "warn"
            String metric,
            String operator,      // lte|gte|between|isTrue|eq|lteHall|excludesAll ...
            Double threshold,
            Double min,
            Double max,
            String unit,
            String requiresDocument,
            Map<String, Double> hallLimits,
            List<String> forbidden
    ) {
    }
}
