api

package
v0.0.0-...-4420375 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package api exposes a programmatic, low-level, read-only interface to a MoneyWell document, itself a Core Data SQLite database.

This project is in no way affiliated with No Thirst Software.

Index

Constants

View Source
const (
	ActivityTypeFavourites   = 4
	ActivityTypeSpendingPlan = 6
	ActivityTypeTransactions = 7
)
View Source
const (
	BucketGroupTypeIncome  = 1
	BucketGroupTypeExpense = 2
)
View Source
const (
	RecurrenceTypeDaily   = 0
	RecurrenceTypeWeekly  = 1
	RecurrenceTypeMonthly = 2
	RecurrenceTypeYearly  = 3

	WeekNumberNone   = 0
	WeekNumberFirst  = 1
	WeekNumberSecond = 2
	WeekNumberThird  = 3
	WeekNumberFourth = 4
	WeekNumberLast   = -1

	DayOfTheWeekNone       = 0
	DayOfTheWeekSunday     = 1
	DayOfTheWeekMonday     = 2
	DayOfTheWeekTuesday    = 3
	DayOfTheWeekWednesday  = 4
	DayOfTheWeekThursday   = 5
	DayOfTheWeekFriday     = 6
	DayOfTheWeekSaturday   = 7
	DayOfTheWeekDay        = -1
	DayOfTheWeekWeekday    = -2
	DayOfTheWeekWeekendday = -3
)
View Source
const (
	TransactionTypeDeposit    = 0
	TransactionTypeWithdrawal = 1
	TransactionTypeCheck      = 2
)
View Source
const (
	TransactionStatusNone       = -1
	TransactionStatusVoided     = 0
	TransactionStatusReconciled = 1
	TransactionStatusCleared    = 2
	TransactionStatusOpen       = 3
	TransactionStatusPending    = 4
)

Variables

This section is empty.

Functions

func DescribeFillRecurrenceRule

func DescribeFillRecurrenceRule(recurrenceRule RecurrenceRule) string

func DescribeRecurrenceRule

func DescribeRecurrenceRule(recurrenceRule RecurrenceRule) string

func GetAccountBalance

func GetAccountBalance(account Account, transactions []Transaction) money.Money

GetAccountBalance uses the given transactions to compute the balance of an account at the given time.

func GetAccountGroupsMap

func GetAccountGroupsMap(database *sql.DB) (map[int64]AccountGroup, error)

func GetAccountsMap

func GetAccountsMap(database *sql.DB) (map[int64]Account, error)

GetAccountsMap gets a map from the account primary key to the account.

func GetBucketBalance

func GetBucketBalance(bucket Bucket, events []Event, settings Settings) (money.Money, error)

GetBucketBalance uses the given events to compute the current balance of a bucket.

func GetBucketGroupsMap

func GetBucketGroupsMap(database *sql.DB) (map[int64]BucketGroup, error)

func GetBucketsMap

func GetBucketsMap(database *sql.DB) (map[int64]Bucket, error)

GetBucketsMap gets a map from the bucket primary key to the bucket.

func GetRecurrenceRulesMap

func GetRecurrenceRulesMap(database *sql.DB) (map[int64]RecurrenceRule, error)

GetRecurrenceRulesMap gets a map from the bucket primary key to the bucket.

func GetTagTransactionMap

func GetTagTransactionMap(database *sql.DB) (map[int64][]int64, error)

GetTagTransactionMap fetches a map from tag to a set of transactions.

func GetTagsMap

func GetTagsMap(database *sql.DB) (map[int64]Tag, error)

GetTagsMap gets a map from the tag primary key to the tag.

func GetTransactionTagMap

func GetTransactionTagMap(database *sql.DB) (map[int64][]int64, error)

GetTransactionTagMap fetches a map from transaction to a set of tags.

func OpenDocument

func OpenDocument(moneywellPath string) (*sql.DB, error)

OpenDocument opens the given MoneyWell document and returns an interface to the SQLite database therein.

Types

type Account

type Account struct {
	PrimaryKey        int64
	Name              string
	Balance           money.Money
	IsBucketOptional  bool
	IncludeInCashFlow bool
	CurrencyCode      string
	AccountGroup      int64
}

Account represents an cash account, savings account, chequing account, line of credit, credit card or other type of account in a MoneyWell document. An account correlates 1:1 with a record in the ZACCOUNT table. Not all columns are exported.

The MoneyWell SQLite schema for the ZACCOUNT table is as follows:

> .schema ZACCOUNT
CREATE TABLE ZACCOUNT (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZALLOWAUTORECONCILE INTEGER,
    ZALLOWONLINEBANKING INTEGER,
    ZALLOWONLINEBILLPAY INTEGER,
    ZBALANCEDATEYMD INTEGER,
    ZINCLUDEINCASHFLOW INTEGER,
    ZINCLUDEINNETWORTH INTEGER,
    ZINTRODUCTORYDATEYMD INTEGER,
    ZISBUCKETOPTIONAL INTEGER,
    ZISDEBT INTEGER,
    ZISHIDDEN INTEGER,
    ZISSELECTED INTEGER,
    ZISTAXDEFERRED INTEGER,
    ZONLINEAVAILABLEDATEYMD INTEGER,
    ZONLINEENDDATEYMD INTEGER,
    ZONLINELEDGERDATEYMD INTEGER,
    ZONLINESTARTDATEYMD INTEGER,
    ZSEQUENCE INTEGER,
    ZSTARTINGDATEYMD INTEGER,
    ZTYPE INTEGER,
    ZACCOUNTGROUP INTEGER,
    ZONLINECONNECTION INTEGER,
    ZBALANCE DECIMAL,
    ZCREDITLIMIT DECIMAL,
    ZINTERESTRATE DECIMAL,
    ZINTRODUCTORYRATE DECIMAL,
    ZMINIMUMBALANCE DECIMAL,
    ZONLINEAVAILABLEBALANCE DECIMAL,
    ZONLINELEDGERBALANCE DECIMAL,
    ZACCOUNTNUMBER VARCHAR,
    ZCURRENCYCODE VARCHAR,
    ZIMPORTFORMAT VARCHAR,
    ZMEMO VARCHAR,
    ZNAME VARCHAR,
    ZROUTINGNUMBER VARCHAR,
    ZTICDSSYNCID VARCHAR,
    ZUNIQUEID VARCHAR
);

func GetAccounts

func GetAccounts(database *sql.DB) ([]Account, error)

GetAccounts fetches the set of accounts in a MoneyWell document, sorted by the display order as MoneyWell itself would render.

type AccountGroup

type AccountGroup struct {
	PrimaryKey int64
	Name       string
}

AccountGroup represents an account group in a MoneyWell document. An account group correlates 1:1 with a record in the ZACCOUNTGROUP table. Not all columns are exported.

The MoneyWell SQLite schema for the ZACCOUNTGROUP table is as follows:

> .schema ZACCOUNTGROUP
CREATE TABLE ZACCOUNTGROUP (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZSEQUENCE INTEGER,
    ZNAME VARCHAR,
    ZTICDSSYNCID VARCHAR,
    ZUNIQUEID VARCHAR
);

func GetAccountGroups

func GetAccountGroups(database *sql.DB) ([]AccountGroup, error)

GetAccountGroups fetches the set of accounts in a MoneyWell document, sorted by the display order as MoneyWell itself would render.

type Bucket

type Bucket struct {
	PrimaryKey      int64
	Type            int64
	BucketGroup     int64
	Name            string
	StartingBalance money.Money
	CurrencyCode    string
}

Bucket represents an income or expense bucket in a MoneyWell document. A bucket correlates 1:1 with a record in the ZBUCKET table. Not all columns are exported.

The MoneyWell SQLite schema for the ZBUCKET table is as follows:

> .schema ZBUCKET
CREATE TABLE ZBUCKET (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZINCLUDEINAUTOFILL INTEGER,
    ZISHIDDEN INTEGER,
    ZISSELECTED INTEGER,
    ZISTAXRELATED INTEGER,
    ZSEQUENCE INTEGER,
    ZTYPE INTEGER,
    ZBUCKETGROUP INTEGER,
    ZOVERFLOWBUCKET INTEGER,
    ZSOURCEBUCKET INTEGER,
    ZCURRENCYCODE VARCHAR,
    ZMEMO VARCHAR,
    ZNAME VARCHAR,
    ZTICDSSYNCID VARCHAR,
    ZUNIQUEID VARCHAR
);

func GetBuckets

func GetBuckets(database *sql.DB) ([]Bucket, error)

GetBuckets fetches the set of buckets in a MoneyWell document, sorted by the display order as MoneyWell itself would render.

type BucketGroup

type BucketGroup struct {
	PrimaryKey int64
	Type       int64
	Name       string
}

BucketGroup represents an income or expense bucket group in a MoneyWell document. A bucket group correlates 1:1 with a record in the ZBUCKETGROUP table. Not all columns are exported.

The MoneyWell SQLite schema for the ZBUCKETGROUP table is as follows:

> .schema ZBUCKETGROUP
CREATE TABLE ZBUCKETGROUP (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZSEQUENCE INTEGER,
    ZTYPE INTEGER,
    ZNAME VARCHAR,
    ZTICDSSYNCID VARCHAR,
    ZUNIQUEID VARCHAR
);

func GetBucketGroups

func GetBucketGroups(database *sql.DB) ([]BucketGroup, error)

GetBucketGroups fetches the set of bucket groups in a MoneyWell document.

type BucketTransfer

type BucketTransfer struct {
	PrimaryKey   int
	Date         time.Time
	TransferType int
	Amount       money.Money
	Bucket       int64
	TargetBucket int64
}

BucketTransfer represents a transfer between buckets in a MoneyWell document.

The MoneyWell SQLite schema for the ZBUCKETRANSFER table is as follows:

> .schema ZBUCKETTRANSFER {
CREATE TABLE ZBUCKETTRANSFER (
   Z_PK INTEGER PRIMARY KEY,
   Z_ENT INTEGER,
   Z_OPT INTEGER,
   ZDATEYMD INTEGER,
   ZISUSERCREATED INTEGER,
   ZSEQUENCE INTEGER,
   ZTYPE INTEGER,
   ZACCOUNT INTEGER,
   ZBUCKET INTEGER,
   ZEVENT INTEGER,
   ZTRANSFERSIBLING INTEGER,
   ZAMOUNT DECIMAL,
   ZMEMO VARCHAR,
   ZTICDSSYNCID VARCHAR,
   ZUNIQUEID VARCHAR
);

func GetBucketTransfers

func GetBucketTransfers(database *sql.DB) ([]BucketTransfer, error)

GetBucketTransfers fetches the set of bucket transfers in a MoneyWell document.

func (*BucketTransfer) GetAmount

func (bt *BucketTransfer) GetAmount() money.Money

GetAmount implements the Event interface to return the bucket transfer amount.

func (*BucketTransfer) GetBucket

func (bt *BucketTransfer) GetBucket() int64

GetAmount implements the Event interface to return the bucket in question.

func (*BucketTransfer) GetDate

func (bt *BucketTransfer) GetDate() time.Time

GetDate implements the Event interface to return the bucket transfer date.

type ByEventDate

type ByEventDate []Event

func (ByEventDate) Len

func (s ByEventDate) Len() int

func (ByEventDate) Less

func (s ByEventDate) Less(i, j int) bool

func (ByEventDate) Swap

func (s ByEventDate) Swap(i, j int)

type Event

type Event interface {
	GetDate() time.Time
	GetAmount() money.Money
	GetBucket() int64
}

Event abstracts a transaction or bucket transfer in a MoneyWell document.

func GetBucketEvents

func GetBucketEvents(
	bucket Bucket,
	transactions []Transaction,
	bucketTransfers []BucketTransfer,
) ([]Event, error)

GetBucketEvents uses the given transactions and bucket transfers to generate a list of events against the bucket sorted by date, generally matching the display of a bucket in MoneyWell.

type RecurrenceRule

type RecurrenceRule struct {
	PrimaryKey         int64
	EndDate            time.Time
	FirstDayOfTheWeek  int64
	OccurrenceCount    int64
	RecurrenceInterval int64
	RecurrenceType     int64
	DaysOfTheMonth     []int64
	DaysOfTheWeek      []int64
	MonthsOfTheYear    []int64
	OnThe              RecurrenceRuleOnThe
	WeekdaysOfTheMonth []int64
}

func GetRecurrenceRules

func GetRecurrenceRules(database *sql.DB) ([]RecurrenceRule, error)

GetRecurrenceRules fetches the set of recurrence rules in a MoneyWell document.

func (*RecurrenceRule) Equals

func (r *RecurrenceRule) Equals(other *RecurrenceRule) bool

type RecurrenceRuleOnThe

type RecurrenceRuleOnThe struct {
	DayOfTheWeek int64
	WeekNumber   int64
}

RecurrenceRule represents the conditions under which a spending plan event or its corresponding fill event are repeated.

The MoneyWell SQLite schema for the ZRECURRENCERULE table is as follows: > .schema ZRECURRENCERULE CREATE TABLE ZRECURRENCERULE (

Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZENDDATEYMD INTEGER,
ZFIRSTDAYOFTHEWEEK INTEGER,
ZOCCURRENCECOUNT INTEGER,
ZRECURRENCEINTERVAL INTEGER,
ZRECURRENCETYPE INTEGER,
ZACTIVITY INTEGER,
Z5_ACTIVITY INTEGER,
ZEVENT INTEGER,
ZTICDSSYNCID VARCHAR,
ZUNIQUEID VARCHAR,
ZDAYSOFTHEMONTH BLOB,
ZDAYSOFTHEWEEK BLOB,
ZMONTHSOFTHEYEAR BLOB,
ZNTHWEEKDAYSOFTHEMONTH BLOB

);

type RecurrenceRuleSort

type RecurrenceRuleSort []RecurrenceRule

func (RecurrenceRuleSort) Len

func (s RecurrenceRuleSort) Len() int

func (RecurrenceRuleSort) Less

func (s RecurrenceRuleSort) Less(i, j int) bool

func (RecurrenceRuleSort) Swap

func (s RecurrenceRuleSort) Swap(i, j int)

type Settings

type Settings struct {
	PrimaryKey          int64
	CashFlowStartDate   time.Time
	LastFillBucketsDate time.Time
	AttachmentPath      string
}

Settings represents the single row from the ZETTINGS table in a MoneyWell document.

The MoneyWell SQLite schema for the ZSETTINGS table is as follows:

> .schema ZSETTINGS
CREATE TABLE ZSETTINGS (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCASHFLOWSTARTDATEYMD INTEGER,
    ZLASTFILLBUCKETSDATEYMD INTEGER,
    ZATTACHMENTPATH VARCHAR,
    ZTICDSSYNCID VARCHAR
);

func GetSettings

func GetSettings(database *sql.DB) (Settings, error)

GetSettings fetches the settings in a MoneyWell document.

type SpendingPlan

type SpendingPlan struct {
	PrimaryKey         int64
	Date               time.Time
	Name               string
	Amount             money.Money
	Bucket             int64
	RecurrenceRule     int64
	FillRecurrenceRule int64
}

SpendingPlan represents spending plan events associated with a bucket in a MoneyWell document. This is a subset of the ZACTIVITY table, where both transactions, favourite transactions and spending plan amounts are recorded. Not all spending plan columns are exported.

The MoneyWell SQLite schema for the ZACTIVITY table is as follows:

> .schema ZACTIVITY
CREATE TABLE ZACTIVITY (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZDATEYMD INTEGER,
    ZISBUCKETOPTIONAL INTEGER,
    ZISFLAGGED INTEGER,
    ZISLOCKED INTEGER,
    ZSEQUENCE INTEGER,
    ZSOURCE INTEGER,
    ZTYPE INTEGER,
    ZSPLITPARENT INTEGER,
    Z3_SPLITPARENT INTEGER,
    ZTRANSFERACCOUNT INTEGER,
    ZTRANSFERSIBLING INTEGER,
    Z3_TRANSFERSIBLING INTEGER,
    ZARETAGSSAVED INTEGER,
    ZISAMOUNTSAVED INTEGER,
    ZISBUCKETSAVEDINTEGER,
    ZISMEMOSAVED INTEGER,
    ZISTYPESAVED INTEGER,
    ZACCOUNT INTEGER,
    ZBUCKET INTEGER,
    ZGENERATECOUNT INTEGER,
    ZHASVARIABLEAMOUNT INTEGER,
    ZACCOUNT1 INTEGER,
    ZBUCKET1 INTEGER,
    ZRECURRENCERULE INTEGER,
    ZISPERCENTAGE INTEGER,
    ZFILLRECURRENCERULE INTEGER,
    ZSPENDINGPLAN INTEGER,
    ZDATERECONCILEDYMD INTEGER,
    ZISLASTIMPORT INTEGER,
    ZISQUARANTINED INTEGER,
    ZISREPEATING INTEGER,
    ZSPLITINDEX INTEGER,
    ZSTATUS INTEGER,
    ZACCOUNT2 INTEGER,
    ZBUCKET2 INTEGER,
    ZINVESTMENTSECURITYID INTEGER,
    ZDATELASTUSED TIMESTAMP,
    ZLASTGENERATEDDATE TIMESTAMP,
    ZAMOUNT DECIMAL,
    ZCHECKREF DECIMAL,
    ZLOCALIZEDAMOUNT DECIMAL,
    ZSALEAMOUNT DECIMAL,
    ZCOMMISSION DECIMAL,
    ZFEES DECIMAL,
    ZLOCALIZEDAMOUNT1 DECIMAL,
    ZSALEAMOUNT1 DECIMAL,
    ZSHAREPRICE DECIMAL,
    ZSHARES DECIMAL,
    ZSHARESSPLITDENOMINATOR DECIMAL,
    ZSHARESSPLITNUMERATOR DECIMAL,
    ZSPLITTOTAL DECIMAL,
    ZTAXES DECIMAL,
    ZAMOUNTSTRING VARCHAR,
    ZCHECKREFSTRING VARCHAR,
    ZMEMO VARCHAR,
    ZPAYEE VARCHAR,
    ZTICDSSYNCID VARCHAR,
    ZUNIQUEID VARCHAR,
    ZSALECURRENCYCODE VARCHAR,
    ZEXTERNALID VARCHAR,
    ZLOCALIZEDAMOUNTSTRING VARCHAR,
    ZORIGINALMEMO VARCHAR,
    ZORIGINALPAYEE VARCHAR,
    ZRECEIPTFILENAME VARCHAR,
    ZSALEAMOUNTSTRING VARCHAR,
    ZSALECURRENCYCODE1 VARCHAR
);

func GetSpendingPlan

func GetSpendingPlan(database *sql.DB) ([]SpendingPlan, error)

GetSpendingPlan fetches the set of spending plan events in a MoneyWell document.

type Tag

type Tag struct {
	PrimaryKey int64
	Name       string
}

Tag represents a tag annotating a transaction in a MoneyWell document. A tag correlates 1:1 with a record in the ZTAG table. Not all columns are exported.

The MoneyWell SQLite schema for the ZTAG table is as follows:

> .schema ZTAG
CREATE TABLE ZTAG (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZNAME VARCHAR,
    ZTICDSSYNCID VARCHAR
);

func GetTags

func GetTags(database *sql.DB) ([]Tag, error)

GetTags fetches the set of tags in a MoneyWell document.

type Transaction

type Transaction struct {
	PrimaryKey       int64
	Date             time.Time
	TransactionType  int
	Amount           money.Money
	Bucket           int64
	Account          int64
	TransferAccount  int64
	TransferSibling  int64
	SplitParent      int64
	IsSplit          bool
	IsBucketOptional bool
	IsPending        bool
	Status           int
	Payee            string
	Memo             string
}

Transaction represents a transaction in a MoneyWell document. This is a subset of the ZACTIVITY table, where both transactions, favourite transactions and spending plan amounts are recorded. Not all transaction columns are exported.

The MoneyWell SQLite schema for the ZACTIVITY table is as follows:

> .schema ZACTIVITY
CREATE TABLE ZACTIVITY (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZDATEYMD INTEGER,
    ZISBUCKETOPTIONAL INTEGER,
    ZISFLAGGED INTEGER,
    ZISLOCKED INTEGER,
    ZSEQUENCE INTEGER,
    ZSOURCE INTEGER,
    ZTYPE INTEGER,
    ZSPLITPARENT INTEGER,
    Z3_SPLITPARENT INTEGER,
    ZTRANSFERACCOUNT INTEGER,
    ZTRANSFERSIBLING INTEGER,
    Z3_TRANSFERSIBLING INTEGER,
    ZARETAGSSAVED INTEGER,
    ZISAMOUNTSAVED INTEGER,
    ZISBUCKETSAVEDINTEGER,
    ZISMEMOSAVED INTEGER,
    ZISTYPESAVED INTEGER,
    ZACCOUNT INTEGER,
    ZBUCKET INTEGER,
    ZGENERATECOUNT INTEGER,
    ZHASVARIABLEAMOUNT INTEGER,
    ZACCOUNT1 INTEGER,
    ZBUCKET1 INTEGER,
    ZRECURRENCERULE INTEGER,
    ZISPERCENTAGE INTEGER,
    ZFILLRECURRENCERULE INTEGER,
    ZSPENDINGPLAN INTEGER,
    ZDATERECONCILEDYMD INTEGER,
    ZISLASTIMPORT INTEGER,
    ZISQUARANTINED INTEGER,
    ZISREPEATING INTEGER,
    ZSPLITINDEX INTEGER,
    ZSTATUS INTEGER,
    ZACCOUNT2 INTEGER,
    ZBUCKET2 INTEGER,
    ZINVESTMENTSECURITYID INTEGER,
    ZDATELASTUSED TIMESTAMP,
    ZLASTGENERATEDDATE TIMESTAMP,
    ZAMOUNT DECIMAL,
    ZCHECKREF DECIMAL,
    ZLOCALIZEDAMOUNT DECIMAL,
    ZSALEAMOUNT DECIMAL,
    ZCOMMISSION DECIMAL,
    ZFEES DECIMAL,
    ZLOCALIZEDAMOUNT1 DECIMAL,
    ZSALEAMOUNT1 DECIMAL,
    ZSHAREPRICE DECIMAL,
    ZSHARES DECIMAL,
    ZSHARESSPLITDENOMINATOR DECIMAL,
    ZSHARESSPLITNUMERATOR DECIMAL,
    ZSPLITTOTAL DECIMAL,
    ZTAXES DECIMAL,
    ZAMOUNTSTRING VARCHAR,
    ZCHECKREFSTRING VARCHAR,
    ZMEMO VARCHAR,
    ZPAYEE VARCHAR,
    ZTICDSSYNCID VARCHAR,
    ZUNIQUEID VARCHAR,
    ZSALECURRENCYCODE VARCHAR,
    ZEXTERNALID VARCHAR,
    ZLOCALIZEDAMOUNTSTRING VARCHAR,
    ZORIGINALMEMO VARCHAR,
    ZORIGINALPAYEE VARCHAR,
    ZRECEIPTFILENAME VARCHAR,
    ZSALEAMOUNTSTRING VARCHAR,
    ZSALECURRENCYCODE1 VARCHAR
);

func GetTransactions

func GetTransactions(database *sql.DB) ([]Transaction, error)

GetTransactions fetches the set of transactions in a MoneyWell document, sorted by the display order as MoneyWell itself would render (and showing oldest to newest).

func (*Transaction) GetAmount

func (t *Transaction) GetAmount() money.Money

func (*Transaction) GetBucket

func (t *Transaction) GetBucket() int64

func (*Transaction) GetDate

func (t *Transaction) GetDate() time.Time

func (*Transaction) IsTransfer

func (t *Transaction) IsTransfer() bool

type TransactionTag

type TransactionTag struct {
	Transaction int64
	Tag         int64
}

TransactionTag represents a tag assigned to a given transaction in a MoneyWell document. A transaction tag correlates 1:1 with a record in the Z_3TAGS table. Not all columns are exported.

The MoneyWell SQLite schema for the Z_3TAGS table is as follows:

> .schema Z_3ZTAGS
CREATE TABLE Z_3TAGS (
    Z_3ACTIVITIES INTEGER,
    Z_24TAGS INTEGER
);

func GetTransactionTags

func GetTransactionTags(database *sql.DB) ([]TransactionTag, error)

GetTransactionTags fetches the set of transaction tags in a MoneyWell document.

Directories

Path Synopsis
Package money abstracts an amount and currency in a MoneyWell document.
Package money abstracts an amount and currency in a MoneyWell document.

Jump to

Keyboard shortcuts

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