Skip to content

Test PoI Submission API Implementation #22

@fatiudeen

Description

@fatiudeen

Description

This issue is created to test the functionality of the Proof of Impact (PoI) submission API implemented in a previous issue. The goal is to validate that users can successfully submit before-and-after cleanup photos, with proper file validation, metadata extraction, and database storage.

Tasks

Test PoI Submission Endpoint

  • Send a POST /api/poi/submit request with valid image files.
  • Ensure the API correctly handles multipart file uploads.

File Validation

  • Confirm only JPEG, JPG, HEIC formats are accepted.
  • Ensure images exceeding 10 MB are rejected.
  • Verify that exactly two images (before & after) are required per submission.

Metadata Extraction & Storage

  • Check that geotags (latitude, longitude) and timestamps are correctly extracted.
  • Confirm metadata is stored without being used for validation.
  • Verify that location data is saved for potential impact tracking.

Database Storage

  • Ensure the following details are correctly stored:
    • User ID (wallet address).
    • Before & After image IPFS/Filecoin CIDs.
    • Extracted metadata (timestamps, geotags).
    • Submission status: "pending" | "verified" | "rejected".

Response & Error Handling

  • Verify a success response with a submission ID if all conditions are met.
  • Confirm proper error messages are returned when:
    • File format is invalid.
    • Image size exceeds 10 MB.
    • Only one image is uploaded.

Expected Outcome

The API should properly validate and process PoI submissions, store relevant data, and handle errors gracefully.

Metadata

Metadata

Assignees

Labels

backendnon-rewardedonlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions