hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
182 stars 105 forks source link

[FEAT] User Self Delete Endpoint #167

Closed jeffmaine240 closed 1 month ago

jeffmaine240 commented 1 month ago

Description

A feature that allows soft deletion functionality for user accounts to ensure users can initiate the deletion process but allow Admin user finalize the permanent removal from the system.

Acceptance Criteria

Request

Expected Outcome

Provide a JSON response confirming the soft deletion with the user's basic details.

{
  "status": "success",
  "message": "Deletion in progress"
}
{
  "status": "error",
  "message": "Bad Request",
  "status_code": 400
}

Purpose

Requirement:

Checklist

nedssoft commented 1 month ago

@jeffmaine240 following REST API convention that was shared, this endpoint should be named as thus:

DELETE v1/api/users/:userId

jeffmaine240 commented 1 month ago

@jeffmaine240 following REST API convention that was shared, this endpoint should be named as thus:

DELETE v1/api/users/:userId

fixed sir

jeffmaine240 commented 1 month ago

fixed sir

nedssoft commented 1 month ago

userId is not snake_case

{
  "status": "success",
  "message": "Account Deleted Successfully",
  "user": {
    "userId": "String",
    "name": "String",
    "phone_number": "String"
  }
}
nedssoft commented 1 month ago

@jeffmaine240 The delete should be soft delete at the first instance, and then it'll be eventually deleted from the system after a set period. But for this task, you should soft delete (you don't have to handle to final delete as that would need some admin decision), every other specs you have remains

jeffmaine240 commented 1 month ago

@jeffmaine240 The delete should be soft delete at the first instance, and then it'll be eventually deleted from the system after a set period. But for this task, you should soft delete (you don't have to handle to final delete as that would need some admin decision), every other specs you have remains

fixed the issue again sir

nedssoft commented 1 month ago

@jeffmaine240 I missed this earlier, you don't need to return the user info when an account is deleted, just status code and message

jeffmaine240 commented 1 month ago

@jeffmaine240 I missed this earlier, you don't need to return the user info when an account is deleted, just status code and message

fixed now sir