wallet

package
v0.0.0-...-38f6076 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const CertificateOfDepositItemType = "certificate-of-deposit"
View Source
const FICFIItemType = "ficfi"
View Source
const FIIItemType = "fiis"
View Source
const StockFundItemType = "stocks-funds"
View Source
const StockItemType = "stocks"
View Source
const TreasuryDirectItemType = "treasury-direct"

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	CNPJ string `json:"CNPJ" bson:"CNPJ"`
	ID   string `json:"id,omitempty" bson:"_id,omitempty"`
	Name string `json:"name" bson:"name" validate:"required"`
	Slug string `json:"slug" bson:"slug" validate:"required"`
}

func (Broker) GetCollectionName

func (s Broker) GetCollectionName() string

func (Broker) GetItemType

func (s Broker) GetItemType() string

type BrokersList

type BrokersList struct {
	Brokers []Broker `json:"brokers" bson:"brokers"`
}

type CertificateOfDeposit

type CertificateOfDeposit struct {
	BrokerSlug        string     `json:"brokerSlug" bson:"brokerSlug" validate:"required"`
	Commission        float64    `json:"commission" bson:"commission"`
	Date              *time.Time `json:"date" bson:"date" validate:"required"`
	DueDate           *time.Time `json:"dueDate" bson:"dueDate" validate:"required"`
	FixedInterestRate float64    `json:"fixedInterestRate" bson:"fixedInterestRate" validate:"required"`
	ID                string     `json:"id,omitempty" bson:"_id,omitempty"`
	ItemType          string     `json:"itemType" bson:"itemType" validate:"required"`
	PortfolioSlug     string     `json:"portfolioSlug" bson:"portfolioSlug" validate:"required"`
	Price             float64    `json:"price" bson:"price" validate:"required"`
	Shares            float64    `json:"shares" bson:"shares" validate:"required"`
	Symbol            string     `json:"symbol" bson:"symbol" validate:"required"`
	Type              string     `json:"type" bson:"type" validate:"required"`
}

func NewCertificateOfDeposit

func NewCertificateOfDeposit() *CertificateOfDeposit

func (CertificateOfDeposit) GetBrokerSlug

func (s CertificateOfDeposit) GetBrokerSlug() string

func (CertificateOfDeposit) GetCollectionName

func (s CertificateOfDeposit) GetCollectionName() string

func (CertificateOfDeposit) GetComission

func (s CertificateOfDeposit) GetComission() float64

func (CertificateOfDeposit) GetItemType

func (s CertificateOfDeposit) GetItemType() string

func (CertificateOfDeposit) GetPrice

func (s CertificateOfDeposit) GetPrice() float64

func (CertificateOfDeposit) GetShares

func (s CertificateOfDeposit) GetShares() float64

func (CertificateOfDeposit) GetType

func (s CertificateOfDeposit) GetType() string

type CertificateOfDepositList

type CertificateOfDepositList []CertificateOfDeposit

type FICFI

type FICFI struct {
	BrokerSlug    string     `json:"brokerSlug" bson:"brokerSlug" validate:"required"`
	Commission    float64    `json:"commission" bson:"commission"`
	Date          *time.Time `json:"date" bson:"date" validate:"required"`
	ID            string     `json:"id,omitempty" bson:"_id,omitempty"`
	ItemType      string     `json:"itemType" bson:"itemType" validate:"required"`
	PortfolioSlug string     `json:"portfolioSlug" bson:"portfolioSlug" validate:"required"`
	Price         float64    `json:"price" bson:"price" validate:"required"`
	Shares        float64    `json:"shares" bson:"shares" validate:"required"`
	Symbol        string     `json:"symbol" bson:"symbol" validate:"required"`
	Type          string     `json:"type" bson:"type" validate:"required"`
}

func NewFICFI

func NewFICFI() *FICFI

func (FICFI) GetBrokerSlug

func (s FICFI) GetBrokerSlug() string

func (FICFI) GetCollectionName

func (s FICFI) GetCollectionName() string

func (FICFI) GetComission

func (s FICFI) GetComission() float64

func (FICFI) GetItemType

func (s FICFI) GetItemType() string

func (FICFI) GetPrice

func (s FICFI) GetPrice() float64

func (FICFI) GetShares

func (s FICFI) GetShares() float64

func (FICFI) GetType

func (s FICFI) GetType() string

type FICFIList

type FICFIList []FICFI

type FII

type FII struct {
	BrokerSlug    string     `json:"brokerSlug" bson:"brokerSlug" validate:"required"`
	Commission    float64    `json:"commission" bson:"commission"`
	Date          *time.Time `json:"date" bson:"date" validate:"required"`
	ID            string     `json:"id,omitempty" bson:"_id,omitempty"`
	ItemType      string     `json:"itemType" bson:"itemType" validate:"required"`
	PortfolioSlug string     `json:"portfolioSlug" bson:"portfolioSlug" validate:"required"`
	Price         float64    `json:"price" bson:"price" validate:"required"`
	Shares        float64    `json:"shares" bson:"shares" validate:"required"`
	Symbol        string     `json:"symbol" bson:"symbol" validate:"required"`
	Type          string     `json:"type" bson:"type" validate:"required"`
}

func NewFII

func NewFII() *FII

func (FII) GetBrokerSlug

func (s FII) GetBrokerSlug() string

func (FII) GetCollectionName

func (s FII) GetCollectionName() string

func (FII) GetComission

func (s FII) GetComission() float64

func (FII) GetItemType

func (s FII) GetItemType() string

func (FII) GetPrice

func (s FII) GetPrice() float64

func (FII) GetShares

func (s FII) GetShares() float64

func (FII) GetType

func (s FII) GetType() string

type FIIList

type FIIList []FII

type OperationsList

type OperationsList []Tradable

type Portfolio

type Portfolio struct {
	CostBasis     float64               `json:"costBasis" bson:"costBasis,omitempty"`
	Gain          float64               `json:"gain" bson:"gain,omitempty"`
	ID            string                `json:"id,omitempty" bson:"_id,omitempty"`
	Items         map[string][]Position `json:"items" bson:"items,omitempty"`
	Name          string                `json:"name" bson:"name" validate:"required"`
	OverallReturn float64               `json:"overallReturn" bson:"overallReturn,omitempty"`
	Slug          string                `json:"slug" bson:"slug" validate:"required"`
}

func (Portfolio) GetCollectionName

func (s Portfolio) GetCollectionName() string

func (Portfolio) GetItemType

func (s Portfolio) GetItemType() string

func (*Portfolio) Recalculate

func (p *Portfolio) Recalculate()

type Position

type Position struct {
	AveragePrice  float64        `json:"averagePrice" bson:"averagePrice"`
	Change        float64        `json:"change" bson:"change"`
	ClosingPrice  float64        `json:"closingPrice" bson:"closingPrice"`
	Commission    float64        `json:"commission" bson:"commission"`
	CostBasis     float64        `json:"costBasis" bson:"costBasis"`
	Gain          float64        `json:"gain" bson:"gain"`
	ItemType      string         `json:"itemType" bson:"itemType"`
	LastPrice     float64        `json:"lastPrice" bson:"lastPrice"`
	LastYearHigh  float64        `json:"lastYearHigh" bson:"lastYearHigh"`
	LastYearLow   float64        `json:"lastYearLow" bson:"lastYearLow"`
	Name          string         `json:"name" bson:"name"`
	Operations    OperationsList `json:"operations" bson:"operations"`
	OverallReturn float64        `json:"overallReturn" bson:"overallReturn"`
	Sector        string         `json:"sector" bson:"sector"`
	Segment       string         `json:"segment" bson:"segment"`
	Shares        float64        `json:"shares" bson:"shares"`
	SubSector     string         `json:"subSector" bson:"subSector"`
	Symbol        string         `json:"symbol" bson:"symbol" validate:"required"`
}

func (*Position) Recalculate

func (pi *Position) Recalculate()

type Queryable

type Queryable interface {
	GetCollectionName() string
	GetItemType() string
}

type Stock

type Stock struct {
	BrokerSlug    string     `json:"brokerSlug" bson:"brokerSlug" validate:"required"`
	Commission    float64    `json:"commission" bson:"commission"`
	Date          *time.Time `json:"date" bson:"date" validate:"required"`
	ID            string     `json:"id,omitempty" bson:"_id,omitempty"`
	ItemType      string     `json:"itemType" bson:"itemType" validate:"required"`
	PortfolioSlug string     `json:"portfolioSlug" bson:"portfolioSlug" validate:"required"`
	Price         float64    `json:"price" bson:"price" validate:"required"`
	Shares        float64    `json:"shares" bson:"shares" validate:"required"`
	Symbol        string     `json:"symbol" bson:"symbol" validate:"required"`
	Type          string     `json:"type" bson:"type" validate:"required"`
}

func NewStock

func NewStock() *Stock

func (Stock) GetBrokerSlug

func (s Stock) GetBrokerSlug() string

func (Stock) GetCollectionName

func (s Stock) GetCollectionName() string

func (Stock) GetComission

func (s Stock) GetComission() float64

func (Stock) GetItemType

func (s Stock) GetItemType() string

func (Stock) GetPrice

func (s Stock) GetPrice() float64

func (Stock) GetShares

func (s Stock) GetShares() float64

func (Stock) GetType

func (s Stock) GetType() string

type StockFund

type StockFund struct {
	BrokerSlug    string     `json:"brokerSlug" bson:"brokerSlug" validate:"required"`
	Commission    float64    `json:"commission" bson:"commission"`
	Date          *time.Time `json:"date" bson:"date" validate:"required"`
	ID            string     `json:"id,omitempty" bson:"_id,omitempty"`
	ItemType      string     `json:"itemType" bson:"itemType" validate:"required"`
	PortfolioSlug string     `json:"portfolioSlug" bson:"portfolioSlug" validate:"required"`
	Price         float64    `json:"price" bson:"price" validate:"required"`
	Shares        float64    `json:"shares" bson:"shares" validate:"required"`
	Symbol        string     `json:"symbol" bson:"symbol" validate:"required"`
	Type          string     `json:"type" bson:"type" validate:"required"`
}

func NewStockFund

func NewStockFund() *StockFund

func (StockFund) GetBrokerSlug

func (s StockFund) GetBrokerSlug() string

func (StockFund) GetCollectionName

func (s StockFund) GetCollectionName() string

func (StockFund) GetComission

func (s StockFund) GetComission() float64

func (StockFund) GetItemType

func (s StockFund) GetItemType() string

func (StockFund) GetPrice

func (s StockFund) GetPrice() float64

func (StockFund) GetShares

func (s StockFund) GetShares() float64

func (StockFund) GetType

func (s StockFund) GetType() string

type StockFundList

type StockFundList []StockFund

type StockList

type StockList []Stock

type Tradable

type Tradable interface {
	GetPrice() float64
	GetShares() float64
	GetComission() float64
	GetType() string
	GetBrokerSlug() string
}

type TreasuryDirect

type TreasuryDirect struct {
	BrokerSlug string     `json:"brokerSlug" bson:"brokerSlug" validate:"required"`
	Commission float64    `json:"commission" bson:"commission"`
	Date       *time.Time `json:"date" bson:"date" validate:"required"`
	//DueDate           *time.Time `json:"dueDate" bson:"dueDate" validate:"required"`
	FixedInterestRate float64 `json:"fixedInterestRate" bson:"fixedInterestRate" validate:"required"`
	ID                string  `json:"id,omitempty" bson:"_id,omitempty"`
	ItemType          string  `json:"itemType" bson:"itemType" validate:"required"`
	PortfolioSlug     string  `json:"portfolioSlug" bson:"portfolioSlug" validate:"required"`
	Price             float64 `json:"price" bson:"price" validate:"required"`
	Shares            float64 `json:"shares" bson:"shares" validate:"required"`
	Symbol            string  `json:"symbol" bson:"symbol" validate:"required"`
	Type              string  `json:"type" bson:"type" validate:"required"`
}

func NewTreasuryDirect

func NewTreasuryDirect() *TreasuryDirect

func (TreasuryDirect) GetBrokerSlug

func (s TreasuryDirect) GetBrokerSlug() string

func (TreasuryDirect) GetCollectionName

func (s TreasuryDirect) GetCollectionName() string

func (TreasuryDirect) GetComission

func (s TreasuryDirect) GetComission() float64

func (TreasuryDirect) GetItemType

func (s TreasuryDirect) GetItemType() string

func (TreasuryDirect) GetPrice

func (s TreasuryDirect) GetPrice() float64

func (TreasuryDirect) GetShares

func (s TreasuryDirect) GetShares() float64

func (TreasuryDirect) GetType

func (s TreasuryDirect) GetType() string

type TreasuryDirectList

type TreasuryDirectList []TreasuryDirect

Jump to

Keyboard shortcuts

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