-
Notifications
You must be signed in to change notification settings - Fork 280
feat: add application feedback submission functionality #2552
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
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 WalkthroughA new endpoint for submitting application feedback was introduced. The PATCH route Changes
Sequence Diagram(s)sequenceDiagram
Client->>+API: PATCH /applications/:applicationId/feedback
API->>+Validator: validateApplicationUpdateData(body)
Validator-->>-API: validation result
alt Validation Failed
API-->>Client: 400 Bad Request
else Validation Passed
API->>+Controller: submitApplicationFeedback(req, res)
Controller->>+Database: getApplication(applicationId)
Database-->>-Controller: application
alt Application Not Found
Controller-->>Client: 404 Not Found
else Application Found
Controller->>Controller: buildFeedbackEntry(status, feedback, reviewerName, timestamp)
Controller->>Controller: appendToExistingFeedback()
Controller->>+Database: updateApplication(newFeedbackList, status)
Database-->>-Controller: updated application
Controller-->>-API: 200 Success + feedback entry
API-->>Client: 200 Success Response
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/integration/application.test.ts (1)
359-435: Add coverage forchanges_requestedfeedback requirement.
Consider adding tests that assert:
status: "changes_requested"with empty/whitespace feedback returns 400.status: "changes_requested"with valid feedback succeeds.
🤖 Fix all issues with AI agents
In `@controllers/applications.ts`:
- Around line 134-173: The handler submitApplicationFeedback reads feedback,
mutates it and calls ApplicationModel.updateApplication which can cause lost
updates under concurrency; instead implement and call an atomic append in the
model (e.g., ApplicationModel.appendFeedback or a transactional method) that
takes applicationId and newFeedbackEntry and uses the DB's atomic array-append
operator (or a transaction) to push the entry and optionally update status, then
update the controller to stop reading/merging existingFeedback and call that new
model method (keep newFeedbackEntry creation and response unchanged).
In `@middlewares/validators/application.ts`:
- Around line 93-99: The Biome lint rule `noThenProperty` is flagging the `then`
usage inside the `joi.when` call (see joi.when with is:
APPLICATION_STATUS_TYPES.CHANGES_REQUESTED) causing CI failures; fix by adding a
local Biome suppression around that expression (disable `noThenProperty` for
that block) or update the Biome config to allow `then` on Joi conditions so the
validator in middlewares/validators/application.ts using
`joi.when(...).then(...)` is not flagged.
7cf9cb9 to
572ef6e
Compare
| ERROR_SUBMITTING_FEEDBACK: "Error while submitting the application feedback", | ||
| }; | ||
|
|
||
| const APPLICATION_STATUS = { |
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.
rename this object as it's make more sense to have one generic status object for the application rather than create different for each functionality.By doing this we can use this for nudge , feedback and other functions
| it("should call next function if only status and feedback is passed, and status has any of the allowed values", async function () { | ||
| const req = { | ||
| body: { | ||
| status: "pending", |
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.
changed this as earlier we are allowing pending status update by superuser with the new flow they can use changes_requested status
e57c612 to
a02baf1
Compare
* feat: add application feedback submission functionality (#2552) * test: implement comprehensive application feedback tests (#2555) * feat: add application feedback submission functionality * feat: enhance application feedback functionality with comprehensive tests * refactor: update application validator tests for improved clarity and consistency * test: remove unauthorized user test case for application feedback
Date: 18 Jan, 2026
Developer Name: @AnujChhikara
Issue Ticket Number
Tech Doc Link
Business Doc Link
Description
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
Test Coverage
Screenshot 1
Additional Notes