Conversation
Randitha superbranch
|
Warning Rate limit exceeded@RandithaK has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 56 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, 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 the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (13)
✨ 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.
Pull Request Overview
This PR adds project approval/rejection functionality to the project service with inter-service communication capabilities. The changes enable admins to approve or reject custom project requests, automatically triggering notifications and appointment updates.
- Adds new
approveProjectandrejectProjectendpoints with admin authorization - Introduces inter-service clients for Appointment and Notification services
- Extends Project entity with appointmentId, projectType, and desiredCompletionDate fields
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| application.properties | Adds configuration for appointment and notification service URLs |
| ProjectServiceImpl.java | Implements approve/reject logic with client dependencies and field mappings |
| ProjectService.java | Adds approve/reject method signatures to service interface |
| ProjectStatus.java | Adds PENDING_ADMIN_REVIEW status for custom project workflow |
| Project.java | Adds appointmentId, projectType, and desiredCompletionDate fields |
| ProjectResponseDto.java | Adds projectType and desiredCompletionDate to response DTO |
| ProjectRequestDto.java | Adds projectType and desiredCompletionDate to request DTO |
| ProjectController.java | Adds approve/reject endpoints with admin authorization |
| RestTemplateConfig.java | Configures RestTemplate bean for HTTP client communication |
| DataSeeder.java | Updates seed data with required projectType field |
| NotificationClient.java | Implements client for sending project notifications |
| AppointmentClient.java | Implements client for appointment confirmation/cancellation |
| buildtest.yaml | Restricts workflow to specific branches (main, dev, devOps) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import org.hibernate.annotations.CreationTimestamp; | ||
| import org.hibernate.annotations.UpdateTimestamp; | ||
| import java.math.BigDecimal; | ||
| import java.time.LocalDate; |
There was a problem hiding this comment.
LocalDate is imported but the desiredCompletionDate field on line 37 is declared as String. This creates a type mismatch. Either change the field type to LocalDate or remove the unused import. Using LocalDate would be more appropriate for date handling.
| import lombok.NoArgsConstructor; | ||
|
|
||
| import java.math.BigDecimal; | ||
| import java.time.LocalDate; |
There was a problem hiding this comment.
LocalDate is imported but the desiredCompletionDate field on line 30 is declared as String. This creates a type mismatch. Either change the field type to LocalDate or remove the unused import. Using LocalDate would provide better type safety and validation.
| } | ||
|
|
||
| @Operation(summary = "Reject a custom project request (admin only)") | ||
| @PostMapping("/{projectId}/admin/reject") |
There was a problem hiding this comment.
The URL pattern is inconsistent with the approve endpoint. The approve endpoint uses '/{projectId}/approve' (line 149), but this reject endpoint uses '/{projectId}/admin/reject'. For consistency and better API design, consider using '/{projectId}/reject' since the @PreAuthorize annotation already restricts access to admins. Note there's already a customer reject endpoint at '/{projectId}/reject' for quote rejection (line 110), so you may need to use a different pattern like '/{projectId}/admin/approve' and '/{projectId}/admin/reject' for both admin operations.
No description provided.