qfx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package qfx provides processing of QFX files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QFXLoader

type QFXLoader struct {
	// Store stores which fitIds, unique identifier in QFX files,
	// have already been processed.
	Store qfxdb.Store
}

QFXLoader implements the autoimport.Loader interface for QFX files.

func (QFXLoader) Load

func (q QFXLoader) Load(
	accountId int64,
	bankAccountId string,
	r io.Reader,
	startDate time.Time) (autoimport.Batch, error)

type QfxBatch

type QfxBatch struct {
	// Stores the fitIds of imported transactions.
	Store qfxdb.Store

	// The account ID to where entries in this batch will be imported
	AccountId int64

	// The entries to be imported along with their fitIds
	QfxEntries []*QfxEntry
}

QfxBatch implements the autoimport.Batch interface. Although it was written for QFX files, it can be reused for any import file type as long as each transaction has a unique ID like the fitId in QFX files. QfxBatch instances must be treated as immutable.

func (*QfxBatch) Entries

func (q *QfxBatch) Entries() []*fin.Entry

func (*QfxBatch) Len

func (q *QfxBatch) Len() int

func (*QfxBatch) MarkProcessed

func (q *QfxBatch) MarkProcessed(t db.Transaction) error

func (*QfxBatch) SkipProcessed

func (q *QfxBatch) SkipProcessed(t db.Transaction) (autoimport.Batch, error)

type QfxEntry

type QfxEntry struct {
	fin.Entry
	FitId string
}

QfxEntry represents an entry to be imported along with its fitId.

func (*QfxEntry) Check

func (q *QfxEntry) Check() error

Check ensures this instance contains required fields.

Directories

Path Synopsis
Package qfxdb provides the data structures for storing which fitIds have been processed.
Package qfxdb provides the data structures for storing which fitIds have been processed.
fixture
Package fixture provides test suites to test implementations of the qfxdb.Store interface.
Package fixture provides test suites to test implementations of the qfxdb.Store interface.
for_sqlite
Package for_sqlite provides a sqlite implementation for storing processed QFX file fitIds.
Package for_sqlite provides a sqlite implementation for storing processed QFX file fitIds.

Jump to

Keyboard shortcuts

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