> For the complete documentation index, see [llms.txt](https://baeminchan-project.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://baeminchan-project.gitbook.io/project/undefined-1.md).

# 장바구니

## 구조 설명

* 하나의 장바구니 아이템 (cart\_item)은 (user, item, amount) (사용자, 반찬, 수량)을 가진다.
* 한 사용자가 가진 모든 cart\_item을 모아야 전체 장바구니에 담긴 반찬을 알 수 있다.

## 주의 사항

user는 token을 header에 넣어서 식별, 항상 있어야 가능

body에 입력되는 내용은 json 형식으로 작성해야함

### 장바구니 아이템 추가시 형식

```
{
    "item_pk": 1,
    "amount": 2
}
```

### 장바구니 아이템 수량 변경시 형식

```
{
    "cart_item_pk": 4,
    "amount": 4
}
또는 
{
    "cart_item_pk": 4,
    "add_amount": 1
}
add_amount는 음수도 가

```

### 장바구니 아이템 삭제

```
{
    "cart_item_pk": 5
}
```

### 결과 설명

* cart\_item\_pk
* &#x20;user
  * user\_pk
  * username
  * first\_name
  * last\_name
  * email
  * img\_profile
* item (반찬)
  * item\_pk
  * company
  * item\_name
  * origin\_price
  * sale\_price
  * discount\_rate
  * list\_thumbnail
* amount (수량)
