models

package
v0.0.0-...-62c273f Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSV

type CSV struct {
	Data     CSVable
	FileName string
}

CSV holds CSV-able data, accompanied by a file name.

type CSVable

type CSVable interface {
	ToCSV() [][]string
}

CSVable provides functionality to convert a struct type to CSV-writable data.

type StatisticsReport

type StatisticsReport struct {
	ClosedTransactions   int
	AcceptedTransactions int
	RejectedTransactions int

	FirstYearAcceptedMonthlyFilings  map[t.Month]int
	SecondYearAcceptedMonthlyFilings map[t.Month]int
}

StatisticsReport holds statistical data formed from Transaction data.

func NewStatisticsReport

func NewStatisticsReport() *StatisticsReport

NewStatisticsReport returns a newly constructed StatisticsReport with default values.

func (*StatisticsReport) ToCSV

func (sr *StatisticsReport) ToCSV() [][]string

ToCSV returns a [][]string version of the data within the StatisticsReport struct provided.

type Transaction

type Transaction struct {
	ID   string          `bson:"_id"`
	Data TransactionData `bson:"data"`
}

Transaction describes a transaction database entity.

type TransactionData

type TransactionData struct {
	Description string                       `bson:"description"`
	Filings     map[string]TransactionFiling `bson:"filings"`
	Links       map[string]string            `bson:"links"`
	Status      string                       `bson:"status"`
	ClosedAt    time.Time                    `bson:"created_at"`
}

TransactionData holds the data of each Transaction.

type TransactionFiling

type TransactionFiling struct {
	Type   string `bson:"type"`
	Status string `bson:"status"`
}

TransactionFiling contains the type and status of a Transactions Filing.

Jump to

Keyboard shortcuts

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