# Reservations API

## Ticket Filtering API View

<mark style="color:blue;">`GET`</mark> `https://younghoonjean.com/api/tickets/filter/`

영화 예매 필터링 API입니다. 각 조건에 따라 동적으로 리스트가 변동합니다.

#### Query Parameters

| Name          | Type   | Description                   |
| ------------- | ------ | ----------------------------- |
| movie         | string | input Movie title             |
| location      | string | input location of Theater     |
| sub\_location | string | input sub location of Theater |
| time          | string | YYYY-MM-DD 형태의 date           |

#### Headers

| Name           | Type   | Description        |
| -------------- | ------ | ------------------ |
| Authentication | string | token \<token key> |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Ticket Seat Reservation View

<mark style="color:blue;">`GET`</mark> `https://younghoonjean.com/api/tickets/seats/<int:pk>/`&#x20;

auditorium pk 은 상영관의 pk 입니다. Response로 해당 상영관의 좌석 예매 현황을 \
나타내어줍니다.

#### Path Parameters

| Name      | Type   | Description                                            |
| --------- | ------ | ------------------------------------------------------ |
| Screen PK | string | input Screening instance pk want to make a reservation |

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Authorization | string | Token \<token key> |

{% tabs %}
{% tab title="200 " %}

```
[
    {
        "pk": 1,
        # 좌석 고유의 pk 값
        "row": 1,
        # 행
        "number": 1,
        # 열
        "reservationCheck": true
        # 예매시 true 
    },
    {
        "pk": 2,
        "row": 1,
        "number": 2,
        "reservationCheck": true
    },
    {
        "pk": 3,
        "row": 1,
        "number": 3,
        "reservationCheck": false
        # 예매되지 않은 좌석은 false
    },
    ...
]
```

{% endtab %}
{% endtabs %}

## Make a Reservation View

<mark style="color:green;">`POST`</mark> `https://younhoonjean.com/api/tickets/reservations/`

입력한 상영 및 좌석 정보로 예약을 생성해줍니다.

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Content-Type  | string | application/json   |
| Authorization | string | Token \<token key> |

#### Request Body

| Name   | Type   | Description                                  |
| ------ | ------ | -------------------------------------------- |
| screen | string | input Screening instance pk                  |
| seats  | array  | input seat pk you want to make a reservation |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Movie Select API View For Reservation in iOS(Mobile)

<mark style="color:blue;">`GET`</mark> `https://younghoonjean.com/api/tickets/m/movies/`

현재 극장에 등록되어 있는 모든 영화 리스트를 보여줍니다.

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Authorization | string | Token \<token key> |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Ticket Filtering API View For iOS(Mobile)

<mark style="color:blue;">`GET`</mark> `https://younghoonjean.com/api/tickets/m/filter/<int:pk>/`

선택한 영화의 예약 가능정보들을 보여줍니다.

#### Path Parameters

| Name     | Type   | Description             |
| -------- | ------ | ----------------------- |
| movie pk | string | input movie instance pk |

#### Query Parameters

| Name     | Type   | Description                  |
| -------- | ------ | ---------------------------- |
| location | string | input location for filtering |
| time     | string | input YYYY-MM-DD form date   |

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Authorization | string | Token \<token key> |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}
