Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.

Dev#9

Merged
RandithaK merged 15 commits intomainfrom
dev
Nov 11, 2025
Merged

Dev#9
RandithaK merged 15 commits intomainfrom
dev

Conversation

@RandithaK
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings November 11, 2025 19:31
@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between e60b5db and 0715511.

📒 Files selected for processing (13)
  • .github/workflows/buildtest.yaml (1 hunks)
  • project-service/src/main/java/com/techtorque/project_service/client/AppointmentClient.java (1 hunks)
  • project-service/src/main/java/com/techtorque/project_service/client/NotificationClient.java (1 hunks)
  • project-service/src/main/java/com/techtorque/project_service/config/DataSeeder.java (3 hunks)
  • project-service/src/main/java/com/techtorque/project_service/config/RestTemplateConfig.java (1 hunks)
  • project-service/src/main/java/com/techtorque/project_service/controller/ProjectController.java (1 hunks)
  • project-service/src/main/java/com/techtorque/project_service/dto/request/ProjectRequestDto.java (2 hunks)
  • project-service/src/main/java/com/techtorque/project_service/dto/response/ProjectResponseDto.java (1 hunks)
  • project-service/src/main/java/com/techtorque/project_service/entity/Project.java (2 hunks)
  • project-service/src/main/java/com/techtorque/project_service/entity/ProjectStatus.java (1 hunks)
  • project-service/src/main/java/com/techtorque/project_service/service/ProjectService.java (1 hunks)
  • project-service/src/main/java/com/techtorque/project_service/service/impl/ProjectServiceImpl.java (4 hunks)
  • project-service/src/main/resources/application.properties (1 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 approveProject and rejectProject endpoints 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;
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDate;
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
}

@Operation(summary = "Reject a custom project request (admin only)")
@PostMapping("/{projectId}/admin/reject")
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@RandithaK RandithaK merged commit 311a7d3 into main Nov 11, 2025
7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants