package com.iqser.red.service.persistence.management.v1.processor.service;

import org.springframework.stereotype.Service;

import com.iqser.red.service.persistence.management.v1.processor.client.redactionservice.RedactionClient;
import com.iqser.red.service.persistence.service.v1.api.shared.model.RuleFileType;
import com.iqser.red.service.redaction.v1.model.DroolsSyntaxValidation;
import com.iqser.red.service.redaction.v1.model.RuleValidationModel;

import lombok.RequiredArgsConstructor;

@Service
@RequiredArgsConstructor
public class RulesValidationService {

    private final RedactionClient redactionServiceClient;


    public DroolsSyntaxValidation validateRules(RuleFileType ruleFileType, String rules) {

        return redactionServiceClient.testRules(new RuleValidationModel(ruleFileType.name(), rules));
    }

}
