CodeRabbit suggestion/nitpick comment on Ticket entity:
"Removing cascade operations aligns with the requirement to preserve whistleblower data.
However, without cascade and without explicit ON DELETE constraints at the DB level, attempting to delete a Ticket will either:
- Fail with a FK constraint violation (desired behavior), or
- Leave orphaned
TicketComment, Attachment, and AuditLog rows if FK constraints aren't enforced
To ensure data integrity, consider implementing a soft-delete pattern (e.g., an isDeleted or deletedAt field) and preventing hard deletes at the service layer. This makes the intent explicit and avoids relying solely on DB constraint behavior.
CodeRabbit suggestion/nitpick comment on
Ticketentity:"Removing cascade operations aligns with the requirement to preserve whistleblower data.
However, without cascade and without explicit
ON DELETEconstraints at the DB level, attempting to delete aTicketwill either:TicketComment,Attachment, andAuditLogrows if FK constraints aren't enforcedTo ensure data integrity, consider implementing a soft-delete pattern (e.g., an
isDeletedordeletedAtfield) and preventing hard deletes at the service layer. This makes the intent explicit and avoids relying solely on DB constraint behavior.