hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
182 stars 105 forks source link

[FEAT] Delete Customer API Endpoint #157

Closed AMdabour closed 2 weeks ago

AMdabour commented 1 month ago

Description

Create an API endpoint to soft delete a customer. This endpoint will handle the soft deletion of customer records by marking them as deleted and ensure proper validation and error handling.

Acceptance Criteria

API Endpoint Implementation:

Data Validation and Authorization:

Response:

Request Example:

DELETE /api/customers/{customerId}

Successful Response:

{
  "message": "Customer deleted successfully",
  "status_code": 200
}

Error Response:

{
  "message": "provide a valid customer ID ",
  "status_code": 400
}

if a valid customer ID provided but no customer with this ID found in the database

{
  "message": "Customer not found ",
  "status_code": 404
}

Purpose

Provides a backend service to delete customer records securely, ensuring only authorized admins can perform this action.

Requirements

Expected Outcome

API endpoint allows admins to delete customer records securely, returning appropriate success and error responses.

Status Codes

Testing

nedssoft commented 1 month ago

This should be a soft delete. For compliance purposes you don't permanently delete user information immediately, soft delete in the db

chukssomzzy commented 1 month ago

Are you guys going to be working on this? if you are, please add an in progress label, else my team would be working on it.

AMdabour commented 1 month ago

@chukssomzzy i will wok on it but i don't have access on the repo so i couldn't add in progress label

AMdabour commented 1 month ago

@chukssomzzy if you have access, could you add it for me please

chukssomzzy commented 1 month ago

Do you have nodejs or python dev on your team yet?

AMdabour commented 1 month ago

Our slack IDs @Ahmed_Dabour @Ashade_Samson

AshadeSamson commented 1 month ago

@Ahmed_Dabour - FastAPI @Ashade_Samson - Nest.js

AMdabour commented 1 month ago

@FreemanBoss could you label our issue to be in progress

FreemanBoss commented 1 month ago

Please sorry just seeing this. Should I still label it?

AshadeSamson commented 1 month ago

Yes please @FreemanBoss

FreemanBoss commented 1 month ago

Done!