models

package
v0.0.0-...-92102cf Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buy

type Buy struct {
	Transaction
	QuantityLeft float64
}

func (Buy) ToProtoModel

func (b Buy) ToProtoModel() stockpb.Buy

type BuySold

type BuySold struct {
	BuyID    string
	Quantity float64
}

func (BuySold) ToProtoModel

func (bs BuySold) ToProtoModel() stockpb.BuySold

type Sell

type Sell struct {
	Transaction
	TaxMethod TaxMethod
	Profit    float64
	CGTProfit float64
	BuysSold  []BuySold
}

func (Sell) ToProtoModel

func (s Sell) ToProtoModel() stockpb.Sell

type StockPosition

type StockPosition struct {
	Ticker     string
	Quantity   float64
	NetSpend   float64
	SoldProfit float64
	CGTProfit  float64
	Buys       []Buy
	Sells      []Sell
}

func (StockPosition) ToProtoModel

func (sp StockPosition) ToProtoModel() stockpb.StockPosition

type StockTax

type StockTax struct {
	FinancialYear   string
	NetProfitCGT    float64
	NetProfitCGTAUD float64
	NetProfit       float64
	NetProfitAUD    float64
	GainsCGT        float64
	GainsCGTAUD     float64
	Gains           float64
	Losses          float64
	Events          []TaxEvent
}

func (StockTax) ToProtoModel

func (st StockTax) ToProtoModel() stockpb.StockTax

type StockTransactions

type StockTransactions struct {
	Ticker       string
	Transactions []Transaction
}

type TaxEvent

type TaxEvent struct {
	Date         time.Time
	Ticker       string
	Profit       float64
	ProfitAUD    float64
	CGTProfit    float64
	CGTProfitAUD float64
}

func (TaxEvent) ToProtoModel

func (te TaxEvent) ToProtoModel() stockpb.TaxEvent

type TaxMethod

type TaxMethod string
var (
	FIFO    TaxMethod = "FIFO"
	LIFO    TaxMethod = "LIFO"
	MaxLoss TaxMethod = "MAX_LOSS"
	MinGain TaxMethod = "MIN_GAIN"
	MinCGT  TaxMethod = "MIN_CGT"
)

func (TaxMethod) ToProtoModel

func (tm TaxMethod) ToProtoModel() stockpb.TaxMethod

type Transaction

type Transaction struct {
	ID           string
	Ticker       string
	Currency     string
	Date         time.Time
	Type         TransactionType
	Quantity     float64
	TradePrice   float64
	RealPrice    float64
	Proceeds     float64
	BrokerageFee float64
	Basis        float64
	BrokerProfit float64
	USDAUD       float64
	Splitfactor  float64
}

func (Transaction) ToProtoModel

func (t Transaction) ToProtoModel() stockpb.Transaction

type TransactionType

type TransactionType string
var (
	Buytype  TransactionType = "BUY"
	Selltype TransactionType = "SELL"
)

func (TransactionType) ToProtoModel

func (tt TransactionType) ToProtoModel() stockpb.TransactionType

Jump to

Keyboard shortcuts

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