-
Connection string can be found in appsettings.json
file
-
To add migration (make sure you start in Infrastructure directory):
dotnet ef migrations add <name of new migration> -c ApplicationDbContext -s ./../Api
-
To remove migration (make sure you start in Infrastructure directory):
dotnet ef migrations remove -c ApplicationDbContext -s ./../Api
JWT token must be provided in the header when accessing sensitive data.
Method |
Path |
Body |
Params |
Description |
Responses |
Who can access |
GET |
api/items/{id} |
none |
id |
Returns an ItemCard with given id or 404 if item doesn't exist. |
ItemCard, 404 |
everyone |
GET |
api/items? |
none |
brand, name, category, make, model, gender, minPrice, maxPrice |
Returns a list of items. List can be empty if none is found. |
ItemObject[] |
everyone |
GET |
api/items/category? |
none |
category, pageIndex, pageSize |
Returns list of items with given category name |
ItemObject[] |
everyone |
GET |
api/items/trending? |
none |
category, count |
Returns list of trending items |
ItemCard[] |
everyone |
POST |
api/items |
CreateItemCommand |
none |
Creates a new item based on the data in the body. |
200, 500 |
admin |
PUT |
api/items/{id} |
UpdateItemCommand |
id |
Updates an item if found. Returns 404 otherwise. |
200, 404 |
admin |
DELETE |
api/items/{id} |
none |
id |
Deletes an item if found. Returns 404 otherwise. |
200, 404 |
admin |
Method |
Path |
Body |
Params |
Description |
Responses |
Who can access |
GET |
api/user |
none |
none |
Returns user data. |
UserSettingsObject |
Signed in users |
GET |
api/user/level |
none |
none |
Returns UserSellerLevel as a string. |
string |
Signed in users |
PUT |
api/user |
none |
none |
Returns user data. |
200 |
Signed in users |
Method |
Path |
Body |
Params |
Description |
Responses |
Who can access |
GET |
api/asks/{id} |
none |
id |
Returns ask details or 404 it ask doesn't exist. |
AskObject, 404 |
Signed in users |
GET |
api/asks/ |
none |
SearchAsksQuery |
Returns list of asks for a user. List can be empty if user has no asks. |
AskObject[] |
Signed in users |
POST |
api/asks/ |
CreateAskCommand |
none |
Creates a new ask. |
200 |
Signed in users |
PUT |
api/asks/{id} |
UpdateAskCommand |
id |
Updates an ask if found. Returns 404 otherwise. |
200, 404 |
Ask owner |
DELETE |
api/asks/{id} |
none |
id |
Deletes an ask if found. Returns 404 otherwise. |
200, 404 |
Ask owner |
Method |
Path |
Body |
Parameters |
Description |
Responses |
Who can access |
GET |
api/bids/{id} |
none |
id |
Returns bid details or 404 it ask doesn't exist. |
BidObject, 404 |
Signed in users |
GET |
api/bids/ |
none |
SearchBidsquery |
Returns list of bids for a user. List can be empty if user has no bids. |
BidObject[] |
Signed in users |
POST |
api/bids/ |
CreateBidCommand |
none |
Creates a new bid. |
200 |
Signed in users |
PUT |
api/bids/{id} |
UpdateBidCommand |
id |
Updates a bid if found. Returns 404 otherwise. |
200, 404 |
Bid owner |
DELETE |
api/bids/{id} |
none |
id |
Deletes a bid if found. Returns 404 otherwise. |
200, 404 |
Bid owner |
Method |
Path |
Body |
Params |
Description |
Responses |
Who can access |
GET |
api/transactions/{id} |
none |
id |
Returns TransactionObject if transaction with given id exists. Otherwise, returns 404. Code 403 is returned when user doesn't own the transaction. |
TransactionObject, 404, 403 |
Buyer and seller |
GET |
api/transactions/ |
none |
none |
Returns list of user transactions. |
TransactionObject[] |
Signed in user |
Method |
Path |
Body |
Params |
Description |
Responses |
Who can access |
GET |
api/supervisorPanel/orders |
none |
|
Returns list of transactions assigned to the supervisor. |
TransactionObject[] |
supervisor |
GET |
api/supervisorPanel/orders/{id} |
none |
id |
Returns TransactionObject with given id. Returns 403 if the transaction isn't assigned to the supervisor. Returns 404 if transaction doesn't exist. |
TransactionObject[], 403, 404 |
supervisor |
PUT |
api/supervisorPanel/orders/{id} |
UpdateTransactionCommand |
id |
Updates a transaction if found. Returns 404 otherwise. |
200, 404 |
supervisor |