# RESTful API

### Auth

#### GET

* <mark style="color:blue;">`/auth/me`</mark> : Authentication check
* <mark style="color:blue;">`/auth/csrf-token`</mark> : Csrf attack security

#### POST

* <mark style="color:blue;">`/auth/signup`</mark> : User sign up
* <mark style="color:blue;">`/auth/login`</mark> : User login
* <mark style="color:blue;">`/auth/logout`</mark> : User logout

***

### Customer

#### GET

* <mark style="color:blue;">`customer/all`</mark> : Get list of customers
* <mark style="color:blue;">`/customer?addname&dong&ho`</mark> : Find customers by its address name, dong, ho

#### POST

* <mark style="color:blue;">`/customer`</mark> : Create a new customer

#### PUT

* <mark style="color:blue;">`/customer/:id`</mark> : Update an existing customer by its ID

#### DELETE

* <mark style="color:blue;">`/customer/:id`</mark> : Delete an existing customer by its ID

***

### Address

#### GET

* <mark style="color:blue;">`/address`</mark> : Get list of address
* <mark style="color:blue;">`/address/:id`</mark> : Find a address by its ID

#### POST

* &#x20;<mark style="color:blue;">`/address`</mark> : Create a new address

#### PUT

* <mark style="color:blue;">`/address/:id`</mark> : Update an existing address by its ID

#### DELETE

* <mark style="color:blue;">`/address/:id`</mark> : Delete an existing address by its ID

***

### Products

#### GET

* <mark style="color:blue;">`/products`</mark> : Get list of products, category

#### POST

* <mark style="color:blue;">`/products`</mark> : Create a new category
* <mark style="color:blue;">`/products/list`</mark> : Create a new product

#### PUT

* <mark style="color:blue;">`/products/:id`</mark> : Update an existing category list by its ID
* <mark style="color:blue;">`products/list/:id`</mark> : Update an existing product list by its ID

#### DELETE

* <mark style="color:blue;">`/products/:id`</mark> : Delete an existing category by its ID

***

### Records

#### GET

* <mark style="color:blue;">`/records?addname&dong&ho`</mark> : Find records by customer's address name, dong, ho
* <mark style="color:blue;">`/records/date?startDate&endDate`</mark> : Find records by its Date

#### POST

* <mark style="color:blue;">`/records`</mark> : Create a new record

#### DELETE

* <mark style="color:blue;">`/records/:id`</mark> : Delete an existing record by its ID

***

### Sale

#### GET

* <mark style="color:blue;">`/sale`</mark> : Get list of sales

#### POST

* <mark style="color:blue;">`/sale`</mark> : Create a new sale
