Documentation ¶
Index ¶
- Constants
- Variables
- type AffixIncomeRecord
- type BankAccountConfig
- type BankHistoryConfig
- type BankHistoryRecord
- type BankRecord
- type BillHistoryConfig
- type BillHistoryRecord
- type BillRecord
- type BillsConfig
- type CCField
- type CCFieldMap
- type CardHistoryRecord
- type CreditCardConfig
- type CreditCardHistoryConfig
- type CreditCardRecord
- type FieldMap
- type IncomeConfig
- type IncomeHistoryConfig
- type IncomeHistoryRecord
- type IncomeRecord
- type MonthRecord
- type Period
- type QueryMap
- type SqliteDb
- func (sdb SqliteDb) AffixIncome(historyID int, name string, amount lib.Currency)
- func (sdb SqliteDb) Close()
- func (sdb SqliteDb) CreateBankAccount(config BankAccountConfig)
- func (sdb SqliteDb) CreateBankAccountHistory(config BankHistoryConfig)
- func (sdb SqliteDb) CreateBillHistory(cfg BillHistoryConfig)
- func (sdb SqliteDb) CreateCreditCard(config CreditCardConfig)
- func (sdb SqliteDb) CreateCreditCardHistory(config CreditCardHistoryConfig)
- func (sdb SqliteDb) CreateIncome(config IncomeConfig) int64
- func (sdb SqliteDb) CreateIncomeHistory(config IncomeHistoryConfig)
- func (sdb SqliteDb) CreateMonth(t time.Time)
- func (sdb SqliteDb) CreateNewBill(cfg BillsConfig)
- func (sdb SqliteDb) CreateTransfer(td TransferConfig)
- func (sdb SqliteDb) InsertInto(t Table, values ...any) string
- func (sdb SqliteDb) QueryAffixIncome(qm QueryMap) ([]AffixIncomeRecord, error)
- func (sdb SqliteDb) QueryBankAccountHistory(qm QueryMap) ([]BankHistoryRecord, error)
- func (sdb SqliteDb) QueryBankAccounts(qm QueryMap, password *string) ([]BankRecord, error)
- func (sdb SqliteDb) QueryBillHistory(qm QueryMap) ([]BillHistoryRecord, error)
- func (sdb SqliteDb) QueryBills(qm QueryMap) ([]BillRecord, error)
- func (sdb SqliteDb) QueryCreditCardHistory(qm QueryMap) ([]CardHistoryRecord, error)
- func (sdb SqliteDb) QueryCreditCards(qm QueryMap, password *string) ([]CreditCardRecord, error)
- func (sdb SqliteDb) QueryIncome(qm QueryMap) ([]IncomeRecord, error)
- func (sdb SqliteDb) QueryIncomeHistory(qm QueryMap) ([]IncomeHistoryRecord, error)
- func (sdb SqliteDb) QueryMonths(qm QueryMap) ([]MonthRecord, error)
- func (sdb SqliteDb) QueryTransfers(qm QueryMap) ([]TransferRecord, error)
- func (sdb SqliteDb) SetCreditCardHistory(historyID int, fieldMap CCFieldMap) error
- func (sdb SqliteDb) SetIncome(id int, amount lib.Currency)
- type Table
- type TableFields
- type TransferConfig
- type TransferRecord
- type TransferType
- type WhereFlag
Constants ¶
View Source
const ( WITHDRAWAL = TransferType("withdrawal") DEPOSIT = TransferType("deposit") MOVE = TransferType("move") )
View Source
const ( CC_BALANCE = CCField("balance") CC_LIMIT = CCField("credit_limit") CC_PAID_AMOUNT = CCField("paid_amount") CC_PAID_DAY = CCField("paid_day") CC_DUE_DAY = CCField("due_day") )
View Source
const ( MONTHS = Table("months") INCOME = Table("income") INCOME_HISTORY = Table("income_history") INCOME_AFFIXES = Table("income_affixes") BANK_ACCOUNTS = Table("bank_accounts") BANK_ACCOUNT_HISTORY = Table("bank_account_history") TRANSFERS = Table("transfers") CREDIT_CARDS = Table("credit_cards") CREDIT_CARD_HISTORY = Table("credit_card_history") BILLS = Table("bills") BILL_HISTORY = Table("bill_history") )
View Source
const ( WHERE_ID = WhereFlag(1 << iota) WHERE_NAME WHERE_AMOUNT WHERE_BALANCE WHERE_YEAR WHERE_MONTH WHERE_MONTH_ID WHERE_BANK_ACCOUNT_ID WHERE_INCOME_ID WHERE_INCOME_HISTORY_ID WHERE_CREDIT_CARD_ID WHERE_BILL_ID )
View Source
const ( YEARLY = Period("yearly") MONTHLY = Period("monthly") WEEKLY = Period("weekly") BIWEEKLY = Period("biweekly") )
Variables ¶
View Source
var ( ErrForeignKey = fmt.Errorf("foreign key failed validation") ErrDueDayInvalid = fmt.Errorf("failed to validate due_day constraint") ErrTransferTypeInvalid = fmt.Errorf("failed to valid transfer_type constraint") ErrAmountInvalid = fmt.Errorf("failed to validate amount constraint") ErrMonthInvalid = fmt.Errorf("failed to validate month constraint") ErrUniqueName = fmt.Errorf("failed unique 'name' constraint requirement") )
View Source
var ErrDirtyDate = fmt.Errorf("not a clean date")
View Source
var WhereFieldMap = map[WhereFlag]string{ WHERE_ID: "id", WHERE_NAME: "name", WHERE_AMOUNT: "amount", WHERE_BALANCE: "balance", WHERE_YEAR: "year", WHERE_MONTH: "month", WHERE_MONTH_ID: "month_id", WHERE_BANK_ACCOUNT_ID: "bank_account_id", WHERE_INCOME_ID: "income_id", WHERE_INCOME_HISTORY_ID: "income_history_id", WHERE_CREDIT_CARD_ID: "credit_card_id", WHERE_BILL_ID: "bill_id", }
Functions ¶
This section is empty.
Types ¶
type AffixIncomeRecord ¶
type BankAccountConfig ¶
type BankHistoryConfig ¶
type BankHistoryRecord ¶
type BillHistoryConfig ¶
type BillHistoryRecord ¶
type BillHistoryRecord struct { ID int BillHistoryConfig }
type BillRecord ¶
type BillRecord struct { ID int BillsConfig }
type BillsConfig ¶
type CCFieldMap ¶
type CardHistoryRecord ¶
type CardHistoryRecord struct { ID int CreditCardID int MonthID int Balance lib.Currency CreditLimit *lib.Currency PaidAmount lib.Currency PaidDay *int DueDay int Period Period }
func (CardHistoryRecord) String ¶
func (chr CardHistoryRecord) String() string
type CreditCardConfig ¶
type CreditCardHistoryConfig ¶
type CreditCardRecord ¶
type CreditCardRecord struct { ID int Name string DueDay int CreditLimit *lib.Currency CardNumber *string LastFourDigits string Notes *string }
func (CreditCardRecord) String ¶
func (cr CreditCardRecord) String() string
type IncomeHistoryConfig ¶
type IncomeHistoryRecord ¶
type IncomeHistoryRecord struct { ID int IncomeHistoryConfig }
func (IncomeHistoryRecord) String ¶
func (ih IncomeHistoryRecord) String() string
type IncomeRecord ¶
type IncomeRecord struct { ID int IncomeConfig }
type MonthRecord ¶
type SqliteDb ¶
type SqliteDb struct {
// contains filtered or unexported fields
}
func NewSqliteDb ¶
func NewSqliteDb(filePath string, cc lib.CurrencyCode) *SqliteDb
func (SqliteDb) AffixIncome ¶
AffixIncome tracks an appended amount to an existing income. This could be a bonus or overtime amount.
func (SqliteDb) CreateBankAccount ¶
func (sdb SqliteDb) CreateBankAccount(config BankAccountConfig)
func (SqliteDb) CreateBankAccountHistory ¶
func (sdb SqliteDb) CreateBankAccountHistory(config BankHistoryConfig)
func (SqliteDb) CreateBillHistory ¶
func (sdb SqliteDb) CreateBillHistory(cfg BillHistoryConfig)
func (SqliteDb) CreateCreditCard ¶
func (sdb SqliteDb) CreateCreditCard(config CreditCardConfig)
func (SqliteDb) CreateCreditCardHistory ¶
func (sdb SqliteDb) CreateCreditCardHistory(config CreditCardHistoryConfig)
func (SqliteDb) CreateIncome ¶
func (sdb SqliteDb) CreateIncome(config IncomeConfig) int64
func (SqliteDb) CreateIncomeHistory ¶
func (sdb SqliteDb) CreateIncomeHistory(config IncomeHistoryConfig)
func (SqliteDb) CreateMonth ¶
func (SqliteDb) CreateNewBill ¶
func (sdb SqliteDb) CreateNewBill(cfg BillsConfig)
func (SqliteDb) CreateTransfer ¶
func (sdb SqliteDb) CreateTransfer(td TransferConfig)
func (SqliteDb) QueryAffixIncome ¶
func (sdb SqliteDb) QueryAffixIncome(qm QueryMap) ([]AffixIncomeRecord, error)
func (SqliteDb) QueryBankAccountHistory ¶
func (sdb SqliteDb) QueryBankAccountHistory(qm QueryMap) ([]BankHistoryRecord, error)
func (SqliteDb) QueryBankAccounts ¶
func (sdb SqliteDb) QueryBankAccounts(qm QueryMap, password *string) ([]BankRecord, error)
func (SqliteDb) QueryBillHistory ¶
func (sdb SqliteDb) QueryBillHistory(qm QueryMap) ([]BillHistoryRecord, error)
func (SqliteDb) QueryBills ¶
func (sdb SqliteDb) QueryBills(qm QueryMap) ([]BillRecord, error)
func (SqliteDb) QueryCreditCardHistory ¶
func (sdb SqliteDb) QueryCreditCardHistory(qm QueryMap) ([]CardHistoryRecord, error)
func (SqliteDb) QueryCreditCards ¶
func (sdb SqliteDb) QueryCreditCards( qm QueryMap, password *string, ) ([]CreditCardRecord, error)
func (SqliteDb) QueryIncome ¶
func (sdb SqliteDb) QueryIncome(qm QueryMap) ([]IncomeRecord, error)
func (SqliteDb) QueryIncomeHistory ¶
func (sdb SqliteDb) QueryIncomeHistory(qm QueryMap) ([]IncomeHistoryRecord, error)
func (SqliteDb) QueryMonths ¶
func (sdb SqliteDb) QueryMonths(qm QueryMap) ([]MonthRecord, error)
func (SqliteDb) QueryTransfers ¶
func (sdb SqliteDb) QueryTransfers(qm QueryMap) ([]TransferRecord, error)
func (SqliteDb) SetCreditCardHistory ¶
func (sdb SqliteDb) SetCreditCardHistory(historyID int, fieldMap CCFieldMap) error
type TableFields ¶
type TransferConfig ¶
type TransferRecord ¶
type TransferRecord struct { TransferConfig ID int }
type TransferType ¶
type TransferType string
Click to show internal directories.
Click to hide internal directories.