1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Investment Portfolio Sync (#974)

* Add investment portfolio models

* Add portfolio to demo data

* Setup initial tests

* Rough sketch of sync logic

* Clean up trade sync logic

* Add trade validation

* Integrate trades into sync process
This commit is contained in:
Zach Gollwitzer 2024-07-16 09:26:49 -04:00 committed by GitHub
parent d0bc959bee
commit 47523f64c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 591 additions and 56 deletions

View file

@ -7,6 +7,15 @@ valuation:
entryable_type: Account::Valuation
entryable: one
trade:
name: Purchase 10 shares of AAPL
date: <%= 1.day.ago.to_date %>
amount: 2140 # 10 shares * $214 per share
currency: USD
account: investment
entryable_type: Account::Trade
entryable: one
transaction:
name: Starbucks
date: <%= 1.day.ago.to_date %>

15
test/fixtures/account/holdings.yml vendored Normal file
View file

@ -0,0 +1,15 @@
one:
account: investment
security: aapl
date: <%= Date.current %>
qty: 10
amount: 2150 # 10 * $215
currency: USD
two:
account: investment
security: aapl
date: <%= 1.day.ago.to_date %>
qty: 10
amount: 2140 # 10 * $214
currency: USD

4
test/fixtures/account/trades.yml vendored Normal file
View file

@ -0,0 +1,4 @@
one:
security: aapl
qty: 10
price: 214

9
test/fixtures/securities.yml vendored Normal file
View file

@ -0,0 +1,9 @@
aapl:
isin: US0378331005
symbol: aapl
name: Apple
msft:
isin: US5949181045
symbol: msft
name: Microsoft

11
test/fixtures/security/prices.yml vendored Normal file
View file

@ -0,0 +1,11 @@
one:
isin: US0378331005 # AAPL
date: <%= Date.current %>
price: 215
currency: USD
two:
isin: US0378331005 # AAPL
date: <%= 1.day.ago.to_date %>
price: 214
currency: USD