Simple REST application, written on Java using Spring Boot.
The service allows users to report what things they are willing to share, as well as find the desired thing and rent it for a certain period. You can reserve a thing for certain dates. Access to it from other users is closed during the booking period. If the desired thing is not on the service, users have the opportunity to leave requests. Upon request, it will be possible to add new things for exchange.
- Users
POST /usersCreate user
Example request body:{ "name": "user", "email": "user@user.com" }GET /users/{id}Get user byid
GET /usersGet list of all users
PATCH /users/{id}Change user info{ "name": "user", "email": "user@user.com" }DELETE /users/{id}Delete user byid - Requests
UserId passed in request headerX-Sharer-User-Id.
POST /requestsCreate request{ "description": "description" }GET /requests/{requestId}Get request byid
GET /requestsGet list of all requests from current user
GET /requests/allGet list of all requests from other users - Items
UserId passed in request headerX-Sharer-User-Id.
POST /itemsCreate item{ "name": "item name", "description": "item description", "available": true, "requestId": 1 }GET /items/{id}Get item byid
GET /itemsGet list of all items from current user
PATCH /items/{id}Change item info{ "id": 1, "name": "new item name", "description": "new item description", "available": false }DELETE /items/{id}Delete item byidGET /items/search?text={text}Search item by name or descriptionPOST /items/{itemId}/commentAdd comment to the item{ "text": "Comment for item 1" } - Bookings
UserId passed in request headerX-Sharer-User-Id.
POST /bookingsCreate booking{ "itemId": 2, "start": "2024-09-25T13:20:57", "end": "2024-09-26T13:20:57" }PATCH /bookings/{bookingId}?approved={approved}Approve or decline booking status by owner of item.approvedmay betrueorfalse
GET /bookings/{bookingId}Get booking byid
GET /bookings?state={state}Get list of all booking for user.statemay beALL,CURRENT,PAST,FUTURE,WAITING,REJECTED
GET /bookings/owner?state={state}Get list of all booking for owner.statemay beALL,CURRENT,PAST,FUTURE,WAITING,REJECTED
