extractor

package
v0.0.0-...-2bd5d0f Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

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