Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
UUID string
Name string
Currency string
Note string
Retired bool
Transactions []AccountTransaction
}
Account represents a cash/deposit account.
type AccountTransaction ¶
type AccountTransaction struct {
UUID string
Type string
Date time.Time
Amount int64 // integer minor units
Currency string
Note string
SecurityRef string // raw reference attribute (resolved to Security pointer)
Security *Security
Units []TxUnit
}
AccountTransaction represents a single transaction within an account.
type Assignment ¶
Assignment links a security to a classification with a weight.
type AttributeType ¶
AttributeType defines a custom attribute type for securities or accounts.
type Classification ¶
type Classification struct {
ID string
Name string
Color string
Weight int
Children []Classification
Assignments []Assignment
}
Classification is a node in the taxonomy tree.
type Client ¶
type Client struct {
Version int
BaseCurrency string
Securities []*Security
Accounts []*Account
Portfolios []*Portfolio
Taxonomies []*Taxonomy
Settings *Settings
}
Client is the root struct representing the Portfolio Performance data file.
type Holding ¶
type Holding struct {
Security *Security
LatestPrice int64 // 0 if unknown
Currency string
Value int64 // 0 if unknown; minor units
}
Holding represents a net share position in a portfolio for a single security.
func ComputeHoldings ¶
ComputeHoldings aggregates net share positions from a portfolio's transactions. It returns one Holding per security that appears in the portfolio. Securities with net shares ≤ 0 are included; callers filter as needed.
type Portfolio ¶
type Portfolio struct {
UUID string
Name string
ReferenceAccount *Account
ReferenceAccountRef string // raw reference string, resolved to ReferenceAccount
Transactions []PortfolioTransaction
}
Portfolio represents a securities portfolio (depot).
type PortfolioTransaction ¶
type PortfolioTransaction struct {
UUID string
Type string
Date time.Time
Amount int64 // integer minor units
Currency string
Note string
SecurityRef string // raw reference attribute (resolved to Security pointer)
Security *Security
Units []TxUnit
}
PortfolioTransaction represents a buy/sell or transfer within a portfolio.
type Security ¶
type Security struct {
UUID string
Name string
Currency string
ISIN string
Ticker string
Feed string
Retired bool
UpdatedAt time.Time
Prices []SecurityPrice
Events []SecurityEvent
}
Security represents a financial security (stock, ETF, bond, etc.).
type SecurityEvent ¶
SecurityEvent represents a corporate action or dividend event.
type SecurityPrice ¶
SecurityPrice represents a price data point for a security.
type Settings ¶
type Settings struct {
Bookmarks []Bookmark
AttributeTypes []AttributeType
}
Settings holds application settings from the portfolio file.
type Shares ¶
type Shares int64
Shares represents a share quantity stored as int64 multiples of 10^8. e.g., 50000000000 = 500 shares.
type Taxonomy ¶
type Taxonomy struct {
ID string
Name string
Root Classification
}
Taxonomy represents a classification taxonomy (e.g., asset allocation, industry).