Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Update]: define customer's routes and endpoints #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions customers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Customers Routes

This endpoints will be used for customers' profile, customers' dashboard and some functionalities in the customers' setting

### Create Customer

POST /v1/customers - This route won't be defined.

Response

```json
res.status(500).json({
status: 'success',
message: 'This route is not defined! please use /signup instead',
});
```

### Get All Customer

GET /v1/customers - This route will be used to fetch all customers data

Response

```json
res.status(200).json({
results: customers.length
status: 'success',
data: {
data: customers
}
})
```

### Get a Customer

GET /v1/getMe - This route will be used to fetch a customers data

Response

```json
res.status(200).json({
status: 'success',
id: mongodb Object
username: 'Joely',
email: '[email protected]'
})
```

### Update a Customer details

PATCH /v1/updateMe - This route will be used to update editable customer details except password
Request
{
email: '[email protected]'
}

Response

```json
res.status(201).json({
status: 'success',
email: '[email protected]'
})
```

### Delete a Customer

DELETE /v1/deleteMe - This route will be used to temporarily delete customer. The account can be reclaimed. There will be active field in the customer's table which will be set to False when the customer requested for the closing of the account.

Response

```json
res.status(204).json()
```