hngprojects / hng_boilerplate_golang_web

Apache License 2.0
77 stars 50 forks source link

[FEAT]: NewsLetter Page Api Endpoint #12

Closed Ajinx1 closed 2 months ago

Ajinx1 commented 3 months ago

Description

Develop a backend endpoint to handle requests for newsletter subscriptions. The endpoint will accept an email address, validate and sanitize it, and then handle both successful and failed validations appropriately. If the email passes validation, it will be stored in the database and a 'success' response will be sent to the client. If validation fails, an error message will be returned._

Acceptance Criteria

Requirements

Expected Outcome

Endpoint

HTTP POST /api/v1/newsletter

Requests:

headers:

Database design

schema

Table new_letters { id uuid [primary key] email varchar(70) created_at timestamp updated_at timestamp }

_

Testing

  1. Unit Tests

The systems should have unit tests covering:

Ajinx1 commented 3 months ago

copied from an approved issue here