safe-client-gateway icon indicating copy to clipboard operation
safe-client-gateway copied to clipboard

Add Targeted Messaging API

Open hectorgomezv opened this issue 4 months ago • 0 comments

Summary

This PR adds the Targeted Messaging feature's API endpoints and domain logic.

GET submission

GET /v1/targeted-messaging/outreaches/{outreachId}/chains/{chainId}/safes/{safeAddress}/signers/{signerAddress}/submissions

Retrieves a given submission by Outreach, Chain, Safe, and Safe signer.

  • 204 No Content: The Safe signer is NOT targeted for the outreach.
  • 400 Bad Request: The signer address is NOT a signer of the Safe.
  • 200 OK: The Safe signer is targeted. If the submission did happen, completionDate would hold the completion date. Otherwise, it would be null.

CREATE submission

POST /v1/targeted-messaging/outreaches/{outreachId}/chains/{chainId}/safes/{safeAddress}/signers/{signerAddress}/submissions
  • 201 Created: If the submission was successfully recorded.
  • 400 Bad Request: The payload is invalid or if the Safe signer has already made the submission.
  • 400 Bad Request: The signer address is NOT a signer of the Safe.
  • 404 Not Found: The Safe signer is NOT targeted for the outreach.

Submission schema

{
  "outreachId": number,
  "targetedSafeId": number,
  "signerAddress": `0x${string}`,
  "completionDate": Date | null
}

Changes

  • Adds GET and POST endpoints to /targeted-messaging/outreaches/ to create and retrieve submissions.

hectorgomezv avatar Oct 02 '24 14:10 hectorgomezv