banks

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConverterMap = map[BankAccountType]ConverterFunc{
	// contains filtered or unexported fields
}

ConverterMap maps bank account types to their respective ConverterFunc.

Functions

This section is empty.

Types

type BankAccountType

type BankAccountType string

BankAccountType is an enum for the type of bank accounts.

func InferAccountType

func InferAccountType(account string) (BankAccountType, error)

InferAccountType accepts an account name and infers its type.

type ConverterFunc

type ConverterFunc func(csvContent [][]string) ([]*TransactionDoc, error)

ConverterFunc represents a function that converts CSV bank statements into a list of transaction documents. It can be implemented differently for each bank as per their statement format.

type TransactionDoc

type TransactionDoc struct {
	AccountName string `json:"account_name"`

	Amount    float64   `json:"amount"`
	Timestamp time.Time `json:"timestamp"`

	RefNum      string `json:"bank_ref_num"`
	PaymentMode string `json:"payment_mode"`
	Remarks     string `json:"remarks"`
}

TransactionDoc represents a bank agnostic transaction document.

Jump to

Keyboard shortcuts

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