package com.cloudhandson.vpdbackoffice.domain.masking;

public record ColumnMaskingRule(
    long columnId,
    long objectId,
    String owner,
    String objectName,
    String columnName,
    long ruleId,
    String ruleCode,
    String ruleName,
    String templateCode,
    String ruleEnabledYn
) {

  public String targetLabel() {
    return owner + "." + objectName + "." + columnName;
  }

  public MaskingTemplate template() {
    return MaskingTemplate.from(templateCode);
  }

  public String ruleLabel() {
    return ruleName + " · " + template().label();
  }

  public boolean ruleEnabled() {
    return "Y".equalsIgnoreCase(ruleEnabledYn);
  }
}
