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

Method validateField

reconciliation.go:1266–1272  ·  view source on GitHub ↗

validateField checks if the provided field is valid for a matching rule. Parameters: - field: The field to validate. Returns an error if the field is invalid.

(field string)

Source from the content-addressed store, hash-verified

1264// - field: The field to validate.
1265// Returns an error if the field is invalid.
1266func (s *LedgerForge) validateField(field string) error {
1267 validFields := []string{"amount", "date", "description", "reference", "currency"}
1268 if !contains(validFields, field) {
1269 return errors.New("invalid field")
1270 }
1271 return nil
1272}
1273
1274// validateDrift checks the allowable drift for the given field and operator.
1275// Drift refers to acceptable deviations (e.g., percentage for amounts or seconds for dates).

Callers 1

validateCriteriaMethod · 0.95

Calls 1

containsFunction · 0.70

Tested by

no test coverage detected