rules

package
v0.0.0-...-37de4d1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(txs []domain.Transaction, rules []domain.Rule) []domain.Transaction

Apply runs all rules against each transaction in a single pass. A rule can set Type, Category, or both. First match per field wins. Descriptions are normalized before matching (lowercase, collapsed whitespace).

func Load

func Load(path string) ([]domain.Rule, []string, error)

Load reads the rules file. If the file doesn't exist it creates one with the default category buckets and no rules — ready for the user to populate via the review workflow.

func SaveRule

func SaveRule(path string, r domain.Rule) error

SaveRule saves a rule, updating an existing entry for the same pattern if one exists.

func Uncategorised

func Uncategorised(txs []domain.Transaction, rulesList []domain.Rule) []domain.Transaction

Uncategorised returns one representative transaction per unique description for expense transactions that have no category and are not already acknowledged by any rule.

func UnreviewedTransfers

func UnreviewedTransfers(txs []domain.Transaction, rulesList []domain.Rule) []domain.Transaction

UnreviewedTransfers returns one representative transaction per unique description for transfer transactions not yet acknowledged by any rule.

func ValidateRules

func ValidateRules(rulesList []domain.Rule) error

ValidateRules returns an error if any rule with Regex=true contains an invalid pattern.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL