Skip to content

Arshdeep225615024/feature/incident reporting upgrade#340

Open
Arshdeep225615024 wants to merge 5 commits into
mainfrom
Arshdeep225615024/feature/incident-reporting-upgrade
Open

Arshdeep225615024/feature/incident reporting upgrade#340
Arshdeep225615024 wants to merge 5 commits into
mainfrom
Arshdeep225615024/feature/incident-reporting-upgrade

Conversation

@Arshdeep225615024
Copy link
Copy Markdown
Collaborator

Summary

This PR enhances the existing incident tracking system by adding support for rich media uploads, GPS metadata, standardized timestamps, and a structured status lifecycle.


Key Enhancements

1. Incident Schema Improvements

  • Added GPS location support
    • latitude
    • longitude
  • Added server-side timestamp
    • recordedAt
  • Replaced old status values with a structured lifecycle
    • SUBMITTED → IN_REVIEW → RESOLVED

2. Attachment System Upgrade

  • Extended attachment schema to include:
    • originalName
    • mimeType
    • fileSize
    • mediaType (image, video, audio, pdf, other)
  • Enabled rich media uploads
    • Images
    • Videos
    • Audio
    • PDFs

3. Controller Enhancements

  • createIncident
    • Accepts GPS data
    • Automatically sets recordedAt
    • Defaults status to SUBMITTED
  • updateIncident
    • Enforces valid status transitions
  • uploadAttachment
    • Automatically detects and stores media metadata

4. Multer Configuration

  • Extended file support for:
    • images, videos, audio, PDFs
  • Increased file size limit to support larger media uploads

5. API Updates

  • Updated:
    • POST /api/v1/incidents
  • Extended:
    • POST /api/v1/incidents/{id}/attachments
  • Added metadata-aware file handling

6. Swagger Documentation

  • Updated status enum:
    • [SUBMITTED, IN_REVIEW, RESOLVED]
  • Updated attachment descriptions to include rich media support
  • Improved endpoint documentation and request/response clarity

Testing

  • Created incidents with and without GPS data
  • Verified:
    • recordedAt timestamp
    • structured status lifecycle
  • Tested valid and invalid status transitions
  • Uploaded:
    • images, PDFs, audio, and video files
  • Verified attachment metadata storage
  • Confirmed role-based access control

@uppalkrish
Copy link
Copy Markdown
Collaborator

swagger screenshot

@Arshdeep225615024
Copy link
Copy Markdown
Collaborator Author

Screenshot 2026-05-08 at 4 08 14 AM Screenshot 2026-05-08 at 3 57 29 AM Screenshot 2026-05-08 at 3 58 36 AM Screenshot 2026-05-08 at 3 59 03 AM Screenshot 2026-05-08 at 3 59 47 AM Screenshot 2026-05-08 at 4 00 13 AM Screenshot 2026-05-08 at 4 01 54 AM Screenshot 2026-05-08 at 4 02 18 AM

@Arshdeep225615024
Copy link
Copy Markdown
Collaborator Author

Added swagger docs screenshots

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