> For the complete documentation index, see [llms.txt](https://alecmei-gubin.gitbook.io/citron-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alecmei-gubin.gitbook.io/citron-system/untitled/proekty/etapy-proekta.md).

# Этапы проекта

## index

<mark style="color:blue;">`GET`</mark> `https://api.url/api/project_stages`

Список всех этапов

#### Headers

| Name          | Type   | Description                     |
| ------------- | ------ | ------------------------------- |
| Authorization | string | Токен, выданный при авторизации |

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

```javascript
{
    "data": [
        {
            "id": 2,
            "description": "rewereqr",
            "project_id": 1,
            "position": 0
        },
        {
            "id": 3,
            "description": "Описание этапа проекта",
            "project_id": 1,
            "position": 3
        },
        {
            "id": 4,
            "description": "Описание этапа проекта 2",
            "project_id": 1,
            "position": 4
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## show

<mark style="color:blue;">`GET`</mark> `https://api.url/api/project_stages/{id}`

Получить этап по id

#### Path Parameters

| Name | Type    | Description      |
| ---- | ------- | ---------------- |
| id   | integer | id этапа проекта |

#### Headers

| Name          | Type   | Description                     |
| ------------- | ------ | ------------------------------- |
| Authorization | string | Токен, выданный при авторизации |

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

```javascript
{
    "data": {
        "id": 3,
        "description": "Описание этапа проекта",
        "project_id": 1,
        "position": 3
    }
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "errors": {
        "id": [
            "The selected id is invalid."
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## store

<mark style="color:green;">`POST`</mark> `https://api.url/api/project_stages`

Создать этап

#### Headers

| Name          | Type   | Description                     |
| ------------- | ------ | ------------------------------- |
| Authorization | string | Токен, выданный при авторизации |

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

```javascript
{
    "data": {
        "id": 5,
        "description": "Формирование задач проекта",
        "project_id": "1",
        "position": "4"
    }
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "errors": {
        "description": [
            "The description field is required."
        ],
        "project_id": [
            "The project id field is required."
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## update

<mark style="color:orange;">`PUT`</mark> `https://api.url/api/project_stages/{id}`

Изменить данные этапа

#### Path Parameters

| Name | Type    | Description      |
| ---- | ------- | ---------------- |
| id   | integer | id этапа проекта |

#### Query Parameters

| Name        | Type    | Description            |
| ----------- | ------- | ---------------------- |
| position    | integer | номер позиции в списке |
| project\_id | integer | id проекта             |
| description | string  | описание этапа         |

#### Headers

| Name          | Type   | Description                     |
| ------------- | ------ | ------------------------------- |
| Authorization | string | Токен, выданный при авторизации |

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

```javascript
{
    "data": {
        "id": 3,
        "description": "Новое описание этапа проекта",
        "project_id": 1,
        "position": 3
    }
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "errors": {
        "id": [
            "The selected id is invalid."
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## delete

<mark style="color:red;">`DELETE`</mark> `https://api.url/api/project_stages/{id}`

Удаляет этап по id проекта

#### Path Parameters

| Name | Type   | Description      |
| ---- | ------ | ---------------- |
| id   | string | id этапа проекта |

#### Headers

| Name          | Type   | Description                     |
| ------------- | ------ | ------------------------------- |
| Authorization | string | Токен, выданный при авторизации |

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

```javascript
[
    "success"
]
```

{% endtab %}
{% endtabs %}
