{
  "openapi": "3.0.0",
  "info": {
    "title": "ptg-back",
    "version": "0.0.1",
    "description": "PTG_Back",
    "contact": {}
  },
  "paths": {
    "/global/user/me": {
      "delete": {
        "x-controller-name": "GlobalUserController",
        "x-operation-name": "deleteLoggedUser",
        "tags": [
          "GlobalUserController"
        ],
        "responses": {
          "204": {
            "description": "User DELETE success"
          }
        },
        "operationId": "GlobalUserController.deleteLoggedUser"
      }
    },
    "/global/user/{id}": {
      "delete": {
        "x-controller-name": "GlobalUserController",
        "x-operation-name": "deleteById",
        "tags": [
          "GlobalUserController"
        ],
        "responses": {
          "204": {
            "description": "User DELETE success"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "GlobalUserController.deleteById"
      }
    },
    "/iam/change-password": {
      "post": {
        "x-controller-name": "IamController",
        "x-operation-name": "changePassword",
        "tags": [
          "IamController"
        ],
        "responses": {
          "200": {
            "description": "Change user password"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "newPassword": {
                    "type": "string"
                  },
                  "oldPassword": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "operationId": "IamController.changePassword"
      }
    },
    "/iam/login": {
      "post": {
        "x-controller-name": "IamController",
        "x-operation-name": "login",
        "tags": [
          "IamController"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Token",
            "content": {}
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "password"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 8
                  }
                }
              }
            }
          },
          "description": "The input of login function",
          "required": true
        },
        "operationId": "IamController.login"
      }
    },
    "/iam/me": {
      "get": {
        "x-controller-name": "IamController",
        "x-operation-name": "printCurrentUser",
        "tags": [
          "IamController"
        ],
        "responses": {
          "200": {
            "description": "The current user profile"
          }
        },
        "operationId": "IamController.printCurrentUser"
      }
    },
    "/iam/reset-password/finish": {
      "put": {
        "x-controller-name": "IamController",
        "x-operation-name": "resetPasswordFinish",
        "tags": [
          "IamController"
        ],
        "responses": {
          "200": {
            "description": "Return value of IamController.resetPasswordFinish"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyAndPassword"
              }
            }
          }
        },
        "operationId": "IamController.resetPasswordFinish"
      }
    },
    "/iam/reset-password/init": {
      "post": {
        "x-controller-name": "IamController",
        "x-operation-name": "resetPasswordInit",
        "tags": [
          "IamController"
        ],
        "responses": {
          "200": {
            "description": "Return value of IamController.resetPasswordInit"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordInit"
              }
            }
          }
        },
        "operationId": "IamController.resetPasswordInit"
      }
    },
    "/iam/validate": {
      "patch": {
        "x-controller-name": "IamController",
        "x-operation-name": "activateAccount",
        "tags": [
          "IamController"
        ],
        "responses": {
          "200": {
            "description": "Activate users account"
          }
        },
        "operationId": "IamController.activateAccount"
      }
    },
    "/infraestucture-settings": {
      "get": {
        "x-controller-name": "InfraestructureSettingsController",
        "x-operation-name": "find",
        "tags": [
          "InfraestructureSettingsController"
        ],
        "responses": {
          "200": {
            "description": "Information of the diferents elements that are part of the hole application like the app version or the api version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InfraestuctureSettings"
                  }
                }
              }
            }
          }
        },
        "operationId": "InfraestructureSettingsController.find"
      }
    },
    "/user/me": {
      "patch": {
        "x-controller-name": "UserController",
        "x-operation-name": "updateLoggedUser",
        "tags": [
          "UserController"
        ],
        "responses": {
          "204": {
            "description": "Update all the information related with the logged user"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userIAM": {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "password": {
                        "type": "string",
                        "minLength": 8
                      }
                    }
                  },
                  "userFeatures": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "nickname": {
                        "type": "string"
                      },
                      "telephone": {
                        "type": "number"
                      },
                      "imgUser": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "description": "The input of registration function",
          "required": true
        },
        "operationId": "UserController.updateLoggedUser"
      },
      "get": {
        "x-controller-name": "UserController",
        "x-operation-name": "printCurrentUser",
        "tags": [
          "UserController"
        ],
        "responses": {
          "200": {
            "description": "The current user profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserFeaturesWithRelations"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserFeatures.Filter"
                }
              }
            }
          }
        ],
        "operationId": "UserController.printCurrentUser"
      },
      "delete": {
        "x-controller-name": "UserController",
        "x-operation-name": "deleteLoggedUser",
        "tags": [
          "UserController"
        ],
        "responses": {
          "204": {
            "description": "User DELETE success"
          }
        },
        "operationId": "UserController.deleteLoggedUser"
      }
    },
    "/user/{id}": {
      "patch": {
        "x-controller-name": "UserController",
        "x-operation-name": "updateById",
        "tags": [
          "UserController"
        ],
        "responses": {
          "204": {
            "description": "Update all the information related with the user"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userIAM": {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "password": {
                        "type": "string",
                        "minLength": 8
                      }
                    }
                  },
                  "userFeatures": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "nickname": {
                        "type": "string"
                      },
                      "telephone": {
                        "type": "number"
                      },
                      "imgUser": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "description": "The input of registration function",
          "required": true,
          "x-parameter-index": 1
        },
        "operationId": "UserController.updateById"
      },
      "get": {
        "x-controller-name": "UserController",
        "x-operation-name": "findById",
        "tags": [
          "UserController"
        ],
        "responses": {
          "200": {
            "description": "All the information related with the user (filter --> relation with userSettings & userIAM)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserFeaturesWithRelations"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserFeatures.Filter"
                }
              }
            }
          }
        ],
        "operationId": "UserController.findById"
      },
      "delete": {
        "x-controller-name": "UserController",
        "x-operation-name": "deleteById",
        "tags": [
          "UserController"
        ],
        "responses": {
          "204": {
            "description": "User DELETE success"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "UserController.deleteById"
      }
    },
    "/user-settings/{id}": {
      "patch": {
        "x-controller-name": "UserSettingsController",
        "x-operation-name": "updateById",
        "tags": [
          "UserSettingsController"
        ],
        "responses": {
          "204": {
            "description": "UserSettings PATCH success"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserSettingsPartial"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "UserSettingsController.updateById"
      },
      "get": {
        "x-controller-name": "UserSettingsController",
        "x-operation-name": "findById",
        "tags": [
          "UserSettingsController"
        ],
        "responses": {
          "200": {
            "description": "UserSettings model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSettings"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "UserSettingsController.findById"
      }
    },
    "/users": {
      "get": {
        "x-controller-name": "UserController",
        "x-operation-name": "find",
        "tags": [
          "UserController"
        ],
        "responses": {
          "200": {
            "description": "Array with all the users information (filter --> relation with userSettings & userIAM)"
          }
        },
        "operationId": "UserController.find"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.dev.mcp.orbyn.pitagorinesgroup.com"
    }
  ],
  "components": {
    "schemas": {
      "ResetPasswordInit": {
        "title": "ResetPasswordInit",
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "KeyAndPassword": {
        "title": "KeyAndPassword",
        "type": "object",
        "properties": {
          "resetKey": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "confirmPassword": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "UserSettings": {
        "title": "UserSettings",
        "type": "object",
        "properties": {
          "idUser": {
            "type": "string"
          },
          "pushToken": {
            "type": "string"
          },
          "onboardingShown": {
            "type": "boolean"
          }
        },
        "required": [
          "idUser"
        ],
        "additionalProperties": false
      },
      "UserSettingsPartial": {
        "title": "UserSettingsPartial",
        "type": "object",
        "description": "(tsType: Partial<UserSettings>, schemaOptions: { partial: true })",
        "properties": {
          "idUser": {
            "type": "string"
          },
          "pushToken": {
            "type": "string"
          },
          "onboardingShown": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Partial<UserSettings>"
      },
      "UserSettingsWithRelations": {
        "title": "UserSettingsWithRelations",
        "type": "object",
        "description": "(tsType: UserSettingsWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "idUser": {
            "type": "string"
          },
          "pushToken": {
            "type": "string"
          },
          "onboardingShown": {
            "type": "boolean"
          }
        },
        "required": [
          "idUser"
        ],
        "additionalProperties": false,
        "x-typescript-type": "UserSettingsWithRelations"
      },
      "UserCredentialsWithRelations": {
        "title": "UserCredentialsWithRelations",
        "type": "object",
        "description": "(tsType: UserCredentialsWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "required": [
          "password",
          "userId"
        ],
        "additionalProperties": true,
        "x-typescript-type": "UserCredentialsWithRelations"
      },
      "UserIAMWithRelations": {
        "title": "UserIAMWithRelations",
        "type": "object",
        "description": "(tsType: UserIAMWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string"
          },
          "realm": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "emailVerified": {
            "type": "boolean"
          },
          "verificationToken": {
            "type": "string"
          },
          "idUser": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "userCredentials": {
            "$ref": "#/components/schemas/UserCredentialsWithRelations"
          }
        },
        "required": [
          "email",
          "idUser"
        ],
        "additionalProperties": false,
        "x-typescript-type": "UserIAMWithRelations"
      },
      "UserFeaturesWithRelations": {
        "title": "UserFeaturesWithRelations",
        "type": "object",
        "description": "(tsType: UserFeaturesWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "idUser": {
            "type": "string"
          },
          "imgUser": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "nickname": {
            "type": "string"
          },
          "telephone": {
            "type": "number"
          },
          "userSettings": {
            "$ref": "#/components/schemas/UserSettingsWithRelations"
          },
          "user": {
            "$ref": "#/components/schemas/UserIAMWithRelations"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "UserFeaturesWithRelations"
      },
      "InfraestuctureSettings": {
        "title": "InfraestuctureSettings",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "appVersion": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "UserFeatures.ScopeFilter": {
        "type": "object",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              }
            ]
          },
          "include": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false,
        "title": "UserFeatures.ScopeFilter"
      },
      "UserFeatures.IncludeFilter.Items": {
        "title": "UserFeatures.IncludeFilter.Items",
        "type": "object",
        "properties": {
          "relation": {
            "type": "string",
            "enum": [
              "userSettings",
              "user"
            ]
          },
          "scope": {
            "$ref": "#/components/schemas/UserFeatures.ScopeFilter"
          }
        }
      },
      "UserFeatures.Filter": {
        "type": "object",
        "title": "UserFeatures.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "UserFeatures.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "idUser": {
                    "type": "boolean"
                  },
                  "imgUser": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "boolean"
                  },
                  "nickname": {
                    "type": "boolean"
                  },
                  "telephone": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "idUser",
                    "imgUser",
                    "name",
                    "nickname",
                    "telephone"
                  ],
                  "example": "idUser"
                },
                "uniqueItems": true
              }
            ],
            "title": "UserFeatures.Fields"
          },
          "include": {
            "title": "UserFeatures.IncludeFilter",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/UserFeatures.IncludeFilter.Items"
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<UserFeatures>"
      }
    },
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "jwt": []
    }
  ]
}