{
  "openapi": "3.0.1",
  "info": {
    "title": "Sparesti API",
    "description": "The Sparesti API",
    "version": "3.0"
  },
  "servers": [
    {
      "url": "http://localhost:8080",
      "description": "Generated server url"
    }
  ],
  "security": [
    {
      "Bearer Authentication": []
    }
  ],
  "tags": [
    {
      "name": "Friend",
      "description": "API for managing friend relationships"
    }
  ],
  "paths": {
    "/api/users/subscription/{subscriptionLevel}": {
      "put": {
        "tags": [
          "User"
        ],
        "summary": "Update User Subscription Level",
        "description": "Updates the subscription level of the current user",
        "operationId": "updateSubscriptionLevel",
        "parameters": [
          {
            "name": "subscriptionLevel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription level updated successfully",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/friends/{friendId}": {
      "put": {
        "tags": [
          "Friend"
        ],
        "summary": "Accept a friend request",
        "description": "Accepts a friend request from another user.",
        "operationId": "acceptFriendRequest",
        "parameters": [
          {
            "name": "friendId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Friend request not found",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "200": {
            "description": "Friend request successfully accepted",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Friend"
        ],
        "summary": "Delete a friend or cancel a friend request",
        "description": "Deletes an existing friend from your friend list or cancels a received friend request.",
        "operationId": "deleteFriendOrFriendRequest",
        "parameters": [
          {
            "name": "friendId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Friend or friend request not found",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "200": {
            "description": "Friend successfully deleted or friend request cancelled",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/bank/v1/transaction/norwegian-domestic-payment-to-self": {
      "post": {
        "tags": [
          "transaction-controller"
        ],
        "summary": "Transfer to account",
        "description": "Transfer money from a users account to another account of the same user",
        "operationId": "transferToSelf",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "404": {
            "description": "Bank profile id does not exist",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDTO"
                }
              }
            }
          },
          "200": {
            "description": "No accounts associated with a bank user",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDTO"
                }
              }
            }
          }
        }
      }
    },
    "/bank/v1/profile/create-profile": {
      "post": {
        "tags": [
          "bank-profile-controller"
        ],
        "summary": "Create bank profile",
        "description": "Create a bank profile by providing a social security number",
        "operationId": "createBankProfile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BankProfileDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Could not create profile",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/BankProfileResponseDTO"
                }
              }
            }
          },
          "200": {
            "description": "Successfully created a bank profile",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/BankProfileResponseDTO"
                }
              }
            }
          }
        }
      }
    },
    "/bank/v1/account/create-account": {
      "post": {
        "tags": [
          "account-controller"
        ],
        "summary": "Create account",
        "description": "Create account with random balance",
        "operationId": "createAccount",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "404": {
            "description": "Provided bank profile id could not be found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponseDTO"
                }
              }
            }
          },
          "200": {
            "description": "Successfully created account",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponseDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/users/send-feedback": {
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Send feedback",
        "description": "Send feedback from an email.",
        "operationId": "sendFeedback",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/api/users/reset-password": {
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Initiate a password reset",
        "description": "Send a password reset mail to the user with the specified email",
        "operationId": "resetPassword",
        "requestBody": {
          "content": {
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Successfully initiated a password reset"
          }
        },
        "security": []
      }
    },
    "/api/users/confirm-password": {
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Confirm a password reset",
        "description": "Confirms a password reset using a token and a new password",
        "operationId": "confirmPasswordReset",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "403": {
            "description": "Invalid token"
          },
          "204": {
            "description": "Password was reset successfully"
          }
        },
        "security": []
      }
    },
    "/api/images": {
      "post": {
        "tags": [
          "Image"
        ],
        "summary": "Upload an image",
        "description": "Upload an image to the server",
        "operationId": "uploadImage",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully uploaded the image",
            "content": {
              "*/*": {
                "schema": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          }
        }
      }
    },
    "/api/goal/createGoal": {
      "post": {
        "tags": [
          "goal"
        ],
        "operationId": "createGoal",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGoalDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GoalDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/friends/{userId}": {
      "post": {
        "tags": [
          "Friend"
        ],
        "summary": "Send a friend request",
        "description": "Sends a new friend request to another user.",
        "operationId": "addFriendRequest",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Friend request successfully created"
          }
        }
      }
    },
    "/api/budget/update/{budgetId}": {
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Updates a budget",
        "description": "Updates a budget based on the budget request",
        "operationId": "updateBudget",
        "parameters": [
          {
            "name": "budgetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Budget is not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "200": {
            "description": "Successfully updated budget",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/budget/update/expense/{budgetId}": {
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Created/Updates an expense",
        "description": "Creates/Updates a budget based on the budget request",
        "operationId": "updateExpense",
        "parameters": [
          {
            "name": "budgetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExpenseRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Error updating expense",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "200": {
            "description": "Successfully updated budget",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/budget/create": {
      "post": {
        "tags": [
          "User"
        ],
        "summary": "Create a new budget",
        "description": "Create a new budget with based on the budget request",
        "operationId": "createBudget",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetRequestDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully created new budget",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/valid-email/{email}": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Validate email",
        "description": "Check that the given email is valid",
        "operationId": "validateEmail",
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Email is valid",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Email already exists",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/auth/signup": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "User Signup",
        "description": "Sign up a new user",
        "operationId": "signup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignUpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successfully signed up",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationResponse"
                }
              }
            }
          },
          "409": {
            "description": "Email already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "User Login",
        "description": "Log in with an existing user",
        "operationId": "login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully logged in",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticationResponse"
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/users": {
      "patch": {
        "tags": [
          "User"
        ],
        "summary": "Update a profile",
        "description": "Update the profile of the authenticated user",
        "operationId": "update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdateDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/users/update-account": {
      "patch": {
        "tags": [
          "User"
        ],
        "summary": "Update a user's bank account",
        "description": "Changes either a user's checking account or savings account",
        "operationId": "selectBankAccount",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BankAccountDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          }
        }
      }
    },
    "/api/users/password": {
      "patch": {
        "tags": [
          "User"
        ],
        "summary": "Update a password",
        "description": "Update the password of the authenticated user",
        "operationId": "updatePassword",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordUpdateDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successfully updated password",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/UserDTO"
                }
              }
            }
          }
        }
      }
    },
    "/bank/v1/account/accounts/ssn/{ssn}": {
      "get": {
        "tags": [
          "account-controller"
        ],
        "summary": "Get user accounts",
        "description": "Get accounts associated with a user by providing their social security number",
        "operationId": "getAccountsBySsn",
        "parameters": [
          {
            "name": "ssn",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "No accounts associated with a bank user",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Social security number does not exist",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Account"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/bank/v1/account/accounts/profile/{bankProfileId}": {
      "get": {
        "tags": [
          "account-controller"
        ],
        "summary": "Get user accounts",
        "description": "Get accounts associated with a user by providing their bank profile id",
        "operationId": "getAccounts",
        "parameters": [
          {
            "name": "bankProfileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Bank profile id does not exist",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "200": {
            "description": "No accounts associated with a bank user",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Account"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/users/{userId}/profile": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get a profile",
        "description": "Get the profile of a user",
        "operationId": "getProfile",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/users/search/{searchTerm}/{filter}": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Search for users by name and filter",
        "description": "Returns a list of users whose names contain the specified search term and match the filter.",
        "operationId": "getUsersByNameAndFilter",
        "parameters": [
          {
            "name": "searchTerm",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved list of users",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserDTO"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/users/search/random/{amount}/{filter}": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get X amount of random users",
        "description": "Get X amount of random users that fit the filter",
        "operationId": "getRandomUsers",
        "parameters": [
          {
            "name": "amount",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "filter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved list of users",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserDTO"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/users/me": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get the authenticated user",
        "description": "Get all user information for the authenticated user",
        "operationId": "getUser",
        "responses": {
          "200": {
            "description": "Successfully got user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/users/get-feedback": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Send feedback",
        "description": "Send feedback from a user.",
        "operationId": "getFeedback",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FeedbackResponseDTO"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/leaderboard": {
      "get": {
        "tags": [
          "Leaderboard"
        ],
        "operationId": "getLeaderboard",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entryCount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeaderboardDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/leaderboard/surrounding": {
      "get": {
        "tags": [
          "Leaderboard"
        ],
        "operationId": "getSurrounding",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entryCount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeaderboardDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/images/{id}": {
      "get": {
        "tags": [
          "Image"
        ],
        "summary": "Retrieve an image",
        "description": "Retrieve an image from the server",
        "operationId": "getImage",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Image not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ExceptionResponse"
                }
              }
            }
          },
          "200": {
            "description": "Successfully retrieved the image",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/goal/getGoals": {
      "get": {
        "tags": [
          "goal"
        ],
        "operationId": "getGoals",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GoalDTO"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/goal/getGoal": {
      "get": {
        "tags": [
          "goal"
        ],
        "operationId": "getGoal",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GoalDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/friends": {
      "get": {
        "tags": [
          "Friend"
        ],
        "summary": "Get all friends",
        "description": "Returns a list of all friends.",
        "operationId": "getFriends",
        "responses": {
          "200": {
            "description": "Successfully retrieved list of friends",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserDTO"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/friends/requests": {
      "get": {
        "tags": [
          "Friend"
        ],
        "summary": "Get friend requests",
        "description": "Returns a list of all users who have sent a friend request.",
        "operationId": "getFriendRequests",
        "responses": {
          "200": {
            "description": "Successfully retrieved friend requests",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserDTO"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/budget": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get the list of budgets",
        "description": "Get all budgets related to the authenticated user",
        "operationId": "getBudgetsByUser",
        "responses": {
          "200": {
            "description": "Successfully got budgets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BudgetResponseDTO"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/budget/{budgetId}": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get the budget",
        "description": "Get budget by its id ",
        "operationId": "getBudget",
        "parameters": [
          {
            "name": "budgetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "500": {
            "description": "Budget is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponseDTO"
                }
              }
            }
          },
          "200": {
            "description": "Successfully got budget",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetResponseDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/budget/expenses/{budgetId}": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get the list of budgets",
        "description": "Get all budgets related to the authenticated user",
        "operationId": "getExpenses",
        "parameters": [
          {
            "name": "budgetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got expenses",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExpenseResponseDTO"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/budget/expense/{expenseId}": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Get the expense",
        "description": "Get expense by its id ",
        "operationId": "getExpense",
        "parameters": [
          {
            "name": "expenseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully got expense",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseResponseDTO"
                }
              }
            }
          },
          "500": {
            "description": "Expense is not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpenseResponseDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/budget/delete/{budgetId}": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Deletes a budget",
        "description": "Deletes a budget based on provided budget id",
        "operationId": "deleteBudget",
        "parameters": [
          {
            "name": "budgetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "500": {
            "description": "Budget is not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "200": {
            "description": "Successfully deleted budget",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/budget/delete/expense/{expenseId}": {
      "get": {
        "tags": [
          "User"
        ],
        "summary": "Deletes an expense",
        "description": "Deletes an expense based on provided expense id",
        "operationId": "deleteExpense",
        "parameters": [
          {
            "name": "expenseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted expense",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Expense is not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TransactionDTO": {
        "type": "object",
        "properties": {
          "debtorBBAN": {
            "type": "integer",
            "format": "int64"
          },
          "creditorBBAN": {
            "type": "integer",
            "format": "int64"
          },
          "amount": {
            "type": "number"
          }
        }
      },
      "BankProfileDTO": {
        "type": "object",
        "properties": {
          "ssn": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "bban": {
            "type": "integer",
            "format": "int64"
          },
          "balance": {
            "type": "number"
          },
          "bankProfile": {
            "$ref": "#/components/schemas/BankProfile"
          }
        }
      },
      "BankProfile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "ssn": {
            "type": "integer",
            "format": "int64"
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Account"
            }
          }
        }
      },
      "BankProfileResponseDTO": {
        "type": "object",
        "properties": {
          "ssn": {
            "type": "integer",
            "format": "int64"
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Account"
            }
          }
        }
      },
      "AccountRequestDTO": {
        "type": "object",
        "properties": {
          "ssn": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "AccountResponseDTO": {
        "type": "object",
        "properties": {
          "bankProfileId": {
            "type": "integer",
            "format": "int64"
          },
          "balance": {
            "type": "number"
          }
        }
      },
      "FeedbackRequestDTO": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "PasswordResetDTO": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "CreateGoalDTO": {
        "type": "object",
        "properties": {
          "goalName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "targetAmount": {
            "type": "integer",
            "format": "int32"
          },
          "targetDate": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ChallengeDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "potentialSavingAmount": {
            "type": "integer",
            "format": "int32"
          },
          "points": {
            "type": "integer",
            "format": "int32"
          },
          "days": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "dailyChallengeProgressList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DailyChallengeProgressDTO"
            }
          }
        }
      },
      "DailyChallengeProgressDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "challengeDay": {
            "type": "integer",
            "format": "int32"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "GoalDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "goalName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "targetAmount": {
            "type": "integer",
            "format": "int32"
          },
          "targetDate": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "challenges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChallengeDTO"
            }
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParticipantDTO"
            }
          }
        }
      },
      "ParticipantDTO": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "CREATOR",
              "CONTRIBUTOR"
            ]
          },
          "user": {
            "$ref": "#/components/schemas/ParticipantUserDTO"
          }
        }
      },
      "ParticipantUserDTO": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          }
        }
      },
      "BudgetRequestDTO": {
        "type": "object",
        "properties": {
          "budgetName": {
            "type": "string"
          },
          "budgetAmount": {
            "type": "number"
          },
          "expenseAmount": {
            "type": "number"
          }
        }
      },
      "ExpenseRequestDTO": {
        "type": "object",
        "properties": {
          "expenseId": {
            "type": "integer",
            "format": "int64"
          },
          "description": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          }
        }
      },
      "ExceptionResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ConfigurationDTO": {
        "type": "object",
        "properties": {
          "commitment": {
            "type": "string"
          },
          "experience": {
            "type": "string"
          },
          "challengeTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SignUpRequest": {
        "required": [
          "configuration"
        ],
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "configuration": {
            "$ref": "#/components/schemas/ConfigurationDTO"
          }
        }
      },
      "AuthenticationResponse": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "profileImage": {
            "type": "integer",
            "format": "int64"
          },
          "role": {
            "type": "string"
          },
          "subscriptionLevel": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        }
      },
      "LoginRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        }
      },
      "UserUpdateDTO": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "profileImage": {
            "type": "integer",
            "format": "int64"
          },
          "configuration": {
            "$ref": "#/components/schemas/ConfigurationDTO"
          }
        }
      },
      "UserDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "profileImage": {
            "type": "integer",
            "format": "int64"
          },
          "email": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "role": {
            "type": "string"
          },
          "subscriptionLevel": {
            "type": "string"
          }
        }
      },
      "BankAccountDTO": {
        "type": "object",
        "properties": {
          "bban": {
            "type": "integer",
            "format": "int64"
          },
          "bankAccountType": {
            "type": "string"
          }
        }
      },
      "PasswordUpdateDTO": {
        "type": "object",
        "properties": {
          "oldPassword": {
            "type": "string"
          },
          "newPassword": {
            "type": "string"
          }
        }
      },
      "ProfileDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "profileImage": {
            "type": "integer",
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FeedbackResponseDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "LeaderboardDTO": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "filter": {
            "type": "string"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeaderboardEntryDTO"
            }
          }
        }
      },
      "LeaderboardEntryDTO": {
        "type": "object",
        "properties": {
          "user": {
            "$ref": "#/components/schemas/UserDTO"
          },
          "score": {
            "type": "integer",
            "format": "int32"
          },
          "rank": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "BudgetResponseDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "budgetName": {
            "type": "string"
          },
          "budgetAmount": {
            "type": "number"
          },
          "expenseAmount": {
            "type": "number"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ExpenseResponseDTO": {
        "type": "object",
        "properties": {
          "expenseId": {
            "type": "integer",
            "format": "int64"
          },
          "budgetId": {
            "type": "integer",
            "format": "int64"
          },
          "description": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "Bearer Authentication": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}