"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getIntersectionRulExample = exports.getIntersectionRuleEmpty = void 0;
const BooleanDataDefinition_1 = require("@appglue/common/dist/Common/Data/Definitions/BooleanDataDefinition");
const AndGroup_1 = require("@appglue/common/dist/Expressions/Expressions/Logic/AndGroup");
const IsFalse_1 = require("@appglue/common/dist/Expressions/Expressions/Logic/IsFalse");
const IsTrue_1 = require("@appglue/common/dist/Expressions/Expressions/Logic/IsTrue");
const NotExpression_1 = require("@appglue/common/dist/Expressions/Expressions/Logic/NotExpression");
const OrGroup_1 = require("@appglue/common/dist/Expressions/Expressions/Logic/OrGroup");
const StringContainsExpression_1 = require("@appglue/common/dist/Expressions/Expressions/String/StringContainsExpression");
const StringIsNotEmptyExpression_1 = require("@appglue/common/dist/Expressions/Expressions/String/StringIsNotEmptyExpression");
const IntersectionRuleConfiguration_1 = require("@appglue/common/dist/Rule/Intersection/IntersectionRuleConfiguration");
const DataDefinition_1 = require("../DataDefinition");
const getIntersectionRuleEmpty = () => {
    const intersectionRule = new IntersectionRuleConfiguration_1.IntersectionRuleConfiguration();
    intersectionRule.inputData = (0, DataDefinition_1.getTestInputDataDefinition)();
    return intersectionRule;
};
exports.getIntersectionRuleEmpty = getIntersectionRuleEmpty;
const getIntersectionRulExample = () => {
    const intersectionRule = new IntersectionRuleConfiguration_1.IntersectionRuleConfiguration();
    intersectionRule.inputData = (0, DataDefinition_1.getTestInputDataDefinition)();
    let isTrue = new IsTrue_1.IsTrueExpression();
    isTrue.value1.variableName = "exempt";
    intersectionRule.xaxisExpressions[0].expression = isTrue;
    intersectionRule.addXAxisExpression();
    let isFalse = new IsFalse_1.IsFalseExpression();
    isFalse.value1.variableName = "exempt";
    intersectionRule.xaxisExpressions[1].expression = isFalse;
    let orExp = new OrGroup_1.OrGroup();
    isTrue = new IsTrue_1.IsTrueExpression();
    isTrue.value1.variableName = "fullTime";
    orExp.elements[0].subExpression = isTrue;
    orExp.add();
    let textNotEmpty = new StringIsNotEmptyExpression_1.StringIsNotEmptyExpression();
    textNotEmpty.value1.variableName = "benefitsID";
    orExp.elements[1].subExpression = textNotEmpty;
    intersectionRule.yaxisExpressions[0].expression = orExp;
    intersectionRule.addYAxisExpression();
    let andExp = new AndGroup_1.AndGroup();
    isTrue = new IsTrue_1.IsTrueExpression();
    isTrue.value1.variableName = "fullTime";
    andExp.elements[0].subExpression = isTrue;
    andExp.add();
    isTrue = new IsTrue_1.IsTrueExpression();
    isTrue.value1.variableName = "isManager";
    andExp.elements[1].subExpression = isTrue;
    intersectionRule.yaxisExpressions[1].expression = andExp;
    intersectionRule.addYAxisExpression();
    andExp = new AndGroup_1.AndGroup();
    isFalse = new IsFalse_1.IsFalseExpression();
    isFalse.value1.variableName = "fullTime";
    andExp.elements[0].subExpression = isFalse;
    andExp.add();
    let containsExp = new StringContainsExpression_1.StringContainsExpression();
    containsExp.value1.variableName = "benefitsID";
    containsExp.value2.value = "1AC";
    andExp.elements[1].subExpression = containsExp;
    intersectionRule.yaxisExpressions[2].expression = andExp;
    intersectionRule.addYAxisExpression();
    andExp = new AndGroup_1.AndGroup();
    isFalse = new IsFalse_1.IsFalseExpression();
    isFalse.value1.variableName = "fullTime";
    andExp.elements[0].subExpression = isFalse;
    andExp.add();
    containsExp = new StringContainsExpression_1.StringContainsExpression();
    containsExp.value1.variableName = "benefitsID";
    containsExp.value2.value = "1AC";
    let notExp = new NotExpression_1.NotExpression();
    notExp.value1.subExpression = containsExp;
    andExp.elements[1].subExpression = notExp;
    intersectionRule.yaxisExpressions[3].expression = andExp;
    intersectionRule.results[0].setValue(false);
    intersectionRule.results[1].setValue(true);
    intersectionRule.results[2].setValue(true);
    intersectionRule.results[3].setValue(true);
    intersectionRule.results[4].setValue(false);
    intersectionRule.results[5].setValue(true);
    intersectionRule.results[6].setValue(false);
    intersectionRule.results[7].setValue(false);
    intersectionRule.setTypeResults(new BooleanDataDefinition_1.BooleanDataDefinition());
    return intersectionRule;
};
exports.getIntersectionRulExample = getIntersectionRulExample;
//# sourceMappingURL=Intersection.js.map