Documentation ¶
Index ¶
- type CapitalRate
- type Finder
- type Item
- type Persister
- type Wallet
- func (w *Wallet) AddBankAccount(ba *bank.Account) error
- func (w *Wallet) AddOperation(o *operation.Operation) error
- func (w *Wallet) AddTrade(n int, o *operation.Operation) error
- func (w *Wallet) CurrentCapitalRate() CapitalRate
- func (w *Wallet) DecreaseInvestment(v mm.Value)
- func (w *Wallet) DividendGrossProjectedNextMonth() mm.Value
- func (w *Wallet) DividendGrossProjectedNextYear() mm.Value
- func (w *Wallet) DividendNetProjectedNextMonth(retention float64) mm.Value
- func (w *Wallet) DividendNetProjectedNextYear(retention float64) mm.Value
- func (w *Wallet) FreeMargin() mm.Value
- func (w *Wallet) IncreaseInvestment(v mm.Value)
- func (w *Wallet) Margin() mm.Value
- func (w *Wallet) NetBenefits() mm.Value
- func (w *Wallet) NetCapital() mm.Value
- func (w *Wallet) PercentageBenefits() float64
- func (w *Wallet) SetCapitalRate(capitalRate CapitalRate)
- func (w *Wallet) UpdateCapital(v mm.Value)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CapitalRate ¶
type Finder ¶
type Finder interface { FindByName(name string) (*Wallet, error) FindByBankAccount(ba *bank.Account) (*Wallet, error) LoadBankAccounts(w *Wallet) error FindWithItemByStock(stk *stock.Stock) ([]*Wallet, error) LoadActiveItems(w *Wallet) error LoadInactiveItems(w *Wallet) error LoadAllItems(w *Wallet) error LoadItemByStock(w *Wallet, stk *stock.Stock) error LoadItemOperations(i *Item) error LoadActiveTrades(w *Wallet) error LoadTradeItemOperations(i *Item) error }
type Item ¶
type Item struct { ID uuid.UUID Stock *stock.Stock Amount int Invested mm.Value Dividend mm.Value Buys mm.Value Sells mm.Value CapitalRate float64 Operations []*operation.Operation Trades map[int]*trade.Trade DividendRetention mm.Value }
func (*Item) NetBenefits ¶
func (i *Item) NetBenefits() mm.Value
func (*Item) PercentageBenefits ¶
func (*Item) PercentageInvestedRepresented ¶
func (*Item) WeightedAveragePrice ¶
func (i *Item) WeightedAveragePrice() mm.Value
type Wallet ¶
type Wallet struct { ID uuid.UUID Name string URL string BankAccounts map[uuid.UUID]*bank.Account // stocks in trade Items map[uuid.UUID]*Item // inital capital Invested mm.Value // capital (sum of all wallet item capital) Capital mm.Value Funds mm.Value Operations []*operation.Operation Dividend mm.Value Commission mm.Value Connection mm.Value Interest mm.Value Trades map[int]*trade.Trade // contains filtered or unexported fields }
func (*Wallet) CurrentCapitalRate ¶
func (w *Wallet) CurrentCapitalRate() CapitalRate
func (*Wallet) DecreaseInvestment ¶
func (w *Wallet) DecreaseInvestment(v mm.Value)
func (*Wallet) DividendGrossProjectedNextMonth ¶
func (w *Wallet) DividendGrossProjectedNextMonth() mm.Value
func (*Wallet) DividendGrossProjectedNextYear ¶
func (w *Wallet) DividendGrossProjectedNextYear() mm.Value
func (*Wallet) DividendNetProjectedNextMonth ¶
func (*Wallet) DividendNetProjectedNextYear ¶
func (*Wallet) FreeMargin ¶
func (w *Wallet) FreeMargin() mm.Value
func (*Wallet) IncreaseInvestment ¶
func (w *Wallet) IncreaseInvestment(v mm.Value)
func (*Wallet) NetBenefits ¶
func (w *Wallet) NetBenefits() mm.Value
func (*Wallet) NetCapital ¶
func (w *Wallet) NetCapital() mm.Value
func (*Wallet) PercentageBenefits ¶
func (*Wallet) SetCapitalRate ¶
func (w *Wallet) SetCapitalRate(capitalRate CapitalRate)
func (*Wallet) UpdateCapital ¶
func (w *Wallet) UpdateCapital(v mm.Value)
Click to show internal directories.
Click to hide internal directories.