refactor: OOO request schema for requestedBy and userID field#2466
refactor: OOO request schema for requestedBy and userID field#2466iamitprakash merged 1 commit intodevelopfrom
Conversation
…serId * modified controller and service to replace userId with requestedBy for consistency * updated test fixtures and integration tests to reflect the change * ensured unit tests align with the new structure
Summary by CodeRabbit
WalkthroughSwitched OOO request identification from username-based to userId-based. Controllers now query by requestedBy:userId; service creates requests with requestedBy:userId and removes userId field. Tests and fixtures updated to reflect the new schema and expectations, including dropping a non-null assertion in an integration test. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Controller as OOORequests Controller
participant Service as OOORequest Service
participant Repo as Requests Repo/DB
Client->>Controller: POST /requests (OOO payload)
Controller->>Repo: getByKeyValues({requestedBy: userId, type: OOO, status: PENDING})
alt Pending exists
Repo-->>Controller: Existing request
Controller-->>Client: 409 Conflict / appropriate response
else No pending
Repo-->>Controller: null
Controller->>Service: createOooRequest({from, until, reason, comment, userId})
Service->>Repo: create({requestedBy: userId, type: OOO, status: PENDING, ...})
Repo-->>Service: Created request
Service-->>Controller: Created request
Controller-->>Client: 201 Created (request)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (5)
🧰 Additional context used🧠 Learnings (5)📓 Common learnings📚 Learning: 2025-03-16T05:23:33.460ZApplied to files:
📚 Learning: 2025-03-16T05:28:26.722ZApplied to files:
📚 Learning: 2025-03-09T06:30:20.120ZApplied to files:
📚 Learning: 2025-06-26T20:08:47.146ZApplied to files:
🧬 Code Graph Analysis (1)controllers/oooRequests.ts (2)
🔇 Additional comments (4)
✨ Finishing Touches
🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
I've completed my review and didn't find any issues... but I did find this bear.
/ \.-"""-./ \
\ - - /
| o o |
\ .-'''-. /
'-\__Y__/-'
`---`Files scanned
| File Path | Reviewed |
|---|---|
| services/oooRequest.ts | ✅ |
| controllers/oooRequests.ts | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
|
@RishiChaubey31 Please fix the PR title and attach issue ticket |
Date: 20-08-2025
Developer Name: Rishi Chaubey
Issue Ticket Number
Description
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
creation.mp4
Test Coverage
Screenshot 1
Additional Notes