Skip to content

Conversation

@snehar-nd
Copy link

@snehar-nd snehar-nd commented Sep 25, 2025

📋 Description

JIRA ID:
Commiting code required for 3.5.0 from 3.6.0

Summary by CodeRabbit

  • New Features

    • New endpoint to activate/deactivate an employee’s signature.
    • Standardized API routes for signature upload, fetch, and existence checks.
    • Download responses now include properly encoded filenames for better cross-browser support.
  • Bug Fixes

    • More robust media type handling; defaults to application/octet-stream on parsing errors.
    • Improved file processing and error handling for signature upload and download operations.
  • Chores

    • Version updated to 3.5.0.

@coderabbitai
Copy link

coderabbitai bot commented Sep 25, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Updates project version to 3.5.0, refines EmployeeSignatureController mappings and response handling, adds an activation/deactivation endpoint, introduces a service method to update signature status, adjusts repository primary key type to Integer, and makes a minor formatting cleanup in EmployeeMasterController.

Changes

Cohort / File(s) Summary
Project Version
pom.xml
Bumped artifact version from 3.4.0 to 3.5.0.
Employee Master Controller (cosmetic)
src/main/java/com/iemr/admin/controller/employeemaster/EmployeeMasterController.java
Removed an extraneous blank line in getEmployeeByDesignation; no logic changes.
Signature Controller: mappings, headers, new endpoint
src/main/java/com/iemr/admin/controller/employeemaster/EmployeeSignatureController.java
Switched to @PostMapping/@GetMapping, added filename UTF-8 encoding via ContentDisposition, safer media type parsing with fallback, Base64 decode before upload, enhanced logging/error handling, and added ActivateUser endpoint to toggle active/deleted status.
Repository ID type change
src/main/java/com/iemr/admin/repository/user/UserLoginRepo.java
Changed CrudRepository key type from Long → Integer; method signatures otherwise unchanged.
Signature Service: status update
src/main/java/com/iemr/admin/service/employeemaster/EmployeeSignatureServiceImpl.java
Added updateUserSignatureStatus(String) to toggle signature deleted flag based on parsed JSON (userID, active); fetches entity, validates existence, persists update.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as EmployeeSignatureController
  participant SVC as EmployeeSignatureServiceImpl
  participant REPO as EmployeeSignatureRepo

  Client->>API: POST /signature/activate { userID, active }
  API->>SVC: updateUserSignatureStatus(activateUser JSON)
  SVC->>REPO: findByUserId(userID)
  alt Signature found
    SVC->>SVC: set deleted = !active
    SVC->>REPO: save(signature)
    REPO-->>SVC: updated signature
    SVC-->>API: updated signature
    API-->>Client: 200 OK { userID, active }
  else Not found
    SVC-->>API: throw not found
    API-->>Client: 404/400 with error
  end
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as EmployeeSignatureController
  participant REPO as EmployeeSignatureRepo
  Client->>API: GET /signature/{id}
  API->>REPO: fetch signature bytes + metadata
  REPO-->>API: content, mimeType, filename
  API->>API: parse MediaType or fallback to application/octet-stream
  API->>API: set Content-Disposition with UTF-8 filename
  API-->>Client: 200 OK (bytes, content-type, length, headers)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Feature/signaturerelease #104: Adds ActivateUser endpoint and corresponding service method; overlaps with signature activation flow introduced here.
  • Feature/signaturerelease #103: Adjusts EmployeeSignatureController download headers and media type handling similar to the content-disposition and parsing updates in this PR.

Suggested reviewers

  • helenKaryamsetty

Poem

A hop, a bump—now 3.5 we go,
New routes mapped where signatures flow.
Toggle on, toggle off—so neat,
UTF-8 wraps filenames sweet.
Keys switched size, the repo knows—
Thump of paws, the build now grows. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title focuses on cherry-picking commits for version 3.5.0 from 3.6.0 but doesn’t reflect the actual main changes—version bump from 3.4.0 to 3.5.0, EmployeeSignatureController enhancements, repository type updates, and new service methods—and even contains a typo, making it misleading and insufficiently descriptive. Please revise the title to clearly summarize the core changes, such as “Bump admin-api to 3.5.0, enhance EmployeeSignatureController endpoints, and update UserLoginRepo ID type,” and correct the typo from “form” to “from.”
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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.

@snehar-nd snehar-nd changed the base branch from main to release-3.5.0 September 25, 2025 18:02
Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (2)
src/main/java/com/iemr/admin/controller/employeemaster/EmployeeMasterController.java (1)

1054-1054: Superfluous whitespace

Please drop the extra blank line to keep formatting tidy.

src/main/java/com/iemr/admin/controller/employeemaster/EmployeeSignatureController.java (1)

24-51: Remove unused imports

URLEncoder was added but isn’t used. Please clean it up.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 225cf5a and 3a4363e.

📒 Files selected for processing (5)
  • pom.xml (1 hunks)
  • src/main/java/com/iemr/admin/controller/employeemaster/EmployeeMasterController.java (1 hunks)
  • src/main/java/com/iemr/admin/controller/employeemaster/EmployeeSignatureController.java (4 hunks)
  • src/main/java/com/iemr/admin/repository/user/UserLoginRepo.java (1 hunks)
  • src/main/java/com/iemr/admin/service/employeemaster/EmployeeSignatureServiceImpl.java (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/main/java/com/iemr/admin/controller/employeemaster/EmployeeSignatureController.java (1)
src/main/java/com/iemr/admin/utils/response/OutputResponse.java (1)
  • OutputResponse (38-233)
🔇 Additional comments (1)
pom.xml (1)

8-8: Version bump matches release objective

Project version updated to 3.5.0 — aligns with the stated cherry-pick goal.

@sonarqubecloud
Copy link

@snehar-nd snehar-nd merged commit 27241e1 into release-3.5.0 Sep 26, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 10, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants