Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add api contract for Post /requests endpoint of onboarding extension requests #216

Merged
Changes from all commits
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: 43 additions & 0 deletions requests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ Creates a new request.
"state": "PENDING"
}
```
- Example Onboarding Extension Request:
```json
{
"type": "ONBOARDING",
"numberOfDays": "<number>",
"userId": "<RDS Discord Id>",
"reason": "<Request Reason>"
}
```

- **Success Response of OOO Request:**

Expand Down Expand Up @@ -200,6 +209,40 @@ Creates a new request.
- **Code:** 500
- **Content:** `{ "statusCode": 500, "error": "Internal Server Error", "message": "An internal server error occurred" }`

- **Success Response of Onboarding Extension Request:**

- **Code:** 201
- **Content:**
```json
{
"message": "Onboarding extension request created successfully",
"data": {
"id": "string",
"createdAt": "number",
"updatedAt": "number",
"requestedBy": "<username>",
"type": "string",
"state": "string",
"userId": "string",
"requestNumber": "number",
"reason": "<request-reason>",
"newEndsOn": "number",
"oldEndsOn": "number",
}
}
```

- **Error Responses of Onboarding Extension Request:**
- **Code:** 409
- **Content:** `{ "statusCode": 409, "error": "Conflict", "message": "Request already exists please wait for approval or rejection" }`
- **Code:** 500
- **Content:** `{ "statusCode": 500, "error": "Internal Server Error", "message": "An internal server error occurred"" }`
- **Code:** 404
- **Content:** `{ "statusCode": 404, "error": "Not Found", "message": "User not found" }`
- **Code:** 403
- **Content:** `{ "statusCode": 403, "error": "Forbidden", "message": "Only super user and onboarding user are authorized to create an onboarding extension request" }`


#### Authentication and Authorization:

- Authentication is required for creating a new request.
Expand Down