diconium / ethereal-pulse

Apache License 2.0
0 stars 3 forks source link

Create Template Route in API #26

Closed ivanLOliveira closed 1 week ago

ivanLOliveira commented 2 weeks ago

Description

We need to create a route in the API for managing email templates. This route will allow users to create, retrieve, update, and delete email templates.

Tasks

  1. Set up the template route:

    • Create a new route in the NestJS server for email templates.
  2. Implement Create Template endpoint:

    • Define the endpoint to create a new email template.
    • Validate the input data (e.g., template name, content).
    • Save the template to the database.
  3. Implement Retrieve Templates endpoint:

    • Define the endpoint to retrieve all email templates for a user.
    • Fetch the templates from the database and return them.
  4. Implement Update Template endpoint:

    • Define the endpoint to update an existing email template.
    • Validate the input data.
    • Update the template in the database.
  5. Implement Delete Template endpoint:

    • Define the endpoint to delete an email template.
    • Remove the template from the database.
  6. Add authentication and authorization:

    • Ensure that only authenticated users can access these endpoints.
    • Implement authorization to ensure users can only manage their own templates.
  7. Write tests:

    • Write unit and integration tests for each endpoint to ensure they work as expected.

Additional Context

Labels

backend, api, enhancement

Acceptance Criteria