feat: add uploader_role to ticket attachments - #66
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request adds uploader role tracking to ticket attachments. A new Changes
Sequence DiagramsequenceDiagram
participant User as User/Client
participant Service as AttachmentService
participant Entity as TicketAttachment
participant DB as Database
participant DTO as AttachmentResponse
User->>Service: uploadAttachment(file, user.role)
Service->>Entity: builder().uploaderRole(user.role)
Service->>DB: save(attachment)
DB->>DB: INSERT with uploader_role
Service->>DTO: AttachmentResponse.from(attachment, signedUrl)
DTO->>DTO: populate uploaderRole field
DTO-->>User: Response with uploaderRole
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Type of Change
Labels
p3-lowfeatbackendWhat Changed
uploader_rolefield (VARCHAR(20)) to theticket_attachmenttable via Flyway migrationV14__add_uploader_role_to_attachment.sqluploaderRoleto theTicketAttachmententityAttachmentServicenow persists the uploader's role when saving a new attachmentAttachmentResponseDTO exposesuploaderRolein API responsesWhy
Allows consumers (admin UI, analytics) to distinguish whether an attachment was uploaded by a student, staff, or admin without joining the users table on every query.
How to Test
uploaderRoleis"STUDENT"in the responseuploaderRolereflects the admin role./mvnw test— all existing tests should passRelated Issues
Screenshots
Checklist
ApiResponse<T>wrapperapplication.yamlis NOT stagedSummary by CodeRabbit