Skip to content

First UML diagram#5604

Draft
KarlBelow wants to merge 2 commits intoportfolio-performance:masterfrom
KarlBelow:doc/uml
Draft

First UML diagram#5604
KarlBelow wants to merge 2 commits intoportfolio-performance:masterfrom
KarlBelow:doc/uml

Conversation

@KarlBelow
Copy link
Copy Markdown
Contributor

Closes #5603

@KarlBelow KarlBelow marked this pull request as draft March 29, 2026 16:34
@KarlBelow
Copy link
Copy Markdown
Contributor Author

This is just an example how UML documentation with Mermaid could look like.
To be discussed whether this kind of documentation could help to improve maintainability of this project.

@Morpheus1w3
Copy link
Copy Markdown
Contributor

Without warranty.

Image
Image

classDiagram
direction TB

class Client {
  version : int
  baseCurrency : String
  industryTaxonomyId : String
}

class Security {
  uuid : String
  onlineId : String
  name : String
  currencyCode : String
  targetCurrencyCode : String
  isin : String
  tickerSymbol : String
  wkn : String
  calendar : String
  feed : String
  feedURL : String
  latestFeed : String
  latestFeedURL : String
  isRetired : boolean
  updatedAt : Instant
  type : String
  industryClassification : String
}

class Account {
  uuid : String
  name : String
  currencyCode : String
  isRetired : boolean
  updatedAt : Instant
}

class Portfolio {
  uuid : String
  name : String
  isRetired : boolean
  updatedAt : Instant
}

class Watchlist {
  name : String
}

class InvestmentPlan {
  name : String
  autoGenerate : boolean
  start : LocalDateTime
  interval : int
  amount : long
  fees : long
  taxes : long
  type : Type
}

class Taxonomy {
  id : String
  name : String
  source : String
}

class Dashboard {
  id : String
  name : String
}

class Category {
  uuid : String
  name : String
  percentage : int
}

class Classification {
  id : String
  name : String
  description : String
  color : String
  weight : int
  rank : int
}

class Assignment {
  weight : int
}

class SecurityPrice
class LatestSecurityPrice
class SecurityEvent
class SecurityProperty
class Attributes
class ClientSettings

Client "1" o-- "*" Security : securities
Client "1" o-- "*" Watchlist : watchlists
Client "1" o-- "*" Account : accounts
Client "1" o-- "*" Portfolio : portfolios
Client "1" o-- "*" InvestmentPlan : plans
Client "1" o-- "*" Taxonomy : taxonomies
Client "1" o-- "*" Dashboard : dashboards
Client "1" --> "1" ClientSettings : settings
Client "1" --> "1" Category : rootCategory

Security "1" o-- "*" SecurityPrice : prices
Security "1" --> "0..1" LatestSecurityPrice : latest
Security "1" --> "0..1" Attributes : attributes
Security "1" o-- "*" SecurityEvent : events
Security "1" o-- "*" SecurityProperty : properties

Account "1" --> "0..1" Attributes : attributes
Portfolio "1" --> "0..1" Attributes : attributes

Watchlist "*" o-- "*" Security : securities

InvestmentPlan "0..1" --> "1" Security : security
InvestmentPlan "0..1" --> "1" Portfolio : portfolio
InvestmentPlan "0..1" --> "1" Account : account
InvestmentPlan "1" --> "0..1" Attributes : attributes

Portfolio "0..1" --> "1" Account : referenceAccount

Taxonomy "1" --> "1" Classification : root

Classification "0..1" --> "1" Classification : parent
Classification "1" o-- "*" Classification : children
Classification "1" o-- "*" Assignment : assignments
Assignment "*" --> "1" InvestmentVehicle : investmentVehicle

Category "0..1" --> "1" Category : parent
Category "1" o-- "*" Category : children
Category "1" o-- "*" Object : elements
classDiagram
direction TB

class InvestmentVehicle {
  <<interface>>
}

class TransactionOwner~T~ {
  <<interface>>
}

class Annotated {
  <<interface>>
}

class Adaptable {
  <<interface>>
}

class Attributable {
  <<interface>>
}

class Security {
  uuid : String
  name : String
  currencyCode : String
}

class Account {
  uuid : String
  name : String
  currencyCode : String
}

class Portfolio {
  uuid : String
  name : String
  referenceAccount : Account
}

class Transaction {
  <<abstract>>
  uuid : String
  date : LocalDateTime
  currencyCode : String
  amount : long
  shares : long
  note : String
  source : String
  updatedAt : Instant
}

class AccountTransaction {
  type : Type
  exDate : LocalDateTime
}

class PortfolioTransaction {
  type : Type
}

class CrossEntry {
  <<interface>>
}

class BuySellEntry

class AccountTransferEntry

class PortfolioTransferEntry

class Unit {
  type : Type
  amount : Money
  forex : Money
  exchangeRate : BigDecimal
}

class Money {
  currencyCode : String
  amount : long
}

Account ..|> TransactionOwner~AccountTransaction~
Portfolio ..|> TransactionOwner~PortfolioTransaction~

Security ..|> InvestmentVehicle
Account ..|> InvestmentVehicle
Account ..|> Attributable
Portfolio ..|> Attributable

Transaction ..|> Annotated
Transaction ..|> Adaptable

Transaction <|-- AccountTransaction
Transaction <|-- PortfolioTransaction

Account "1" o-- "*" AccountTransaction : transactions
Portfolio "1" o-- "*" PortfolioTransaction : transactions

Transaction "*" --> "0..1" Security : security
Transaction "*" --> "0..1" CrossEntry : crossEntry
Transaction "1" o-- "*" Unit : units

Unit --> "1" Money : amount
Unit --> "0..1" Money : forex

CrossEntry <|.. BuySellEntry
CrossEntry <|.. AccountTransferEntry
CrossEntry <|.. PortfolioTransferEntry

BuySellEntry "1" --> "1" Portfolio : portfolio
BuySellEntry "1" --> "1" PortfolioTransaction : portfolioTransaction
BuySellEntry "1" --> "1" Account : account
BuySellEntry "1" --> "1" AccountTransaction : accountTransaction

AccountTransferEntry "1" --> "1" Account : accountFrom
AccountTransferEntry "1" --> "1" AccountTransaction : transactionFrom
AccountTransferEntry "1" --> "1" Account : accountTo
AccountTransferEntry "1" --> "1" AccountTransaction : transactionTo

PortfolioTransferEntry "1" --> "1" Portfolio : portfolioFrom
PortfolioTransferEntry "1" --> "1" PortfolioTransaction : transactionFrom
PortfolioTransferEntry "1" --> "1" Portfolio : portfolioTo
PortfolioTransferEntry "1" --> "1" PortfolioTransaction : transactionTo

@buchen
Copy link
Copy Markdown
Member

buchen commented Mar 29, 2026

Thanks @Morpheus1w3 for sharing these diagrams.

Looks okay (but I did check now all properties and relations).

I am not sure though about adding another artifact to the repository that needs additional maintenance. I think new users will just use tools like Claude Code or Codex and ask questions about the code base. That allows new users to ask questions about the code. (and the tools quickly understand all the dirty hacks of the past 10 years and can reason on them as well).

For example, I just asked Claude code to generate one with the most important classes. First it created a diagram for the PDF importer (it still was in my context) and then for the "model" classes. Isn't that more convenient for new users?

@buchen
Copy link
Copy Markdown
Member

buchen commented Mar 30, 2026

I understand the diagram can be rendered directly on Github. But somehow here in the pull request I only see the textual representation. And of course we would not want to submit an additional image with the rendered diagram.

Somehow in the commit diff, I can't make it work. But in the comment sections it seems to work:

classDiagram
direction TB

class InvestmentVehicle {
  <<interface>>
}

class TransactionOwner~T~ {
  <<interface>>
}

class Annotated {
  <<interface>>
}

class Adaptable {
  <<interface>>
}

class Attributable {
  <<interface>>
}

class Security {
  uuid : String
  name : String
  currencyCode : String
}

class Account {
  uuid : String
  name : String
  currencyCode : String
}

class Portfolio {
  uuid : String
  name : String
  referenceAccount : Account
}

class Transaction {
  <<abstract>>
  uuid : String
  date : LocalDateTime
  currencyCode : String
  amount : long
  shares : long
  note : String
  source : String
  updatedAt : Instant
}

class AccountTransaction {
  type : Type
  exDate : LocalDateTime
}

class PortfolioTransaction {
  type : Type
}

class CrossEntry {
  <<interface>>
}

class BuySellEntry

class AccountTransferEntry

class PortfolioTransferEntry

class Unit {
  type : Type
  amount : Money
  forex : Money
  exchangeRate : BigDecimal
}

class Money {
  currencyCode : String
  amount : long
}

Account ..|> TransactionOwner~AccountTransaction~
Portfolio ..|> TransactionOwner~PortfolioTransaction~

Security ..|> InvestmentVehicle
Account ..|> InvestmentVehicle
Account ..|> Attributable
Portfolio ..|> Attributable

Transaction ..|> Annotated
Transaction ..|> Adaptable

Transaction <|-- AccountTransaction
Transaction <|-- PortfolioTransaction

Account "1" o-- "*" AccountTransaction : transactions
Portfolio "1" o-- "*" PortfolioTransaction : transactions

Transaction "*" --> "0..1" Security : security
Transaction "*" --> "0..1" CrossEntry : crossEntry
Transaction "1" o-- "*" Unit : units

Unit --> "1" Money : amount
Unit --> "0..1" Money : forex

CrossEntry <|.. BuySellEntry
CrossEntry <|.. AccountTransferEntry
CrossEntry <|.. PortfolioTransferEntry

BuySellEntry "1" --> "1" Portfolio : portfolio
BuySellEntry "1" --> "1" PortfolioTransaction : portfolioTransaction
BuySellEntry "1" --> "1" Account : account
BuySellEntry "1" --> "1" AccountTransaction : accountTransaction

AccountTransferEntry "1" --> "1" Account : accountFrom
AccountTransferEntry "1" --> "1" AccountTransaction : transactionFrom
AccountTransferEntry "1" --> "1" Account : accountTo
AccountTransferEntry "1" --> "1" AccountTransaction : transactionTo

PortfolioTransferEntry "1" --> "1" Portfolio : portfolioFrom
PortfolioTransferEntry "1" --> "1" PortfolioTransaction : transactionFrom
PortfolioTransferEntry "1" --> "1" Portfolio : portfolioTo
PortfolioTransferEntry "1" --> "1" PortfolioTransaction : transactionTo
Loading

@buchen
Copy link
Copy Markdown
Member

buchen commented Mar 30, 2026

(I am warming up the idea - just saying)

@KarlBelow
Copy link
Copy Markdown
Contributor Author

Inside Eclipse I use Previewer from the Eclipse Marketplace. During coding the diagram in text it shows immediatly the drawing.

@KarlBelow
Copy link
Copy Markdown
Contributor Author

I think it should be sufficient the document just the main packages with the main classes. Also not all the attributes and all the methods must be covered. To sketch the main classes with their associations should be okay.

@KarlBelow
Copy link
Copy Markdown
Contributor Author

Somehow in the commit diff, I can't make it work. But in the comment sections it seems to work:

I use the rich diff, and this shows then the diagram.

@buchen
Copy link
Copy Markdown
Member

buchen commented Apr 2, 2026

https://deepwiki.com/portfolio-performance/portfolio

Deep Wiki has also generated class diagrams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[documentation] add UML diagrams

3 participants