Skip to content

[Good First Issue] Add validation for incident report form #4

@Dapappa

Description

@Dapappa

Points: 100

Add server-side validation for incident report submissions.

Validation Rules:

  • Description: Required, 10-1000 characters
  • Location: Required, valid lat/lng coordinates
  • Photos: Optional, max 5 files, max 5MB each
  • Contact: Optional, valid phone or email format
  • Category: Required, one of: kidnapping, suspicious, road-block, other

Files to modify:

  • /packages/database/src/routes/incidents.ts
  • /packages/database/src/validators/incidentValidator.ts (create new)

Testing:

  • Invalid submissions return 400 with clear error messages
  • Valid submissions are accepted
  • SQL injection attempts are blocked

Want to work on this?

  1. Comment "I'd like to work on this!" to claim
  2. Wait for maintainer approval
  3. Fork the repo and create a branch
  4. Submit a PR when ready

Questions? Ask on Discord

🇳🇬 Part of Code for Change - Building technology that saves lives!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions