MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / validateRuleBasics

Method validateRuleBasics

reconciliation.go:1218–1228  ·  view source on GitHub ↗

validateRuleBasics checks that the rule has a valid name and at least one criterion. Parameters: - rule: The rule to validate. Returns an error if the rule is missing required fields.

(rule *model.MatchingRule)

Source from the content-addressed store, hash-verified

1216// - rule: The rule to validate.
1217// Returns an error if the rule is missing required fields.
1218func (s *LedgerForge) validateRuleBasics(rule *model.MatchingRule) error {
1219 if rule.Name == "" {
1220 return errors.New("rule name is required")
1221 }
1222
1223 if len(rule.Criteria) == 0 {
1224 return errors.New("at least one matching criteria is required")
1225 }
1226
1227 return nil
1228}
1229
1230// validateCriteria checks the validity of a criterion, including its field, operator, and drift values.
1231// Parameters:

Callers 1

validateRuleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected