---
openapi: "3.0.4"
info:
  title: "Task Manager"
servers:
- url: "https://tm.volnenko.ru/api/"
components:
  schemas:
    Error:
      type: "object"
      description: "Ошибка"
      required:
      - "success"
      properties:
        success:
          type: "boolean"
          description: "Результат выполнения"
        message:
          type: "string"
          description: "Сообщение об ошибке"
        errorCode:
          type: "string"
          description: "Код ошибки"
    Project:
      type: "object"
      description: "Проект"
      required:
      - "id"
      - "userId"
      - "created"
      - "updated"
      properties:
        id:
          type: "string"
          format: "uuid"
          description: "Идентификатор"
        name:
          type: "string"
          description: "Название"
        description:
          type: "string"
          description: "Описание"
        statusType:
          type: "string"
          description: "Статус"
          enum:
          - "NOT_STARTED"
          - "IN_PROGRESS"
          - "COMPLETE"
        userId:
          type: "string"
          format: "uuid"
          description: "Код пользователя"
        created:
          type: "string"
          format: "iso8601"
          description: "Дата создания"
        updated:
          type: "string"
          format: "iso8601"
          description: "Дата создания"
    Task:
      type: "object"
      description: "Задача"
      required:
      - "id"
      - "userId"
      - "created"
      - "updated"
      properties:
        id:
          type: "string"
          format: "uuid"
          description: "Идентификатор"
        name:
          type: "string"
          description: "Название"
        description:
          type: "string"
          description: "Описание"
        statusType:
          type: "string"
          description: "Статус"
          enum:
          - "NOT_STARTED"
          - "IN_PROGRESS"
          - "COMPLETE"
        userId:
          type: "string"
          format: "uuid"
          description: "Код пользователя"
        created:
          type: "string"
          format: "iso8601"
          description: "Дата создания"
        updated:
          type: "string"
          format: "iso8601"
          description: "Дата создания"
    User:
      type: "object"
      description: "Пользователь"
      required:
      - "id"
      - "username"
      - "email"
      - "created"
      - "updated"
      properties:
        id:
          type: "string"
          format: "uuid"
          description: "Идентификатор"
        username:
          type: "string"
          description: "Имя пользователя"
        firstName:
          type: "string"
          description: "Имя"
        lastName:
          type: "string"
          description: "Фамилия"
        middleName:
          type: "string"
          description: "Отчество"
        email:
          type: "string"
          description: "E-mail"
        created:
          type: "string"
          format: "iso8601"
          description: "Дата создания"
        updated:
          type: "string"
          format: "iso8601"
          description: "Дата создания"
paths:
  /project/one/{projectId}/:
    get:
      tags:
      - "project"
      summary: "Выборка проекта."
      description: "Выборка одного проекта по Id."
      operationId: "selectOneProject"
      parameters:
      - name: "projectId"
        in: "path"
        description: "Код проекта"
        required: true
        schema:
          type: "string"
          format: "uuid"
      responses:
        200:
          description: "Успешный ответ"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
            application/xml:
              schema:
                $ref: "#/components/schemas/Project"
        404:
          description: "Проект не найден"
        default:
          description: "Неизветсная ошибока"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /project/all/:
    get:
      tags:
      - "project"
      summary: "Выборка всех проектов."
      description: "Выборка всех проектов."
      operationId: "selectAllProject"
      responses:
        200:
          description: "Успешный ответ"
          content:
            application/json:
              schema:
                type: "array"
                items:
                  $ref: "#/components/schemas/Project"
            application/xml:
              schema:
                type: "array"
                items:
                  $ref: "#/components/schemas/Project"
        default:
          description: "Неизветсная ошибока"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /task/one/{taskId}/:
    get:
      tags:
      - "task"
      summary: "Выборка задачи."
      description: "Выборка одной задачи по Id."
      operationId: "selectOneTask"
      parameters:
      - name: "taskId"
        in: "path"
        description: "Код задачи"
        required: true
        schema:
          type: "string"
          format: "uuid"
      responses:
        200:
          description: "Успешный ответ"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
            application/xml:
              schema:
                $ref: "#/components/schemas/Task"
        404:
          description: "Проект не найден"
        default:
          description: "Неизветсная ошибока"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /task/all/:
    get:
      tags:
      - "task"
      summary: "Выборка всех задач."
      description: "Выборка всех задач."
      operationId: "selectAllTask"
      responses:
        200:
          description: "Успешный ответ"
          content:
            application/json:
              schema:
                type: "array"
                items:
                  $ref: "#/components/schemas/Task"
            application/xml:
              schema:
                type: "array"
                items:
                  $ref: "#/components/schemas/Task"
        default:
          description: "Неизветсная ошибока"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
