Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions requests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The Requests API provides endpoints for creating, fetching, and updating request
| [GET /requests](#get-requests) | Returns a list of requests with pagination and filtering options. |
| [POST /requests](#post-requests) | Creates a new request. |
| [PUT /requests/:id](#put-requestsid) | Updates an existing request. |
| [PATCH /requests/:id](#patch-requestsid) | Updates an existing request before approval or rejection. |
| [PATCH /requests/:id](#patch-requestsid) | Updates an existing request partially. |

### **GET /requests**

Expand Down Expand Up @@ -368,9 +368,11 @@ Updates an existing request with the provided details.

### **PATCH /requests/:id**

Updates an existing request before approval or rejection with the provided details.
- **Description:** Partially updates an existing request based on its type:

- **Description:** Updates an existing request before approval or rejection with the provided details..
- For requests of type ONBOARDING, this endpoint updates the request details prior to its approval or rejection.

- For requests of type OOO (Out-Of-Office), it processes the approval or rejection of the request using the provided data.

- **URL:** `https://api.realdevsquad.com/requests/:id`

Expand All @@ -394,6 +396,41 @@ Updates an existing request before approval or rejection with the provided detai

- Body Parameters:

- **Example of OOO Request:**
```json
{
"type": "OOO",
"status": "string", // status must be APPROVED or REJECTED
"comment": "string" // optional
}
```

- **Success Response of OOO Request:**

- **Code:** 200
- **Content:**
```json
{
"message": "Request approved/rejected successfully"
}
```

- **Error Responses of OOO Request:**
- **Code:** 400
- **Content:** `{ "statusCode": 400, "error": "Bad Request", "message": "Invalid request type" }`
- **Code:** 409
- **Content:** `{ "statusCode": 409, "error": "Conflict", "message": "Request already approved" }`
- **Code:** 409
- **Content:** `{ "statusCode": 409, "error": "Conflict", "message": "Request already rejected" }`
- **Code:** 401
- **Content:** `{ "statusCode": 401, "error": "Unauthorized", "message": "Unauthenticated User" }`
- **Code:** 403
- **Content:** `{ "statusCode": 401, "error": "Forbidden", "message": "Only super users are allowed to acknowledge OOO requests" }`
- **Code:** 404
- **Content:** `{ "statusCode": 404, "error": "Not Found", "message": "Request does not exist" }`
- **Code:** 500
- **Content:** `{ "statusCode": 500, "error": "Internal Server Error", "message": "An internal server error occurred" }`

- **Example of Onboarding Extension Request:**
```json
{
Expand Down