-
Notifications
You must be signed in to change notification settings - Fork 49
Add API contract for PATCH /requests/:id endpoint for OOO request #226
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 PATCH /requests/:id endpoint for OOO request #226
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Summary by CodeRabbit
WalkthroughThe pull request updates the API documentation in the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API
participant Server
Client->>API: PATCH /ooo-request (with JSON payload)
API->>Server: Validate and process OOO request
alt Valid Request
Server-->>API: Success response (APPROVED/REJECTED with message)
else Invalid Request
Server-->>API: 400 Error ("Invalid request type", "Request already approved", or "Request already rejected")
else Unauthorized
Server-->>API: 401 Error (unauthenticated or super user restrictions)
else Not Found/Error
Server-->>API: 404 Error (request does not exist) or 500 Error (internal server error)
end
API-->>Client: Return appropriate response
Possibly related issues
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
requests/README.md
(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
requests/README.md
391-391: Unordered list indentation
Expected: 2; Actual: 3
(MD007, ul-indent)
392-392: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
403-403: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
🔇 Additional comments (1)
requests/README.md (1)
409-424
: API Contract: Clear and Comprehensive Error Responses
The error responses for the PATCH endpoint are well defined for multiple scenarios (400, 401, 404, and 500). Please verify that the duplicate HTTP status codes (multiple 400s and 401s) are intentional to distinctly cover different error conditions.
b1428d9
to
5ee2647
Compare
1f8ce14
to
d87fe84
Compare
d87fe84
to
3cefb8f
Compare
2cc40f5
Date: 18 Mar, 2025
Developer Name: Suraj Maity ( @surajmaity1 )
Issue Ticket Number
Description
The PR adds the API contract for PATCH /requests/:id endpoint for OOO requests.
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
Test Coverage
Screenshot 1
Additional Notes