The user should be able to create new public and private asset allocation strategies on the dashboard.
Technical details
The values of the strategy items should be restricted to the following (stock, bond, real-estate, crypto, gold, commodity, cash)
The API endpoints already exist here (POST/PUT/DELETE /dashboard/strategies).
The payload format is { name: string; items: { name: string; size: number }[] }.
The sum size of the items must be 1.0.
The strategy visibility is set to private for now, public strategies will be created in the database directly or via the admin dashboard. The sharing of strategies will be implemented later.
We don't need editing functionality for now. If the user wants to modify a strategy, they should delete and recreate it.
[x] This functionality should be placed on the dashboard view.
[x] Probably a modal is the easiest way to introduce the creation flow, but other ideas are also welcome (e.g.: some kind of piechart editor).
[x] Loading state should be handled properly.
[x] Possible errors:
[x] 400 - malformed payload
[x] ~401 - the user is not autheticated~ (this is a possible error, but should not happen in this state of the frontend)
[x] 403 - the user is not allowed to create strategies
Description
The user should be able to create new public and private asset allocation strategies on the dashboard.
Technical details
stock
,bond
,real-estate
,crypto
,gold
,commodity
,cash
)POST/PUT/DELETE /dashboard/strategies
).{ name: string; items: { name: string; size: number }[] }
.1.0
.private
for now, public strategies will be created in the database directly or via the admin dashboard. The sharing of strategies will be implemented later.