fix: added prop for loginResponse, response CRUD Course curiculum and…#85
Conversation
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 37 minutes and 57 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR introduces profile picture URL resolution in the login flow and adds comprehensive curriculum and insight validation across course creation, updates, and retrieval. The backend login handler now resolves user profile picture URLs via a file storage service dependency, returning the URL in LoginResponse with graceful fallback to null on failure. Frontend types and services are updated to propagate the avatar field. Course handlers validate and serialize curriculum/insight using a centralized helper, normalizing behavior across create, update, and query operations. ChangesProfile Picture URL Resolution in Login
Course Curriculum and Insight Management
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
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)
frontend/interface/auth/auth.interface.ts (1)
26-33:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAlign login response field name with the backend contract.
Line 32 uses
avatar, but the backend response field isProfilePictureUrl(JSONprofilePictureUrl). This mismatch will drop the profile picture on login.Proposed fix
// frontend/interface/auth/auth.interface.ts export interface LoginResponse { accessToken: string; refreshToken?: string; email: string; firstName: string; lastName: string; - avatar?: string | null; + profilePictureUrl?: string | null; } // frontend/services/auth/auth.service.ts const user: User = { uuid, email, fullName: `${firstName} ${lastName}`.trim() || null, role, - avatar: data.avatar ?? null, + avatar: data.profilePictureUrl ?? null, };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/interface/auth/auth.interface.ts` around lines 26 - 33, The LoginResponse interface currently defines an avatar field that doesn't match the backend JSON; replace avatar with profilePictureUrl (matching backend's ProfilePictureUrl / profilePictureUrl) and keep the same optional string | null type to preserve nullable behavior; update the LoginResponse interface declaration and any code referencing LoginResponse.avatar to use LoginResponse.profilePictureUrl (or map the backend field into that property where responses are parsed).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@backend/Src/PIED_LMS.Application/UserCases/Commands/Course/CreateCourseHandler.cs`:
- Line 4: CreateCourseHandler references CourseContentHelper (used around where
CreateCourseHandler constructs course content) but the type is missing causing
CS0103; restore or add the CourseContentHelper class in the appropriate
namespace and then import that namespace with a using, or fully qualify the type
where used in CreateCourseHandler; ensure the class name and public API
(methods/properties) match the usages in CreateCourseHandler so the references
compile.
In `@backend/Src/PIED_LMS.Contract/Services/Course/Request.cs`:
- Around line 21-22: The request contract declares "insight" as nullable but
handlers expect it non-null; update the request model to make insight required
by changing the parameter/property from [FromForm(Name = "insight")] string?
Insight to a non-nullable string and/or add a validation attribute (e.g.,
[Required]) on the Insight member in the Request class/record, and ensure
create/update handlers that reference Insight (the create/update handler
methods) keep their current validation logic unchanged so the contract and
runtime behavior are aligned.
---
Outside diff comments:
In `@frontend/interface/auth/auth.interface.ts`:
- Around line 26-33: The LoginResponse interface currently defines an avatar
field that doesn't match the backend JSON; replace avatar with profilePictureUrl
(matching backend's ProfilePictureUrl / profilePictureUrl) and keep the same
optional string | null type to preserve nullable behavior; update the
LoginResponse interface declaration and any code referencing
LoginResponse.avatar to use LoginResponse.profilePictureUrl (or map the backend
field into that property where responses are parsed).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 59716f36-b36f-4fbe-886c-e06c2f385255
📒 Files selected for processing (14)
backend/Src/PIED_LMS.Application/UserCases/Commands/Auth/LoginHandler.csbackend/Src/PIED_LMS.Application/UserCases/Commands/Course/CreateCourseHandler.csbackend/Src/PIED_LMS.Application/UserCases/Commands/Course/UpdateCourseHandler.csbackend/Src/PIED_LMS.Application/UserCases/Queries/Course/GetCourseByIdHandler.csbackend/Src/PIED_LMS.Application/UserCases/Queries/Course/GetCourseCurriculumHandler.csbackend/Src/PIED_LMS.Application/UserCases/Queries/Course/GetCoursesHandler.csbackend/Src/PIED_LMS.Contract/Services/Course/Command.csbackend/Src/PIED_LMS.Contract/Services/Course/Request.csbackend/Src/PIED_LMS.Contract/Services/Course/Response.csbackend/Src/PIED_LMS.Contract/Services/Identity/Response.csbackend/Src/PIED_LMS.Presentation/APIs/CourseEndpoints.csfrontend/interface/auth/auth.interface.tsfrontend/interface/store/auth.types.tsfrontend/services/auth/auth.service.ts
… insigint
Summary by CodeRabbit
Release Notes