- Stock (name: string - must be unique)
- Bearer (name: string - must be unique)(can own many stocks)
- Create a stock with a referenced bearer.
- Update a stock.
- The bearer cannot be updated via stock update endpoint. If you need to change the bearer, a new object needs to be created. If bearer exists already, it must be re-used and connected to the stock.
- List all stocks with bearer information.
- Soft-delete a stock so it doesn't appear on the API.
NOTE: Error responses should be detailed enough to see what exactly missied or wrong.
- Ruby 2.7.1
Create a stock with a referenced bearer.
POST api/v1/:bearer_id/stocks with { stock: { name: string } }
Update a stock.
PATCH api/v1/:id with { stock: { name: string, bearer_name: string } }
one of params is required
The bearer cannot be updated via stock update endpoint. If you need to change the bearer, a new object needs to be created. If bearer exists already, it must be re-used and connected to the stock.
covered within stock#update
List all stocks with bearer information.
GET api/v1/stocks
Soft-delete a stock so it doesn't appear on the API.
DELETE api/v1/stocks/:id