Skip to content

Commit 4a305ff

Browse files
committed
fix: adds missing automation operator less than, fixes #65
1 parent 616410c commit 4a305ff

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

internal/automation/evaluator.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ func (e *Engine) evaluateRule(rule models.RuleDetail, conversation cmodels.Conve
209209
value1, _ := strconv.Atoi(valueToCompare)
210210
value2, _ := strconv.Atoi(rule.Value)
211211
conditionMet = value1 > value2
212+
case models.RuleOperatorLessThan:
213+
value1, _ := strconv.Atoi(valueToCompare)
214+
value2, _ := strconv.Atoi(rule.Value)
215+
conditionMet = value1 < value2
212216
default:
213217
e.lo.Error("error unrecognized rule logical operator", "operator", rule.Operator)
214218
return false

internal/automation/models/models.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const (
2929
RuleOperatorSet = "set"
3030
RuleOperatorNotSet = "not set"
3131
RuleOperatorGreaterThan = "greater than"
32+
RuleOperatorLessThan = "less than"
3233

3334
RuleTypeNewConversation = "new_conversation"
3435
RuleTypeConversationUpdate = "conversation_update"

0 commit comments

Comments
 (0)