Skip to content

Feature/non editable ticket#6

Merged
simonforsberg merged 4 commits intomainfrom
feature/non-editable-ticket
Apr 2, 2026
Merged

Feature/non editable ticket#6
simonforsberg merged 4 commits intomainfrom
feature/non-editable-ticket

Conversation

@simonforsberg
Copy link
Copy Markdown
Contributor

@simonforsberg simonforsberg commented Apr 2, 2026

Summary by CodeRabbit

  • New Features

    • Expanded audit logging capabilities with new action types: Status Changed, Unassigned, Comment Added, and Attachment Added.
  • Refactor

    • Enhanced database schema configuration with improved identity generation and relationship mapping strategies.
    • Strengthened data integrity through stricter column constraints and immutability rules on key fields.

…` constraints, and specify ID generation strategy
…GNED`, `COMMENT_ADDED`, `ATTACHMENT_ADDED`)
…rategy, define lazy fetching, update column definitions, and fix method naming in repository
…, enforce non-null constraints, define lazy fetching for relationships, and configure table mapping for `Attachment`.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 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: b85f9269-b6b7-404a-acc8-0f962da3a40f

📥 Commits

Reviewing files that changed from the base of the PR and between 51bd77c and 41d74fe.

📒 Files selected for processing (7)
  • src/main/java/org/example/alfs/entities/Attachment.java
  • src/main/java/org/example/alfs/entities/AuditLog.java
  • src/main/java/org/example/alfs/entities/Ticket.java
  • src/main/java/org/example/alfs/entities/TicketComment.java
  • src/main/java/org/example/alfs/entities/User.java
  • src/main/java/org/example/alfs/enums/AuditAction.java
  • src/main/java/org/example/alfs/repositories/TicketCommentRepository.java

📝 Walkthrough

Walkthrough

JPA entity configurations are standardized across five entity classes by explicitly setting primary key generation to GenerationType.IDENTITY, adding table and column mappings, and configuring relationship fetching strategies. The TicketComment field isInternalNote is renamed to internalNote. The AuditAction enum replaces UPDATED with STATUS_CHANGED and adds three new audit action types. Repository query method naming is updated accordingly.

Changes

Cohort / File(s) Summary
Entity Primary Key & Relationship Configurations
src/main/java/org/example/alfs/entities/Attachment.java, AuditLog.java, Ticket.java, TicketComment.java, User.java
Standardized primary key generation to GenerationType.IDENTITY across all entities. Added explicit @Table mapping, configured lazy-fetch relationships with explicit @JoinColumn constraints specifying column names and nullability.
Entity Field Updates & Column Constraints
src/main/java/org/example/alfs/entities/TicketComment.java, Ticket.java, AuditLog.java
Renamed isInternalNote to internalNote in TicketComment. Marked title and description columns as non-updatable in Ticket. Added non-null constraints to fieldName and createdAt in AuditLog.
Audit Action Enum Expansion
src/main/java/org/example/alfs/enums/AuditAction.java
Removed UPDATED constant and added STATUS_CHANGED, UNASSIGNED, COMMENT_ADDED, and ATTACHMENT_ADDED action types.
Repository Query Method Update
src/main/java/org/example/alfs/repositories/TicketCommentRepository.java
Renamed method from findByTicketIdAndIsInternalNoteOrderByCreatedAtAsc to findByTicketIdAndInternalNoteOrderByCreatedAtAsc to align with entity field rename.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Feature/repository #4 — Modifies the same entity mappings and repository APIs for Ticket, TicketComment, and Attachment with overlapping internal-note field changes.
  • Feature/entities #1 — Updates JPA annotations and field/relationship details on the same entity classes that were initially introduced.
  • Feature/entity edit #2 — Modifies the Attachment entity with non-null column constraints for related fields.

Poem

Hopping through the schema with delight, 🐰
Identity keys shine ever bright,
Lazy relationships fetch with care,
Audit actions bloom everywhere,
Field names refined, constraints aligned,
A mapping marvel we've designed!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feature/non editable ticket' directly aligns with the main changes, which add immutability constraints to ticket fields and related entity mappings.

✏️ 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/non-editable-ticket

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.

@addee1
Copy link
Copy Markdown
Contributor

addee1 commented Apr 2, 2026

Nice improvements overall.especially the more detailed AuditAction enum and consistent use of nullable and updatable 💯

Copy link
Copy Markdown
Contributor

@addee1 addee1 left a comment

Choose a reason for hiding this comment

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

Nice improvements overall, especially the more detailed AuditAction enum and consistent use of nullable and updatable. This aligns well with audit and data integrity requirements :)

@simonforsberg simonforsberg merged commit c961c67 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