Documentation
¶
Overview ¶
Package extractor provides common transaction extraction logic for email readers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTransactionDetails ¶
func ExtractTransactionDetails( emailBody string, amountRegex, merchantRegex, currencyRegex *regexp.Regexp, receivedTime time.Time, ) *api.TransactionDetails
ExtractTransactionDetails extracts transaction details from an email body using regex patterns.
Amount extraction: group 1 of amountRegex is treated as the raw amount string (commas stripped).
Merchant extraction: the first non-empty capture group of merchantRegex is used, which allows alternation patterns like `at (X) on|Info: (X)\.` where only one branch matches.
Currency extraction: group 1 of currencyRegex is used as the ISO 4217 currency code (e.g. "INR", "USD", "EUR"). If currencyRegex is nil or produces no match, Currency is left empty and store ingestion will apply its own default (currently "INR").
Types ¶
This section is empty.