Skip to content

Commit db275cc

Browse files
authored
v2 API release prep (#58)
1 parent fb45e66 commit db275cc

4 files changed

Lines changed: 82 additions & 98 deletions

File tree

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
# Change Log
2+
## v2.0.0
3+
### Overview
4+
This major release includes numerous quality of life improvements and architectural changes. The settings table has been removed, with its values migrated directly to the snapshot table for better data organization. A new feature allows storing customizable value orderings that persist across clients, ensuring consistent data presentation.
5+
6+
Due to breaking API changes, v1 endpoints are now deprecated. All API requests should use the new `/api/v2` base path.
7+
8+
### Added
9+
* Add support for storing snapshot value ordering ([#54](https://github.com/MicroFish91/portfolio-instruments-api/pull/54))
10+
* Add recommended rebalance threshold field for benchmarks ([#36](https://github.com/MicroFish91/portfolio-instruments-api/pull/36))
11+
* Add an optional rebalance threshold field per snapshot ([#38](https://github.com/MicroFish91/portfolio-instruments-api/pull/38))
12+
* Support momentum-based asset types ([#35](https://github.com/MicroFish91/portfolio-instruments-api/pull/35))
13+
14+
### Changed
15+
* Remove separate settings table. Update rebalance logic and tests to reflect data coming from the new snapshot rebalance field ([#40](https://github.com/MicroFish91/portfolio-instruments-api/pull/40))
16+
17+
### Fixed
18+
* Snapshot calculations should include deprecated items ([#56](https://github.com/MicroFish91/portfolio-instruments-api/pull/56))
19+
* Don't allow duplicate accounts even if one of them is deprecated ([#49](https://github.com/MicroFish91/portfolio-instruments-api/pull/49))
20+
* Don't allow duplicate holdings even if one of them is deprecated ([#47](https://github.com/MicroFish91/portfolio-instruments-api/pull/47))
21+
* Don't allow duplicate benchmarks even if one of them is deprecated ([#46](https://github.com/MicroFish91/portfolio-instruments-api/pull/46))
22+
23+
### Engineering
24+
* Improve docker-compose and build scripts for quickly bootstrapping a local db and app ([#51](https://github.com/MicroFish91/portfolio-instruments-api/pull/51))
225

326
## v1.0.1
427
### Engineering

docs/DatabaseDesign.md

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,64 +20,59 @@
2020
enc_pw =
2121
role = Default | Admin
2222

23-
#### Settings:
24-
25-
| Column Name | Datatype | Not Null | Primary Key |
26-
|----------------|-----------|----------|-------------|
27-
| setting_id | PKEY | ✅ | ✅ |
28-
| reb_thresh_pct | INTEGER | ✅ | |
29-
| user_id | INTEGER | ✅ | |
30-
| benchmark_id | INTEGER | | |
31-
| created_at | TIMESTAMP | ✅ | |
32-
| updated_at | TIMESTAMP | ✅ | |
33-
34-
Example:
35-
setting_id = 1
36-
reb_thresh_pct = 10
37-
user_id = 1
38-
benchmark_id = 5
39-
4023
#### Benchmarks:
4124

42-
| Column Name | Datatype | Not Null | Primary Key |
43-
|----------------|-----------|----------|-------------|
44-
| benchmark_id | PKEY | ✅ | ✅ |
45-
| name | TEXT | ✅ | |
46-
| description | TEXT | | |
47-
| std_dev_pct | REAL | | |
48-
| real_return_pct| REAL | | |
49-
| drawdown_yrs | INTEGER | | |
50-
| is_deprecated | BOOLEAN | ✅ | |
51-
| user_id | INTEGER | ✅ | |
52-
| created_at | TIMESTAMP | ✅ | |
53-
| updated_at | TIMESTAMP | ✅ | |
25+
| Column Name | Datatype | Not Null | Primary Key |
26+
|--------------------------------|-----------|----------|-------------|
27+
| benchmark_id | PKEY | ✅ | ✅ |
28+
| name | TEXT | ✅ | |
29+
| description | TEXT | | |
30+
| asset_allocation | JSONB | ✅ | |
31+
| std_dev_pct | REAL | | |
32+
| real_return_pct | REAL | | |
33+
| drawdown_yrs | INTEGER | | |
34+
| rec_rebalance_threshold_pct | INTEGER | | |
35+
| is_deprecated | BOOLEAN | ✅ | |
36+
| user_id | INTEGER | ✅ | |
37+
| created_at | TIMESTAMP | ✅ | |
38+
| updated_at | TIMESTAMP | ✅ | |
5439

5540
Example:
5641
benchmark_id = 1
5742
name = "Golden Butterfly"
5843
description: "A higher return portfolio based around the philosophies of the Permanent Portfolio"
44+
asset_allocation: {"TSM": 20, "DSCV": 20, "LTB": 20, "STB": 20, "GOLD": 20}
5945
std_dev_pct: 11.2
6046
real_return_pct: 7.4
6147
drawdown_yrs: 3
48+
rec_rebalance_threshold_pct: 10
6249
is_deprecated: false
6350
user_id = 1
6451

6552
#### Snapshots
6653

67-
| Column Name | Datatype | Not Null | Primary Key |
68-
|----------------|-----------|----------|-------------|
69-
| snap_id | PKEY | ✅ | ✅ |
70-
| description | TEXT | | |
71-
| snap_date | DATE | ✅ | |
72-
| total | REAL | ✅ | |
73-
| user_id | INTEGER | ✅ | |
74-
| created_at | TIMESTAMP | ✅ | |
75-
| updated_at | TIMESTAMP | ✅ | |
54+
| Column Name | Datatype | Not Null | Primary Key |
55+
|----------------------------|-----------|----------|-------------|
56+
| snap_id | PKEY | ✅ | ✅ |
57+
| description | TEXT | | |
58+
| snap_date | DATE | ✅ | |
59+
| total | REAL | | |
60+
| weighted_er_pct | REAL | | |
61+
| benchmark_id | INTEGER | | |
62+
| rebalance_threshold_pct | INTEGER | | |
63+
| value_order | INTEGER[] | | |
64+
| user_id | INTEGER | ✅ | |
65+
| created_at | TIMESTAMP | ✅ | |
66+
| updated_at | TIMESTAMP | ✅ | |
7667

7768
Example:
78-
snapshot_id = 1
79-
snapshot_date = 07/14/2024
80-
total = 100.00
69+
snap_id = 1
70+
snap_date = 07/14/2024
71+
total = 100000.00
72+
weighted_er_pct = 0.125
73+
benchmark_id = 1
74+
rebalance_threshold_pct = 10
75+
value_order = [1, 3, 2, 5, 4]
8176
user_id = 1
8277

8378
#### SnapshotValues
@@ -96,11 +91,11 @@
9691

9792
Example:
9893
snap_val_id = 1
99-
snapshot_id = 1
94+
snap_id = 1
10095
account_id = 1
10196
holding_id = 2
10297
total = 5750.45
103-
skip_rebalance = false // We want to rebalance by default
98+
skip_rebalance = false
10499
user_id = 1
105100

106101
#### Accounts:
@@ -144,12 +139,18 @@ A generalized data type typically used to represent a mutual fund/ETF holding, i
144139
| created_at | TIMESTAMP | ✅ | |
145140
| updated_at | TIMESTAMP | ✅ | |
146141

142+
Asset Categories (ENUM):
143+
CASH, BILLS, STB, ITB, LTB, COMMODITIES, GOLD, REITS, TSM,
144+
DLCB, DLCG, DLCV, DLCM, DMCB, DMCG, DMCV, DMCM, DSCG, DSCB, DSCV, DSCM,
145+
ILCB, ILCG, ILCV, ILCM, IMCB, IMCG, IMCV, IMCM, ISCB, ISCG, ISCV, ISCM,
146+
CRYPTO, OTHER
147+
147148
Example:
148149
holding_id = 1
149150
name = Vanguard Total Stock Market Index
150151
ticker = VTSAX
151152
asset_category = TSM
152-
expense_ratio = 0.08
153+
expense_ratio_pct = 0.08
153154
is_deprecated = false
154155
user_id = 1
155156

@@ -158,6 +159,6 @@ A generalized data type typically used to represent a mutual fund/ETF holding, i
158159
name = OTC Bond 05/2026
159160
asset_category = STB
160161
maturation_date = 05/01/2026
161-
interest_rate = 4.5
162+
interest_rate_pct = 4.5
162163
is_deprecated = false
163164
user_id = 1

docs/Swagger.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ The swagger tool I want to use is only supported through Fiber v2, so I will wai
1111
* `GET /api/v2/me`
1212

1313
### Users
14+
* `GET /api/v2/users` (Admin only)
1415
* `GET /api/v2/users/:id`
15-
* `PUT /api/v2/users/:id`
16+
* `PUT /api/v2/users/:id/verify` (Admin only)
1617
* `DEL /api/v2/users/:id`
1718

18-
* `GET /api/v2/users/:id/settings`
19-
* `PUT /api/v2/users/:id/settings`
20-
2119
### Benchmarks
2220
* `POST /api/v2/benchmarks`
2321
* `GET /api/v2/benchmarks`
@@ -33,23 +31,24 @@ The swagger tool I want to use is only supported through Fiber v2, so I will wai
3331
* `DEL /api/v2/accounts/:id`
3432

3533
### Holdings
36-
* `POST /api/v2/accounts`
37-
* `GET /api/v2/accounts`
38-
* `GET /api/v2/accounts/:id`
39-
* `PUT /api/v2/accounts/:id`
40-
* `DEL /api/v2/accounts/:id`
34+
* `POST /api/v2/holdings`
35+
* `GET /api/v2/holdings`
36+
* `GET /api/v2/holdings/:id`
37+
* `PUT /api/v2/holdings/:id`
38+
* `DEL /api/v2/holdings/:id`
4139

4240
### Snapshots
4341
* `POST /api/v2/snapshots`
4442
* `GET /api/v2/snapshots`
4543
* `GET /api/v2/snapshots/:id`
4644
* `GET /api/v2/snapshots/:id/rebalance`
4745
* `PUT /api/v2/snapshots/:id`
46+
* `PUT /api/v2/snapshots/:id/order`
4847
* `DEL /api/v2/snapshots/:id`
4948

5049
### SnapshotValues
51-
* `POST /api/v2/snapshots/:s_id/values`
52-
* `GET /api/v2/snapshots/:s_id/values`
53-
* `GET /api/v2/snapshots/:s_id/values/:sv_id`
54-
* `PUT /api/v2/snapshots/:s_id/values/:sv_id`
55-
* `DEL /api/v2/snapshots/:s_id/values/:sv_id`
50+
* `POST /api/v2/snapshots/:snap_id/values`
51+
* `GET /api/v2/snapshots/:snap_id/values`
52+
* `GET /api/v2/snapshots/:snap_id/values/:snap_val_id`
53+
* `PUT /api/v2/snapshots/:snap_id/values/:snap_val_id`
54+
* `DEL /api/v2/snapshots/:snap_id/values/:snap_val_id`

docs/release/v2_release_plan.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)