package com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.rules;

import com.iqser.red.service.persistence.service.v1.api.shared.model.RuleFileType;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "Object containing a string of Drools rules.")
public class RulesUploadRequestModel {

    @NonNull
    @Schema(description = "The actual string of rules.")
    private String rules;

    @NonNull
    @Schema(description = "The DossierTemplate Id for these rules")
    private String dossierTemplateId;

    @Schema(description = "The Rule file type of these rules", allowableValues = {"ENTITY", "COMPONENT"})
    private RuleFileType ruleFileType = RuleFileType.ENTITY;

    @Schema(description = "The dry-run parameter if set to true the file is not saved (only the validation results are returned", defaultValue = "false")
    private boolean dryRun;


    public RulesUploadRequestModel(@NonNull String rules, @NonNull String dossierTemplateId, RuleFileType ruleFileType) {

        this.rules = rules;
        this.dossierTemplateId = dossierTemplateId;
        this.ruleFileType = ruleFileType;
        this.dryRun = false;
    }

}
