{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "schemes": [
    "https"
  ],
  "swagger": "2.0",
  "info": {
    "title": "JNX Admin-Dashboard API Documentation.",
    "version": "1.0.0"
  },
  "host": "jannex",
  "basePath": "/v1",
  "paths": {
    "/adminarea/roles": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "adminarea"
        ],
        "summary": "Get all roles",
        "operationId": "adminareaGetRoles",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "All roles",
            "schema": {
              "$ref": "#/definitions/AdminAreaRolesResponse"
            }
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to get roles"
          }
        }
      }
    },
    "/equipment/documentation/create": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "equipment"
        ],
        "summary": "Create a new equipment documentation",
        "operationId": "equipmentCreateEquipmentDocumentation",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          },
          {
            "name": "body",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/CreateEquipmentDocumentationRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "New equipment documentation created successfully"
          },
          "400": {
            "description": "Invalid request body"
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to create equipment documentation"
          }
        }
      }
    },
    "/equipment/documentation/edit": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "equipment"
        ],
        "summary": "Edit equipment documentation",
        "operationId": "equipmentEditEquipmentDocumentation",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          },
          {
            "name": "body",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/EditEquipmentDocumentationRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Equipment documentation edited successfully"
          },
          "400": {
            "description": "Invalid request body"
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to edit equipment documentation"
          }
        }
      }
    },
    "/equipment/documentation/{stockItemId}/{documentationId}": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "equipment"
        ],
        "summary": "Get equipment documentation",
        "operationId": "equipmentGetEquipmentDocumentation",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          },
          {
            "type": "string",
            "description": "Stock item id",
            "name": "stockItemId",
            "in": "path",
            "required": true
          },
          {
            "type": "string",
            "description": "Documentation id",
            "name": "documentationId",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Equipment documentation",
            "schema": {
              "$ref": "#/definitions/EquipmentDocumentation"
            }
          },
          "400": {
            "description": "Invalid request body"
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to get equipment documentation"
          }
        }
      }
    },
    "/equipment/documentations/{stockItemId}": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "equipment"
        ],
        "summary": "Get equipment documentations",
        "operationId": "equipmentGetEquipmentDocumentations",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          },
          {
            "type": "string",
            "description": "Stock item id",
            "name": "stockItemId",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Equipment documentations. Status 200 if equipment documentations found, status 404 if stock item not found on invex, status 401 if backend has no permissions to access invex",
            "schema": {
              "$ref": "#/definitions/EquipmentDocumentationResponse"
            }
          },
          "400": {
            "description": "Invalid request body"
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to get equipment documentations"
          }
        }
      }
    },
    "/equipment/thumbnail/{stockItemId}": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "equipment"
        ],
        "summary": "Get equipment thumbnail",
        "operationId": "equipmentGetEquipmentThumbnail",
        "parameters": [
          {
            "type": "string",
            "description": "Stock item id",
            "name": "stockItemId",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Equipment thumbnail picture. Backend server is just proxying the request to invex server and returning the response"
          },
          "400": {
            "description": "Invalid request body"
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to get equipment thumbnail"
          }
        }
      }
    },
    "/grouptasks": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "grouptask"
        ],
        "summary": "Get all group tasks",
        "operationId": "grouptaskGetGroupTasks",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "All group tasks",
            "schema": {
              "$ref": "#/definitions/GroupTasksResponse"
            }
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to get group tasks"
          }
        }
      }
    },
    "/grouptasks/start": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "grouptask"
        ],
        "summary": "Start a new group task",
        "operationId": "grouptaskStartGroupTask",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          },
          {
            "name": "body",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/ApiGroupTaskRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "New group task started successfully"
          },
          "400": {
            "description": "Invalid request body"
          },
          "401": {
            "description": "No permissions"
          },
          "422": {
            "description": "Global inputs are not complete or no group tasks in this category"
          },
          "500": {
            "description": "Failed to start group task"
          }
        }
      }
    },
    "/user/auth/login": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "user"
        ],
        "summary": "Login user",
        "operationId": "userLogin",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/UserLoginRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User logged in successfully",
            "schema": {
              "$ref": "#/definitions/UserLoginResponse"
            }
          },
          "400": {
            "description": "Invalid request body"
          },
          "401": {
            "description": "Incorrect password or user deactivated"
          },
          "500": {
            "description": "Failed to login user"
          }
        }
      }
    },
    "/user/auth/logout": {
      "delete": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "user"
        ],
        "summary": "Logout user",
        "operationId": "userLogout",
        "parameters": [
          {
            "description": "User session id",
            "name": "X-Authorization",
            "in": "header"
          }
        ],
        "responses": {
          "201": {
            "description": "User logged out successfully"
          },
          "500": {
            "description": "Failed to logout user"
          }
        }
      }
    },
    "/user/avatar": {
      "post": {
        "consumes": [
          "multipart/form-data"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "user"
        ],
        "summary": "Update user avatar",
        "operationId": "userAvatar",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          },
          {
            "type": "file",
            "description": "Avatar file",
            "name": "file",
            "in": "formData"
          }
        ],
        "responses": {
          "200": {
            "description": "User avatar updated successfully"
          },
          "400": {
            "description": "Invalid request body"
          },
          "401": {
            "description": "No permissions"
          },
          "413": {
            "description": "File too large"
          },
          "422": {
            "description": "Invalid file type"
          },
          "500": {
            "description": "Failed to update user avatar"
          }
        }
      }
    },
    "/user/info": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "user"
        ],
        "summary": "Get user info",
        "operationId": "userInfo",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "User info",
            "schema": {
              "$ref": "#/definitions/UserInfoResponse"
            }
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to get user info"
          }
        }
      }
    },
    "/user/profile": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "user"
        ],
        "summary": "Get user profile",
        "operationId": "userProfile",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "User profile",
            "schema": {
              "$ref": "#/definitions/UserProfileResponse"
            }
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to get user profile"
          }
        }
      }
    },
    "/user/session/{idForDeletion}": {
      "delete": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "user"
        ],
        "summary": "Sign out user session",
        "operationId": "userSignOutSession",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          },
          {
            "description": "Id for deletion",
            "name": "idForDeletion",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "User session signed out successfully"
          },
          "400": {
            "description": "Invalid request body"
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to sign out user session"
          }
        }
      }
    },
    "/users": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "users"
        ],
        "summary": "Get all users",
        "operationId": "usersGetUsers",
        "parameters": [
          {
            "description": "You can create a new api key in your user profile",
            "name": "X-Api-Key",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "All users",
            "schema": {
              "$ref": "#/definitions/UsersResponse"
            }
          },
          "401": {
            "description": "No permissions"
          },
          "500": {
            "description": "Failed to get users"
          }
        }
      }
    }
  },
  "definitions": {
    "AdminAreaRolesResponse": {
      "type": "object",
      "properties": {
        "Roles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Role"
          }
        },
        "RolesPermissions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RolePermissions"
          }
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "AllUsers": {
      "type": "object",
      "properties": {
        "Avatar": {
          "type": "string"
        },
        "ConnectionStatus": {
          "type": "integer",
          "format": "uint8"
        },
        "Deactivated": {
          "type": "boolean"
        },
        "Id": {
          "type": "string"
        },
        "LastOnline": {
          "type": "string",
          "format": "date-time"
        },
        "RoleId": {
          "type": "string"
        },
        "Username": {
          "type": "string"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "ApiGroupTaskRequest": {
      "type": "object",
      "properties": {
        "Category": {
          "type": "string"
        },
        "Description": {
          "type": "string"
        },
        "GlobalInputs": {
          "type": "object"
        },
        "GroupId": {
          "type": "string"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "CategoryGroup": {
      "type": "object",
      "properties": {
        "category": {
          "type": "string",
          "x-go-name": "Category"
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Group"
          },
          "x-go-name": "Groups"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "CreateEquipmentDocumentationRequest": {
      "type": "object",
      "properties": {
        "notes": {
          "type": "object",
          "x-go-name": "Notes"
        },
        "stockItemId": {
          "type": "string",
          "x-go-name": "StockItemId"
        },
        "title": {
          "type": "string",
          "x-go-name": "Title"
        },
        "type": {
          "type": "integer",
          "format": "uint8",
          "x-go-name": "Type"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "EditEquipmentDocumentationRequest": {
      "type": "object",
      "properties": {
        "documentationId": {
          "type": "string",
          "x-go-name": "DocumentationId"
        },
        "notes": {
          "type": "object",
          "x-go-name": "Notes"
        },
        "title": {
          "type": "string",
          "x-go-name": "Title"
        },
        "type": {
          "type": "integer",
          "format": "uint8",
          "x-go-name": "Type"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "EquipmentDocumentation": {
      "type": "object",
      "properties": {
        "CreatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "CreatedByUserId": {
          "type": "string"
        },
        "Id": {
          "type": "string"
        },
        "Notes": {
          "type": "string"
        },
        "StockItemId": {
          "type": "string"
        },
        "Title": {
          "type": "string"
        },
        "Type": {
          "type": "integer",
          "format": "uint8"
        },
        "UpdatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "EquipmentDocumentationResponse": {
      "type": "object",
      "properties": {
        "Documentations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EquipmentDocumentation"
          }
        },
        "Status": {
          "type": "integer",
          "format": "int64"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "GlobalInputs": {
      "type": "object",
      "properties": {
        "displayName": {
          "type": "string",
          "x-go-name": "DisplayName"
        },
        "parameterName": {
          "type": "string",
          "x-go-name": "ParameterName"
        },
        "type": {
          "type": "string",
          "x-go-name": "Type"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "Group": {
      "type": "object",
      "properties": {
        "category": {
          "type": "string",
          "x-go-name": "Category"
        },
        "globalInputs": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/GlobalInputs"
          },
          "x-go-name": "GlobalInputs"
        },
        "id": {
          "type": "string",
          "x-go-name": "Id"
        },
        "name": {
          "type": "string",
          "x-go-name": "Name"
        },
        "tasks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Task"
          },
          "x-go-name": "Tasks"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "GroupTaskSteps": {
      "type": "object",
      "properties": {
        "CreatorUserId": {
          "type": "string"
        },
        "EndedAt": {
          "type": "string",
          "format": "date-time"
        },
        "Files": {
          "type": "string"
        },
        "GroupTasksId": {
          "type": "string"
        },
        "Id": {
          "type": "string"
        },
        "Inputs": {
          "type": "string"
        },
        "LockedByUserId": {
          "type": "string"
        },
        "Log": {
          "type": "string"
        },
        "StartedAt": {
          "type": "string",
          "format": "date-time"
        },
        "Status": {
          "type": "integer",
          "format": "uint8"
        },
        "Step": {
          "type": "integer",
          "format": "uint8"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "GroupTasks": {
      "type": "object",
      "properties": {
        "Category": {
          "type": "string"
        },
        "CreatorUserId": {
          "type": "string"
        },
        "CurrentTasksStep": {
          "type": "integer",
          "format": "uint8"
        },
        "Description": {
          "type": "string"
        },
        "EndedAt": {
          "type": "string",
          "format": "date-time"
        },
        "GlobalInputs": {
          "type": "string"
        },
        "GroupId": {
          "type": "string"
        },
        "GroupName": {
          "type": "string"
        },
        "Id": {
          "type": "string"
        },
        "NumberOfSteps": {
          "type": "integer",
          "format": "uint8"
        },
        "RememberId": {
          "type": "string"
        },
        "StartedAt": {
          "type": "string",
          "format": "date-time"
        },
        "Status": {
          "type": "integer",
          "format": "uint8"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "GroupTasksResponse": {
      "type": "object",
      "properties": {
        "CategoryGroups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CategoryGroup"
          }
        },
        "GroupTasks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/GroupTasks"
          }
        },
        "GroupTasksSteps": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/GroupTaskSteps"
          }
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "Role": {
      "type": "object",
      "properties": {
        "CreatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "Description": {
          "type": "string"
        },
        "DisplayName": {
          "type": "string"
        },
        "Id": {
          "type": "string"
        },
        "Master": {
          "type": "boolean"
        },
        "SortingOrder": {
          "type": "integer",
          "format": "int64"
        },
        "UpdatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "RolePermissions": {
      "type": "object",
      "properties": {
        "Permissions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "RoleId": {
          "type": "string"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "Task": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "x-go-name": "Name"
        },
        "onFinish": {
          "type": "string",
          "x-go-name": "OnFinish"
        },
        "parameters": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TaskParameter"
          },
          "x-go-name": "Parameters"
        },
        "repeatPossible": {
          "type": "boolean",
          "x-go-name": "RepeatPossible"
        },
        "scriptPath": {
          "type": "string",
          "x-go-name": "ScriptPath"
        },
        "undoPossible": {
          "type": "boolean",
          "x-go-name": "UndoPossible"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "TaskParameter": {
      "type": "object",
      "properties": {
        "displayName": {
          "type": "string",
          "x-go-name": "DisplayName"
        },
        "global": {
          "type": "boolean",
          "x-go-name": "Global"
        },
        "parameterName": {
          "type": "string",
          "x-go-name": "ParameterName"
        },
        "type": {
          "type": "string",
          "x-go-name": "Type"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "UserApiKey": {
      "type": "object",
      "properties": {
        "CreatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "Id": {
          "type": "string"
        },
        "LastUsed": {
          "type": "string",
          "format": "date-time"
        },
        "Name": {
          "type": "string"
        },
        "Token": {
          "type": "string"
        },
        "UsageCount": {
          "type": "integer",
          "format": "uint64"
        },
        "UserId": {
          "type": "string"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "UserInfoResponse": {
      "type": "object",
      "properties": {
        "AvailableGroupTasks": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "Avatar": {
          "type": "string"
        },
        "Permissions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "UserId": {
          "type": "string"
        },
        "Username": {
          "type": "string"
        },
        "Users": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AllUsers"
          }
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "UserLoginRequest": {
      "type": "object",
      "properties": {
        "Password": {
          "type": "string"
        },
        "Username": {
          "type": "string"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "UserLoginResponse": {
      "type": "object",
      "properties": {
        "Session": {
          "type": "string"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "UserProfileResponse": {
      "type": "object",
      "properties": {
        "ApiKeys": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UserApiKey"
          }
        },
        "Email": {
          "type": "string"
        },
        "Sessions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UserSessionSocket"
          }
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "UserSessionSocket": {
      "type": "object",
      "properties": {
        "ConnectionStatus": {
          "type": "integer",
          "format": "uint8"
        },
        "ExpiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "IdForDeletion": {
          "type": "string"
        },
        "LastUsed": {
          "type": "string",
          "format": "date-time"
        },
        "UserAgent": {
          "type": "string"
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    },
    "UsersResponse": {
      "type": "object",
      "properties": {
        "RoleId": {
          "type": "string"
        },
        "Roles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Role"
          }
        },
        "Users": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AllUsers"
          }
        }
      },
      "x-go-package": "jannex/admin-dashboard-backend/modules/structs"
    }
  }
}