Skip to content

Commit 25adc3f

Browse files
authored
Merge pull request #183 from Real-Dev-Squad/request-api-contract
DOC : Added api contract for request endpoint
2 parents aa5babc + ce10d9d commit 25adc3f

File tree

1 file changed

+37
-10
lines changed

1 file changed

+37
-10
lines changed

requests/README.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ Returns a list of requests with pagination and filtering options.
9191
- Filtering options are available using parameters like `requestedBy`,`type`, and `state`.
9292
- The response includes a list of request objects with their respective properties.
9393

94-
### Authentication and Authorization:
94+
#### Authentication and Authorization:
9595

9696
- Authentication is required for accessing this endpoint.
9797

98-
### Additional Notes:
98+
#### Additional Notes:
9999

100100
- The provided response includes details of each request, such as ID, timestamps, requester, type, message, state, etc.
101101
- Pagination functionality is implemented using `next` and `prev` parameters in the response.
@@ -129,24 +129,51 @@ Creates a new request.
129129

130130
- Body Parameters:
131131

132-
- `type`: Required string to specify the type of request (e.g., OOO).
132+
- `type`: Required string to specify the type of request (e.g., OOO,EXTENSION,TASK).
133133
- `from`: Required number to specify the start timestamp of the request.
134134
- `until`: Required number to specify the end timestamp of the request.
135135
- `message`: Required string to specify the message for the request.
136136
- `state`: Required string to specify the state of the request (e.g., PENDING).
137137

138-
- Example:
138+
- Example OOO Request:
139139
```json
140140
{
141141
"type": "OOO",
142142
"from": "<timestamp>",
143143
"until": "<timestamp>",
144-
"message": "string",
144+
"message": "<Request Message>",
145+
"state": "PENDING"
146+
}
147+
```
148+
- Example EXTENSION Request:
149+
```json
150+
{
151+
"type": "EXTENSION",
152+
"taskId": "<Task ID>",
153+
"title": "<Extension Title>",
154+
"oldEndsOn": "<timestamp>",
155+
"newEndsOn": "<timestamp>",
156+
"message": "<Extension Message>",
157+
"state": "PENDING"
158+
}
159+
```
160+
- Example TASK Request:
161+
```json
162+
{
163+
"type": "TASK",
164+
"externalIssueUrl": "<GitHub Issue API URL>",
165+
"externalIssueHtmlUrl": "<GitHub Issue HTML URL>",
166+
"requestType": "CREATION | ASSIGNMENT",
167+
"proposedStartDate": "<timestamp>",
168+
"proposedDeadline": "<timestamp>",
169+
"description": "<Request Description>",
170+
"markdownEnabled": "false | true",
171+
"userId": "<RDS User ID>",
145172
"state": "PENDING"
146173
}
147174
```
148175

149-
- **Success Response:**
176+
- **Success Response of OOO Request:**
150177

151178
- **Code:** 200
152179
- **Content:**
@@ -173,11 +200,11 @@ Creates a new request.
173200
- **Code:** 500
174201
- **Content:** `{ "statusCode": 500, "error": "Internal Server Error", "message": "An internal server error occurred" }`
175202

176-
### Authentication and Authorization:
203+
#### Authentication and Authorization:
177204

178205
- Authentication is required for creating a new request.
179206

180-
### Additional Notes:
207+
#### Additional Notes:
181208

182209
- The request body should contain the necessary details for creating a new request, including type, timestamps for from and until, message, and state.
183210
- The state is set to "PENDING" by default.
@@ -248,11 +275,11 @@ Updates an existing request with the provided details.
248275
- **Code:** 500
249276
- **Content:** `{ "statusCode": 500, "error": "Internal Server Error", "message": "An internal server error occurred" }`
250277

251-
### Authentication and Authorization:
278+
#### Authentication and Authorization:
252279

253280
- Authentication is required for accessing this endpoint.
254281

255-
### Additional Notes:
282+
#### Additional Notes:
256283

257284
- The request body should contain the necessary details for updating an existing request, including type, reason, and state.
258285
- Error handling is provided for cases where the request is already approved and for internal server errors.

0 commit comments

Comments
 (0)