Skip to content

Feature/dto#3

Merged
FionaSprinkles merged 12 commits intomainfrom
feature/dto
Apr 2, 2026
Merged

Feature/dto#3
FionaSprinkles merged 12 commits intomainfrom
feature/dto

Conversation

@FionaSprinkles
Copy link
Copy Markdown
Contributor

@FionaSprinkles FionaSprinkles commented Mar 31, 2026

Add DTO layer for ticket and comment handling.

Summary by CodeRabbit

  • New Features
    • Create and view ticket comments with author, role, and timestamps
    • Create tickets with required non-empty title and description
    • Assign an investigator to a ticket
    • Update ticket status and view detailed ticket information (status, creation date, assigned handler)

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a993fbc0-8d5a-4eae-8281-e97ed8087bf7

📥 Commits

Reviewing files that changed from the base of the PR and between 590f9e5 and a6104ec.

📒 Files selected for processing (1)
  • src/main/java/org/example/alfs/dto/ticket/TicketViewDTO.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/org/example/alfs/dto/ticket/TicketViewDTO.java

📝 Walkthrough

Walkthrough

Adds six new DTO classes for tickets and comments, each annotated with Lombok @Data and validation annotations: CommentCreateDTO, CommentViewDTO, TicketCreateDTO, TicketViewDTO, TicketAssignDTO, and TicketStatusUpdateDTO.

Changes

Cohort / File(s) Summary
Comment DTOs
src/main/java/org/example/alfs/dto/comment/CommentCreateDTO.java, src/main/java/org/example/alfs/dto/comment/CommentViewDTO.java
Added CommentCreateDTO with @NotBlank message; added CommentViewDTO with id, message, author, role, createdAt.
Ticket DTOs
src/main/java/org/example/alfs/dto/ticket/TicketCreateDTO.java, src/main/java/org/example/alfs/dto/ticket/TicketViewDTO.java, src/main/java/org/example/alfs/dto/ticket/TicketAssignDTO.java, src/main/java/org/example/alfs/dto/ticket/TicketStatusUpdateDTO.java
Added TicketCreateDTO with @NotBlank title and description; TicketViewDTO with id, title, description, status, createdAt, assignedInvestigatorId; TicketAssignDTO with @NotNull investigatorId; TicketStatusUpdateDTO with @NotNull status (uses TicketStatus).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Feature/entity edit #2 — Introduces the TicketStatus enum and comment-related entity changes referenced by the new DTOs.

Poem

🐰 I hop through fields both short and neat,
New DTO carrots lined up to meet.
Titles, messages, statuses in tow,
I tuck them in rows where data can grow.
A tiny thump for structures that flow.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feature/dto' is vague and generic, failing to clearly describe the specific changes being introduced—adding multiple DTO classes for ticket and comment handling. Revise the title to be more specific and descriptive, such as 'Add DTO classes for ticket and comment handling' or 'Introduce ticket and comment DTOs for API layer'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/dto

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
Copy Markdown

@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: 1

🧹 Nitpick comments (1)
src/main/java/org/example/alfs/dto/ticket/TicketAssignDTO.java (1)

12-13: Use domain-consistent assignee naming.

handlerId diverges from the domain term investigator (src/main/java/org/example/alfs/entities/Ticket.java, Lines 62-68). Renaming now will reduce mapping ambiguity before API stabilizes.

🔧 Suggested rename
 public class TicketAssignDTO {
@@
-    private Long handlerId;
+    private Long investigatorId;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/org/example/alfs/dto/ticket/TicketAssignDTO.java` around lines
12 - 13, Rename the DTO field to match domain terminology: change the field
handlerId in TicketAssignDTO to investigatorId and update any related
getters/setters, constructors, and usages (e.g., mapping code) to use
investigatorId so it aligns with the Ticket entity's investigator property and
avoids mapping ambiguity; ensure JSON/serialization annotations or mapping
profiles are updated to reflect the new name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/java/org/example/alfs/dto/ticket/TicketStatusUpdateDTO.java`:
- Around line 3-16: The TicketStatusUpdateDTO class incorrectly uses `@NotBlank`
on the enum field status which causes a runtime UnexpectedTypeException; change
the validation annotation on the field named status in class
TicketStatusUpdateDTO from `@NotBlank` to `@NotNull` so the enum is validated
correctly (replace the import of jakarta.validation.constraints.NotBlank with
jakarta.validation.constraints.NotNull and update the annotation on the status
field).

---

Nitpick comments:
In `@src/main/java/org/example/alfs/dto/ticket/TicketAssignDTO.java`:
- Around line 12-13: Rename the DTO field to match domain terminology: change
the field handlerId in TicketAssignDTO to investigatorId and update any related
getters/setters, constructors, and usages (e.g., mapping code) to use
investigatorId so it aligns with the Ticket entity's investigator property and
avoids mapping ambiguity; ensure JSON/serialization annotations or mapping
profiles are updated to reflect the new name.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5aa61ede-3dc1-460e-be71-68ded61adddd

📥 Commits

Reviewing files that changed from the base of the PR and between 6e48e81 and 1872641.

📒 Files selected for processing (6)
  • src/main/java/org/example/alfs/dto/comment/CommentCreateDTO.java
  • src/main/java/org/example/alfs/dto/comment/CommentViewDTO.java
  • src/main/java/org/example/alfs/dto/ticket/TicketAssignDTO.java
  • src/main/java/org/example/alfs/dto/ticket/TicketCreateDTO.java
  • src/main/java/org/example/alfs/dto/ticket/TicketStatusUpdateDTO.java
  • src/main/java/org/example/alfs/dto/ticket/TicketViewDTO.java

@FionaSprinkles FionaSprinkles merged commit 51bd77c into main Apr 2, 2026
2 checks passed
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.

2 participants