transaction

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package transaction provides contracts for managing transactions.

Package transaction contains JSON mapping structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BankTransaction added in v0.1.1

type BankTransaction struct {
	ID            string    `json:"id"`
	AccountName   string    `json:"accountName"`
	AccountID     string    `json:"accountId"`
	AccountBank   string    `json:"accountBank"`
	Amount        float64   `json:"amount"`
	Category      string    `json:"category"`
	ReferenceText string    `json:"referenceText"`
	DisplayDate   time.Time `json:"displayDate"`
	PartnerName   string    `json:"partnerName"`
	PartnerID     string    `json:"partnerId"`
	PartnerBank   string    `json:"partnerBank"`
}

BankTransaction represents a bank transaction (not moneylover transaction). This struct holds needed data to create and import transaction to moneylover.

type Finder

type Finder interface {
	// FindAllTransactionsInRange finds all transactions in a time period.
	FindAllTransactionsInRange(ctx context.Context, wallet wallet.Wallet, from time.Time, to time.Time) ([]Transaction, error)
}

Finder is a service to find transactions.

type Transaction

type Transaction struct {
	ID         string            `json:"_id"`              // Required.
	Note       string            `json:"note"`             // Required.
	Account    wallet.Wallet     `json:"account"`          // Required.
	Category   category.Category `json:"category"`         // Required.
	Amount     float64           `json:"amount,omitempty"` // Format: double.
	LastEditBy user.User         `json:"lastEditBy,omitempty"`
	Longitude  float64           `json:"longitude,omitempty"` // Format: float.
	Latitude   float64           `json:"latitude,omitempty"`  // Format: float.
	Address    string            `json:"address,omitempty"`
	// Format: date-time.
	// Required.
	DisplayDate   time.Time `json:"displayDate"`
	Remind        int64     `json:"remind,omitempty"`
	ExcludeReport bool      `json:"exclude_report,omitempty"`
	// Format: date-time.
	// Required.
	CreatedAt time.Time `json:"createdAt"`
}

Transaction structure is generated from "#/components/schemas/Transaction".

Jump to

Keyboard shortcuts

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