{
  "openapi": "3.0.0",
  "info": {
    "title": "API Documentation",
    "version": "1.0.0",
    "description": "This is the API documentation for the site, powered by Mash Server."
  },
  "paths": {
    "/api/affiliate/condition": {
      "get": {
        "summary": "Lists all MLM Referral Conditions with pagination and optional filtering",
        "operationId": "listMlmReferralConditions",
        "tags": [
          "MLM",
          "Referral Conditions"
        ],
        "responses": {
          "200": {
            "description": "List of MLM Referral Conditions with pagination information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "reward": {
                            "type": "number"
                          },
                          "reward_type": {
                            "type": "string"
                          },
                          "reward_currency": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "MLM Referral Conditions not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/affiliate": {
      "get": {
        "summary": "Get Affiliate Dashboard",
        "description": "Retrieves dashboard data for the authenticated affiliate, with optional period filtering.",
        "operationId": "getAffiliateDashboard",
        "tags": [
          "Affiliate",
          "Dashboard"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "3m",
                "6m",
                "1y"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Affiliate dashboard data retrieved successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/affiliate/network": {
      "get": {
        "summary": "Get Affiliate Network Node",
        "description": "Retrieves the current user's affiliate network data for client visualization.",
        "operationId": "getAffiliateNetworkNode",
        "tags": [
          "Affiliate",
          "Network"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Network data retrieved successfully."
          },
          "401": {
            "description": "Unauthorized – login required."
          },
          "404": {
            "description": "User not found."
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/affiliate/referral/analysis": {
      "post": {
        "summary": "Gets chart data for analytics",
        "operationId": "getAnalyticsData",
        "tags": [
          "User",
          "Analytics"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "timeframe": {
                    "type": "string"
                  },
                  "db": {
                    "type": "string"
                  },
                  "keyspace": {
                    "type": "string",
                    "nullable": true
                  },
                  "charts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "line",
                            "bar",
                            "pie",
                            "stackedBar",
                            "stackedArea"
                          ]
                        },
                        "model": {
                          "type": "string"
                        },
                        "metrics": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "kpis": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "metric": {
                          "type": "string"
                        },
                        "model": {
                          "type": "string"
                        },
                        "icon": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "model",
                  "timeframe",
                  "charts",
                  "kpis"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Analytics data object matching your shape (kpis + chart keys)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kpis": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "value": {
                            "type": "number"
                          },
                          "change": {
                            "type": "number"
                          },
                          "trend": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "date": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "icon": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized access"
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/affiliate/referral": {
      "get": {
        "summary": "List referrals for authenticated affiliate",
        "operationId": "listAffiliateReferrals",
        "tags": [
          "Affiliate",
          "Referral"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Referral list retrieved successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/affiliate/referral/node": {
      "get": {
        "summary": "Fetch MLM node details by UUID",
        "description": "Retrieves information about a specific MLM node using its UUID.",
        "operationId": "getNodeById",
        "tags": [
          "MLM",
          "Referrals"
        ],
        "responses": {
          "200": {
            "description": "Node details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number",
                      "description": "User ID"
                    },
                    "firstName": {
                      "type": "string",
                      "description": "First name"
                    },
                    "lastName": {
                      "type": "string",
                      "description": "Last name"
                    },
                    "referrals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number",
                            "description": "Referral ID"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Node not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/affiliate/referral/{id}": {
      "get": {
        "summary": "Get details for a single referral",
        "operationId": "getAffiliateReferral",
        "tags": [
          "Affiliate",
          "Referral"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Referral details retrieved successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/affiliate/reward": {
      "get": {
        "summary": "Lists all MLM Referral Rewards with pagination and optional filtering",
        "operationId": "listMlmReferralRewards",
        "tags": [
          "MLM",
          "Referral Rewards"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of MLM Referral Rewards with pagination information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the MLM Referral Reward",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "reward": {
                            "type": "number",
                            "description": "Amount of the reward",
                            "nullable": false
                          },
                          "isClaimed": {
                            "type": "boolean",
                            "description": "Whether the reward has been claimed"
                          },
                          "conditionId": {
                            "type": "string",
                            "description": "ID of the MLM Referral Condition associated with the reward",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "referrerId": {
                            "type": "string",
                            "description": "ID of the user who referred another user",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Creation date of the MLM Referral Reward",
                            "nullable": false
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Last update date of the MLM Referral Reward",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "MLM Referral Rewards not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/affiliate/reward/{id}/claim": {
      "post": {
        "summary": "Claims a specific referral reward",
        "description": "Processes the claim of a specified referral reward.",
        "operationId": "claimReward",
        "tags": [
          "MLM",
          "Rewards"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Referral reward UUID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reward claimed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Affiliate Reward not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ai/investment/log": {
      "get": {
        "summary": "Retrieves all investments for the logged-in user",
        "description": "Fetches all AI trading investments for the currently authenticated user, excluding active investments.",
        "operationId": "getAllInvestments",
        "tags": [
          "AI Trading"
        ],
        "responses": {
          "200": {
            "description": "Investments retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "The unique identifier for the investment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "userId": {
                        "type": "string",
                        "description": "User ID associated with the investment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "planId": {
                        "type": "string",
                        "description": "Plan ID associated with the investment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "durationId": {
                        "type": "string",
                        "description": "Duration ID associated with the investment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": true
                      },
                      "market": {
                        "type": "string",
                        "description": "Market involved in the investment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "amount": {
                        "type": "number",
                        "description": "Amount invested",
                        "nullable": false
                      },
                      "status": {
                        "type": "string",
                        "description": "Current status of the investment",
                        "enum": [
                          "ACTIVE",
                          "COMPLETED",
                          "CANCELLED",
                          "REJECTED"
                        ]
                      },
                      "createdAt": {
                        "type": "string",
                        "description": "Timestamp when the investment was created",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false,
                        "pattern": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "description": "Timestamp when the investment was last updated",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": true,
                        "pattern": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "AI Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Creates a new investment",
        "description": "Creates a new AI trading investment for the currently authenticated user based on the provided details.",
        "operationId": "createInvestment",
        "tags": [
          "AI Trading"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "description": "Currency of the investment"
                  },
                  "pair": {
                    "type": "string",
                    "description": "Trading pair"
                  },
                  "planId": {
                    "type": "string",
                    "description": "Plan ID to be used for the investment"
                  },
                  "durationId": {
                    "type": "string",
                    "description": "Duration ID for the investment"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount to be invested"
                  },
                  "type": {
                    "type": "string",
                    "description": "Type of wallet"
                  }
                },
                "required": [
                  "planId",
                  "durationId",
                  "amount",
                  "currency",
                  "pair"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI Investment created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ai/investment/log/{id}": {
      "del": {
        "summary": "Deletes an AI investment",
        "description": "Deletes an existing AI trading investment for the currently authenticated user.",
        "operationId": "deleteInvestment",
        "tags": [
          "AI Trading"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Investment ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "AI Investment deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message indicating successful deletion"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "AI Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "Retrieves specific investment by ID for the logged-in user",
        "description": "Fetches a specific AI trading investment by ID for the currently authenticated user.",
        "operationId": "getInvestmentById",
        "tags": [
          "AI Trading"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Investment ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Investment retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The unique identifier for the investment",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "userId": {
                      "type": "string",
                      "description": "User ID associated with the investment",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "planId": {
                      "type": "string",
                      "description": "Plan ID associated with the investment",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "durationId": {
                      "type": "string",
                      "description": "Duration ID associated with the investment",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": true
                    },
                    "market": {
                      "type": "string",
                      "description": "Market involved in the investment",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "amount": {
                      "type": "number",
                      "description": "Amount invested",
                      "nullable": false
                    },
                    "status": {
                      "type": "string",
                      "description": "Current status of the investment",
                      "enum": [
                        "ACTIVE",
                        "COMPLETED",
                        "CANCELLED",
                        "REJECTED"
                      ]
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Timestamp when the investment was created",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false,
                      "pattern": "date-time"
                    },
                    "updatedAt": {
                      "type": "string",
                      "description": "Timestamp when the investment was last updated",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": true,
                      "pattern": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "AI Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ai/investment/plan": {
      "get": {
        "summary": "Retrieves all active AI trading plans",
        "description": "Fetches all active AI trading plans available for users to invest in, including details about each plan and its associated durations.",
        "operationId": "getAiTradingPlans",
        "tags": [
          "AI Trading Plans"
        ],
        "responses": {
          "200": {
            "description": "AI trading plans retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "The unique identifier for the trading plan",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "title": {
                        "type": "string",
                        "description": "Title of the trading plan",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of the trading plan",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "image": {
                        "type": "string",
                        "description": "URL of the image representing the trading plan",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "minAmount": {
                        "type": "number",
                        "description": "Minimum amount required to invest in the plan",
                        "nullable": false
                      },
                      "maxAmount": {
                        "type": "number",
                        "description": "Maximum amount allowed for investment in the plan",
                        "nullable": false
                      },
                      "invested": {
                        "type": "number",
                        "description": "Total amount currently invested in the plan",
                        "nullable": false
                      },
                      "trending": {
                        "type": "boolean",
                        "description": "Indicator if the plan is trending"
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Status of the trading plan (active/inactive)"
                      },
                      "durations": {
                        "type": "array",
                        "description": "List of durations available for this trading plan",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Unique identifier of the duration",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "duration": {
                              "type": "number",
                              "description": "Duration number",
                              "nullable": false
                            },
                            "timeframe": {
                              "type": "string",
                              "description": "Timeframe of the duration (e.g., days, months)",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            }
                          },
                          "required": [
                            "id",
                            "duration",
                            "timeframe"
                          ]
                        }
                      }
                    },
                    "required": [
                      "id",
                      "title",
                      "description",
                      "minAmount",
                      "maxAmount",
                      "status"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "AI Investment Plan not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecommerce/category": {
      "get": {
        "summary": "Retrieves all active ecommerce categories",
        "description": "Fetches all active ecommerce categories along with their active products, with calculated ratings and review counts for each product.",
        "operationId": "listEcommerceCategories",
        "tags": [
          "Ecommerce",
          "Categories"
        ],
        "responses": {
          "200": {
            "description": "Ecommerce categories retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "The unique identifier for the category",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the category",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of the category",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "image": {
                        "type": "string",
                        "description": "URL of the image representing the category",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": true
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Status of the category (active/inactive)"
                      },
                      "products": {
                        "type": "array",
                        "description": "List of active products in this category",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Unique identifier of the product",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "name": {
                              "type": "string",
                              "description": "Name of the product",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "description": {
                              "type": "string",
                              "description": "Description of the product",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "price": {
                              "type": "string",
                              "description": "Price of the product",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "stock": {
                              "type": "string",
                              "description": "Stock available for the product",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ecommerce Category not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecommerce/category/{slug}": {
      "get": {
        "summary": "Retrieves a specific ecommerce category by slug",
        "description": "Fetches a single ecommerce category by its slug, including all active products in that category with calculated ratings and review counts.",
        "operationId": "getEcommerceCategoryBySlug",
        "tags": [
          "Ecommerce",
          "Categories"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Category slug"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ecommerce category retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The unique identifier for the category",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the category",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the category",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "image": {
                      "type": "string",
                      "description": "URL of the image representing the category",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": true
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Status of the category (active/inactive)"
                    },
                    "products": {
                      "type": "array",
                      "description": "List of active products in this category",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of the product",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the product",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Description of the product",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "price": {
                            "type": "string",
                            "description": "Price of the product",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "stock": {
                            "type": "string",
                            "description": "Stock available for the product",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ecommerce Category not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecommerce/discount/{productId}": {
      "post": {
        "summary": "Applies a discount code to a product",
        "description": "Allows a user to apply a discount code to a product if the discount is active and has not expired.",
        "operationId": "applyEcommerceDiscount",
        "tags": [
          "Ecommerce",
          "Discounts"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Product ID to which the discount is applied"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Discount code"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Discount applied successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The unique identifier for the discount",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "code": {
                      "type": "string",
                      "description": "The discount code applied",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "status": {
                      "type": "string",
                      "description": "The current status of the discount (e.g., ACTIVE, INACTIVE)",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    }
                  },
                  "required": [
                    "id",
                    "code",
                    "status"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ecommerce Discount not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecommerce/order": {
      "get": {
        "summary": "Lists all ecommerce orders with pagination and optional filtering",
        "operationId": "listEcommerceOrders",
        "tags": [
          "E-commerce",
          "Orders"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of ecommerce orders with details about order items and the user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the e-commerce order",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "userId": {
                            "type": "string",
                            "description": "User ID associated with the order",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "status": {
                            "type": "string",
                            "description": "Status of the order",
                            "enum": [
                              "PENDING",
                              "COMPLETED",
                              "CANCELLED",
                              "REJECTED"
                            ]
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Creation date of the order",
                            "nullable": true
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Last update date of the order",
                            "nullable": true
                          },
                          "deletedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Deletion date of the order",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "E-commerce Orders not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Creates a new order",
        "description": "Processes a new order for the logged-in user, checking inventory, wallet balance, and applying any available discounts.",
        "operationId": "createEcommerceOrder",
        "tags": [
          "Ecommerce",
          "Orders"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "type": "string",
                    "description": "Product ID to order"
                  },
                  "discountId": {
                    "type": "string",
                    "description": "Discount ID applied to the order",
                    "nullable": true
                  },
                  "amount": {
                    "type": "number",
                    "description": "Quantity of the product to purchase"
                  },
                  "shippingAddress": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "street": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name",
                      "email",
                      "phone",
                      "street",
                      "city",
                      "state",
                      "postalCode",
                      "country"
                    ]
                  }
                },
                "required": [
                  "productId",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecommerce/order/product/{productId}": {
      "get": {
        "summary": "Checks if user purchased a specific product",
        "description": "Fetches an order containing the given productId for the authenticated user, to verify purchase.",
        "operationId": "getEcommerceOrderByProductId",
        "tags": [
          "Ecommerce",
          "Orders"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Product ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order containing the product retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The unique identifier for the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "orderItems": {
                      "type": "array",
                      "description": "List of items in the order",
                      "items": {
                        "type": "object",
                        "properties": {
                          "productId": {
                            "type": "string",
                            "description": "Product ID of the item",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "quantity": {
                            "type": "number",
                            "description": "Quantity of the product ordered",
                            "nullable": false
                          },
                          "product": {
                            "type": "object",
                            "description": "Details of the product ordered",
                            "properties": {
                              "name": {
                                "type": "string",
                                "description": "Name of the product",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "price": {
                                "type": "number",
                                "description": "Price of the product",
                                "nullable": false
                              },
                              "image": {
                                "type": "string",
                                "description": "Product image URL",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": true
                              }
                            },
                            "required": [
                              "name",
                              "price"
                            ]
                          }
                        },
                        "required": [
                          "productId",
                          "quantity",
                          "product"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ecommerce Order for Product not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecommerce/order/{id}": {
      "get": {
        "summary": "Retrieves a specific order by ID",
        "description": "Fetches a single order by its ID, including details of the products in the order.",
        "operationId": "getEcommerceOrderById",
        "tags": [
          "Ecommerce",
          "Orders"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Order ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The unique identifier for the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "orderItems": {
                      "type": "array",
                      "description": "List of items in the order",
                      "items": {
                        "type": "object",
                        "properties": {
                          "productId": {
                            "type": "string",
                            "description": "Product ID of the item",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "quantity": {
                            "type": "number",
                            "description": "Quantity of the product ordered",
                            "nullable": false
                          },
                          "product": {
                            "type": "object",
                            "description": "Details of the product ordered",
                            "properties": {
                              "name": {
                                "type": "string",
                                "description": "Name of the product",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "price": {
                                "type": "number",
                                "description": "Price of the product",
                                "nullable": false
                              },
                              "image": {
                                "type": "string",
                                "description": "Product image URL",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": true
                              }
                            },
                            "required": [
                              "name",
                              "price"
                            ]
                          }
                        },
                        "required": [
                          "productId",
                          "quantity",
                          "product"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ecommerce Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecommerce/product": {
      "get": {
        "summary": "Retrieves all ecommerce products",
        "description": "Fetches a list of all active ecommerce products, including their categories and aggregated review stats.",
        "operationId": "getEcommerceProducts",
        "tags": [
          "Ecommerce",
          "Products"
        ],
        "responses": {
          "200": {
            "description": "Products retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "The unique identifier for the product",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the product",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of the product",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of the product",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "price": {
                        "type": "number",
                        "description": "Price of the product",
                        "nullable": false
                      },
                      "categoryId": {
                        "type": "string",
                        "description": "Category ID of the product",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "inventoryQuantity": {
                        "type": "number",
                        "description": "Inventory quantity available",
                        "nullable": false
                      },
                      "image": {
                        "type": "string",
                        "description": "URL of the product image",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": true
                      },
                      "currency": {
                        "type": "string",
                        "description": "Currency of the price",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "walletType": {
                        "type": "string",
                        "description": "Wallet type for the transaction",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "createdAt": {
                        "type": "string",
                        "description": "Timestamp when the product was created",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false,
                        "pattern": "date-time"
                      },
                      "category": {
                        "type": "object",
                        "description": "Category details",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Category ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "name": {
                            "type": "string",
                            "description": "Category name",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "reviews": {
                        "type": "array",
                        "description": "List of reviews for the product",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Review ID",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "comment": {
                              "type": "string",
                              "description": "Review comment",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "user": {
                              "type": "object",
                              "description": "User who made the review",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "User's UUID",
                                  "maxLength": 255,
                                  "minLength": 0,
                                  "nullable": false
                                },
                                "firstName": {
                                  "type": "string",
                                  "description": "User's first name",
                                  "maxLength": 255,
                                  "minLength": 0,
                                  "nullable": false
                                },
                                "lastName": {
                                  "type": "string",
                                  "description": "User's last name",
                                  "maxLength": 255,
                                  "minLength": 0,
                                  "nullable": false
                                },
                                "avatar": {
                                  "type": "string",
                                  "description": "User's avatar",
                                  "maxLength": 255,
                                  "minLength": 0,
                                  "nullable": true
                                }
                              },
                              "required": [
                                "id",
                                "firstName",
                                "lastName"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "comment",
                            "user"
                          ]
                        }
                      },
                      "rating": {
                        "type": "number",
                        "description": "Average rating"
                      },
                      "reviewsCount": {
                        "type": "number",
                        "description": "Number of reviews"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "slug"
                    ]
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecommerce/product/{slug}": {
      "get": {
        "summary": "Retrieves a specific ecommerce product by slug",
        "description": "Fetches a single ecommerce product by its slug, including details such as category and reviews.",
        "operationId": "getEcommerceProductBySlug",
        "tags": [
          "Ecommerce",
          "Products"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Product slug"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ecommerce product retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The unique identifier for the product",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the product",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the product",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "type": {
                      "type": "string",
                      "description": "Type of the product",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "price": {
                      "type": "number",
                      "description": "Price of the product",
                      "nullable": false
                    },
                    "categoryId": {
                      "type": "string",
                      "description": "Category ID of the product",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "inventoryQuantity": {
                      "type": "number",
                      "description": "Inventory quantity available",
                      "nullable": false
                    },
                    "image": {
                      "type": "string",
                      "description": "URL of the product image",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": true
                    },
                    "currency": {
                      "type": "string",
                      "description": "Currency of the price",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "walletType": {
                      "type": "string",
                      "description": "Wallet type for the transaction",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Timestamp when the product was created",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false,
                      "pattern": "date-time"
                    },
                    "category": {
                      "type": "object",
                      "description": "Category details",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Category ID",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "name": {
                          "type": "string",
                          "description": "Category name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ]
                    },
                    "reviews": {
                      "type": "array",
                      "description": "List of reviews for the product",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Review ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "comment": {
                            "type": "string",
                            "description": "Review comment",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "user": {
                            "type": "object",
                            "description": "User who made the review",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "User's UUID",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "firstName": {
                                "type": "string",
                                "description": "User's first name",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "lastName": {
                                "type": "string",
                                "description": "User's last name",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "avatar": {
                                "type": "string",
                                "description": "User's avatar",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": true
                              }
                            },
                            "required": [
                              "id",
                              "firstName",
                              "lastName"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "comment",
                          "user"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ecommerce Product not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecommerce/review/{productId}": {
      "post": {
        "summary": "Creates or updates a review for a product",
        "description": "Allows a user to submit a review for a product they have purchased. Users can only review products once, but they can update their review.",
        "operationId": "createEcommerceReview",
        "tags": [
          "Ecommerce",
          "Reviews"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Product ID for the review"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rating": {
                    "type": "number",
                    "description": "Rating given to the product"
                  },
                  "comment": {
                    "type": "string",
                    "description": "Comment about the product",
                    "nullable": true
                  }
                },
                "required": [
                  "rating"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Review created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecommerce/shipping": {
      "get": {
        "summary": "Get user's shipping records",
        "description": "Returns all shipping records for the current user, including all related order, items, products, and addresses.",
        "operationId": "getUserShippingRecords",
        "tags": [
          "Ecommerce",
          "Shipping",
          "User"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Shipping records for user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "permission": "access.ecommerce.shipping",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecommerce/wishlist": {
      "get": {
        "summary": "Retrieves the user's wishlist",
        "description": "Fetches all items in the user's wishlist, including product details, categories, and reviews.",
        "operationId": "getEcommerceWishlist",
        "tags": [
          "Ecommerce",
          "Wishlist"
        ],
        "responses": {
          "200": {
            "description": "Wishlist retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "Product ID in the wishlist",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "product": {
                        "type": "object",
                        "description": "Details of the product",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The unique identifier for the product",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the product",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Description of the product",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of the product",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "price": {
                            "type": "number",
                            "description": "Price of the product",
                            "nullable": false
                          },
                          "categoryId": {
                            "type": "string",
                            "description": "Category ID of the product",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "inventoryQuantity": {
                            "type": "number",
                            "description": "Inventory quantity available",
                            "nullable": false
                          },
                          "image": {
                            "type": "string",
                            "description": "URL of the product image",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "currency": {
                            "type": "string",
                            "description": "Currency of the price",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "walletType": {
                            "type": "string",
                            "description": "Wallet type for the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "Timestamp when the product was created",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false,
                            "pattern": "date-time"
                          },
                          "category": {
                            "type": "object",
                            "description": "Category details",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Category ID",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "name": {
                                "type": "string",
                                "description": "Category name",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ]
                          },
                          "reviews": {
                            "type": "array",
                            "description": "List of reviews for the product",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "Review ID",
                                  "maxLength": 255,
                                  "minLength": 0,
                                  "nullable": false
                                },
                                "comment": {
                                  "type": "string",
                                  "description": "Review comment",
                                  "maxLength": 255,
                                  "minLength": 0,
                                  "nullable": false
                                },
                                "user": {
                                  "type": "object",
                                  "description": "User who made the review",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "description": "User's UUID",
                                      "maxLength": 255,
                                      "minLength": 0,
                                      "nullable": false
                                    },
                                    "firstName": {
                                      "type": "string",
                                      "description": "User's first name",
                                      "maxLength": 255,
                                      "minLength": 0,
                                      "nullable": false
                                    },
                                    "lastName": {
                                      "type": "string",
                                      "description": "User's last name",
                                      "maxLength": 255,
                                      "minLength": 0,
                                      "nullable": false
                                    },
                                    "avatar": {
                                      "type": "string",
                                      "description": "User's avatar",
                                      "maxLength": 255,
                                      "minLength": 0,
                                      "nullable": true
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "firstName",
                                    "lastName"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "comment",
                                "user"
                              ]
                            }
                          }
                        },
                        "required": [
                          "name"
                        ]
                      }
                    },
                    "required": [
                      "productId",
                      "product"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ecommerce Wishlist not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Adds a product to the user's wishlist",
        "description": "Allows a user to add a product to their wishlist if it's not already included.",
        "operationId": "addToEcommerceWishlist",
        "tags": [
          "Ecommerce",
          "Wishlist"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "type": "string",
                    "description": "Product ID to be added to the wishlist"
                  }
                },
                "required": [
                  "productId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wishlist created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecommerce/wishlist/{id}": {
      "del": {
        "summary": "Removes a product from the user's wishlist",
        "description": "Allows a user to remove a product from their wishlist.",
        "operationId": "removeFromEcommerceWishlist",
        "tags": [
          "Ecommerce",
          "Wishlist"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Product ID to be removed from the wishlist"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wishlist deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message indicating successful deletion"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Wishlist not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecosystem/chart": {
      "get": {
        "summary": "Retrieves historical data for a specific symbol",
        "description": "Fetches historical price data based on the specified interval and date range.",
        "operationId": "getHistoricalData",
        "tags": [
          "Market",
          "Historical"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trading symbol, e.g., BTC/USD"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "description": "Start timestamp for historical data"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "description": "End timestamp for historical data"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Time interval for the data, e.g., 1m, 5m, 1h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Historical data retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "openTime": {
                        "type": "number",
                        "description": "Open time of the candle",
                        "nullable": false
                      },
                      "closeTime": {
                        "type": "number",
                        "description": "Close time of the candle",
                        "nullable": false
                      },
                      "open": {
                        "type": "string",
                        "description": "Opening price",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "high": {
                        "type": "string",
                        "description": "Highest price",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "low": {
                        "type": "string",
                        "description": "Lowest price",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "close": {
                        "type": "string",
                        "description": "Closing price",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "volume": {
                        "type": "string",
                        "description": "Volume",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Chart not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecosystem/deposit/unlock": {
      "get": {
        "summary": "Unlocks a specific deposit address",
        "description": "Allows administrative unlocking of a custodial wallet deposit address to make it available for reuse. This is typically used for NO_PERMIT token addresses that need to be released after deposit completion.",
        "operationId": "unlockDepositAddress",
        "tags": [
          "Wallet",
          "Deposit"
        ],
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "description": "The deposit address to unlock (must be a valid address format)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deposit address unlocked successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message indicating the address has been unlocked."
                    },
                    "address": {
                      "type": "string",
                      "description": "The address that was unlocked"
                    },
                    "timestamp": {
                      "type": "string",
                      "description": "ISO timestamp of when the unlock occurred"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Address not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecosystem/market": {
      "get": {
        "summary": "Retrieves all ecosystem markets",
        "description": "Fetches a list of all active markets available in the ecosystem.",
        "operationId": "listEcosystemMarkets",
        "tags": [
          "Ecosystem",
          "Markets"
        ],
        "responses": {
          "200": {
            "description": "Markets retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number",
                        "description": "Market ID",
                        "nullable": false
                      },
                      "name": {
                        "type": "string",
                        "description": "Market name",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Market status"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Market not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecosystem/market/{id}": {
      "get": {
        "summary": "Retrieves a specific ecosystem market",
        "description": "Fetches details of a specific market in the ecosystem.",
        "operationId": "getEcosystemMarket",
        "tags": [
          "Ecosystem",
          "Markets"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "number",
              "description": "Market ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Market details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number",
                      "description": "Market ID",
                      "nullable": false
                    },
                    "name": {
                      "type": "string",
                      "description": "Market name",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Market status"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Market not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecosystem/order": {
      "get": {
        "summary": "List Orders",
        "operationId": "listOrders",
        "tags": [
          "Exchange",
          "Orders"
        ],
        "description": "Retrieves a list of orders for the authenticated user.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Type of order to retrieve.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Symbol of the order to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Order ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "symbol": {
                        "type": "string",
                        "description": "Trading symbol",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "type": {
                        "type": "string",
                        "description": "Order type",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "side": {
                        "type": "string",
                        "description": "Order side (buy/sell)",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "amount": {
                        "type": "string",
                        "description": "Order amount, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "price": {
                        "type": "string",
                        "description": "Order price, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "cost": {
                        "type": "string",
                        "description": "Total cost, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "fee": {
                        "type": "string",
                        "description": "Order fee, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "filled": {
                        "type": "string",
                        "description": "Filled amount, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "remaining": {
                        "type": "string",
                        "description": "Remaining amount, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "status": {
                        "type": "string",
                        "description": "Order status",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Creates a new trading order",
        "description": "Submits a new trading order for the logged-in user.",
        "operationId": "createOrder",
        "tags": [
          "Trading",
          "Orders"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "description": "Currency symbol (e.g., BTC)"
                  },
                  "pair": {
                    "type": "string",
                    "description": "Pair symbol (e.g., USDT)"
                  },
                  "type": {
                    "type": "string",
                    "description": "Order type, limit or market"
                  },
                  "side": {
                    "type": "string",
                    "description": "Order side, buy or sell"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount of the order"
                  },
                  "price": {
                    "type": "number",
                    "description": "Price of the order (required if limit)"
                  }
                },
                "required": [
                  "currency",
                  "pair",
                  "type",
                  "side",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecosystem/order/{id}": {
      "del": {
        "summary": "Cancels an existing trading order",
        "description": "Cancels an open trading order and refunds the unfulfilled amount, including fee adjustments for partial fills.",
        "operationId": "cancelOrder",
        "tags": [
          "Trading",
          "Orders"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "UUID of the order"
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Timestamp of the order"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order cancelled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecosystem/token": {
      "get": {
        "summary": "Retrieves all ecosystem tokens",
        "description": "Fetches a list of all active tokens available in the ecosystem.",
        "operationId": "listEcosystemTokens",
        "tags": [
          "Ecosystem",
          "Tokens"
        ],
        "responses": {
          "200": {
            "description": "Tokens retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Token name",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "currency": {
                        "type": "string",
                        "description": "Token currency code",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "chain": {
                        "type": "string",
                        "description": "Blockchain chain name",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "type": {
                        "type": "string",
                        "description": "Token type",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Token status"
                      },
                      "precision": {
                        "type": "number",
                        "description": "Token precision",
                        "nullable": false
                      },
                      "limits": {
                        "type": "object",
                        "description": "Token transfer limits"
                      },
                      "decimals": {
                        "type": "number",
                        "description": "Token decimal places",
                        "nullable": false
                      },
                      "icon": {
                        "type": "string",
                        "description": "Token icon URL",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": true
                      },
                      "contractType": {
                        "type": "string",
                        "description": "Type of token contract",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "network": {
                        "type": "string",
                        "description": "Network type",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "fee": {
                        "type": "object",
                        "description": "Token fee"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Token not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecosystem/token/{currency}": {
      "get": {
        "summary": "Retrieves a specific ecosystem token",
        "description": "Fetches details of a specific token in the ecosystem.",
        "operationId": "getEcosystemToken",
        "tags": [
          "Ecosystem",
          "Tokens"
        ],
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Blockchain chain name"
            }
          },
          {
            "name": "currency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Currency code of the token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Token details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Token name",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "currency": {
                      "type": "string",
                      "description": "Token currency code",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "chain": {
                      "type": "string",
                      "description": "Blockchain chain name",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "type": {
                      "type": "string",
                      "description": "Token type",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Token status"
                    },
                    "precision": {
                      "type": "number",
                      "description": "Token precision",
                      "nullable": false
                    },
                    "limits": {
                      "type": "object",
                      "description": "Token transfer limits"
                    },
                    "decimals": {
                      "type": "number",
                      "description": "Token decimal places",
                      "nullable": false
                    },
                    "icon": {
                      "type": "string",
                      "description": "Token icon URL",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": true
                    },
                    "contractType": {
                      "type": "string",
                      "description": "Type of token contract",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "network": {
                      "type": "string",
                      "description": "Network type",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "fee": {
                      "type": "object",
                      "description": "Token fee"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Token not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecosystem/wallet": {
      "get": {
        "summary": "Lists all wallets for the logged-in user",
        "description": "Retrieves all wallets associated with the logged-in user, optionally including transactions and address.",
        "operationId": "listWallets",
        "tags": [
          "Wallet",
          "User"
        ],
        "parameters": [
          {
            "name": "transactions",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Whether to include transaction details"
          },
          {
            "name": "address",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Whether to include wallet address"
          }
        ],
        "responses": {
          "200": {
            "description": "Wallets retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Wallet ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "type": {
                        "type": "string",
                        "description": "Wallet type",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "currency": {
                        "type": "string",
                        "description": "Wallet currency",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "balance": {
                        "type": "number",
                        "description": "Wallet balance",
                        "nullable": false
                      },
                      "transactions": {
                        "type": "array",
                        "description": "List of transactions",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Transaction ID",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "type": {
                              "type": "string",
                              "description": "Transaction type",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "status": {
                              "type": "string",
                              "description": "Transaction status",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "amount": {
                              "type": "number",
                              "description": "Transaction amount",
                              "nullable": false
                            },
                            "fee": {
                              "type": "number",
                              "description": "Transaction fee",
                              "nullable": false
                            },
                            "description": {
                              "type": "string",
                              "description": "Transaction description",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "metadata": {
                              "type": "object",
                              "description": "Additional metadata for the transaction"
                            },
                            "referenceId": {
                              "type": "string",
                              "description": "Reference ID",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "createdAt": {
                              "type": "string",
                              "description": "Creation time of the transaction",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false,
                              "pattern": "date-time"
                            }
                          },
                          "nullable": true
                        }
                      },
                      "address": {
                        "type": "array",
                        "description": "Wallet addresses",
                        "items": {
                          "type": "string",
                          "description": "Wallet address",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "nullable": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Wallet not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecosystem/wallet/{currency}": {
      "get": {
        "summary": "Fetches a specific wallet by currency",
        "description": "Retrieves details of a wallet associated with the logged-in user by its currency.",
        "operationId": "getWallet",
        "tags": [
          "Wallet",
          "User"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "currency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Currency of the wallet"
            }
          },
          {
            "name": "contractType",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Chain of the wallet address"
            }
          },
          {
            "name": "chain",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Chain of the wallet address"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Wallet ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "type": {
                      "type": "string",
                      "description": "Wallet type",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "currency": {
                      "type": "string",
                      "description": "Wallet currency",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "balance": {
                      "type": "number",
                      "description": "Wallet balance",
                      "nullable": false
                    },
                    "transactions": {
                      "type": "array",
                      "description": "List of transactions",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Transaction ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "type": {
                            "type": "string",
                            "description": "Transaction type",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "status": {
                            "type": "string",
                            "description": "Transaction status",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "amount": {
                            "type": "number",
                            "description": "Transaction amount",
                            "nullable": false
                          },
                          "fee": {
                            "type": "number",
                            "description": "Transaction fee",
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Transaction description",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "metadata": {
                            "type": "object",
                            "description": "Additional metadata for the transaction"
                          },
                          "referenceId": {
                            "type": "string",
                            "description": "Reference ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "Creation time of the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false,
                            "pattern": "date-time"
                          }
                        },
                        "nullable": true
                      }
                    },
                    "address": {
                      "type": "array",
                      "description": "Wallet addresses",
                      "items": {
                        "type": "string",
                        "description": "Wallet address",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Wallet not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ecosystem/wallet/{id}/transfer": {
      "post": {
        "summary": "Transfers funds between user wallets",
        "description": "Allows a user to transfer funds to another user's wallet.",
        "operationId": "transferFunds",
        "tags": [
          "Wallet",
          "Transfer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "UUID of the recipient's wallet or user"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "description": "Amount to transfer"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency for the transfer"
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transfer completed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message indicating the transfer has been processed."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Wallet not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ecosystem/withdraw": {
      "post": {
        "summary": "Withdraws funds to an external address",
        "description": "Processes a withdrawal from the user's wallet to an external address.",
        "operationId": "withdrawFunds",
        "tags": [
          "Wallet",
          "Withdrawal"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "description": "Currency to withdraw"
                  },
                  "chain": {
                    "type": "string",
                    "description": "Withdraw method ID"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount to withdraw"
                  },
                  "toAddress": {
                    "type": "string",
                    "description": "Withdraw toAddress"
                  }
                },
                "required": [
                  "currency",
                  "chain",
                  "amount",
                  "toAddress"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Withdrawal processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message indicating the withdrawal has been processed."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Wallet not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/faq/category": {
      "get": {
        "summary": "Get FAQ Categories",
        "description": "Retrieves distinct FAQ categories.",
        "operationId": "getFAQCategories",
        "tags": [
          "FAQ",
          "User"
        ],
        "responses": {
          "200": {
            "description": "Categories retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": []
      }
    },
    "/api/faq": {
      "get": {
        "summary": "Get Public FAQs",
        "description": "Retrieves active FAQ entries with optional search and category filters.",
        "operationId": "getPublicFAQs",
        "tags": [
          "FAQ"
        ],
        "responses": {
          "200": {
            "description": "FAQs retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": []
      }
    },
    "/api/faq/question": {
      "post": {
        "summary": "Submit FAQ Question",
        "description": "Allows a user to submit a question if they cannot find an answer in the FAQs.",
        "operationId": "submitFAQQuestion",
        "tags": [
          "FAQ"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "User's email"
                  },
                  "question": {
                    "type": "string",
                    "description": "The submitted question"
                  }
                },
                "required": [
                  "email",
                  "question"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Question submitted successfully"
          },
          "400": {
            "description": "Bad Request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/faq/search": {
      "post": {
        "summary": "Record FAQ Search Query",
        "description": "Records a search query used on the FAQ page.",
        "operationId": "recordFAQSearch",
        "tags": [
          "FAQ"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string"
                  },
                  "query": {
                    "type": "string"
                  },
                  "resultCount": {
                    "type": "number"
                  },
                  "category": {
                    "type": "string"
                  }
                },
                "required": [
                  "query",
                  "resultCount"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Search query recorded successfully"
          },
          "400": {
            "description": "Bad Request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "requiresAuth": false,
        "security": []
      }
    },
    "/api/faq/{id}/feedback": {
      "post": {
        "summary": "Submit FAQ Feedback",
        "description": "Creates or updates a feedback record for a specific FAQ. If a feedback record already exists for the user and FAQ, it updates the comment field.",
        "operationId": "submitFAQFeedbackPublic",
        "tags": [
          "FAQ"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "FAQ ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "isHelpful": {
                    "type": "boolean"
                  },
                  "comment": {
                    "type": "string"
                  }
                },
                "required": [
                  "isHelpful"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Feedback submitted successfully"
          },
          "400": {
            "description": "Bad Request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/faq/{id}": {
      "get": {
        "summary": "Get FAQ by ID",
        "description": "Retrieves a single FAQ entry by its ID, including its related FAQs, computed helpfulCount from feedback, and increments the view count.",
        "operationId": "getFAQById",
        "tags": [
          "FAQ"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "FAQ ID"
          }
        ],
        "responses": {
          "200": {
            "description": "FAQ retrieved successfully with related FAQs, helpfulCount and updated view count embedded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "FAQ not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": []
      }
    },
    "/api/forex/account": {
      "get": {
        "summary": "Retrieves all Forex accounts for the logged-in user",
        "description": "Fetches all Forex accounts associated with the currently authenticated user.",
        "operationId": "getForexAccounts",
        "tags": [
          "Forex",
          "Accounts"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Forex accounts retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "accountId": {
                        "type": "string",
                        "description": "The unique identifier for the Forex account",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "broker": {
                        "type": "string",
                        "description": "Broker name",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Current status of the account"
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of the account (DEMO or LIVE)",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "mt": {
                        "type": "string",
                        "description": "MetaTrader version",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "balance": {
                        "type": "number",
                        "description": "Current balance in the account",
                        "nullable": false
                      },
                      "leverage": {
                        "type": "string",
                        "description": "Account leverage",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "user": {
                        "type": "object",
                        "description": "User details associated with the account",
                        "properties": {
                          "uuid": {
                            "type": "string",
                            "description": "User UUID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "firstName": {
                            "type": "string",
                            "description": "User's first name",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "lastName": {
                            "type": "string",
                            "description": "User's last name",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "avatar": {
                            "type": "string",
                            "description": "User's avatar URL",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Forex Account not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/account/{id}/deposit": {
      "post": {
        "summary": "Deposits money into a specified Forex account",
        "description": "Allows a user to deposit money from their wallet into a Forex account.",
        "operationId": "depositForexAccount",
        "tags": [
          "Forex",
          "Accounts"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Forex account ID"
            }
          }
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Wallet type"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency code"
                  },
                  "chain": {
                    "type": "string",
                    "description": "Blockchain network",
                    "nullable": true
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount to deposit"
                  }
                },
                "required": [
                  "type",
                  "currency",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Deposit successfully processed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    },
                    "transaction": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Transaction ID"
                        },
                        "type": {
                          "type": "string",
                          "description": "Transaction type"
                        },
                        "status": {
                          "type": "string",
                          "description": "Transaction status"
                        },
                        "amount": {
                          "type": "number",
                          "description": "Transaction amount"
                        },
                        "fee": {
                          "type": "number",
                          "description": "Transaction fee"
                        },
                        "description": {
                          "type": "string",
                          "description": "Transaction description"
                        },
                        "metadata": {
                          "type": "object",
                          "description": "Transaction metadata"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Transaction creation date"
                        }
                      }
                    },
                    "balance": {
                      "type": "number",
                      "description": "Wallet balance"
                    },
                    "currency": {
                      "type": "string",
                      "description": "Currency code"
                    },
                    "chain": {
                      "type": "string",
                      "description": "Blockchain network",
                      "nullable": true
                    },
                    "type": {
                      "type": "string",
                      "description": "Deposit method type"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Forex Account not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/account/{id}": {
      "get": {
        "summary": "Retrieves a specific Forex account by ID",
        "description": "Fetches a specific Forex account by its ID for the currently authenticated user.",
        "operationId": "getForexAccountById",
        "tags": [
          "Forex",
          "Accounts"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Account ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Forex account retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accountId": {
                      "type": "string",
                      "description": "The unique identifier for the Forex account",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "broker": {
                      "type": "string",
                      "description": "Broker name",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Current status of the account"
                    },
                    "type": {
                      "type": "string",
                      "description": "Type of the account (DEMO or LIVE)",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "mt": {
                      "type": "string",
                      "description": "MetaTrader version",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "balance": {
                      "type": "number",
                      "description": "Current balance in the account",
                      "nullable": false
                    },
                    "leverage": {
                      "type": "string",
                      "description": "Account leverage",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "user": {
                      "type": "object",
                      "description": "User details associated with the account",
                      "properties": {
                        "uuid": {
                          "type": "string",
                          "description": "User UUID",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "firstName": {
                          "type": "string",
                          "description": "User's first name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "lastName": {
                          "type": "string",
                          "description": "User's last name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "avatar": {
                          "type": "string",
                          "description": "User's avatar URL",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Forex Account not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/account/{id}/withdraw": {
      "post": {
        "summary": "Withdraws money from the specified Forex account",
        "description": "Allows a user to withdraw money from their Forex account into their wallet.",
        "operationId": "withdrawForexAccount",
        "tags": [
          "Forex",
          "Accounts"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Forex account ID"
            }
          }
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Wallet type"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency code"
                  },
                  "chain": {
                    "type": "string",
                    "description": "Blockchain network",
                    "nullable": true
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount to withdraw"
                  }
                },
                "required": [
                  "type",
                  "currency",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Withdrawal successfully processed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    },
                    "transaction": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Transaction ID"
                        },
                        "userId": {
                          "type": "string",
                          "description": "User ID"
                        },
                        "walletId": {
                          "type": "string",
                          "description": "Wallet ID"
                        },
                        "type": {
                          "type": "string",
                          "description": "Transaction type"
                        },
                        "status": {
                          "type": "string",
                          "description": "Transaction status"
                        },
                        "amount": {
                          "type": "number",
                          "description": "Transaction amount"
                        },
                        "fee": {
                          "type": "number",
                          "description": "Transaction fee"
                        },
                        "description": {
                          "type": "string",
                          "description": "Transaction description"
                        },
                        "metadata": {
                          "type": "object",
                          "description": "Transaction metadata"
                        },
                        "createdAt": {
                          "type": "string",
                          "description": "Transaction creation date"
                        },
                        "updatedAt": {
                          "type": "string",
                          "description": "Transaction update date"
                        }
                      }
                    },
                    "balance": {
                      "type": "number",
                      "description": "Wallet balance"
                    },
                    "currency": {
                      "type": "string",
                      "description": "Currency code"
                    },
                    "chain": {
                      "type": "string",
                      "description": "Blockchain network",
                      "nullable": true
                    },
                    "type": {
                      "type": "string",
                      "description": "Wallet type"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Forex Account not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/duration": {
      "get": {
        "summary": "Get Forex Investment Durations",
        "description": "Retrieves a list of all available Forex investment durations, ordered by timeframe (HOUR, DAY, WEEK, MONTH) then duration ascending.",
        "operationId": "getForexDurations",
        "tags": [
          "Forex",
          "Duration"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Forex investment durations retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Duration ID"
                      },
                      "duration": {
                        "type": "number",
                        "description": "Duration value"
                      },
                      "timeframe": {
                        "type": "string",
                        "enum": [
                          "HOUR",
                          "DAY",
                          "WEEK",
                          "MONTH"
                        ],
                        "description": "Timeframe unit"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/investment/active": {
      "get": {
        "summary": "Retrieves active Forex investments for the logged-in user",
        "description": "Fetches active Forex investments associated with the currently authenticated user.",
        "operationId": "getActiveForexInvestments",
        "tags": [
          "Forex",
          "Investments"
        ],
        "responses": {
          "200": {
            "description": "Active Forex investments retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Forex investment ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "userId": {
                        "type": "string",
                        "description": "User ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "accountId": {
                        "type": "string",
                        "description": "Forex account ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "planId": {
                        "type": "string",
                        "description": "Forex plan ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "durationId": {
                        "type": "string",
                        "description": "Forex duration ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "amount": {
                        "type": "number",
                        "description": "Investment amount",
                        "nullable": false
                      },
                      "status": {
                        "type": "string",
                        "description": "Investment status",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "returns": {
                        "type": "number",
                        "description": "Investment returns",
                        "nullable": false
                      },
                      "startDate": {
                        "type": "string",
                        "description": "Investment start date",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "endDate": {
                        "type": "string",
                        "description": "Investment end date",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "plan": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Forex plan ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "name": {
                            "type": "string",
                            "description": "Plan name",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "title": {
                            "type": "string",
                            "description": "Plan title",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Plan description",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "profit_percentage": {
                            "type": "number",
                            "description": "Plan profit percentage",
                            "nullable": false
                          },
                          "image": {
                            "type": "string",
                            "description": "Plan image URL",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "title",
                          "description",
                          "profit_percentage",
                          "image"
                        ]
                      },
                      "user": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "User ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "uuid": {
                            "type": "string",
                            "description": "User UUID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "avatar": {
                            "type": "string",
                            "description": "User avatar URL",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "first_name": {
                            "type": "string",
                            "description": "User first name",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "last_name": {
                            "type": "string",
                            "description": "User last name",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          }
                        },
                        "required": [
                          "id",
                          "uuid",
                          "avatar",
                          "first_name",
                          "last_name"
                        ]
                      },
                      "duration": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Forex duration ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "duration": {
                            "type": "number",
                            "description": "Duration",
                            "nullable": false
                          },
                          "timeframe": {
                            "type": "string",
                            "description": "Timeframe",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          }
                        },
                        "required": [
                          "id",
                          "duration",
                          "timeframe"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Forex Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/investment": {
      "get": {
        "summary": "Lists all Forex Investments with pagination and optional filtering",
        "operationId": "listForexInvestments",
        "tags": [
          "Admin",
          "Forex",
          "Investments"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of Forex Investments with pagination information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the Forex Investment",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "userId": {
                            "type": "string",
                            "description": "ID of the User",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "planId": {
                            "type": "string",
                            "description": "ID of the Forex Plan",
                            "maxLength": 191,
                            "minLength": 0,
                            "nullable": true
                          },
                          "durationId": {
                            "type": "string",
                            "description": "ID of the Forex Duration",
                            "maxLength": 191,
                            "minLength": 0,
                            "nullable": true
                          },
                          "amount": {
                            "type": "number",
                            "description": "Invested Amount",
                            "nullable": false
                          },
                          "profit": {
                            "type": "number",
                            "description": "Profit from Investment",
                            "nullable": false
                          },
                          "result": {
                            "type": "string",
                            "description": "Result of the Investment",
                            "enum": [
                              "WIN",
                              "LOSS",
                              "DRAW"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "description": "Status of the Investment",
                            "enum": [
                              "ACTIVE",
                              "COMPLETED",
                              "CANCELLED",
                              "REJECTED"
                            ]
                          },
                          "endDate": {
                            "type": "string",
                            "format": "date-time",
                            "description": "End Date of the Investment",
                            "nullable": false
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Creation Date of the Investment",
                            "nullable": false
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Last Update Date of the Investment",
                            "nullable": false
                          },
                          "deletedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Deletion Date of the Investment",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Forex Investments not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Creates a new Forex investment",
        "description": "Allows a user to initiate a new Forex investment.",
        "operationId": "createForexInvestment",
        "tags": [
          "Forex",
          "Investments"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "planId": {
                    "type": "string",
                    "description": "Forex plan ID"
                  },
                  "durationId": {
                    "type": "string",
                    "description": "Investment duration ID"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount to invest"
                  }
                },
                "required": [
                  "planId",
                  "durationId",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Forex investment created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Forex investment ID"
                    },
                    "userId": {
                      "type": "string",
                      "description": "User ID"
                    },
                    "planId": {
                      "type": "string",
                      "description": "Forex plan ID"
                    },
                    "durationId": {
                      "type": "string",
                      "description": "Investment duration ID"
                    },
                    "amount": {
                      "type": "number",
                      "description": "Investment amount"
                    },
                    "profit": {
                      "type": "number",
                      "description": "Investment profit"
                    },
                    "result": {
                      "type": "string",
                      "description": "Investment result (WIN, LOSS, or DRAW)"
                    },
                    "status": {
                      "type": "string",
                      "description": "Investment status (ACTIVE, COMPLETED, CANCELLED, or REJECTED)"
                    },
                    "endDate": {
                      "type": "string",
                      "description": "Investment end date"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Investment creation timestamp"
                    },
                    "updatedAt": {
                      "type": "string",
                      "description": "Investment update timestamp"
                    }
                  },
                  "required": [
                    "id",
                    "userId",
                    "planId",
                    "durationId",
                    "amount",
                    "status",
                    "endDate"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Forex Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/investment/{id}": {
      "get": {
        "summary": "Retrieves detailed information of a specific forex investment by ID",
        "operationId": "getForexInvestmentById",
        "tags": [
          "Admin",
          "Forex Investments"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the forex investment to retrieve",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Forex investment details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Forex investment ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "userId": {
                      "type": "string",
                      "description": "User ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "accountId": {
                      "type": "string",
                      "description": "Forex account ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "planId": {
                      "type": "string",
                      "description": "Forex plan ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "durationId": {
                      "type": "string",
                      "description": "Forex duration ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "amount": {
                      "type": "number",
                      "description": "Investment amount",
                      "nullable": false
                    },
                    "status": {
                      "type": "string",
                      "description": "Investment status",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "returns": {
                      "type": "number",
                      "description": "Investment returns",
                      "nullable": false
                    },
                    "startDate": {
                      "type": "string",
                      "description": "Investment start date",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "endDate": {
                      "type": "string",
                      "description": "Investment end date",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "plan": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Forex plan ID",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "name": {
                          "type": "string",
                          "description": "Plan name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "title": {
                          "type": "string",
                          "description": "Plan title",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "description": {
                          "type": "string",
                          "description": "Plan description",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "profit_percentage": {
                          "type": "number",
                          "description": "Plan profit percentage",
                          "nullable": false
                        },
                        "image": {
                          "type": "string",
                          "description": "Plan image URL",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "title",
                        "description",
                        "profit_percentage",
                        "image"
                      ]
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "User ID",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "uuid": {
                          "type": "string",
                          "description": "User UUID",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "avatar": {
                          "type": "string",
                          "description": "User avatar URL",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": true
                        },
                        "first_name": {
                          "type": "string",
                          "description": "User first name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "last_name": {
                          "type": "string",
                          "description": "User last name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        }
                      },
                      "required": [
                        "id",
                        "uuid",
                        "avatar",
                        "first_name",
                        "last_name"
                      ]
                    },
                    "duration": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Forex duration ID",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "duration": {
                          "type": "number",
                          "description": "Duration",
                          "nullable": false
                        },
                        "timeframe": {
                          "type": "string",
                          "description": "Timeframe",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        }
                      },
                      "required": [
                        "id",
                        "duration",
                        "timeframe"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Forex Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/investment/{id}/status": {
      "put": {
        "summary": "Retrieves specific Forex investment status",
        "description": "Fetches details of a specific Forex investment for the logged-in user.",
        "operationId": "getForexInvestmentStatus",
        "tags": [
          "Forex",
          "Investments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Forex investment ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Forex investment details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Forex investment ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "userId": {
                      "type": "string",
                      "description": "User ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "accountId": {
                      "type": "string",
                      "description": "Forex account ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "planId": {
                      "type": "string",
                      "description": "Forex plan ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "durationId": {
                      "type": "string",
                      "description": "Forex duration ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "amount": {
                      "type": "number",
                      "description": "Investment amount",
                      "nullable": false
                    },
                    "status": {
                      "type": "string",
                      "description": "Investment status",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "returns": {
                      "type": "number",
                      "description": "Investment returns",
                      "nullable": false
                    },
                    "startDate": {
                      "type": "string",
                      "description": "Investment start date",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "endDate": {
                      "type": "string",
                      "description": "Investment end date",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "plan": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Forex plan ID",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "name": {
                          "type": "string",
                          "description": "Plan name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "title": {
                          "type": "string",
                          "description": "Plan title",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "description": {
                          "type": "string",
                          "description": "Plan description",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "profit_percentage": {
                          "type": "number",
                          "description": "Plan profit percentage",
                          "nullable": false
                        },
                        "image": {
                          "type": "string",
                          "description": "Plan image URL",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "title",
                        "description",
                        "profit_percentage",
                        "image"
                      ]
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "User ID",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "uuid": {
                          "type": "string",
                          "description": "User UUID",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "avatar": {
                          "type": "string",
                          "description": "User avatar URL",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": true
                        },
                        "first_name": {
                          "type": "string",
                          "description": "User first name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "last_name": {
                          "type": "string",
                          "description": "User last name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        }
                      },
                      "required": [
                        "id",
                        "uuid",
                        "avatar",
                        "first_name",
                        "last_name"
                      ]
                    },
                    "duration": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Forex duration ID",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "duration": {
                          "type": "number",
                          "description": "Duration",
                          "nullable": false
                        },
                        "timeframe": {
                          "type": "string",
                          "description": "Timeframe",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        }
                      },
                      "required": [
                        "id",
                        "duration",
                        "timeframe"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Forex Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/overview": {
      "get": {
        "summary": "Get Forex User Dashboard Data",
        "description": "Retrieves user-specific dashboard data including overview statistics, chart data, plan distribution, and recent investments.",
        "operationId": "getForexUserDashboardData",
        "tags": [
          "Forex",
          "Dashboard",
          "User"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "name": "timeframe",
            "in": "query",
            "description": "Timeframe for chart data: 1m, 3m, or 1y",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "3m",
                "1y"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User dashboard data retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "overview": {
                      "type": "object",
                      "properties": {
                        "totalInvested": {
                          "type": "number"
                        },
                        "totalProfit": {
                          "type": "number"
                        },
                        "profitPercentage": {
                          "type": "number"
                        },
                        "activeInvestments": {
                          "type": "number"
                        },
                        "completedInvestments": {
                          "type": "number"
                        }
                      }
                    },
                    "chartData": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "planDistribution": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "number"
                          },
                          "percentage": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "recentInvestments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "plan": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "number"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/plan": {
      "get": {
        "summary": "Get Forex Investment Plans",
        "description": "Retrieves a list of forex investment plans filtered and sorted based on query parameters. Parameters include activeTab, search, minProfit, maxInvestment, and sortBy.",
        "operationId": "getForexPlans",
        "tags": [
          "Forex",
          "Plan"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "name": "activeTab",
            "in": "query",
            "description": "If set to \"trending\", only trending plans are returned.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "trending"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search term to filter plans by title or description.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minProfit",
            "in": "query",
            "description": "Minimum profit value (number) that a plan must have.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "maxInvestment",
            "in": "query",
            "description": "Maximum investment allowed. Plans with \"maxAmount\" (defaulting to 100000 if missing) must be less than or equal to this value.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Sort the plans by \"popularity\" (invested descending), \"profit\" (profitPercentage descending) or \"minInvestment\" (minAmount ascending).",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "popularity",
                "profit",
                "minInvestment"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Forex investment plans retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "image": {
                        "type": "string"
                      },
                      "currency": {
                        "type": "string"
                      },
                      "walletType": {
                        "type": "string"
                      },
                      "minProfit": {
                        "type": "number"
                      },
                      "maxProfit": {
                        "type": "number"
                      },
                      "minAmount": {
                        "type": "number"
                      },
                      "maxAmount": {
                        "type": "number"
                      },
                      "invested": {
                        "type": "number"
                      },
                      "profitPercentage": {
                        "type": "number"
                      },
                      "trending": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/plan/{id}": {
      "get": {
        "summary": "Retrieve specific Forex Investment Plan",
        "description": "Fetches details of a specific Forex investment plan for the logged-in user along with available durations, plus the total number of distinct investors and the total invested amount.",
        "operationId": "getForexPlanById",
        "tags": [
          "Forex",
          "Plan"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Forex investment plan ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Forex plan retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Forex plan ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "title": {
                      "type": "string",
                      "description": "Plan title",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "description": {
                      "type": "string",
                      "description": "Plan description",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "image": {
                      "type": "string",
                      "description": "Plan image URL",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "minAmount": {
                      "type": "number",
                      "description": "Minimum investment amount",
                      "nullable": false
                    },
                    "maxAmount": {
                      "type": "number",
                      "description": "Maximum investment amount",
                      "nullable": false
                    },
                    "invested": {
                      "type": "number",
                      "description": "Total invested amount in this plan"
                    },
                    "trending": {
                      "type": "boolean",
                      "description": "Indicates if the plan is trending"
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Active status of the plan"
                    },
                    "forexPlanDuration": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Duration ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "duration": {
                            "type": "number",
                            "description": "Duration value",
                            "nullable": false
                          },
                          "timeframe": {
                            "type": "string",
                            "description": "Timeframe of the duration",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          }
                        },
                        "required": [
                          "id",
                          "duration",
                          "timeframe"
                        ]
                      }
                    },
                    "durations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "duration": {
                            "type": "number"
                          },
                          "timeframe": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "totalInvestors": {
                      "type": "number",
                      "description": "Total distinct users who invested in this plan"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Forex Plan not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/forex/stats": {
      "get": {
        "summary": "Get Forex Platform Statistics",
        "description": "Retrieves platform-wide forex stats: number of active investors, total invested amount, average return (completed investments), and number of countries served.",
        "operationId": "getForexStats",
        "tags": [
          "Forex",
          "Stats"
        ],
        "responses": {
          "200": {
            "description": "Forex platform statistics retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "activeInvestors": {
                      "type": "number",
                      "description": "Unique users with active investments."
                    },
                    "totalInvested": {
                      "type": "number",
                      "description": "Total amount invested (all time)."
                    },
                    "averageReturn": {
                      "type": "number",
                      "description": "Average return percentage for completed investments."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": []
      }
    },
    "/api/forex/transaction": {
      "get": {
        "summary": "Lists transactions with optional filters",
        "operationId": "listForexTransactions",
        "tags": [
          "User",
          "Forex",
          "Transactions"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of transactions retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of the transaction (DEPOSIT, WITHDRAW, etc.)",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "status": {
                            "type": "string",
                            "description": "Current status of the transaction (PENDING, COMPLETED, etc.)",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false,
                            "enum": [
                              "PENDING",
                              "COMPLETED",
                              "FAILED",
                              "CANCELLED",
                              "REJECTED",
                              "EXPIRED"
                            ]
                          },
                          "amount": {
                            "type": "number",
                            "description": "Amount involved in the transaction",
                            "nullable": false
                          },
                          "fee": {
                            "type": "number",
                            "description": "Fee associated with the transaction",
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Description of the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "metadata": {
                            "type": "object",
                            "description": "Additional metadata of the transaction",
                            "nullable": true
                          },
                          "referenceId": {
                            "type": "string",
                            "description": "Reference ID of the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "trxId": {
                            "type": "string",
                            "description": "Transaction ID from the payment processor",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Transactions not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/futures/chart": {
      "get": {
        "summary": "Retrieves historical data for a specific futures symbol",
        "description": "Fetches historical price data based on the specified interval and date range.",
        "operationId": "getFuturesHistoricalData",
        "tags": [
          "Futures",
          "Historical"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trading symbol, e.g., BTC/USD"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "description": "Start timestamp for historical data"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "description": "End timestamp for historical data"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Time interval for the data, e.g., 1m, 5m, 1h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Historical data retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "openTime": {
                        "type": "number",
                        "description": "Open time of the candle",
                        "nullable": false
                      },
                      "closeTime": {
                        "type": "number",
                        "description": "Close time of the candle",
                        "nullable": false
                      },
                      "open": {
                        "type": "string",
                        "description": "Opening price",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "high": {
                        "type": "string",
                        "description": "Highest price",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "low": {
                        "type": "string",
                        "description": "Lowest price",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "close": {
                        "type": "string",
                        "description": "Closing price",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "volume": {
                        "type": "string",
                        "description": "Volume",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Chart not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/futures/market": {
      "get": {
        "summary": "Retrieves all futures markets",
        "description": "Fetches a list of all active futures markets.",
        "operationId": "listFuturesMarkets",
        "tags": [
          "Futures",
          "Markets"
        ],
        "responses": {
          "200": {
            "description": "Futures markets retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number",
                        "description": "Futures Market ID",
                        "nullable": false
                      },
                      "currency": {
                        "type": "string",
                        "description": "Futures market currency",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "pair": {
                        "type": "string",
                        "description": "Futures market pair",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Futures market status"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Futures Market not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/futures/market/{id}": {
      "get": {
        "summary": "Retrieves a specific futures market",
        "description": "Fetches details of a specific futures market.",
        "operationId": "getFuturesMarket",
        "tags": [
          "Futures",
          "Markets"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Futures Market ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Futures market details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number",
                      "description": "Futures Market ID",
                      "nullable": false
                    },
                    "currency": {
                      "type": "string",
                      "description": "Futures market currency",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "pair": {
                      "type": "string",
                      "description": "Futures market pair",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Futures market status"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Futures Market not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/futures/order": {
      "get": {
        "summary": "List Futures Orders",
        "operationId": "listFuturesOrders",
        "tags": [
          "Futures",
          "Orders"
        ],
        "description": "Retrieves a list of futures orders for the authenticated user.",
        "parameters": [
          {
            "name": "currency",
            "in": "query",
            "description": "Currency of the orders to retrieve.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pair",
            "in": "query",
            "description": "Pair of the orders to retrieve.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Type of order to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of futures orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Order ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "symbol": {
                        "type": "string",
                        "description": "Trading symbol",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "type": {
                        "type": "string",
                        "description": "Order type",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "side": {
                        "type": "string",
                        "description": "Order side (buy/sell)",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "amount": {
                        "type": "string",
                        "description": "Order amount, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "price": {
                        "type": "string",
                        "description": "Order price, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "cost": {
                        "type": "string",
                        "description": "Total cost, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "fee": {
                        "type": "string",
                        "description": "Order fee, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "filled": {
                        "type": "string",
                        "description": "Filled amount, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "remaining": {
                        "type": "string",
                        "description": "Remaining amount, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "status": {
                        "type": "string",
                        "description": "Order status",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "stop_loss_price": {
                        "type": "string",
                        "description": "Stop loss price, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "take_profit_price": {
                        "type": "string",
                        "description": "Take profit price, converted from bigint",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Creates a new futures trading order",
        "description": "Submits a new futures trading order for the logged-in user.",
        "operationId": "createFuturesOrder",
        "tags": [
          "Futures",
          "Orders"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "description": "Currency symbol (e.g., BTC)"
                  },
                  "pair": {
                    "type": "string",
                    "description": "Pair symbol (e.g., USDT)"
                  },
                  "type": {
                    "type": "string",
                    "description": "Order type, e.g., limit, market"
                  },
                  "side": {
                    "type": "string",
                    "description": "Order side, either buy or sell"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount of the order"
                  },
                  "price": {
                    "type": "number",
                    "description": "Price of the order (not required for market orders)"
                  },
                  "leverage": {
                    "type": "number",
                    "description": "Leverage for the futures order"
                  },
                  "stopLossPrice": {
                    "type": "number",
                    "description": "Stop loss price for the order",
                    "nullable": true
                  },
                  "takeProfitPrice": {
                    "type": "number",
                    "description": "Take profit price for the order",
                    "nullable": true
                  }
                },
                "required": [
                  "currency",
                  "pair",
                  "type",
                  "side",
                  "amount",
                  "leverage"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/futures/order/{id}": {
      "del": {
        "summary": "Cancels an existing futures trading order",
        "description": "Cancels an open futures trading order and refunds the unfulfilled amount.",
        "operationId": "cancelFuturesOrder",
        "tags": [
          "Futures",
          "Orders"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "UUID of the order"
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Timestamp of the order"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order cancelled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/futures/position": {
      "get": {
        "summary": "List Futures Positions",
        "operationId": "listFuturesPositions",
        "tags": [
          "Futures",
          "Positions"
        ],
        "description": "Retrieves a list of futures positions for the authenticated user.",
        "parameters": [
          {
            "name": "currency",
            "in": "query",
            "description": "Currency of the positions to retrieve.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pair",
            "in": "query",
            "description": "Pair of the positions to retrieve.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Type of positions to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of futures positions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "userId": {
                        "type": "string"
                      },
                      "symbol": {
                        "type": "string"
                      },
                      "side": {
                        "type": "string"
                      },
                      "entryPrice": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "string"
                      },
                      "leverage": {
                        "type": "string"
                      },
                      "unrealizedPnl": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Position not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/futures/position/{id}": {
      "del": {
        "summary": "Closes an open futures position",
        "description": "Closes an open futures position for the logged-in user.",
        "operationId": "closeFuturesPosition",
        "tags": [
          "Futures",
          "Positions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "description": "Currency symbol (e.g., BTC)"
                  },
                  "pair": {
                    "type": "string",
                    "description": "Pair symbol (e.g., USDT)"
                  },
                  "side": {
                    "type": "string",
                    "description": "Position side, either buy or sell"
                  }
                },
                "required": [
                  "currency",
                  "pair",
                  "side"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Position closed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Position not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/futures/ticker": {
      "get": {
        "summary": "Get All Market Tickers",
        "operationId": "getAllMarketTickers",
        "tags": [
          "Exchange",
          "Markets"
        ],
        "description": "Retrieves ticker information for all available market pairs.",
        "responses": {
          "200": {
            "description": "All market tickers information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string",
                      "description": "Trading symbol",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "price": {
                      "type": "string",
                      "description": "Latest trading price",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ticker not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ico/blockchain": {
      "get": {
        "summary": "Get Active Blockchain Configurations",
        "description": "Retrieves all active blockchain configurations for users.",
        "operationId": "getActiveBlockchainConfigs",
        "tags": [
          "ICO",
          "Blockchain"
        ],
        "responses": {
          "200": {
            "description": "Active blockchain configurations retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": []
      }
    },
    "/api/ico/creator/investor": {
      "get": {
        "summary": "Get Investors for Creator Offerings",
        "description": "Retrieves aggregated investor details (including total amount invested, total tokens purchased, latest transaction date, rejected investment amount, and token info from the ICO offering) for ICO offerings created by the authenticated creator. Supports pagination, sorting, and searching. (Aggregation is done by computing valid transactions (PENDING/RELEASED) and rejected transactions separately.)",
        "operationId": "getCreatorInvestors",
        "tags": [
          "ICO",
          "Creator",
          "Investors"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Page number"
          },
          {
            "index": 1,
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Number of items per page"
          },
          {
            "index": 2,
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Field to sort by. For associated fields use dot notation (e.g. 'user.firstName'). Defaults to 'lastTransactionDate'."
          },
          {
            "index": 3,
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort direction: asc or desc (default: desc)"
          },
          {
            "index": 4,
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Search query to filter by investor first or last name"
          }
        ],
        "responses": {
          "200": {
            "description": "Investors retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "currentPage": {
                          "type": "number"
                        },
                        "totalPages": {
                          "type": "number"
                        },
                        "totalItems": {
                          "type": "number"
                        },
                        "itemsPerPage": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/launch": {
      "post": {
        "summary": "Create ICO Offering",
        "description": "Creates a new ICO offering along with token details, team members, and roadmap items. Also verifies user wallet balance and deducts the launch fee based on the selected launch plan.",
        "operationId": "createIcoOffering",
        "tags": [
          "ICO",
          "Offerings"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2
                  },
                  "icon": {
                    "type": "string",
                    "description": "Token icon URL"
                  },
                  "symbol": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 8
                  },
                  "tokenType": {
                    "type": "string"
                  },
                  "blockchain": {
                    "type": "string"
                  },
                  "totalSupply": {
                    "type": "number"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 50,
                    "maxLength": 1000
                  },
                  "tokenDetails": {
                    "type": "object",
                    "properties": {
                      "whitepaper": {
                        "type": "string",
                        "format": "uri"
                      },
                      "github": {
                        "type": "string",
                        "description": "GitHub repository URL",
                        "format": "uri"
                      },
                      "twitter": {
                        "type": "string",
                        "description": "Twitter handle or URL",
                        "format": "uri"
                      },
                      "telegram": {
                        "type": "string",
                        "description": "Telegram handle or URL",
                        "format": "uri"
                      },
                      "useOfFunds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "whitepaper",
                      "github",
                      "useOfFunds",
                      "twitter",
                      "telegram"
                    ]
                  },
                  "teamMembers": {
                    "type": "array",
                    "description": "Team members information",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string",
                          "description": "Member name"
                        },
                        "role": {
                          "type": "string",
                          "description": "Member role"
                        },
                        "bio": {
                          "type": "string",
                          "description": "Member bio",
                          "maxLength": 500
                        },
                        "linkedin": {
                          "type": "string",
                          "description": "LinkedIn URL",
                          "format": "uri"
                        },
                        "twitter": {
                          "type": "string",
                          "description": "Twitter URL",
                          "format": "uri"
                        },
                        "github": {
                          "type": "string",
                          "description": "GitHub URL",
                          "format": "uri"
                        },
                        "website": {
                          "type": "string",
                          "description": "Website URL",
                          "format": "uri"
                        }
                      },
                      "required": [
                        "name",
                        "role",
                        "bio"
                      ]
                    }
                  },
                  "roadmap": {
                    "type": "array",
                    "description": "Roadmap items",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 1000
                        },
                        "date": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "completed": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "title",
                        "description",
                        "date"
                      ]
                    }
                  },
                  "website": {
                    "type": "string",
                    "description": "Project website URL",
                    "format": "uri"
                  },
                  "targetAmount": {
                    "type": "number"
                  },
                  "startDate": {
                    "type": "string",
                    "description": "Start date of the offering",
                    "format": "date-time"
                  },
                  "phases": {
                    "type": "array",
                    "description": "Offering phases",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "tokenPrice": {
                          "type": "number"
                        },
                        "allocation": {
                          "type": "number"
                        },
                        "durationDays": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "name",
                        "tokenPrice",
                        "allocation",
                        "durationDays"
                      ]
                    }
                  },
                  "termsAccepted": {
                    "type": "boolean"
                  },
                  "selectedPlan": {
                    "type": "string",
                    "description": "ID of the selected launch plan",
                    "pattern": "^[0-9a-fA-F-]{36}$"
                  },
                  "paymentComplete": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "symbol",
                  "icon",
                  "tokenType",
                  "blockchain",
                  "totalSupply",
                  "description",
                  "tokenDetails",
                  "website",
                  "targetAmount",
                  "startDate",
                  "phases",
                  "termsAccepted",
                  "selectedPlan",
                  "paymentComplete"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ICO offering created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "offering": {
                      "type": "object",
                      "description": "The created offering record"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized – Admin privileges required."
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/launch/plan": {
      "get": {
        "summary": "Get Launch Plans",
        "description": "Retrieves all launch plans for ICO admin.",
        "operationId": "getLaunchPlans",
        "tags": [
          "ICO",
          "Admin",
          "LaunchPlans"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Launch plans retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized – Admin privileges required."
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/performance": {
      "get": {
        "summary": "Get Creator Chart Data",
        "description": "Retrieves chart data (daily, weekly, or monthly performance) for the authenticated creator's ICO offerings based on a specified time range.",
        "operationId": "getCreatorStatsChart",
        "tags": [
          "ICO",
          "Creator",
          "Stats"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "range",
            "in": "query",
            "description": "Time range for chart data: '7d' for current week (Monday–Sunday), '30d' for current month (daily), '90d' for 3 full months (from start of two months before current month till end of current month), or 'all' for all time (monthly, extended to at least 12 months).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Creator chart data retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "date": {
                        "type": "string",
                        "description": "Date in YYYY-MM-DD format"
                      },
                      "amount": {
                        "type": "number",
                        "description": "Amount raised for that period"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/stat": {
      "get": {
        "summary": "Get Creator Stats",
        "description": "Retrieves aggregated statistics (counts, growth metrics) for the authenticated creator's ICO offerings, and calculates total raised and raise growth from all transactions except those with a 'REJECTED' status.",
        "operationId": "getCreatorStatsStats",
        "tags": [
          "ICO",
          "Creator",
          "Stats"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Creator statistics retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalOfferings": {
                      "type": "number"
                    },
                    "pendingOfferings": {
                      "type": "number"
                    },
                    "activeOfferings": {
                      "type": "number"
                    },
                    "completedOfferings": {
                      "type": "number"
                    },
                    "rejectedOfferings": {
                      "type": "number"
                    },
                    "totalRaised": {
                      "type": "number"
                    },
                    "currentRaised": {
                      "type": "number"
                    },
                    "previousRaised": {
                      "type": "number"
                    },
                    "offeringsGrowth": {
                      "type": "number"
                    },
                    "activeGrowth": {
                      "type": "number"
                    },
                    "raiseGrowth": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/token": {
      "get": {
        "summary": "Get Creator ICO Offerings",
        "description": "Retrieves ICO offerings for the authenticated creator, grouped by status (active, pending, completed) along with currentRaised for each offering.",
        "operationId": "getCreatorOfferings",
        "tags": [
          "ICO",
          "Creator",
          "Offerings"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Creator offerings retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "active": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "pending": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "completed": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/token/{id}": {
      "get": {
        "summary": "Get ICO Offering by ID (Creator)",
        "description": "Retrieves detailed ICO offering data (including phases, token detail, team members, roadmap items, launch plan, computed stats, investor count, and rejected funds) for the authenticated creator.",
        "operationId": "getCreatorIcoOfferingById",
        "tags": [
          "ICO",
          "Creator",
          "Offerings"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ICO offering ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ICO offering retrieved successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Offering not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/token/{id}/plan": {
      "put": {
        "summary": "Upgrade ICO Offering Plan",
        "description": "Updates the launch plan for the specified ICO offering for the authenticated creator.",
        "operationId": "upgradeOfferingPlan",
        "tags": [
          "ICO",
          "Creator",
          "Plan"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ICO offering ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "New plan ID",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "planId": {
                    "type": "string"
                  }
                },
                "required": [
                  "planId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Plan upgraded successfully"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Offering not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/token/{id}/release": {
      "get": {
        "summary": "Fetch Token Release Transactions",
        "description": "Retrieves token release transactions for a given token (offering) ID, optionally filtered by status and paginated with sorting support.",
        "operationId": "getTokenReleaseTransactions",
        "tags": [
          "ICO",
          "Token",
          "Release"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "param",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token (offering) ID"
          },
          {
            "index": 1,
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter transactions by status (PENDING, VERIFICATION, RELEASED)"
          },
          {
            "index": 2,
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Page number"
          },
          {
            "index": 3,
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Number of items per page"
          },
          {
            "index": 4,
            "name": "sortField",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Field to sort by (default is createdAt). For associated models use dot notation (e.g., 'user.firstName')"
          },
          {
            "index": 5,
            "name": "sortDirection",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Sort direction: asc or desc (default is desc)"
          }
        ],
        "responses": {
          "200": {
            "description": "Token release transactions retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "currentPage": {
                          "type": "number"
                        },
                        "totalPages": {
                          "type": "number"
                        },
                        "totalItems": {
                          "type": "number"
                        },
                        "itemsPerPage": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/token/{id}/release/{transactionId}": {
      "put": {
        "summary": "Submit Token Release Transaction Hash",
        "description": "Submits the transaction hash after sending tokens to the investor and updates the token release status to VERIFICATION.",
        "operationId": "submitTokenReleaseHash",
        "tags": [
          "ICO",
          "Token",
          "Release"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the token release transaction"
          },
          {
            "index": 1,
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the token offering"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "releaseUrl": {
                    "type": "string"
                  }
                },
                "required": [
                  "releaseUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token release transaction hash submitted successfully."
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Transaction not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/token/{id}/roadmap": {
      "get": {
        "summary": "Get Roadmap Items for ICO Offering",
        "description": "Retrieves roadmap items for the ICO offering for the authenticated creator.",
        "operationId": "getCreatorTokenRoadmap",
        "tags": [
          "ICO",
          "Creator",
          "Roadmap"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ICO offering ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Roadmap items retrieved successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Roadmap items not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Add a Roadmap Item",
        "description": "Adds a new roadmap item to the specified ICO offering for the authenticated creator.",
        "operationId": "addRoadmapItem",
        "tags": [
          "ICO",
          "Creator",
          "Roadmap"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ICO offering ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Roadmap item data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "date": {
                    "type": "string"
                  },
                  "completed": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "title",
                  "description",
                  "date"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Roadmap item added successfully"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/token/{id}/roadmap/{roadmapId}": {
      "del": {
        "summary": "Delete a Roadmap Item",
        "description": "Deletes a roadmap item from the specified ICO offering for the authenticated creator.",
        "operationId": "deleteRoadmapItem",
        "tags": [
          "ICO",
          "Creator",
          "Roadmap"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ICO offering ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "index": 1,
            "name": "roadmapId",
            "in": "path",
            "description": "Roadmap item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Roadmap item deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Roadmap item not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "summary": "Update a Roadmap Item",
        "description": "Updates a roadmap item of a specified ICO offering for the authenticated creator.",
        "operationId": "updateRoadmapItem",
        "tags": [
          "ICO",
          "Creator",
          "Roadmap"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ICO offering ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "index": 1,
            "name": "roadmapId",
            "in": "path",
            "description": "Roadmap item ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Updated roadmap item data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "date": {
                    "type": "string"
                  },
                  "completed": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "title",
                  "description",
                  "date"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Roadmap item updated successfully"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Roadmap item not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/token/{id}/team": {
      "get": {
        "summary": "Get Team Members for ICO Offering",
        "description": "Retrieves team members for the ICO offering for the authenticated creator.",
        "operationId": "getCreatorTokenTeam",
        "tags": [
          "ICO",
          "Creator",
          "Team"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ICO offering ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team members retrieved successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Team members not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Add a Team Member to an ICO Offering",
        "description": "Adds a new team member to the specified ICO offering for the authenticated creator.",
        "operationId": "addTeamMember",
        "tags": [
          "ICO",
          "Creator",
          "Team"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ICO offering ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Team member data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  },
                  "bio": {
                    "type": "string"
                  },
                  "avatar": {
                    "type": "string"
                  },
                  "linkedin": {
                    "type": "string"
                  },
                  "twitter": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string"
                  },
                  "github": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "role",
                  "bio"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Team member added successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/token/{id}/team/{teamId}": {
      "del": {
        "summary": "Delete a Team Member",
        "description": "Deletes a team member from the specified ICO offering for the authenticated creator.",
        "operationId": "deleteTeamMember",
        "tags": [
          "ICO",
          "Creator",
          "Team"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ICO offering ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "index": 1,
            "name": "teamId",
            "in": "path",
            "description": "Team member ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team member deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Team member not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "summary": "Update a Team Member",
        "description": "Updates a team member of a specified ICO offering for the authenticated creator.",
        "operationId": "updateTeamMember",
        "tags": [
          "ICO",
          "Creator",
          "Team"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ICO offering ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "index": 1,
            "name": "teamId",
            "in": "path",
            "description": "Team member ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Updated team member data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  },
                  "bio": {
                    "type": "string"
                  },
                  "avatar": {
                    "type": "string"
                  },
                  "linkedin": {
                    "type": "string"
                  },
                  "twitter": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string"
                  },
                  "github": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "role",
                  "bio"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Team member updated successfully"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Team member not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/update": {
      "get": {
        "summary": "Get Token Offering Updates",
        "description": "Fetches updates for a specific token offering.",
        "operationId": "getTokenOfferingUpdates",
        "tags": [
          "ICO",
          "Creator",
          "Updates"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Token offering updates retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "offeringId": {
                        "type": "string"
                      },
                      "userId": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "content": {
                        "type": "string"
                      },
                      "attachments": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Create a Token Offering Update",
        "description": "Creates a new update for a token offering by the authenticated creator.",
        "operationId": "createTokenOfferingUpdate",
        "tags": [
          "ICO",
          "Creator",
          "Updates"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tokenId": {
                    "type": "string",
                    "description": "Token offering ID"
                  },
                  "title": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string"
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "document",
                            "link"
                          ]
                        },
                        "url": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "tokenId",
                  "title",
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token offering update created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "update": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/creator/update/{id}": {
      "del": {
        "summary": "Delete a Token Offering Update",
        "description": "Deletes an update for a token offering by the authenticated creator.",
        "operationId": "deleteTokenOfferingUpdate",
        "tags": [
          "ICO",
          "Creator",
          "Updates"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "updateId",
            "in": "path",
            "description": "Token offering update ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Token offering update deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "summary": "Edit a Token Offering Update",
        "description": "Edits an existing update for a token offering by the authenticated creator.",
        "operationId": "editTokenOfferingUpdate",
        "tags": [
          "ICO",
          "Creator",
          "Updates"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "updateId",
            "in": "path",
            "description": "Token offering update ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Updated token offering update data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string"
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "document",
                            "link"
                          ]
                        },
                        "url": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "title",
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token offering update updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "update": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Update not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/offer/featured": {
      "get": {
        "summary": "Get Popular ICO Offerings",
        "description": "Returns the most popular ICO token offerings (by total raised).",
        "operationId": "getPopularIcoOfferings",
        "tags": [
          "ICO",
          "Offerings"
        ],
        "responses": {
          "200": {
            "description": "Popular ICO offerings retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "projects": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "raised": {
                            "type": "string"
                          },
                          "target": {
                            "type": "string"
                          },
                          "progress": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": []
      }
    },
    "/api/ico/offer": {
      "get": {
        "summary": "Get ICO Offerings by Status",
        "description": "Retrieves ICO token offerings filtered by a given status and additional query parameters such as pagination, search, sort, blockchain, tokenType. If the status is 'COMPLETED', the endpoint returns offerings with statuses 'SUCCESS' and 'FAILED'.",
        "operationId": "getIcoOfferingsByStatus",
        "tags": [
          "ICO",
          "Offerings"
        ],
        "parameters": [
          {
            "index": 1,
            "name": "status",
            "in": "query",
            "description": "The offering status to filter by (e.g., ACTIVE, UPCOMING, COMPLETED). Use COMPLETED to fetch offerings with SUCCESS or FAILED status.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "index": 2,
            "name": "page",
            "in": "query",
            "description": "Page number for pagination.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "index": 3,
            "name": "limit",
            "in": "query",
            "description": "Number of items per page for pagination.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "index": 4,
            "name": "search",
            "in": "query",
            "description": "Search term to filter offerings by name or symbol.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "index": 5,
            "name": "sort",
            "in": "query",
            "description": "Sort option for offerings. Valid values: newest, oldest, raised-high, raised-low, target-high, target-low, ending-soon.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "index": 6,
            "name": "blockchain",
            "in": "query",
            "description": "Filter by blockchain. Accepts one or more values (e.g., Ethereum, Solana, Polygon, Binance Smart Chain).",
            "required": false,
            "schema": {
              "type": "string"
            },
            "style": "form",
            "explode": true
          },
          {
            "index": 7,
            "name": "tokenType",
            "in": "query",
            "description": "Filter by token type. Accepts one or more values (e.g., Utility, Security, Governance).",
            "required": false,
            "schema": {
              "type": "string"
            },
            "style": "form",
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "ICO offerings retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "offerings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier for the offering"
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the offering"
                          },
                          "ticker": {
                            "type": "string",
                            "description": "Token ticker"
                          },
                          "description": {
                            "type": "string",
                            "description": "Detailed description of the offering"
                          },
                          "status": {
                            "type": "string",
                            "description": "Current status (ACTIVE, PENDING, etc.). For COMPLETED queries, the status may be SUCCESS or FAILED."
                          },
                          "tokenPrice": {
                            "type": "number",
                            "description": "Current token price"
                          },
                          "targetAmount": {
                            "type": "number",
                            "description": "Total funding target"
                          },
                          "participants": {
                            "type": "number",
                            "description": "Number of participants"
                          },
                          "isPaused": {
                            "type": "boolean",
                            "description": "Flag if the offering is paused"
                          },
                          "isFlagged": {
                            "type": "boolean",
                            "description": "Flag if the offering is flagged"
                          },
                          "startDate": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Start date of the offering"
                          },
                          "endDate": {
                            "type": "string",
                            "format": "date-time",
                            "description": "End date of the offering"
                          },
                          "currentPhase": {
                            "type": "object",
                            "description": "Information about the current phase",
                            "properties": {
                              "name": {
                                "type": "string",
                                "description": "Name of the current phase"
                              },
                              "tokenPrice": {
                                "type": "number",
                                "description": "Token price in the current phase"
                              },
                              "allocation": {
                                "type": "number",
                                "description": "Total allocation in the phase"
                              },
                              "remaining": {
                                "type": "number",
                                "description": "Remaining tokens in the phase"
                              },
                              "endsIn": {
                                "type": "number",
                                "description": "Days until the phase ends (calculated dynamically)"
                              }
                            }
                          },
                          "nextPhase": {
                            "type": "object",
                            "description": "Information about the next phase",
                            "properties": {
                              "name": {
                                "type": "string",
                                "description": "Name of the next phase"
                              },
                              "tokenPrice": {
                                "type": "number",
                                "description": "Token price in the next phase"
                              },
                              "allocation": {
                                "type": "number",
                                "description": "Total allocation in the phase"
                              },
                              "remaining": {
                                "type": "number",
                                "description": "Remaining tokens in the phase"
                              },
                              "endsIn": {
                                "type": "number",
                                "description": "Days until the phase ends (using its full duration)"
                              }
                            }
                          },
                          "phases": {
                            "type": "array",
                            "description": "List of all phases for the offering",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "description": "Phase name"
                                },
                                "tokenPrice": {
                                  "type": "number",
                                  "description": "Token price during the phase"
                                },
                                "allocation": {
                                  "type": "number",
                                  "description": "Total allocation for the phase"
                                },
                                "remaining": {
                                  "type": "number",
                                  "description": "Remaining tokens for the phase"
                                },
                                "duration": {
                                  "type": "number",
                                  "description": "Duration in days for the phase"
                                }
                              }
                            }
                          },
                          "tokenDetail": {
                            "type": "object",
                            "description": "Detailed token information"
                          },
                          "teamMembers": {
                            "type": "array",
                            "description": "List of team members",
                            "items": {
                              "type": "object"
                            }
                          },
                          "roadmapItems": {
                            "type": "array",
                            "description": "List of roadmap items",
                            "items": {
                              "type": "object"
                            }
                          },
                          "currentRaised": {
                            "type": "number",
                            "description": "Sum of all transactions (price * amount) associated with this offering"
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "currentPage": {
                          "type": "number"
                        },
                        "totalPages": {
                          "type": "number"
                        },
                        "totalItems": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": []
      }
    },
    "/api/ico/offer/{id}": {
      "get": {
        "summary": "Get ICO Offering by ID",
        "description": "Retrieves detailed ICO token offering data by its unique identifier. The response includes related phases, token details, team members, and roadmap items. Additionally, it calculates the current and next phases based on the offering's start date and the durations of its phases.",
        "operationId": "getIcoOfferingById",
        "tags": [
          "ICO",
          "Offerings"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Unique identifier of the ICO offering",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ICO offering retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier for the offering"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the offering"
                    },
                    "symbol": {
                      "type": "string",
                      "description": "Token ticker"
                    },
                    "icon": {
                      "type": "string",
                      "description": "Offering icon URL"
                    },
                    "purchaseWalletCurrency": {
                      "type": "string",
                      "description": "Wallet currency for purchase"
                    },
                    "purchaseWalletType": {
                      "type": "string",
                      "description": "Wallet type for purchase"
                    },
                    "status": {
                      "type": "string",
                      "description": "Current status (ACTIVE, PENDING, etc.). For COMPLETED queries, the status may be SUCCESS or FAILED."
                    },
                    "tokenPrice": {
                      "type": "number",
                      "description": "Current token price"
                    },
                    "targetAmount": {
                      "type": "number",
                      "description": "Total funding target"
                    },
                    "participants": {
                      "type": "number",
                      "description": "Number of participants"
                    },
                    "isPaused": {
                      "type": "boolean",
                      "description": "Flag if the offering is paused"
                    },
                    "isFlagged": {
                      "type": "boolean",
                      "description": "Flag if the offering is flagged"
                    },
                    "startDate": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Start date of the offering"
                    },
                    "endDate": {
                      "type": "string",
                      "format": "date-time",
                      "description": "End date of the offering"
                    },
                    "currentPhase": {
                      "type": "object",
                      "description": "Information about the current phase"
                    },
                    "nextPhase": {
                      "type": "object",
                      "description": "Information about the next phase"
                    },
                    "phases": {
                      "type": "array",
                      "description": "List of all phases for the offering",
                      "items": {
                        "type": "object"
                      }
                    },
                    "tokenDetail": {
                      "type": "object",
                      "description": "Detailed token information"
                    },
                    "teamMembers": {
                      "type": "array",
                      "description": "List of team members",
                      "items": {
                        "type": "object"
                      }
                    },
                    "roadmapItems": {
                      "type": "array",
                      "description": "List of roadmap items",
                      "items": {
                        "type": "object"
                      }
                    },
                    "currentRaised": {
                      "type": "number",
                      "description": "Sum of all transactions (price * amount) associated with this offering"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "ICO offering not found."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": []
      }
    },
    "/api/ico/plan": {
      "get": {
        "summary": "Fetch ICO Launch Plans",
        "description": "Retrieves all available ICO launch plans.",
        "operationId": "getIcoLaunchPlans",
        "tags": [
          "ICO",
          "Launch Plans"
        ],
        "responses": {
          "200": {
            "description": "ICO launch plans fetched successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "price": {
                        "type": "number"
                      },
                      "currency": {
                        "type": "string"
                      },
                      "walletType": {
                        "type": "string"
                      },
                      "features": {
                        "type": "object"
                      },
                      "recommended": {
                        "type": "boolean"
                      },
                      "status": {
                        "type": "boolean"
                      },
                      "sortOrder": {
                        "type": "number"
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": []
      }
    },
    "/api/ico/portfolio": {
      "get": {
        "summary": "Get User Portfolio Overview",
        "description": "Retrieves a summary of the user's ICO portfolio including total invested, pending investment, pending verification investment, received investment, rejected investment, current portfolio value, total profit/loss, and ROI. Pending investments indicate funds invested for tokens not yet received, and rejected investments indicate funds that were refunded.",
        "operationId": "getUserPortfolioOverview",
        "tags": [
          "ICO",
          "Portfolio"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "User portfolio overview retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalInvested": {
                      "type": "number"
                    },
                    "pendingInvested": {
                      "type": "number"
                    },
                    "pendingVerificationInvested": {
                      "type": "number"
                    },
                    "receivedInvested": {
                      "type": "number"
                    },
                    "rejectedInvested": {
                      "type": "number"
                    },
                    "currentValue": {
                      "type": "number"
                    },
                    "totalProfitLoss": {
                      "type": "number"
                    },
                    "roi": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/portfolio/performance": {
      "get": {
        "summary": "Get Portfolio Performance Data",
        "description": "Generates historical performance data and calculates metrics for the user's ICO portfolio based on real transactions and token offering data. The timeframe (e.g. '1W', '1M', '3M', '1Y', 'ALL') specifies the period to compute over. Additionally, a metric for rejected investments is provided.",
        "operationId": "getPortfolioPerformanceData",
        "tags": [
          "ICO",
          "Portfolio",
          "Performance"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "timeframe",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Timeframe for performance data (e.g. '1W', '1M', '3M', '1Y', 'ALL')."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Portfolio performance data retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "performanceData": {
                      "type": "array",
                      "description": "Array of daily performance data points."
                    },
                    "metrics": {
                      "type": "object",
                      "description": "Calculated portfolio performance metrics.",
                      "properties": {
                        "initialValue": {
                          "type": "number"
                        },
                        "currentValue": {
                          "type": "number"
                        },
                        "absoluteChange": {
                          "type": "number"
                        },
                        "percentageChange": {
                          "type": "number"
                        },
                        "bestDay": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "change": {
                              "type": "number"
                            }
                          }
                        },
                        "worstDay": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "change": {
                              "type": "number"
                            }
                          }
                        },
                        "volatility": {
                          "type": "number"
                        },
                        "sharpeRatio": {
                          "type": "number"
                        },
                        "rejectedInvested": {
                          "type": "number"
                        },
                        "allocation": {
                          "type": "object",
                          "properties": {
                            "byToken": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "percentage": {
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/stats": {
      "get": {
        "summary": "Get ICO Platform Statistics",
        "description": "Retrieves ICO platform statistics including total raised funds, growth percentage, successful offerings count, total investors, and average ROI. Calculations are now based on all non-rejected transactions and monthly comparisons.",
        "operationId": "getIcoStats",
        "tags": [
          "ICO",
          "Stats"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "ICO platform statistics retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalRaised": {
                      "type": "number"
                    },
                    "raisedGrowth": {
                      "type": "number"
                    },
                    "successfulOfferings": {
                      "type": "number"
                    },
                    "offeringsGrowth": {
                      "type": "number"
                    },
                    "totalInvestors": {
                      "type": "number"
                    },
                    "investorsGrowth": {
                      "type": "number"
                    },
                    "averageROI": {
                      "type": "number"
                    },
                    "roiGrowth": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/token/type": {
      "get": {
        "summary": "Get Enabled Token Type Configurations",
        "description": "Retrieves all enabled token type configurations for users.",
        "operationId": "getEnabledTokenTypes",
        "tags": [
          "ICO",
          "TokenTypes"
        ],
        "responses": {
          "200": {
            "description": "Enabled token type configurations retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": []
      }
    },
    "/api/ico/transaction": {
      "get": {
        "summary": "Lists ICO transactions with optional filters",
        "operationId": "listIcoTransactions",
        "tags": [
          "User",
          "Ico",
          "Transaction"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of ICO transactions retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of the transaction (DEPOSIT, WITHDRAW, etc.)",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "status": {
                            "type": "string",
                            "description": "Current status of the transaction (PENDING, COMPLETED, etc.)",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false,
                            "enum": [
                              "PENDING",
                              "COMPLETED",
                              "FAILED",
                              "CANCELLED",
                              "REJECTED",
                              "EXPIRED"
                            ]
                          },
                          "amount": {
                            "type": "number",
                            "description": "Amount involved in the transaction",
                            "nullable": false
                          },
                          "fee": {
                            "type": "number",
                            "description": "Fee associated with the transaction",
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Description of the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "metadata": {
                            "type": "object",
                            "description": "Additional metadata of the transaction",
                            "nullable": true
                          },
                          "referenceId": {
                            "type": "string",
                            "description": "Reference ID of the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "trxId": {
                            "type": "string",
                            "description": "Transaction ID from the payment processor",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Transactions not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "permission": "access.transaction",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Create a New ICO Investment",
        "description": "Creates a new ICO investment transaction for the authenticated user using icoTransaction only. The wallet type and currency are derived from the associated plan. It also deducts funds from the user's wallet, records the transaction, updates offering stats, and sends email and in‑app notifications to both investor and seller.",
        "operationId": "createIcoInvestment",
        "tags": [
          "ICO",
          "Investments"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "offeringId": {
                    "type": "string",
                    "description": "ICO offering ID"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Investment amount"
                  },
                  "walletAddress": {
                    "type": "string",
                    "description": "Wallet address where tokens will be sent"
                  }
                },
                "required": [
                  "offeringId",
                  "amount",
                  "walletAddress"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ICO investment transaction created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing required fields or insufficient balance."
          },
          "401": {
            "description": "Unauthorized."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/ico/transaction/{id}": {
      "get": {
        "summary": "Get ICO Transaction by ID",
        "description": "Retrieves detailed ICO transaction data by its unique identifier, including associated offering and user details.",
        "operationId": "getIcoTransactionById",
        "tags": [
          "ICO",
          "Transactions"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Unique identifier of the ICO transaction",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ICO transaction retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Transaction ID"
                    },
                    "amount": {
                      "type": "number",
                      "description": "Transaction amount"
                    },
                    "price": {
                      "type": "number",
                      "description": "Token price at time of transaction"
                    },
                    "status": {
                      "type": "string",
                      "description": "Transaction status. One of PENDING, VERIFICATION, RELEASED, or REJECTED"
                    },
                    "releaseUrl": {
                      "type": "string",
                      "description": "Transaction hash (or release URL, if used in its place)"
                    },
                    "tokenAmount": {
                      "type": "number",
                      "description": "Calculated token amount (amount divided by token price)"
                    },
                    "type": {
                      "type": "string",
                      "description": "Derived transaction type (for example, 'completed' if released, otherwise 'pending')"
                    },
                    "date": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Transaction date"
                    },
                    "notes": {
                      "type": "string",
                      "description": "Transaction notes"
                    },
                    "walletAddress": {
                      "type": "string",
                      "description": "Investor's wallet address"
                    },
                    "offering": {
                      "type": "object",
                      "description": "Associated offering details",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "symbol": {
                          "type": "string"
                        },
                        "icon": {
                          "type": "string"
                        },
                        "tokenDetail": {
                          "type": "object"
                        }
                      }
                    },
                    "user": {
                      "type": "object",
                      "description": "Investor user details",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "ICO transaction not found."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": []
      }
    },
    "/api/p2p/dashboard/activity": {
      "get": {
        "summary": "Get P2P Trading Activity",
        "description": "Retrieves recent trading activity logs for the authenticated user.",
        "operationId": "getP2PTradingActivity",
        "tags": [
          "P2P",
          "Dashboard"
        ],
        "responses": {
          "200": {
            "description": "Trading activity retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/dashboard": {
      "get": {
        "summary": "Get P2P Dashboard Data",
        "description": "Retrieves dashboard data including notifications, portfolio, stats, trading activity, and transactions for the authenticated user.",
        "operationId": "getP2PDashboardData",
        "tags": [
          "P2P",
          "Dashboard"
        ],
        "responses": {
          "200": {
            "description": "Dashboard data retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/dashboard/portfolio": {
      "get": {
        "summary": "Get P2P Portfolio Data",
        "description": "Retrieves the portfolio summary for the authenticated user.",
        "operationId": "getP2PPortfolioData",
        "tags": [
          "P2P",
          "Dashboard"
        ],
        "responses": {
          "200": {
            "description": "Portfolio data retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/dashboard/stats": {
      "get": {
        "summary": "Get P2P Dashboard Stats",
        "description": "Retrieves various trade counts and stats for the authenticated user.",
        "operationId": "getP2PDashboardStats",
        "tags": [
          "P2P",
          "Dashboard"
        ],
        "responses": {
          "200": {
            "description": "Dashboard stats retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/dashboard/transaction": {
      "get": {
        "summary": "Get P2P Transactions",
        "description": "Retrieves recent trade transactions for the authenticated user.",
        "operationId": "getP2PTransactions",
        "tags": [
          "P2P",
          "Dashboard"
        ],
        "responses": {
          "200": {
            "description": "Transactions retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/guided-matching": {
      "post": {
        "summary": "Submit Guided Matching Criteria",
        "description": "Finds matching offers based on guided matching criteria provided by the authenticated user.",
        "operationId": "submitP2PGuidedMatching",
        "tags": [
          "P2P",
          "Guided Matching"
        ],
        "requiresAuth": true,
        "requestBody": {
          "description": "Guided matching criteria",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tradeType": {
                    "type": "string",
                    "enum": [
                      "buy",
                      "sell"
                    ]
                  },
                  "cryptocurrency": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "string"
                  },
                  "paymentMethods": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "pricePreference": {
                    "type": "string"
                  },
                  "traderPreference": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  }
                },
                "required": [
                  "tradeType",
                  "cryptocurrency",
                  "amount",
                  "paymentMethods",
                  "pricePreference",
                  "traderPreference",
                  "location"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matching results retrieved successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/location": {
      "get": {
        "summary": "List Distinct Countries from User Profiles",
        "description": "Retrieves a list of distinct countries extracted from user profile locations.",
        "operationId": "listUserCountries",
        "tags": [
          "User",
          "Countries"
        ],
        "responses": {
          "200": {
            "description": "List of countries retrieved successfully."
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/p2p/market/highlight": {
      "get": {
        "summary": "Get P2P Market Highlights",
        "description": "Retrieves highlighted market data (for example, top active offers).",
        "operationId": "getP2PMarketHighlights",
        "tags": [
          "P2P",
          "Market"
        ],
        "responses": {
          "200": {
            "description": "P2P market highlights retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/p2p/market/stats": {
      "get": {
        "summary": "Get P2P Market Stats",
        "description": "Retrieves aggregated market statistics from P2P trades.",
        "operationId": "getP2PMarketStats",
        "tags": [
          "P2P",
          "Market"
        ],
        "responses": {
          "200": {
            "description": "Market stats retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": false,
        "security": []
      }
    },
    "/api/p2p/market/top": {
      "get": {
        "summary": "Get Top Cryptocurrencies in P2P",
        "description": "Retrieves the top cryptocurrencies based on trade volume aggregations.",
        "operationId": "getP2PTopCryptos",
        "tags": [
          "P2P",
          "Market"
        ],
        "responses": {
          "200": {
            "description": "Top cryptocurrencies retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": false,
        "security": []
      }
    },
    "/api/p2p/offer": {
      "get": {
        "summary": "Lists all p2p offers with pagination and optional filtering",
        "operationId": "listP2POffers",
        "tags": [
          "Admin",
          "P2P",
          "Offers"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of p2p offers with detailed information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "p2p Offers not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "permission": "access.p2p.offer",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Create a P2P Offer",
        "description": "Creates a new offer with structured configurations for the authenticated user, and associates payment methods.",
        "operationId": "createP2POffer",
        "tags": [
          "P2P",
          "Offer"
        ],
        "requiresAuth": true,
        "requestBody": {
          "description": "Complete P2P offer payload",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "BUY",
                      "SELL"
                    ]
                  },
                  "currency": {
                    "type": "string"
                  },
                  "walletType": {
                    "type": "string",
                    "enum": [
                      "FIAT",
                      "SPOT",
                      "ECO"
                    ]
                  },
                  "amountConfig": {
                    "type": "object",
                    "properties": {
                      "total": {
                        "type": "number"
                      },
                      "min": {
                        "type": "number"
                      },
                      "max": {
                        "type": "number"
                      },
                      "availableBalance": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "total"
                    ]
                  },
                  "priceConfig": {
                    "type": "object",
                    "properties": {
                      "model": {
                        "type": "string",
                        "enum": [
                          "FIXED",
                          "MARGIN"
                        ]
                      },
                      "value": {
                        "type": "number"
                      },
                      "marketPrice": {
                        "type": "number"
                      },
                      "finalPrice": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "model",
                      "value",
                      "finalPrice"
                    ]
                  },
                  "tradeSettings": {
                    "type": "object",
                    "properties": {
                      "autoCancel": {
                        "type": "number"
                      },
                      "kycRequired": {
                        "type": "boolean"
                      },
                      "visibility": {
                        "type": "string",
                        "enum": [
                          "PUBLIC",
                          "PRIVATE"
                        ]
                      },
                      "termsOfTrade": {
                        "type": "string"
                      },
                      "additionalNotes": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "autoCancel",
                      "kycRequired",
                      "visibility"
                    ]
                  },
                  "locationSettings": {
                    "type": "object",
                    "properties": {
                      "country": {
                        "type": "string"
                      },
                      "region": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "restrictions": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "userRequirements": {
                    "type": "object",
                    "properties": {
                      "minCompletedTrades": {
                        "type": "number"
                      },
                      "minSuccessRate": {
                        "type": "number"
                      },
                      "minAccountAge": {
                        "type": "number"
                      },
                      "trustedOnly": {
                        "type": "boolean"
                      }
                    }
                  },
                  "paymentMethodIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Array of P2P payment‐method IDs to attach"
                  }
                },
                "required": [
                  "type",
                  "currency",
                  "walletType",
                  "amountConfig",
                  "priceConfig",
                  "tradeSettings"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Offer created successfully."
          },
          "400": {
            "description": "Bad Request."
          },
          "401": {
            "description": "Unauthorized."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/offer/popularity": {
      "get": {
        "summary": "Get Popular Offers",
        "description": "Retrieves popular offers ordered by a calculated popularity score based on the number of completed trades (via offerId) and average review ratings from those trades.",
        "operationId": "getPopularOffers",
        "tags": [
          "P2P",
          "Offer"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of offers to return",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Offers retrieved successfully."
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": false,
        "security": []
      }
    },
    "/api/p2p/offer/{id}": {
      "get": {
        "summary": "Get P2P Offer by ID",
        "description": "Retrieves detailed offer data by its ID, including computed seller metrics and ratings.",
        "operationId": "getP2POfferById",
        "tags": [
          "P2P",
          "Offer"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Offer ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Offer retrieved successfully."
          },
          "404": {
            "description": "Offer not found."
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": false,
        "security": []
      }
    },
    "/api/p2p/payment-method": {
      "get": {
        "summary": "List Payment Methods",
        "description": "Retrieves a list of available payment methods using the payment methods model.",
        "operationId": "listPaymentMethods",
        "tags": [
          "P2P",
          "Payment Method"
        ],
        "responses": {
          "200": {
            "description": "Payment methods retrieved successfully."
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": false,
        "security": []
      },
      "post": {
        "summary": "Create Payment Method",
        "description": "Creates a new custom payment method for the authenticated user.",
        "operationId": "createPaymentMethod",
        "tags": [
          "P2P",
          "Payment Method"
        ],
        "requiresAuth": true,
        "requestBody": {
          "description": "Payment method data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "icon": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "instructions": {
                    "type": "string"
                  },
                  "processingTime": {
                    "type": "string"
                  },
                  "available": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment method created successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/payment-method/{id}": {
      "del": {
        "summary": "Delete Payment Method",
        "description": "Deletes an existing custom payment method by its ID.",
        "operationId": "deletePaymentMethod",
        "tags": [
          "P2P",
          "Payment Method"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Payment Method ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment method deleted successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Payment method not found or not owned by user."
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "summary": "Update Payment Method",
        "description": "Updates an existing custom payment method by its ID.",
        "operationId": "updatePaymentMethod",
        "tags": [
          "P2P",
          "Payment Method"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Payment Method ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Fields to update for the payment method",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "icon": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "instructions": {
                    "type": "string"
                  },
                  "processingTime": {
                    "type": "string"
                  },
                  "available": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment method updated successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Payment method not found or not owned by user."
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/trade": {
      "get": {
        "summary": "Get Trade Dashboard Data",
        "description": "Retrieves aggregated trade data for the authenticated user.",
        "operationId": "getP2PTradeDashboardData",
        "tags": [
          "P2P",
          "Trade"
        ],
        "responses": {
          "200": {
            "description": "Trade dashboard data retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/trade/{id}/cancel": {
      "post": {
        "summary": "Cancel Trade",
        "description": "Cancels a trade with a provided cancellation reason.",
        "operationId": "cancelP2PTrade",
        "tags": [
          "P2P",
          "Trade"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Trade ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Cancellation reason",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Reason for cancellation"
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Trade cancelled successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Trade not found."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/trade/{id}/confirm": {
      "post": {
        "summary": "Confirm Payment for Trade",
        "description": "Updates the trade status to 'PAYMENT_SENT' to confirm that payment has been made.",
        "operationId": "confirmP2PTradePayment",
        "tags": [
          "P2P",
          "Trade"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Trade ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment confirmed successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Trade not found."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/trade/{id}/dispute": {
      "post": {
        "summary": "Dispute Trade",
        "description": "Creates a dispute for a trade by providing a reason and description.",
        "operationId": "disputeP2PTrade",
        "tags": [
          "P2P",
          "Trade"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Trade ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Dispute details",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "required": [
                  "reason",
                  "description"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dispute created successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Trade not found."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/trade/{id}": {
      "get": {
        "summary": "Get Trade by ID",
        "description": "Retrieves detailed trade data for the given trade ID.",
        "operationId": "getP2PTradeById",
        "tags": [
          "P2P",
          "Trade"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Trade ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trade retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Trade not found."
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/trade/{id}/message": {
      "get": {
        "summary": "Get Trade Messages",
        "description": "Retrieves messages (stored in timeline) for the specified trade.",
        "operationId": "getP2PTradeMessages",
        "tags": [
          "P2P",
          "Trade"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Trade ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trade messages retrieved successfully."
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Trade not found."
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Send Trade Message",
        "description": "Sends a message within a trade (appended to the timeline).",
        "operationId": "sendP2PTradeMessage",
        "tags": [
          "P2P",
          "Trade"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Trade ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Message payload",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message sent successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Trade not found."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/trade/{id}/release": {
      "post": {
        "summary": "Release Funds for Trade",
        "description": "Releases funds and updates the trade status to 'COMPLETED' for the authenticated seller.",
        "operationId": "releaseP2PTradeFunds",
        "tags": [
          "P2P",
          "Trade"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Trade ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funds released successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Trade not found."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/p2p/trade/{id}/review": {
      "post": {
        "summary": "Submit Trade Review",
        "description": "Submits a review for a trade with rating and feedback.",
        "operationId": "reviewP2PTrade",
        "tags": [
          "P2P",
          "Trade"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Trade ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Review data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rating": {
                    "type": "number"
                  },
                  "feedback": {
                    "type": "string"
                  }
                },
                "required": [
                  "rating",
                  "feedback"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Review submitted successfully."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Trade not found."
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/payment/intent/confirm": {
      "post": {
        "summary": "Confirms a payment intent",
        "operationId": "confirmPaymentIntent",
        "tags": [
          "Payments"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "paymentIntentId": {
                    "type": "string",
                    "description": "Payment Intent ID"
                  },
                  "walletId": {
                    "type": "string",
                    "description": "Wallet ID to process the payment"
                  }
                },
                "required": [
                  "paymentIntentId",
                  "walletId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment confirmed successfully with redirect URL"
          },
          "400": {
            "description": "Invalid request or insufficient balance"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Payment intent or wallet not found"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/payment/intent": {
      "post": {
        "summary": "Creates a payment intent",
        "operationId": "createPaymentIntent",
        "tags": [
          "Payments"
        ],
        "requiresAuth": false,
        "requiresApi": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "description": "Amount to be paid"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Payment currency"
                  },
                  "successUrl": {
                    "type": "string",
                    "description": "URL for successful payment"
                  },
                  "failUrl": {
                    "type": "string",
                    "description": "URL for failed payment"
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional description for the payment intent"
                  },
                  "products": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Product name"
                        },
                        "quantity": {
                          "type": "number",
                          "description": "Quantity"
                        },
                        "price": {
                          "type": "number",
                          "description": "Price"
                        },
                        "currency": {
                          "type": "string",
                          "description": "Product currency"
                        },
                        "sku": {
                          "type": "string",
                          "description": "Product SKU"
                        }
                      },
                      "required": [
                        "name",
                        "quantity",
                        "price",
                        "currency"
                      ]
                    }
                  }
                },
                "required": [
                  "amount",
                  "currency",
                  "successUrl",
                  "failUrl",
                  "products"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment intent created successfully"
          },
          "400": {
            "description": "Invalid request"
          }
        },
        "security": []
      }
    },
    "/api/payment/intent/status": {
      "post": {
        "summary": "Checks the status of a payment intent",
        "operationId": "checkPaymentIntentStatus",
        "tags": [
          "Payments"
        ],
        "requiresAuth": false,
        "requiresApi": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "paymentIntentId": {
                    "type": "string",
                    "description": "Payment Intent ID"
                  }
                },
                "required": [
                  "paymentIntentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment intent status retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "paymentIntentId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "transactionId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Payment intent not found"
          }
        },
        "security": []
      }
    },
    "/api/payment/intent/{id}": {
      "del": {
        "summary": "Delete a payment intent",
        "description": "Cancel and remove a specific payment intent.",
        "operationId": "deletePaymentIntent",
        "tags": [
          "Payments"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the payment intent to delete.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment intent deleted successfully."
          },
          "404": {
            "description": "Payment intent not found."
          },
          "500": {
            "description": "Server error."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "Get Payment Intent Details",
        "description": "Retrieve details of a specific payment intent.",
        "operationId": "getPaymentIntentDetails",
        "tags": [
          "Payments"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the payment intent to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requiresAuth": false,
        "responses": {
          "200": {
            "description": "Payment Intent details retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Payment intent ID."
                    },
                    "userId": {
                      "type": "string",
                      "description": "User associated with the payment intent."
                    },
                    "walletId": {
                      "type": "string",
                      "description": "Wallet used for the payment."
                    },
                    "amount": {
                      "type": "number",
                      "description": "Amount of the payment."
                    },
                    "currency": {
                      "type": "string",
                      "description": "Payment currency."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "COMPLETED",
                        "FAILED",
                        "EXPIRED"
                      ],
                      "description": "Payment status."
                    },
                    "successUrl": {
                      "type": "string",
                      "description": "URL for successful payment."
                    },
                    "failUrl": {
                      "type": "string",
                      "description": "URL for failed payment."
                    },
                    "metadata": {
                      "type": "object",
                      "description": "Additional metadata for the payment."
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Creation timestamp."
                    },
                    "products": {
                      "type": "array",
                      "description": "List of products associated with the payment intent.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Product ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Product name."
                          },
                          "quantity": {
                            "type": "integer",
                            "description": "Quantity purchased."
                          },
                          "price": {
                            "type": "number",
                            "description": "Price of the product."
                          },
                          "currency": {
                            "type": "string",
                            "description": "Currency of the product."
                          },
                          "sku": {
                            "type": "string",
                            "description": "SKU of the product."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Payment Intent not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/staking/calculate-rewards": {
      "post": {
        "summary": "Calculate Potential Staking Rewards",
        "description": "Calculates potential rewards for a given amount and duration based on available staking pools.",
        "operationId": "calculateStakingRewards",
        "tags": [
          "Staking",
          "Rewards",
          "Calculator"
        ],
        "requiresAuth": true,
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount",
                  "duration"
                ],
                "properties": {
                  "amount": {
                    "type": "number",
                    "description": "Amount to stake"
                  },
                  "duration": {
                    "type": "number",
                    "description": "Duration in days"
                  },
                  "tokenId": {
                    "type": "string",
                    "description": "Optional token ID to filter pools"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rewards calculated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "calculations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "poolId": {
                            "type": "string"
                          },
                          "poolName": {
                            "type": "string"
                          },
                          "tokenSymbol": {
                            "type": "string"
                          },
                          "apy": {
                            "type": "number"
                          },
                          "potentialReward": {
                            "type": "number"
                          },
                          "totalReturn": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/staking/pool": {
      "get": {
        "summary": "Get Available Staking Pools",
        "description": "Retrieves all active staking pools available for users to stake in.",
        "operationId": "getStakingPools",
        "tags": [
          "Staking",
          "Pools"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter pools by token name"
          },
          {
            "index": 1,
            "name": "minApr",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Minimum APR filter"
          },
          {
            "index": 2,
            "name": "maxApr",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Maximum APR filter"
          },
          {
            "index": 3,
            "name": "minLockPeriod",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Minimum staking duration in days"
          }
        ],
        "responses": {
          "200": {
            "description": "Staking pools retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pools": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/staking/pool/{id}/analytics": {
      "get": {
        "summary": "Get Staking Pool Analytics",
        "description": "Retrieves detailed analytics for a specific staking pool.",
        "operationId": "getStakingPoolAnalytics",
        "tags": [
          "Staking",
          "Pools",
          "Analytics"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Pool ID"
          },
          {
            "index": 1,
            "name": "timeframe",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "week",
                "month",
                "year",
                "all"
              ]
            },
            "description": "Timeframe for analytics data"
          }
        ],
        "responses": {
          "200": {
            "description": "Pool analytics retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "analytics": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Pool not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/staking/pool/{id}": {
      "get": {
        "summary": "Get Staking Pool Details",
        "description": "Retrieves detailed information about a specific staking pool.",
        "operationId": "getStakingPoolById",
        "tags": [
          "Staking",
          "Pools"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Pool ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Pool details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pool": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Pool not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/staking/position": {
      "get": {
        "summary": "Get User's Staking Positions",
        "description": "Retrieves all staking positions for the authenticated user.",
        "operationId": "getUserStakingPositions",
        "tags": [
          "Staking",
          "Positions"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "LOCKED",
                "PENDING_WITHDRAWAL",
                "COMPLETED"
              ]
            },
            "description": "Filter by position status"
          },
          {
            "index": 1,
            "name": "poolId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by pool ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Positions retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "positions": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Stake Tokens",
        "description": "Creates a new staking position for the authenticated user by staking tokens into a specified pool.",
        "operationId": "stakeTokens",
        "tags": [
          "Staking",
          "Positions"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "poolId": {
                    "type": "string",
                    "description": "The ID of the staking pool"
                  },
                  "amount": {
                    "type": "number",
                    "description": "The amount of tokens to stake"
                  }
                },
                "required": [
                  "poolId",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Staking position created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Staking position ID"
                    },
                    "userId": {
                      "type": "string",
                      "description": "User ID"
                    },
                    "poolId": {
                      "type": "string",
                      "description": "Pool ID"
                    },
                    "amount": {
                      "type": "number",
                      "description": "Staked amount"
                    },
                    "startDate": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Staking start date"
                    },
                    "endDate": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Staking end date"
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the staking position"
                    },
                    "withdrawalRequested": {
                      "type": "boolean",
                      "description": "Withdrawal requested flag"
                    },
                    "withdrawalRequestDate": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true,
                      "description": "Date when withdrawal was requested"
                    },
                    "adminNotes": {
                      "type": "string",
                      "nullable": true,
                      "description": "Admin notes"
                    },
                    "completedAt": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true,
                      "description": "Completion timestamp"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Creation timestamp"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Last update timestamp"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters or business logic validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Staking pool not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/staking/position/{id}/claim": {
      "post": {
        "summary": "Claim Staking Position Earnings",
        "description": "Claims all unclaimed earnings for a specific staking position.",
        "operationId": "claimStakingPositionEarnings",
        "tags": [
          "Staking",
          "Positions",
          "Earnings"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Position ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Earnings claimed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "claimedAmount": {
                      "type": "number"
                    },
                    "transactionId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No earnings to claim"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - Not position owner"
          },
          "404": {
            "description": "Position not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/staking/position/{id}/earnings": {
      "get": {
        "summary": "Get Staking Position Earnings",
        "description": "Retrieves all earnings records for a specific staking position.",
        "operationId": "getStakingPositionEarnings",
        "tags": [
          "Staking",
          "Positions",
          "Earnings"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Position ID"
          },
          {
            "index": 1,
            "name": "claimed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Filter by claimed status"
          }
        ],
        "responses": {
          "200": {
            "description": "Earnings retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "earnings": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "claimed": {
                          "type": "number"
                        },
                        "unclaimed": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - Not position owner"
          },
          "404": {
            "description": "Position not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/staking/position/{id}": {
      "get": {
        "summary": "Get Staking Position Details",
        "description": "Retrieves detailed information about a specific staking position.",
        "operationId": "getStakingPositionById",
        "tags": [
          "Staking",
          "Positions"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Position ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Position details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "position": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - Not position owner"
          },
          "404": {
            "description": "Position not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/staking/position/{id}/withdraw": {
      "post": {
        "summary": "Request Withdrawal from Staking Position",
        "description": "Initiates a withdrawal request for a specific staking position.",
        "operationId": "withdrawStakingPosition",
        "tags": [
          "Staking",
          "Positions",
          "Withdrawal"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Position ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Withdrawal request submitted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "position": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - Not position owner"
          },
          "404": {
            "description": "Position not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/staking/stats": {
      "get": {
        "summary": "Get Staking Platform Statistics",
        "description": "Returns total staked value, active users, and average APR.",
        "tags": [
          "Staking",
          "Stats"
        ],
        "responses": {
          "200": {
            "description": "Staking stats returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalStaked": {
                      "type": "number"
                    },
                    "activeUsers": {
                      "type": "number"
                    },
                    "avgApr": {
                      "type": "number"
                    },
                    "totalRewards": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/staking/user/earnings": {
      "get": {
        "summary": "Get User's Staking Earnings",
        "description": "Retrieves all staking earnings for the authenticated user across all positions.",
        "operationId": "getUserStakingEarnings",
        "tags": [
          "Staking",
          "User",
          "Earnings"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "claimed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Filter by claimed status"
          },
          {
            "index": 1,
            "name": "poolId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by pool ID"
          },
          {
            "index": 2,
            "name": "timeframe",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "week",
                "month",
                "year",
                "all"
              ]
            },
            "description": "Timeframe for earnings data"
          }
        ],
        "responses": {
          "200": {
            "description": "Earnings retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "earnings": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "claimed": {
                          "type": "number"
                        },
                        "unclaimed": {
                          "type": "number"
                        },
                        "byToken": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tokenSymbol": {
                                "type": "string"
                              },
                              "total": {
                                "type": "number"
                              },
                              "claimed": {
                                "type": "number"
                              },
                              "unclaimed": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/staking/user/summary": {
      "get": {
        "summary": "Get User's Staking Summary",
        "description": "Retrieves a summary of the user's staking activity across all positions.",
        "operationId": "getUserStakingSummary",
        "tags": [
          "Staking",
          "User",
          "Summary"
        ],
        "requiresAuth": true,
        "parameters": [],
        "responses": {
          "200": {
            "description": "Summary retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "summary": {
                      "type": "object",
                      "properties": {
                        "totalStaked": {
                          "type": "number"
                        },
                        "totalEarnings": {
                          "type": "number"
                        },
                        "unclaimedEarnings": {
                          "type": "number"
                        },
                        "activePositions": {
                          "type": "number"
                        },
                        "byToken": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/auth/delete/confirm": {
      "post": {
        "summary": "Check account deletion code and delete user",
        "operationId": "checkAccountDeletionCode",
        "tags": [
          "Account"
        ],
        "description": "Checks the deletion code, deletes the user's account if valid, and sends a confirmation email.",
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the user confirming account deletion"
                  },
                  "token": {
                    "type": "string",
                    "description": "Account deletion confirmation token"
                  }
                },
                "required": [
                  "email",
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User account deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/auth/delete": {
      "post": {
        "summary": "Generate account deletion confirmation code",
        "operationId": "generateAccountDeletionCode",
        "tags": [
          "Account"
        ],
        "description": "Generates a code for confirming account deletion and sends it to the user's email.",
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the user requesting account deletion"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deletion confirmation code generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/auth/login/chat": {
      "get": {
        "summary": "Logs in a user to the chat service",
        "description": "Logs in a user to the chat service and returns a session token",
        "operationId": "loginUserChat",
        "tags": [
          "Auth"
        ],
        "requiresAuth": false,
        "parameters": [
          {
            "in": "query",
            "name": "email",
            "required": true,
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "Email of the user"
          },
          {
            "in": "query",
            "name": "password",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Password of the user"
          },
          {
            "in": "query",
            "name": "firstName",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "First name of the user"
          },
          {
            "in": "query",
            "name": "lastName",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Last name of the user"
          }
        ],
        "responses": {
          "200": {
            "description": "User logged into chat successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    },
                    "cookies": {
                      "type": "object",
                      "properties": {
                        "accessToken": {
                          "type": "string",
                          "description": "Access token"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g., missing or invalid email/password)"
          },
          "401": {
            "description": "Unauthorized (incorrect credentials)"
          }
        },
        "security": []
      }
    },
    "/api/auth/login/flutter": {
      "post": {
        "summary": "Logs in a user",
        "description": "Logs in a user and returns a session token",
        "operationId": "loginUser",
        "tags": [
          "Auth"
        ],
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the user"
                  },
                  "password": {
                    "type": "string",
                    "description": "Password of the user"
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User logged in successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    },
                    "twoFactor": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean",
                          "description": "2FA enabled status"
                        },
                        "type": {
                          "type": "string",
                          "description": "Type of 2FA"
                        }
                      }
                    },
                    "id": {
                      "type": "string",
                      "description": "User ID"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g., invalid email or password)"
          },
          "401": {
            "description": "Unauthorized (e.g., incorrect email or password)"
          }
        },
        "security": []
      }
    },
    "/api/auth/login/google": {
      "post": {
        "summary": "Logs in a user with Google",
        "operationId": "loginUserWithGoogle",
        "tags": [
          "Auth"
        ],
        "description": "Logs in a user using Google and returns a session token",
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Google OAuth token"
                  },
                  "ref": {
                    "type": "string",
                    "description": "Referral code"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User logged in successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    },
                    "cookies": {
                      "type": "object",
                      "properties": {
                        "accessToken": {
                          "type": "string",
                          "description": "Access token"
                        },
                        "sessionId": {
                          "type": "string",
                          "description": "Session ID"
                        },
                        "csrfToken": {
                          "type": "string",
                          "description": "CSRF token"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/auth/login": {
      "post": {
        "summary": "Logs in a user",
        "description": "Logs in a user and returns a session token",
        "operationId": "loginUser",
        "tags": [
          "Auth"
        ],
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the user"
                  },
                  "password": {
                    "type": "string",
                    "description": "Password of the user"
                  },
                  "recaptchaToken": {
                    "type": "string",
                    "description": "Recaptcha token if enabled",
                    "nullable": true
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User logged in successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    },
                    "twoFactor": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean",
                          "description": "2FA enabled status"
                        },
                        "type": {
                          "type": "string",
                          "description": "Type of 2FA"
                        }
                      }
                    },
                    "id": {
                      "type": "string",
                      "description": "User ID"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g., invalid email or password)"
          },
          "401": {
            "description": "Unauthorized (e.g., incorrect email or password)"
          }
        },
        "security": []
      }
    },
    "/api/auth/login/nonce": {
      "get": {
        "summary": "Generates a nonce for client use",
        "operationId": "generateNonce",
        "tags": [
          "Auth"
        ],
        "description": "Generates a nonce for client use",
        "requiresAuth": false,
        "responses": {
          "200": {
            "description": "Nonce generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nonce": {
                      "type": "string",
                      "description": "The generated nonce"
                    }
                  },
                  "required": [
                    "nonce"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": []
      }
    },
    "/api/auth/login/wallet": {
      "post": {
        "summary": "Logs in a user with SIWE",
        "description": "Logs in a user using Sign-In With Ethereum (SIWE)",
        "operationId": "siweLogin",
        "tags": [
          "Auth"
        ],
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "SIWE message"
                  },
                  "signature": {
                    "type": "string",
                    "description": "Signature of the SIWE message"
                  }
                },
                "required": [
                  "message",
                  "signature"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User logged in successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    },
                    "id": {
                      "type": "string",
                      "description": "User ID"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g., invalid message or signature)"
          },
          "401": {
            "description": "Unauthorized (e.g., signature verification failed)"
          }
        },
        "security": []
      }
    },
    "/api/auth/logout": {
      "post": {
        "summary": "Logs out the current user",
        "operationId": "logoutUser",
        "tags": [
          "Auth"
        ],
        "description": "Logs out the current user and clears all session tokens",
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "User logged out successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, no user to log out"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/auth/otp/generate": {
      "post": {
        "summary": "Generates an OTP secret",
        "operationId": "generateOTPSecret",
        "tags": [
          "Auth"
        ],
        "description": "Generates an OTP secret for the user",
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "EMAIL",
                      "SMS",
                      "APP"
                    ],
                    "description": "Type of 2FA"
                  },
                  "phoneNumber": {
                    "type": "string",
                    "description": "Phone number for SMS OTP"
                  }
                },
                "required": [
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP secret generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "secret": {
                      "type": "string",
                      "description": "Generated OTP secret"
                    },
                    "qrCode": {
                      "type": "string",
                      "description": "QR code for APP OTP"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/auth/otp/login": {
      "post": {
        "summary": "Verifies the OTP or recovery code for login",
        "operationId": "verifyLoginOTP",
        "tags": [
          "Auth"
        ],
        "description": "Verifies the OTP for login and returns a session token. If the OTP is invalid, the provided code is checked against the recovery codes.",
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "ID of the user"
                  },
                  "otp": {
                    "type": "string",
                    "description": "OTP or recovery code to verify"
                  }
                },
                "required": [
                  "id",
                  "otp"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP or recovery code verified successfully, user logged in",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": []
      }
    },
    "/api/auth/otp/resend": {
      "post": {
        "summary": "Resends the OTP for 2FA",
        "operationId": "resendOtp",
        "tags": [
          "Auth"
        ],
        "description": "Resends the OTP for 2FA",
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "ID of the user"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "EMAIL",
                      "SMS"
                    ],
                    "description": "Type of 2FA"
                  }
                },
                "required": [
                  "id",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP resent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": []
      }
    },
    "/api/auth/otp/save": {
      "post": {
        "summary": "Saves the OTP",
        "operationId": "saveOTP",
        "tags": [
          "Auth"
        ],
        "description": "Saves the OTP secret and type for the user",
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "secret": {
                    "type": "string",
                    "description": "Generated OTP secret"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "EMAIL",
                      "SMS",
                      "APP"
                    ],
                    "description": "Type of 2FA"
                  }
                },
                "required": [
                  "secret",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP saved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/auth/otp/toggle": {
      "post": {
        "summary": "Toggles OTP status",
        "operationId": "toggleOtp",
        "tags": [
          "Auth"
        ],
        "description": "Enables or disables OTP for the user",
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "boolean",
                    "description": "Status to set for OTP (enabled or disabled)"
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP status updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/auth/otp/verify": {
      "post": {
        "summary": "Verifies the OTP",
        "operationId": "verifyOTP",
        "tags": [
          "Auth"
        ],
        "description": "Verifies the OTP and saves it",
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "otp": {
                    "type": "string",
                    "description": "OTP to verify"
                  },
                  "secret": {
                    "type": "string",
                    "description": "Generated OTP secret"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "EMAIL",
                      "SMS",
                      "APP"
                    ],
                    "description": "Type of 2FA"
                  }
                },
                "required": [
                  "otp",
                  "secret",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP verified and saved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/auth/register/google": {
      "post": {
        "summary": "Registers a new user with Google",
        "operationId": "registerUserWithGoogle",
        "tags": [
          "Auth"
        ],
        "description": "Registers a new user using Google and returns a session token",
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Google OAuth token"
                  },
                  "ref": {
                    "type": "string",
                    "description": "Referral code"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User registered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    },
                    "cookies": {
                      "type": "object",
                      "properties": {
                        "accessToken": {
                          "type": "string",
                          "description": "Access token"
                        },
                        "sessionId": {
                          "type": "string",
                          "description": "Session ID"
                        },
                        "csrfToken": {
                          "type": "string",
                          "description": "CSRF token"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/auth/register": {
      "post": {
        "summary": "Registers a new user",
        "operationId": "registerUser",
        "tags": [
          "Auth"
        ],
        "description": "Registers a new user and returns a session token",
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string",
                    "description": "First name of the user"
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name of the user"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the user"
                  },
                  "password": {
                    "type": "string",
                    "description": "Password of the user"
                  },
                  "ref": {
                    "type": "string",
                    "description": "Referral code"
                  }
                },
                "required": [
                  "firstName",
                  "lastName",
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User registered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    },
                    "cookies": {
                      "type": "object",
                      "properties": {
                        "accessToken": {
                          "type": "string",
                          "description": "Access token"
                        },
                        "sessionId": {
                          "type": "string",
                          "description": "Session ID"
                        },
                        "csrfToken": {
                          "type": "string",
                          "description": "CSRF token"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g., email already in use)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/auth/reset": {
      "post": {
        "summary": "Initiates a password reset process for a user",
        "operationId": "resetPassword",
        "tags": [
          "Auth"
        ],
        "description": "Initiates a password reset process for a user and sends an email with a reset link",
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the user"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Password reset process initiated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "example": 200
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "Success message"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g., missing email)"
          },
          "404": {
            "description": "User not found with the provided email"
          }
        },
        "security": []
      }
    },
    "/api/auth/role": {
      "get": {
        "summary": "Retrieves all roles",
        "operationId": "getRoles",
        "tags": [
          "Auth"
        ],
        "description": "Retrieves all roles",
        "requiresAuth": false,
        "responses": {
          "200": {
            "description": "Roles retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "ID of the role"
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the role"
                      },
                      "permissions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "ID of the permission"
                            },
                            "name": {
                              "type": "string",
                              "description": "Name of the permission"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ]
                        }
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "permissions"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Role not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/auth/session": {
      "get": {
        "summary": "Retrieves session data by sessionId",
        "operationId": "getSessionData",
        "tags": [
          "Session"
        ],
        "description": "Retrieves session data from Redis by sessionId",
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Session data retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Category not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/auth/verify/email": {
      "post": {
        "summary": "Verifies the email with the provided token",
        "operationId": "verifyEmailToken",
        "tags": [
          "Auth"
        ],
        "description": "Verifies the email with the provided token",
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "The email verification token"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email verified successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g., missing or invalid token)"
          },
          "404": {
            "description": "Token not found or expired"
          }
        },
        "security": []
      }
    },
    "/api/auth/verify/reset": {
      "post": {
        "summary": "Verifies a password reset token and sets the new password",
        "operationId": "verifyPasswordReset",
        "tags": [
          "Auth"
        ],
        "description": "Verifies a password reset token and sets the new password",
        "requiresAuth": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "The password reset token"
                  },
                  "newPassword": {
                    "type": "string",
                    "description": "The new password"
                  }
                },
                "required": [
                  "token",
                  "newPassword"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Password reset successfully, new password set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    },
                    "cookies": {
                      "type": "object",
                      "properties": {
                        "accessToken": {
                          "type": "string",
                          "description": "The new access token"
                        },
                        "refreshToken": {
                          "type": "string",
                          "description": "The new refresh token"
                        },
                        "sessionId": {
                          "type": "string",
                          "description": "The new session ID"
                        },
                        "csrfToken": {
                          "type": "string",
                          "description": "The new CSRF token"
                        }
                      },
                      "required": [
                        "accessToken",
                        "refreshToken",
                        "csrfToken"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g., missing token or newPassword)"
          },
          "401": {
            "description": "Unauthorized or invalid token"
          }
        },
        "security": []
      }
    },
    "/api/blog/author/all": {
      "get": {
        "summary": "Lists all authors based on status and posts",
        "description": "This endpoint retrieves all available authors based on their status and optionally includes their posts.",
        "operationId": "getAuthors",
        "tags": [
          "Content",
          "Author"
        ],
        "requiresAuth": false,
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter authors by status",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PENDING",
                "APPROVED",
                "REJECTED"
              ]
            }
          },
          {
            "name": "posts",
            "in": "query",
            "description": "Include posts for each author",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authors retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Generic ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "userId": {
                        "type": "string",
                        "description": "User ID associated with the entity",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "status": {
                        "type": "string",
                        "description": "Current status",
                        "enum": [
                          "PENDING",
                          "APPROVED",
                          "REJECTED"
                        ]
                      },
                      "user": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Generic ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "firstName": {
                            "type": "string",
                            "description": "First name of the user",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "lastName": {
                            "type": "string",
                            "description": "Last name of the user",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "avatar": {
                            "type": "string",
                            "description": "Avatar URL of the user",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          }
                        }
                      },
                      "posts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Generic ID",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "title": {
                              "type": "string",
                              "description": "Title of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "content": {
                              "type": "string",
                              "description": "Content of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "categoryId": {
                              "type": "string",
                              "description": "Generic ID",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "authorId": {
                              "type": "string",
                              "description": "Generic ID",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "slug": {
                              "type": "string",
                              "description": "Slug of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "description": {
                              "type": "string",
                              "description": "Description of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": true
                            },
                            "status": {
                              "type": "string",
                              "description": "Post status",
                              "enum": [
                                "PUBLISHED",
                                "DRAFT",
                                "TRASH"
                              ]
                            },
                            "image": {
                              "type": "string",
                              "description": "Image URL of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": true
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Creation date of the post",
                              "nullable": false
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Last update date of the post",
                              "nullable": true
                            }
                          }
                        },
                        "nullable": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Author not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/blog/author": {
      "get": {
        "summary": "Retrieve author with his posts",
        "description": "This endpoint retrieves the author profile associated with a given user id along with the posts linked to that profile.",
        "operationId": "getAuthorWithPosts",
        "tags": [
          "Content",
          "Author"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Author and posts retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "author": {
                      "type": "object"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Author not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Creates a new author",
        "description": "This endpoint creates a new author.",
        "operationId": "createAuthor",
        "tags": [
          "Content",
          "Author"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Author created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/blog/author/manage": {
      "del": {
        "summary": "Bulk deletes posts by IDs",
        "operationId": "bulkDeletePosts",
        "tags": [
          "Content",
          "Author",
          "Post"
        ],
        "parameters": [
          {
            "name": "restore",
            "in": "query",
            "description": "Restore the Posts instead of deleting",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "force",
            "in": "query",
            "description": "Delete the Posts permanently",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of post IDs to delete"
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Posts deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Posts not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "List all posts",
        "operationId": "listPosts",
        "tags": [
          "Content",
          "Author",
          "Post"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Posts retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "title": {
                            "type": "string",
                            "description": "Title of the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "content": {
                            "type": "string",
                            "description": "Content of the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "categoryId": {
                            "type": "string",
                            "description": "Category ID linked to the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "slug": {
                            "type": "string",
                            "description": "Slug for the Post URL",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Description of the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "status": {
                            "type": "string",
                            "description": "Publication status of the Post",
                            "enum": [
                              "PUBLISHED",
                              "DRAFT",
                              "TRASH"
                            ]
                          },
                          "image": {
                            "type": "string",
                            "description": "Image URL of the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Creation date of the Post",
                            "nullable": false
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Last update date of the Post",
                            "nullable": false
                          },
                          "deletedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Deletion date of the Post, if applicable",
                            "nullable": false
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Posts not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Creates a new blog post",
        "description": "This endpoint creates a new blog post.",
        "operationId": "createPost",
        "tags": [
          "Content",
          "Author",
          "Post"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "description": "New blog post data",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Title of the post"
                  },
                  "content": {
                    "type": "string",
                    "description": "Content of the post"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the post"
                  },
                  "categoryId": {
                    "type": "string",
                    "description": "Category ID for the post"
                  },
                  "status": {
                    "type": "string",
                    "description": "Status of the blog post",
                    "enum": [
                      "PUBLISHED",
                      "DRAFT"
                    ]
                  },
                  "tags": {
                    "type": "array",
                    "description": "Array of tag objects associated with the post",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "slug": {
                    "type": "string",
                    "description": "Slug of the post"
                  },
                  "image": {
                    "type": "string",
                    "description": "Image URL for the post"
                  }
                },
                "required": [
                  "title",
                  "content",
                  "categoryId",
                  "status",
                  "slug"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Blog post created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message of successful post creation"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, user must be authenticated"
          },
          "409": {
            "description": "Conflict, post with the same slug already exists"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/blog/author/manage/status": {
      "put": {
        "summary": "Bulk updates the status of Posts",
        "operationId": "bulkUpdatePostStatus",
        "tags": [
          "Content",
          "Author",
          "Post"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "description": "Array of Post IDs to update",
                    "items": {
                      "type": "string"
                    }
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "PUBLISHED",
                      "DRAFT",
                      "TRASH"
                    ],
                    "description": "New status to apply to the Posts"
                  }
                },
                "required": [
                  "ids",
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Post updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Post not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/blog/author/manage/{id}": {
      "del": {
        "summary": "Deletes a specific post",
        "operationId": "deletePost",
        "tags": [
          "Content",
          "Author",
          "Post"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "ID of the post to delete",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "restore",
            "in": "query",
            "description": "Restore the post instead of deleting",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "force",
            "in": "query",
            "description": "Delete the post permanently",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Post deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message indicating successful deletion"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Post not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "Retrieves a single blog post by ID",
        "description": "This endpoint retrieves a single blog post by its ID.",
        "operationId": "getPostById",
        "tags": [
          "Content",
          "Author",
          "Post"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "The ID of the blog post to retrieve",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Post ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Blog post retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "example": 200
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "content": {
                          "type": "string"
                        },
                        "categoryId": {
                          "type": "string"
                        },
                        "authorId": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string",
                          "nullable": true
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "PUBLISHED",
                            "DRAFT",
                            "TRASH"
                          ]
                        },
                        "image": {
                          "type": "string",
                          "nullable": true
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "author": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "userId": {
                              "type": "string"
                            }
                          }
                        },
                        "category": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            }
                          }
                        },
                        "postTag": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "postId": {
                                "type": "string"
                              },
                              "tagId": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Blog post not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "summary": "Updates a blog post identified by id",
        "description": "This endpoint updates an existing blog post.",
        "operationId": "updatePost",
        "tags": [
          "Content",
          "Author",
          "Post"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "The id of the blog post to update",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Post id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Updated blog post data",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Title of the post"
                  },
                  "content": {
                    "type": "string",
                    "description": "Content of the post"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the post"
                  },
                  "categoryId": {
                    "type": "string",
                    "description": "Category ID for the post"
                  },
                  "status": {
                    "type": "string",
                    "description": "New status of the blog post",
                    "enum": [
                      "PUBLISHED",
                      "DRAFT"
                    ]
                  },
                  "tags": {
                    "type": "array",
                    "description": "Array of tag objects associated with the post",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "image": {
                    "type": "string",
                    "description": "Image URL for the post"
                  }
                },
                "required": [
                  "title",
                  "content",
                  "categoryId",
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Blog post updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message of successful post update"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, user must be authenticated"
          },
          "404": {
            "description": "Blog post not found"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/blog/author/manage/{id}/status": {
      "put": {
        "summary": "Update Status for a Post",
        "operationId": "updatePostStatus",
        "tags": [
          "Content",
          "Author",
          "Post"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the Post to update",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "PUBLISHED",
                      "DRAFT",
                      "TRASH"
                    ],
                    "description": "New status to apply to the Post"
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Post updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Post not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/blog/author/top": {
      "get": {
        "summary": "Get Top Blog Authors",
        "description": "Retrieves top authors based on post counts.",
        "operationId": "getAdminTopBlogAuthors",
        "tags": [
          "Blog",
          "Admin",
          "Authors"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Top authors retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "userId": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "postCount": {
                        "type": "number"
                      },
                      "user": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "firstName": {
                            "type": "string"
                          },
                          "lastName": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "avatar": {
                            "type": "string"
                          },
                          "profile": {
                            "type": "object"
                          },
                          "role": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/blog/author/{id}": {
      "get": {
        "summary": "Retrieve author with his posts",
        "description": "This endpoint retrieves the author profile associated with a given user id along with the posts linked to that profile.",
        "operationId": "getAuthorWithPosts",
        "tags": [
          "Content",
          "Author"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Author ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Author and posts retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "author": {
                      "type": "object"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Author not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/blog/category": {
      "get": {
        "summary": "Lists categories with post count",
        "description": "This endpoint retrieves all categories that have at least one published post along with the count of their associated posts.",
        "operationId": "getCategories",
        "tags": [
          "Blog"
        ],
        "requiresAuth": false,
        "responses": {
          "200": {
            "description": "Categories retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Category ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the category",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "slug": {
                        "type": "string",
                        "description": "Slug for the category",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "image": {
                        "type": "string",
                        "description": "Image URL for the category",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": true
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of the category",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": true
                      },
                      "postCount": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Category not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/blog/category/{slug}": {
      "get": {
        "summary": "Retrieves a single category by ID with optional inclusion of posts",
        "description": "This endpoint retrieves a single category by its ID with optional inclusion of posts.",
        "operationId": "getCategoryById",
        "tags": [
          "Blog"
        ],
        "requiresAuth": false,
        "parameters": [
          {
            "index": 0,
            "name": "slug",
            "in": "path",
            "description": "The ID of the category to retrieve",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Category ID"
            }
          },
          {
            "name": "posts",
            "in": "query",
            "description": "Include posts in the category",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Category retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Category ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the category",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "slug": {
                      "type": "string",
                      "description": "Slug for the category",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "image": {
                      "type": "string",
                      "description": "Image URL for the category",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": true
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the category",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": true
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Post ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "title": {
                            "type": "string",
                            "description": "Title of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "content": {
                            "type": "string",
                            "description": "Content of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "categoryId": {
                            "type": "string",
                            "description": "Category ID of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "authorId": {
                            "type": "string",
                            "description": "Author ID of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "slug": {
                            "type": "string",
                            "description": "Slug of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Description of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "status": {
                            "type": "string",
                            "description": "Status of the post",
                            "enum": [
                              "PUBLISHED",
                              "DRAFT",
                              "TRASH"
                            ]
                          },
                          "image": {
                            "type": "string",
                            "description": "Image URL of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Creation date of the post",
                            "nullable": false
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Last update date of the post",
                            "nullable": true
                          }
                        }
                      },
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Category not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/blog/comment": {
      "get": {
        "summary": "Lists all comments with optional inclusion of posts",
        "description": "This endpoint retrieves all available comments along with their associated posts.",
        "operationId": "getComments",
        "tags": [
          "Blog"
        ],
        "requiresAuth": false,
        "responses": {
          "200": {
            "description": "Comments retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Comment ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "name": {
                        "type": "string",
                        "description": "Name associated with the comment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "slug": {
                        "type": "string",
                        "description": "Slug for the comment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "posts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Post ID",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "content": {
                              "type": "string",
                              "description": "Content of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "userId": {
                              "type": "string",
                              "description": "User ID of the poster",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "postId": {
                              "type": "string",
                              "description": "ID of the post commented on",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Creation date of the comment",
                              "nullable": false
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Last update date of the comment",
                              "nullable": false
                            },
                            "deletedAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Deletion date of the comment",
                              "nullable": true
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Comments not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/blog/comment/{id}": {
      "del": {
        "summary": "Deletes a blog comment",
        "description": "This endpoint deletes a blog comment.",
        "operationId": "deleteComment",
        "tags": [
          "Blog"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "The ID of the comment to delete",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comment ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comment deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message indicating successful deletion"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Comment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "summary": "Updates an existing blog comment",
        "description": "This endpoint updates an existing blog comment.",
        "operationId": "updateComment",
        "tags": [
          "Blog"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "The ID of the comment to update",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comment ID"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Comment data to update",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "comment": {
                    "type": "string",
                    "description": "Updated comment content"
                  }
                },
                "required": [
                  "comment"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Comment updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Comment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/blog/comment/{postId}": {
      "get": {
        "summary": "Lists all comments for a given post along with optional inclusion of posts",
        "description": "This endpoint retrieves all comments for the specified post along with their associated posts.",
        "operationId": "getPostComments",
        "tags": [
          "Blog"
        ],
        "requiresAuth": false,
        "parameters": [
          {
            "index": 0,
            "name": "postId",
            "in": "path",
            "description": "The ID of the post",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Post ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comments retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Comment ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "name": {
                        "type": "string",
                        "description": "Name associated with the comment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "slug": {
                        "type": "string",
                        "description": "Slug for the comment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "posts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Post ID",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "content": {
                              "type": "string",
                              "description": "Content of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "userId": {
                              "type": "string",
                              "description": "User ID of the poster",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "postId": {
                              "type": "string",
                              "description": "ID of the post commented on",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Creation date of the comment",
                              "nullable": false
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Last update date of the comment",
                              "nullable": false
                            },
                            "deletedAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Deletion date of the comment",
                              "nullable": true
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Comments not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      },
      "post": {
        "summary": "Creates a new blog comment",
        "description": "This endpoint creates a new blog comment.",
        "operationId": "createComment",
        "tags": [
          "Blog"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "postId",
            "in": "path",
            "description": "The ID of the post to comment on",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Post ID"
            }
          }
        ],
        "requestBody": {
          "description": "Data for creating a new comment",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "description": "Name of the comment to create"
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Comment created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/blog/post": {
      "get": {
        "summary": "List all posts",
        "operationId": "listPosts",
        "tags": [
          "Posts"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Posts retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "title": {
                            "type": "string",
                            "description": "Title of the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "content": {
                            "type": "string",
                            "description": "Content of the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "categoryId": {
                            "type": "string",
                            "description": "Category ID linked to the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "authorId": {
                            "type": "string",
                            "description": "Author ID who wrote the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "slug": {
                            "type": "string",
                            "description": "Slug for the Post URL",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Description of the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "status": {
                            "type": "string",
                            "description": "Publication status of the Post",
                            "enum": [
                              "PUBLISHED",
                              "DRAFT",
                              "TRASH"
                            ]
                          },
                          "image": {
                            "type": "string",
                            "description": "Image URL of the Post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Creation date of the Post",
                            "nullable": false
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Last update date of the Post",
                            "nullable": false
                          },
                          "deletedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Deletion date of the Post, if applicable",
                            "nullable": false
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Posts not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/blog/post/{slug}": {
      "get": {
        "summary": "Retrieves a single blog post by ID",
        "description": "This endpoint retrieves a single blog post by its ID.",
        "operationId": "getPostById",
        "tags": [
          "Blog"
        ],
        "requiresAuth": false,
        "parameters": [
          {
            "index": 0,
            "name": "slug",
            "in": "path",
            "description": "The ID of the blog post to retrieve",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Post ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Blog post retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of the Post",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "title": {
                      "type": "string",
                      "description": "Title of the Post",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "content": {
                      "type": "string",
                      "description": "Content of the Post",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "categoryId": {
                      "type": "string",
                      "description": "Category ID linked to the Post",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "authorId": {
                      "type": "string",
                      "description": "Author ID who wrote the Post",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "slug": {
                      "type": "string",
                      "description": "Slug for the Post URL",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the Post",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "status": {
                      "type": "string",
                      "description": "Publication status of the Post",
                      "enum": [
                        "PUBLISHED",
                        "DRAFT",
                        "TRASH"
                      ]
                    },
                    "image": {
                      "type": "string",
                      "description": "Image URL of the Post",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Creation date of the Post",
                      "nullable": false
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Last update date of the Post",
                      "nullable": false
                    },
                    "deletedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Deletion date of the Post, if applicable",
                      "nullable": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Post not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/blog/tag": {
      "get": {
        "summary": "Lists all tags with optional inclusion of posts",
        "description": "This endpoint retrieves all available tags along with their associated posts.",
        "operationId": "getTags",
        "tags": [
          "Blog"
        ],
        "requiresAuth": false,
        "responses": {
          "200": {
            "description": "Tags retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Tag ID",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the tag",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "slug": {
                        "type": "string",
                        "description": "Slug for the tag",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "posts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Post ID",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "title": {
                              "type": "string",
                              "description": "Title of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "content": {
                              "type": "string",
                              "description": "Content of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "authorId": {
                              "type": "string",
                              "description": "Author ID of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "categoryId": {
                              "type": "string",
                              "description": "Category ID of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "slug": {
                              "type": "string",
                              "description": "Slug of the post",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Creation date of the post",
                              "nullable": false
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Last update date of the post",
                              "nullable": true
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Tag not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/blog/tag/{slug}": {
      "get": {
        "summary": "Retrieves a single tag by slug with optional inclusion of posts",
        "description": "This endpoint retrieves a single tag by its slug with optional inclusion of posts.",
        "operationId": "getTagBySlug",
        "tags": [
          "Blog"
        ],
        "requiresAuth": false,
        "parameters": [
          {
            "index": 0,
            "name": "slug",
            "in": "path",
            "description": "The slug of the tag to retrieve",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "posts",
            "in": "query",
            "description": "Include posts tagged with this tag",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tag retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Tag ID",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the tag",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "slug": {
                      "type": "string",
                      "description": "Slug for the tag",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Post ID",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "title": {
                            "type": "string",
                            "description": "Title of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "content": {
                            "type": "string",
                            "description": "Content of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "authorId": {
                            "type": "string",
                            "description": "Author ID of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "categoryId": {
                            "type": "string",
                            "description": "Category ID of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "slug": {
                            "type": "string",
                            "description": "Slug of the post",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Creation date of the post",
                            "nullable": false
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Last update date of the post",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Tag not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/content/page": {
      "get": {
        "summary": "Lists all pages",
        "description": "Fetches a comprehensive list of all pages available on the platform.",
        "operationId": "listAllPages",
        "tags": [
          "Page"
        ],
        "requiresAuth": false,
        "responses": {
          "200": {
            "description": "Pages retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "ID of the page",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "title": {
                        "type": "string",
                        "description": "Title of the page",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "content": {
                        "type": "string",
                        "description": "Content of the page",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of the page",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "image": {
                        "type": "string",
                        "description": "Image of the page",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": true
                      },
                      "slug": {
                        "type": "string",
                        "description": "Slug of the page",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "status": {
                        "type": "string",
                        "description": "Status of the page",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Date and time the page was created",
                        "nullable": false
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Date and time the page was last updated",
                        "nullable": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Pages not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/content/page/{id}": {
      "get": {
        "summary": "Retrieves a single page by ID",
        "description": "Fetches detailed information about a specific page based on its unique identifier.",
        "operationId": "getPage",
        "tags": [
          "Page"
        ],
        "requiresAuth": false,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the page to retrieve",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of the page",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "title": {
                      "type": "string",
                      "description": "Title of the page",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "content": {
                      "type": "string",
                      "description": "Content of the page",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the page",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "image": {
                      "type": "string",
                      "description": "Image of the page",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": true
                    },
                    "slug": {
                      "type": "string",
                      "description": "Slug of the page",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the page",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Date and time the page was created",
                      "nullable": false
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Date and time the page was last updated",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Page not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/content/slider": {
      "get": {
        "summary": "List all sliders",
        "operationId": "listSliders",
        "tags": [
          "Sliders"
        ],
        "responses": {
          "200": {
            "description": "Sliders retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "ID of the Slider",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "image": {
                        "type": "string",
                        "description": "Image URL of the Slider",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "link": {
                        "type": "string",
                        "description": "Link URL of the Slider",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Status of the Slider"
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Creation date of the Slider",
                        "nullable": false
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Last update date of the Slider",
                        "nullable": false
                      },
                      "deletedAt": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Deletion date of the Slider, if applicable",
                        "nullable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Sliders not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/binary/duration": {
      "get": {
        "summary": "List Available Binary Durations",
        "operationId": "listBinaryDurations",
        "tags": [
          "Exchange",
          "Binary"
        ],
        "description": "Retrieves a list of available durations for binary options.",
        "responses": {
          "200": {
            "description": "A list of binary durations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Binary Duration not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/binary/market": {
      "get": {
        "summary": "List Binary Markets",
        "operationId": "listBinaryMarkets",
        "tags": [
          "Exchange",
          "Binary",
          "Markets"
        ],
        "description": "Retrieves a list of all available binary trading markets.",
        "responses": {
          "200": {
            "description": "A list of binary markets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Market ID"
                      },
                      "currency": {
                        "type": "string",
                        "description": "Base currency"
                      },
                      "pair": {
                        "type": "string",
                        "description": "Quote currency"
                      },
                      "isTrending": {
                        "type": "boolean",
                        "description": "Whether the market is trending"
                      },
                      "isHot": {
                        "type": "boolean",
                        "description": "Whether the market is hot"
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Market status"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Binary Market not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/binary/order": {
      "get": {
        "summary": "List Orders",
        "operationId": "listOrders",
        "tags": [
          "Exchange",
          "Orders"
        ],
        "description": "Retrieves a list of orders for the authenticated user.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Type of order to retrieve.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "description": "currency of the order to retrieve.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pair",
            "in": "query",
            "description": "pair of the order to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Create Binary Order",
        "operationId": "createBinaryOrder",
        "tags": [
          "Binary",
          "Orders"
        ],
        "description": "Creates a new binary order for the authenticated user.",
        "requestBody": {
          "description": "Binary order data to be created.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string"
                  },
                  "pair": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "number"
                  },
                  "side": {
                    "type": "string"
                  },
                  "closedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "isDemo": {
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string"
                  }
                },
                "required": [
                  "currency",
                  "pair",
                  "amount",
                  "side",
                  "closedAt",
                  "type"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Binary Order created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/exchange/binary/order/last": {
      "get": {
        "summary": "List Binary Orders from Last 30 Days",
        "operationId": "listBinaryOrdersLast30Days",
        "tags": [
          "Binary",
          "Orders"
        ],
        "description": "Retrieves the non-pending binary orders for practice and non-practice accounts from the last 30 days and compares them with the previous month.",
        "responses": {
          "200": {
            "description": "A list of binary orders from the last 30 days",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "practiceOrders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "nonPracticeOrders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "livePercentageChange": {
                      "type": "number"
                    },
                    "practicePercentageChange": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/exchange/binary/order/{id}": {
      "del": {
        "summary": "Cancel Binary Order",
        "operationId": "cancelBinaryOrder",
        "tags": [
          "Binary",
          "Orders"
        ],
        "description": "Cancels a binary order for the authenticated user.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the binary order to cancel.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Cancellation percentage data.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "percentage": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "Binary order cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Binary Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      },
      "get": {
        "summary": "Show Binary Order",
        "operationId": "showBinaryOrder",
        "tags": [
          "Binary",
          "Orders"
        ],
        "description": "Retrieves a specific binary order by ID for the authenticated user.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the binary order to retrieve.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Binary order data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of the binary order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false,
                      "x-expectedFormat": "uuid"
                    },
                    "userId": {
                      "type": "string",
                      "description": "User ID associated with the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "symbol": {
                      "type": "string",
                      "description": "Trading symbol",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "price": {
                      "type": "number",
                      "description": "Entry price of the order",
                      "nullable": false
                    },
                    "amount": {
                      "type": "number",
                      "description": "Amount of the order",
                      "nullable": false
                    },
                    "profit": {
                      "type": "number",
                      "description": "Profit from the order",
                      "nullable": false
                    },
                    "side": {
                      "type": "string",
                      "description": "Side of the order (e.g., BUY, SELL)",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "type": {
                      "type": "string",
                      "description": "Type of order (e.g., LIMIT, MARKET)",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "barrier": {
                      "type": "number",
                      "description": "Barrier price of the order",
                      "nullable": true
                    },
                    "strikePrice": {
                      "type": "number",
                      "description": "Strike price of the order",
                      "nullable": true
                    },
                    "payoutPerPoint": {
                      "type": "number",
                      "description": "Payout per point of the order",
                      "nullable": true
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the order (e.g., OPEN, CLOSED)",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "isDemo": {
                      "type": "boolean",
                      "description": "Whether the order is a demo"
                    },
                    "closedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Time when the order was closed",
                      "nullable": true
                    },
                    "closePrice": {
                      "type": "number",
                      "description": "Price at which the order was closed",
                      "nullable": false
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Creation date of the order",
                      "nullable": false
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Last update date of the order",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Binary Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/chart": {
      "get": {
        "summary": "Get Historical Chart Data",
        "operationId": "getHistoricalChartData",
        "tags": [
          "Chart",
          "Historical"
        ],
        "description": "Retrieves historical chart data for the authenticated user.",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "description": "Symbol to retrieve data for.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "description": "Interval to retrieve data for.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Start timestamp to retrieve data from.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "End timestamp to retrieve data from.",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "duration",
            "in": "query",
            "description": "Duration to retrieve data for.",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Historical chart data retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "number",
                        "description": "Timestamp for the data point",
                        "nullable": false
                      },
                      "open": {
                        "type": "number",
                        "description": "Opening price for the data interval",
                        "nullable": false
                      },
                      "high": {
                        "type": "number",
                        "description": "Highest price during the data interval",
                        "nullable": false
                      },
                      "low": {
                        "type": "number",
                        "description": "Lowest price during the data interval",
                        "nullable": false
                      },
                      "close": {
                        "type": "number",
                        "description": "Closing price for the data interval",
                        "nullable": false
                      },
                      "volume": {
                        "type": "number",
                        "description": "Volume of trades during the data interval",
                        "nullable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Chart not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/currency": {
      "get": {
        "summary": "List Currencies",
        "operationId": "getCurrencies",
        "tags": [
          "Currencies"
        ],
        "description": "Retrieves a list of all currencies.",
        "responses": {
          "200": {
            "description": "A list of currencies",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier for the currency",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "currency": {
                        "type": "string",
                        "description": "Currency code (e.g., USD, EUR)",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "name": {
                        "type": "string",
                        "description": "Full name of the currency",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "precision": {
                        "type": "number",
                        "description": "Number of decimal places used by the currency",
                        "nullable": false
                      },
                      "price": {
                        "type": "number",
                        "description": "Current price of the currency in USD",
                        "nullable": false
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Active status of the currency"
                      },
                      "chains": {
                        "type": "object",
                        "description": "Blockchain networks supported by the currency",
                        "additionalProperties": {
                          "type": "object",
                          "properties": {
                            "network": {
                              "type": "string",
                              "description": "Network name",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            },
                            "protocol": {
                              "type": "string",
                              "description": "Protocol used",
                              "maxLength": 255,
                              "minLength": 0,
                              "nullable": false
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Currency not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/currency/{id}": {
      "get": {
        "summary": "Show Currency",
        "operationId": "getCurrency",
        "tags": [
          "Currencies"
        ],
        "description": "Retrieves details of a specific currency by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the currency to retrieve.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Currency details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier for the currency",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "currency": {
                      "type": "string",
                      "description": "Currency code (e.g., USD, EUR)",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "name": {
                      "type": "string",
                      "description": "Full name of the currency",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "precision": {
                      "type": "number",
                      "description": "Number of decimal places used by the currency",
                      "nullable": false
                    },
                    "price": {
                      "type": "number",
                      "description": "Current price of the currency in USD",
                      "nullable": false
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Active status of the currency"
                    },
                    "chains": {
                      "type": "object",
                      "description": "Blockchain networks supported by the currency",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "network": {
                            "type": "string",
                            "description": "Network name",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "protocol": {
                            "type": "string",
                            "description": "Protocol used",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Currency not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/market": {
      "get": {
        "summary": "List Exchange Markets",
        "operationId": "listMarkets",
        "tags": [
          "Exchange",
          "Markets"
        ],
        "description": "Retrieves a list of all available markets.",
        "parameters": [
          {
            "name": "eco",
            "in": "query",
            "required": true,
            "description": "include eco",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of markets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier for the market",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "currency": {
                        "type": "string",
                        "description": "Primary currency of the market",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "pair": {
                        "type": "string",
                        "description": "Currency pair traded in this market",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "isTrending": {
                        "type": "boolean",
                        "description": "Indicator if the market is currently trending"
                      },
                      "isHot": {
                        "type": "boolean",
                        "description": "Indicator if the market is currently considered 'hot'"
                      },
                      "metadata": {
                        "type": "object",
                        "description": "Additional metadata about the market",
                        "additionalProperties": true
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Active status of the market"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Market not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/market/{id}": {
      "get": {
        "summary": "Show Market Details",
        "operationId": "showMarket",
        "tags": [
          "Exchange",
          "Markets"
        ],
        "description": "Retrieves details of a specific market by ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the market to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Market details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier for the market",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "currency": {
                      "type": "string",
                      "description": "Primary currency of the market",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "pair": {
                      "type": "string",
                      "description": "Currency pair traded in this market",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "isTrending": {
                      "type": "boolean",
                      "description": "Indicator if the market is currently trending"
                    },
                    "isHot": {
                      "type": "boolean",
                      "description": "Indicator if the market is currently considered 'hot'"
                    },
                    "metadata": {
                      "type": "object",
                      "description": "Additional metadata about the market",
                      "additionalProperties": true
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Active status of the market"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Market not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/order": {
      "get": {
        "summary": "List Orders",
        "operationId": "listOrders",
        "tags": [
          "Exchange",
          "Orders"
        ],
        "description": "Retrieves a list of orders for the authenticated user.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Type of order to retrieve.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "description": "currency of the order to retrieve.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pair",
            "in": "query",
            "description": "pair of the order to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier for the order",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "referenceId": {
                        "type": "string",
                        "description": "External reference ID for the order",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "userId": {
                        "type": "string",
                        "description": "User ID associated with the order",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "status": {
                        "type": "string",
                        "description": "Status of the order (e.g., pending, completed)",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "symbol": {
                        "type": "string",
                        "description": "Trading symbol for the order",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of order (e.g., market, limit)",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "timeInForce": {
                        "type": "string",
                        "description": "Time in force policy for the order",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "side": {
                        "type": "string",
                        "description": "Order side (buy or sell)",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "price": {
                        "type": "number",
                        "description": "Price per unit",
                        "nullable": false
                      },
                      "average": {
                        "type": "number",
                        "description": "Average price per unit",
                        "nullable": false
                      },
                      "amount": {
                        "type": "number",
                        "description": "Total amount ordered",
                        "nullable": false
                      },
                      "filled": {
                        "type": "number",
                        "description": "Amount filled",
                        "nullable": false
                      },
                      "remaining": {
                        "type": "number",
                        "description": "Amount remaining",
                        "nullable": false
                      },
                      "cost": {
                        "type": "number",
                        "description": "Total cost",
                        "nullable": false
                      },
                      "trades": {
                        "type": "object",
                        "description": "Details of trades executed for this order",
                        "additionalProperties": true
                      },
                      "fee": {
                        "type": "number",
                        "description": "Transaction fee",
                        "nullable": false
                      },
                      "feeCurrency": {
                        "type": "string",
                        "description": "Currency of the transaction fee",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "createdAt": {
                        "type": "string",
                        "description": "Creation date of the order",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "updatedAt": {
                        "type": "string",
                        "description": "Last update date of the order",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Create Order",
        "operationId": "createOrder",
        "tags": [
          "Exchange",
          "Orders"
        ],
        "description": "Creates a new order for the authenticated user.",
        "requestBody": {
          "description": "Order creation data.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "description": "Currency symbol (e.g., BTC)"
                  },
                  "pair": {
                    "type": "string",
                    "description": "Pair symbol (e.g., USDT)"
                  },
                  "type": {
                    "type": "string",
                    "description": "Order type (e.g., limit, market)"
                  },
                  "side": {
                    "type": "string",
                    "description": "Order side (buy or sell)"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Order amount"
                  },
                  "price": {
                    "type": "number",
                    "description": "Order price, required for limit orders"
                  }
                },
                "required": [
                  "currency",
                  "pair",
                  "type",
                  "side",
                  "amount"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Order created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/exchange/order/{id}": {
      "del": {
        "summary": "Cancel Order",
        "operationId": "cancelOrder",
        "tags": [
          "Exchange",
          "Orders"
        ],
        "description": "Cancels a specific order for the authenticated user.",
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the order to cancel.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order canceled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Order canceled successfully"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "Show Order Details",
        "operationId": "showOrder",
        "tags": [
          "Exchange",
          "Orders"
        ],
        "description": "Retrieves details of a specific order by ID for the authenticated user.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the order to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier for the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "referenceId": {
                      "type": "string",
                      "description": "External reference ID for the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "userId": {
                      "type": "string",
                      "description": "User ID associated with the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the order (e.g., pending, completed)",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "symbol": {
                      "type": "string",
                      "description": "Trading symbol for the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "type": {
                      "type": "string",
                      "description": "Type of order (e.g., market, limit)",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "timeInForce": {
                      "type": "string",
                      "description": "Time in force policy for the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "side": {
                      "type": "string",
                      "description": "Order side (buy or sell)",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "price": {
                      "type": "number",
                      "description": "Price per unit",
                      "nullable": false
                    },
                    "average": {
                      "type": "number",
                      "description": "Average price per unit",
                      "nullable": false
                    },
                    "amount": {
                      "type": "number",
                      "description": "Total amount ordered",
                      "nullable": false
                    },
                    "filled": {
                      "type": "number",
                      "description": "Amount filled",
                      "nullable": false
                    },
                    "remaining": {
                      "type": "number",
                      "description": "Amount remaining",
                      "nullable": false
                    },
                    "cost": {
                      "type": "number",
                      "description": "Total cost",
                      "nullable": false
                    },
                    "trades": {
                      "type": "object",
                      "description": "Details of trades executed for this order",
                      "additionalProperties": true
                    },
                    "fee": {
                      "type": "number",
                      "description": "Transaction fee",
                      "nullable": false
                    },
                    "feeCurrency": {
                      "type": "string",
                      "description": "Currency of the transaction fee",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Creation date of the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "updatedAt": {
                      "type": "string",
                      "description": "Last update date of the order",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Order not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/orderbook/{currency}/{pair}": {
      "get": {
        "summary": "Get Market Order Book",
        "operationId": "getMarketOrderBook",
        "tags": [
          "Exchange",
          "Markets"
        ],
        "description": "Retrieves the order book for a specific market pair.",
        "parameters": [
          {
            "name": "currency",
            "in": "path",
            "description": "Currency symbol",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pair",
            "in": "path",
            "description": "Pair symbol",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limit the number of order book entries",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order book information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "asks": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "description": "Order book entry consisting of price and volume"
                        }
                      },
                      "description": "Asks are sell orders in the order book"
                    },
                    "bids": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "number",
                          "description": "Order book entry consisting of price and volume"
                        }
                      },
                      "description": "Bids are buy orders in the order book"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Orderbook not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/ticker": {
      "get": {
        "summary": "Get All Market Tickers",
        "operationId": "getAllMarketTickers",
        "tags": [
          "Exchange",
          "Markets"
        ],
        "description": "Retrieves ticker information for all available market pairs.",
        "responses": {
          "200": {
            "description": "All market tickers information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string",
                      "description": "Trading symbol for the market pair",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "bid": {
                      "type": "number",
                      "description": "Current highest bid price",
                      "nullable": false
                    },
                    "ask": {
                      "type": "number",
                      "description": "Current lowest ask price",
                      "nullable": false
                    },
                    "close": {
                      "type": "number",
                      "description": "Last close price",
                      "nullable": false
                    },
                    "last": {
                      "type": "number",
                      "description": "Most recent transaction price",
                      "nullable": false
                    },
                    "change": {
                      "type": "number",
                      "description": "Price change percentage",
                      "nullable": false
                    },
                    "baseVolume": {
                      "type": "number",
                      "description": "Volume of base currency traded",
                      "nullable": false
                    },
                    "quoteVolume": {
                      "type": "number",
                      "description": "Volume of quote currency traded",
                      "nullable": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ticker not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/ticker/{currency}/{pair}": {
      "get": {
        "summary": "Get Market Ticker",
        "operationId": "getMarketTicker",
        "tags": [
          "Exchange",
          "Markets"
        ],
        "description": "Retrieves ticker information for a specific market pair.",
        "parameters": [
          {
            "name": "currency",
            "in": "path",
            "required": true,
            "description": "The base currency of the market pair.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pair",
            "in": "path",
            "required": true,
            "description": "The quote currency of the market pair.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticker information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string",
                      "description": "Trading symbol for the market pair",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "bid": {
                      "type": "number",
                      "description": "Current highest bid price",
                      "nullable": false
                    },
                    "ask": {
                      "type": "number",
                      "description": "Current lowest ask price",
                      "nullable": false
                    },
                    "close": {
                      "type": "number",
                      "description": "Last close price",
                      "nullable": false
                    },
                    "last": {
                      "type": "number",
                      "description": "Most recent transaction price",
                      "nullable": false
                    },
                    "change": {
                      "type": "number",
                      "description": "Price change percentage",
                      "nullable": false
                    },
                    "baseVolume": {
                      "type": "number",
                      "description": "Volume of base currency traded",
                      "nullable": false
                    },
                    "quoteVolume": {
                      "type": "number",
                      "description": "Volume of quote currency traded",
                      "nullable": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ticker not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/exchange/watchlist": {
      "del": {
        "summary": "Remove Item from Watchlist",
        "operationId": "removeWatchlistItem",
        "tags": [
          "Exchange",
          "Watchlist"
        ],
        "description": "Removes an item from the watchlist for the authenticated user.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the watchlist item to remove.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Watchlist deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message indicating successful deletion"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Watchlist not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "List Watchlist Items",
        "operationId": "listWatchlistItems",
        "tags": [
          "Exchange",
          "Watchlist"
        ],
        "description": "Retrieves a list of watchlist items for the authenticated user.",
        "responses": {
          "200": {
            "description": "A list of watchlist items",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier for the watchlist item",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false,
                        "x-expectedFormat": "uuid"
                      },
                      "userId": {
                        "type": "string",
                        "description": "User ID associated with the watchlist item",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false,
                        "x-expectedFormat": "uuid"
                      },
                      "symbol": {
                        "type": "string",
                        "description": "Symbol of the watchlist item",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Watchlist not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Add Item to Watchlist",
        "operationId": "addWatchlistItem",
        "tags": [
          "Exchange",
          "Watchlist"
        ],
        "description": "Adds a new item to the watchlist for the authenticated user.",
        "requestBody": {
          "description": "Data for the watchlist item to add.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Symbol of the watchlist item"
                  }
                },
                "required": [
                  "symbol"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Watchlist created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/currency": {
      "get": {
        "summary": "Lists all currencies with their current rates",
        "description": "This endpoint retrieves all available currencies along with their current rates.",
        "operationId": "getCurrencies",
        "tags": [
          "Finance",
          "Currency"
        ],
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "description": "The action to perform",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "walletType",
            "in": "query",
            "description": "The type of wallet to retrieve currencies for",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "FIAT",
                "SPOT",
                "ECO",
                "FUTURES"
              ]
            }
          },
          {
            "name": "targetWalletType",
            "in": "query",
            "description": "The type of wallet to transfer to (optional for transfer action)",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "FIAT",
                "SPOT",
                "ECO",
                "FUTURES"
              ]
            }
          }
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Currencies retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "nullable": false
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number",
                            "description": "ID of the currency",
                            "nullable": false
                          },
                          "name": {
                            "type": "string",
                            "description": "Currency name",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "symbol": {
                            "type": "string",
                            "description": "Currency symbol",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "precision": {
                            "type": "number",
                            "description": "Currency precision",
                            "nullable": false
                          },
                          "price": {
                            "type": "number",
                            "description": "Currency price",
                            "nullable": false
                          },
                          "status": {
                            "type": "boolean",
                            "description": "Currency status"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Currency not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/currency/price": {
      "get": {
        "summary": "Get price in USD for a currency",
        "description": "Returns the price in USD for a given currency and wallet type.",
        "operationId": "getCurrencyPriceInUSD",
        "tags": [
          "Finance",
          "Currency"
        ],
        "parameters": [
          {
            "name": "currency",
            "in": "query",
            "description": "The currency to get the price for",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "The wallet type of the currency",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Price in USD retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "nullable": false
                    },
                    "data": {
                      "type": "number",
                      "description": "Price of the currency in USD"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Currency not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/currency/rate": {
      "get": {
        "summary": "Get exchange rate between two currencies",
        "description": "Returns the exchange rate between two currencies given their wallet types.",
        "operationId": "getExchangeRate",
        "tags": [
          "Finance",
          "Currency"
        ],
        "parameters": [
          {
            "name": "fromCurrency",
            "in": "query",
            "description": "The currency to convert from",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromType",
            "in": "query",
            "description": "The wallet type of the currency to convert from",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "toCurrency",
            "in": "query",
            "description": "The currency to convert to",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "toType",
            "in": "query",
            "description": "The wallet type of the currency to convert to",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Exchange rate retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "nullable": false
                    },
                    "data": {
                      "type": "number",
                      "description": "Exchange rate from fromCurrency to toCurrency"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Currency not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/currency/valid": {
      "get": {
        "summary": "Lists all currencies with their current rates",
        "description": "This endpoint retrieves all available currencies along with their current rates.",
        "operationId": "getCurrencies",
        "tags": [
          "Finance",
          "Currency"
        ],
        "responses": {
          "200": {
            "description": "Currencies retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "nullable": false
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "number",
                            "description": "ID of the currency",
                            "nullable": false
                          },
                          "name": {
                            "type": "string",
                            "description": "Currency name",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "symbol": {
                            "type": "string",
                            "description": "Currency symbol",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "precision": {
                            "type": "number",
                            "description": "Currency precision",
                            "nullable": false
                          },
                          "price": {
                            "type": "number",
                            "description": "Currency price",
                            "nullable": false
                          },
                          "status": {
                            "type": "boolean",
                            "description": "Currency status"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Currency not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/finance/currency/{type}/{code}": {
      "get": {
        "summary": "Retrieves a single currency by its ID",
        "description": "This endpoint retrieves a single currency by its ID.",
        "operationId": "getCurrencyById",
        "tags": [
          "Finance",
          "Currency"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "description": "The action to perform",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "index": 0,
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "FIAT",
                "SPOT",
                "ECO",
                "FUTURES"
              ]
            }
          },
          {
            "index": 1,
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Currency retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "nullable": false
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number",
                          "description": "ID of the currency",
                          "nullable": false
                        },
                        "name": {
                          "type": "string",
                          "description": "Currency name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "symbol": {
                          "type": "string",
                          "description": "Currency symbol",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "precision": {
                          "type": "number",
                          "description": "Currency precision",
                          "nullable": false
                        },
                        "price": {
                          "type": "number",
                          "description": "Currency price",
                          "nullable": false
                        },
                        "status": {
                          "type": "boolean",
                          "description": "Currency status"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Currency not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/currency/{type}/{code}/{method}": {
      "get": {
        "summary": "Retrieves a single currency by its ID",
        "description": "This endpoint retrieves a single currency by its ID.",
        "operationId": "getCurrencyById",
        "tags": [
          "Finance",
          "Currency"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "SPOT"
              ]
            }
          },
          {
            "index": 1,
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "index": 2,
            "name": "method",
            "in": "path",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Currency retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "nullable": false
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "number",
                          "description": "ID of the currency",
                          "nullable": false
                        },
                        "name": {
                          "type": "string",
                          "description": "Currency name",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "symbol": {
                          "type": "string",
                          "description": "Currency symbol",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "precision": {
                          "type": "number",
                          "description": "Currency precision",
                          "nullable": false
                        },
                        "price": {
                          "type": "number",
                          "description": "Currency price",
                          "nullable": false
                        },
                        "status": {
                          "type": "boolean",
                          "description": "Currency status"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Currency not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/deposit/fiat": {
      "post": {
        "summary": "Performs a custom fiat deposit transaction",
        "description": "Initiates a custom fiat deposit transaction for the currently authenticated user",
        "operationId": "createCustomFiatDeposit",
        "tags": [
          "Wallets"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "methodId": {
                    "type": "string",
                    "description": "Deposit method ID"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount to deposit"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency to deposit"
                  },
                  "customFields": {
                    "type": "object",
                    "description": "Custom data for the deposit"
                  }
                },
                "required": [
                  "methodId",
                  "amount",
                  "currency",
                  "customFields"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Custom deposit transaction initiated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transaction": {
                      "type": "object"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "method": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Deposit Method not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/deposit/fiat/paypal/details": {
      "get": {
        "summary": "Fetches PayPal order details",
        "description": "Retrieves details for a specific PayPal order by its ID.",
        "operationId": "getPayPalOrderDetails",
        "tags": [
          "Finance",
          "Deposit"
        ],
        "parameters": [
          {
            "name": "orderId",
            "in": "query",
            "description": "PayPal order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PayPal order details fetched successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Order ID"
                    },
                    "status": {
                      "type": "string",
                      "description": "Order status"
                    },
                    "purchase_units": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "amount": {
                            "type": "object",
                            "properties": {
                              "currency_code": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Paypal not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/deposit/fiat/paypal": {
      "post": {
        "summary": "Creates a PayPal payment",
        "description": "Initiates a PayPal payment process by creating a new order.",
        "operationId": "createPayPalPayment",
        "tags": [
          "Finance",
          "Deposit"
        ],
        "requestBody": {
          "description": "Payment information and application type",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "description": "Payment amount in smallest currency unit (e.g., cents)"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency code (e.g., USD)"
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PayPal Order created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/deposit/fiat/paypal/verify": {
      "post": {
        "summary": "Verifies a Stripe checkout session",
        "description": "Confirms the validity of a Stripe checkout session by its session ID, ensuring the session is authenticated and retrieving associated payment intent and line items details.",
        "operationId": "verifyStripeCheckoutSession",
        "tags": [
          "Finance",
          "Deposit"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "name": "orderId",
            "in": "query",
            "description": "The PayPal order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Checkout session verified successfully. Returns the session ID, payment intent status, and detailed line items.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "example": 200
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Session ID"
                        },
                        "status": {
                          "type": "string",
                          "description": "Payment intent status",
                          "nullable": true
                        },
                        "lineItems": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Line item ID"
                              },
                              "description": {
                                "type": "string",
                                "description": "Line item description"
                              },
                              "amountSubtotal": {
                                "type": "number",
                                "description": "Subtotal amount"
                              },
                              "amountTotal": {
                                "type": "number",
                                "description": "Total amount"
                              },
                              "currency": {
                                "type": "string",
                                "description": "Currency code"
                              }
                            }
                          },
                          "description": "List of line items associated with the checkout session"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Paypal not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/deposit/fiat/stripe": {
      "post": {
        "summary": "Creates a Stripe payment intent or checkout session",
        "description": "Initiates a Stripe payment process by creating either a payment intent or a checkout session, based on the request parameters. This endpoint supports different workflows for web and Flutter applications.",
        "operationId": "createStripePayment",
        "tags": [
          "Finance",
          "Deposit"
        ],
        "requestBody": {
          "description": "Payment information and application type",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "description": "Payment amount in smallest currency unit (e.g., cents)"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency code (e.g., USD)"
                  },
                  "intent": {
                    "type": "boolean",
                    "description": "Flag indicating if the request is from a mobile app",
                    "nullable": true
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment intent or checkout session created successfully. The response structure varies based on the request context: for Flutter applications, `id` and `clientSecret` are returned; for web applications, `version`, `id`, and `url` are provided.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Payment intent or session ID"
                    },
                    "clientSecret": {
                      "type": "string",
                      "description": "Client secret for payment intent",
                      "nullable": true
                    },
                    "version": {
                      "type": "string",
                      "description": "Stripe API version",
                      "nullable": true
                    },
                    "url": {
                      "type": "string",
                      "description": "Checkout session URL",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Stripe not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/deposit/fiat/stripe/verified": {
      "post": {
        "summary": "Verifies a Stripe checkout session",
        "description": "Confirms the validity of a Stripe checkout session by its session ID, ensuring the session is authenticated and retrieving associated payment intent and line items details.",
        "operationId": "verifyStripeCheckoutSession",
        "tags": [
          "Finance",
          "Deposit"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "sessionId",
            "in": "query",
            "description": "Stripe checkout session ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Checkout session verified successfully. Returns the session ID, payment intent status, and detailed line items.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Session ID"
                    },
                    "status": {
                      "type": "string",
                      "description": "Payment intent status",
                      "nullable": true
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Line item ID"
                          },
                          "description": {
                            "type": "string",
                            "description": "Line item description"
                          },
                          "amountSubtotal": {
                            "type": "number",
                            "description": "Subtotal amount"
                          },
                          "amountTotal": {
                            "type": "number",
                            "description": "Total amount"
                          },
                          "currency": {
                            "type": "string",
                            "description": "Currency code"
                          }
                        }
                      },
                      "description": "List of line items associated with the checkout session"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Stripe not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/deposit/fiat/stripe/verify-intent": {
      "post": {
        "summary": "Verifies a Stripe payment intent",
        "description": "Confirms a completed Stripe payment intent and creates the corresponding wallet transaction",
        "operationId": "verifyStripePaymentIntent",
        "tags": [
          "Finance",
          "Deposit"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "intentId",
            "in": "query",
            "description": "Stripe payment intent ID (pi_xxxxx)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment intent verified successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transaction": {
                      "type": "object",
                      "description": "Created transaction object"
                    },
                    "balance": {
                      "type": "number",
                      "description": "Updated wallet balance"
                    },
                    "currency": {
                      "type": "string",
                      "description": "Transaction currency"
                    },
                    "method": {
                      "type": "string",
                      "description": "Payment method"
                    },
                    "status": {
                      "type": "string",
                      "description": "Verification status"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Payment Intent not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/deposit/fiat/stripe/verify": {
      "post": {
        "summary": "Verifies a Stripe checkout session",
        "description": "Confirms the validity of a Stripe checkout session by its session ID, ensuring the session is authenticated and retrieving associated payment intent and line items details.",
        "operationId": "verifyStripeCheckoutSession",
        "tags": [
          "Finance",
          "Deposit"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "sessionId",
            "in": "query",
            "description": "Stripe checkout session ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Checkout session verified successfully. Returns the session ID, payment intent status, and detailed line items.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Session ID"
                    },
                    "status": {
                      "type": "string",
                      "description": "Payment intent status",
                      "nullable": true
                    },
                    "lineItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Line item ID"
                          },
                          "description": {
                            "type": "string",
                            "description": "Line item description"
                          },
                          "amountSubtotal": {
                            "type": "number",
                            "description": "Subtotal amount"
                          },
                          "amountTotal": {
                            "type": "number",
                            "description": "Total amount"
                          },
                          "currency": {
                            "type": "string",
                            "description": "Currency code"
                          }
                        }
                      },
                      "description": "List of line items associated with the checkout session"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Stripe not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/deposit/spot": {
      "post": {
        "summary": "Initiates a spot deposit transaction",
        "description": "This endpoint initiates a spot deposit transaction for the user",
        "operationId": "initiateSpotDeposit",
        "tags": [
          "Finance",
          "Deposit"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string"
                  },
                  "chain": {
                    "type": "string"
                  },
                  "trx": {
                    "type": "string"
                  }
                },
                "required": [
                  "currency",
                  "chain",
                  "trx"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Spot deposit transaction initiated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Deposit Method not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/investment": {
      "get": {
        "summary": "Lists all investments",
        "description": "Fetches a comprehensive list of all investments made by users, including details of the investment plan and user information.",
        "operationId": "listAllInvestments",
        "tags": [
          "Finance",
          "Investment"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "The type of investment to retrieve",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Investments retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the investment",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "amount": {
                            "type": "number",
                            "description": "Amount of the investment",
                            "nullable": false
                          },
                          "roi": {
                            "type": "number",
                            "description": "Return on investment (ROI) of the investment",
                            "nullable": false
                          },
                          "duration": {
                            "type": "integer",
                            "description": "Duration of the investment in days",
                            "nullable": false
                          },
                          "status": {
                            "type": "string",
                            "description": "Status of the investment",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "ID of the user",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "firstName": {
                                "type": "string",
                                "description": "First name of the user",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "lastName": {
                                "type": "string",
                                "description": "Last name of the user",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "avatar": {
                                "type": "string",
                                "description": "Avatar of the user",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              }
                            }
                          },
                          "plan": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "ID of the investment plan",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "name": {
                                "type": "string",
                                "description": "Name of the investment plan",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "title": {
                                "type": "string",
                                "description": "Title of the investment plan",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "image": {
                                "type": "string",
                                "description": "Image of the investment plan",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "description": {
                                "type": "string",
                                "description": "Description of the investment plan",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "currency": {
                                "type": "string",
                                "description": "Currency of the investment plan",
                                "maxLength": 255,
                                "minLength": 0,
                                "nullable": false
                              },
                              "minAmount": {
                                "type": "number",
                                "description": "Minimum amount required for the investment plan",
                                "nullable": false
                              },
                              "maxAmount": {
                                "type": "number",
                                "description": "Maximum amount allowed for the investment plan",
                                "nullable": false
                              },
                              "roi": {
                                "type": "number",
                                "description": "Return on investment (ROI) of the investment plan",
                                "nullable": false
                              },
                              "duration": {
                                "type": "integer",
                                "description": "Duration of the investment plan in days",
                                "nullable": false
                              },
                              "status": {
                                "type": "boolean",
                                "description": "Status of the investment plan"
                              }
                            }
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Creates a new investment",
        "description": "Initiates a new investment based on the specified plan and amount. This process involves updating the user's wallet balance and creating transaction records.",
        "operationId": "createInvestment",
        "tags": [
          "Finance",
          "Investment"
        ],
        "parameters": [],
        "requestBody": {
          "description": "Data required to create a new investment",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "The type of investment plan",
                    "example": "general"
                  },
                  "planId": {
                    "type": "string",
                    "description": "The unique identifier of the investment plan",
                    "example": "1"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Investment amount",
                    "example": 1000
                  },
                  "durationId": {
                    "type": "string",
                    "description": "The unique identifier of the investment duration",
                    "example": "1"
                  }
                },
                "required": [
                  "type",
                  "planId",
                  "durationId",
                  "amount"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Investment created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/investment/plan": {
      "get": {
        "summary": "Lists all investment plans",
        "description": "Retrieves a list of all available investment plans that are currently active and open for new investments.",
        "operationId": "listInvestmentPlans",
        "tags": [
          "Finance",
          "Investment"
        ],
        "responses": {
          "200": {
            "description": "Investment plans retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "ID of the investment plan",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the investment plan",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "title": {
                        "type": "string",
                        "description": "Title of the investment plan",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "image": {
                        "type": "string",
                        "description": "Image of the investment plan",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of the investment plan",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "currency": {
                        "type": "string",
                        "description": "Currency of the investment plan",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "minAmount": {
                        "type": "number",
                        "description": "Minimum amount required for the investment plan",
                        "nullable": false
                      },
                      "maxAmount": {
                        "type": "number",
                        "description": "Maximum amount allowed for the investment plan",
                        "nullable": false
                      },
                      "roi": {
                        "type": "number",
                        "description": "Return on investment (ROI) of the investment plan",
                        "nullable": false
                      },
                      "duration": {
                        "type": "integer",
                        "description": "Duration of the investment plan in days",
                        "nullable": false
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Status of the investment plan"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Investment Plan not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": false,
        "security": []
      }
    },
    "/api/finance/investment/plan/{id}": {
      "get": {
        "summary": "Retrieves a single investment plan by ID",
        "description": "Fetches detailed information about a specific investment plan based on its unique identifier.",
        "operationId": "getInvestmentPlan",
        "tags": [
          "Finance",
          "Investment"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the investment plan to retrieve",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Investment plan retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of the investment plan",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the investment plan",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "title": {
                      "type": "string",
                      "description": "Title of the investment plan",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "image": {
                      "type": "string",
                      "description": "Image of the investment plan",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the investment plan",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "currency": {
                      "type": "string",
                      "description": "Currency of the investment plan",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "minAmount": {
                      "type": "number",
                      "description": "Minimum amount required for the investment plan",
                      "nullable": false
                    },
                    "maxAmount": {
                      "type": "number",
                      "description": "Maximum amount allowed for the investment plan",
                      "nullable": false
                    },
                    "roi": {
                      "type": "number",
                      "description": "Return on investment (ROI) of the investment plan",
                      "nullable": false
                    },
                    "duration": {
                      "type": "integer",
                      "description": "Duration of the investment plan in days",
                      "nullable": false
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Status of the investment plan"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Investment Plan not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": false,
        "security": []
      }
    },
    "/api/finance/investment/stats": {
      "get": {
        "summary": "Get Investment Platform Statistics",
        "description": "Retrieves platform-wide investment stats: number of active investors, total invested amount, average return (completed investments), and number of investment plans.",
        "operationId": "getInvestmentStats",
        "tags": [
          "Investment",
          "Stats"
        ],
        "responses": {
          "200": {
            "description": "Investment platform statistics retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "activeInvestors": {
                      "type": "number",
                      "description": "Unique users with active investments."
                    },
                    "totalInvested": {
                      "type": "number",
                      "description": "Total amount invested (all time)."
                    },
                    "averageReturn": {
                      "type": "number",
                      "description": "Average return percentage for completed investments."
                    },
                    "totalPlans": {
                      "type": "number",
                      "description": "Total number of active investment plans."
                    },
                    "maxProfitPercentage": {
                      "type": "number",
                      "description": "Maximum profit percentage among all active plans."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error."
          }
        },
        "security": []
      }
    },
    "/api/finance/investment/user": {
      "get": {
        "summary": "Retrieves investments for the logged-in user",
        "description": "Fetches all active investments associated with the currently authenticated user, including details about the investment plan and user information.",
        "operationId": "getUserInvestments",
        "tags": [
          "Finance",
          "Investment"
        ],
        "responses": {
          "200": {
            "description": "Investments retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "ID of the investment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "amount": {
                        "type": "number",
                        "description": "Amount of the investment",
                        "nullable": false
                      },
                      "roi": {
                        "type": "number",
                        "description": "Return on investment (ROI) of the investment",
                        "nullable": false
                      },
                      "duration": {
                        "type": "integer",
                        "description": "Duration of the investment in days",
                        "nullable": false
                      },
                      "status": {
                        "type": "string",
                        "description": "Status of the investment",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "user": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the user",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "firstName": {
                            "type": "string",
                            "description": "First name of the user",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "lastName": {
                            "type": "string",
                            "description": "Last name of the user",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "avatar": {
                            "type": "string",
                            "description": "Avatar of the user",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          }
                        }
                      },
                      "plan": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the investment plan",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the investment plan",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "title": {
                            "type": "string",
                            "description": "Title of the investment plan",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "image": {
                            "type": "string",
                            "description": "Image of the investment plan",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Description of the investment plan",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "currency": {
                            "type": "string",
                            "description": "Currency of the investment plan",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "minAmount": {
                            "type": "number",
                            "description": "Minimum amount required for the investment plan",
                            "nullable": false
                          },
                          "maxAmount": {
                            "type": "number",
                            "description": "Maximum amount allowed for the investment plan",
                            "nullable": false
                          },
                          "roi": {
                            "type": "number",
                            "description": "Return on investment (ROI) of the investment plan",
                            "nullable": false
                          },
                          "duration": {
                            "type": "integer",
                            "description": "Duration of the investment plan in days",
                            "nullable": false
                          },
                          "status": {
                            "type": "boolean",
                            "description": "Status of the investment plan"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/investment/{id}": {
      "del": {
        "summary": "Cancels an investment",
        "description": "Allows a user to cancel an existing investment by its UUID. The operation reverses any financial transactions associated with the investment and updates the user’s wallet balance accordingly.",
        "operationId": "cancelInvestment",
        "tags": [
          "Finance",
          "Investment"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "The ID of the investment to cancel",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "The type of investment to retrieve",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Investment canceled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "Retrieves a single investment by UUID",
        "description": "Fetches detailed information about a specific investment identified by its UUID, including associated plan and user details.",
        "operationId": "getInvestment",
        "tags": [
          "Finance",
          "Investment"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The Id of the investment to retrieve",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "The type of investment to retrieve",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Investment retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of the investment",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "amount": {
                      "type": "number",
                      "description": "Amount of the investment",
                      "nullable": false
                    },
                    "roi": {
                      "type": "number",
                      "description": "Return on investment (ROI) of the investment",
                      "nullable": false
                    },
                    "duration": {
                      "type": "integer",
                      "description": "Duration of the investment in days",
                      "nullable": false
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the investment",
                      "maxLength": 255,
                      "minLength": 0,
                      "nullable": false
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "ID of the user",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "firstName": {
                          "type": "string",
                          "description": "First name of the user",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "lastName": {
                          "type": "string",
                          "description": "Last name of the user",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "avatar": {
                          "type": "string",
                          "description": "Avatar of the user",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        }
                      }
                    },
                    "plan": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "ID of the investment plan",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "name": {
                          "type": "string",
                          "description": "Name of the investment plan",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "title": {
                          "type": "string",
                          "description": "Title of the investment plan",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "image": {
                          "type": "string",
                          "description": "Image of the investment plan",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "description": {
                          "type": "string",
                          "description": "Description of the investment plan",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "currency": {
                          "type": "string",
                          "description": "Currency of the investment plan",
                          "maxLength": 255,
                          "minLength": 0,
                          "nullable": false
                        },
                        "minAmount": {
                          "type": "number",
                          "description": "Minimum amount required for the investment plan",
                          "nullable": false
                        },
                        "maxAmount": {
                          "type": "number",
                          "description": "Maximum amount allowed for the investment plan",
                          "nullable": false
                        },
                        "roi": {
                          "type": "number",
                          "description": "Return on investment (ROI) of the investment plan",
                          "nullable": false
                        },
                        "duration": {
                          "type": "integer",
                          "description": "Duration of the investment plan in days",
                          "nullable": false
                        },
                        "status": {
                          "type": "boolean",
                          "description": "Status of the investment plan"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Investment not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/transaction": {
      "get": {
        "summary": "Lists transactions with optional filters",
        "operationId": "listTransactions",
        "tags": [
          "Finance",
          "Transactions"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "walletType",
            "in": "query",
            "description": "Type of the wallet",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "description": "Currency of the wallet",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of transactions retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of the transaction (DEPOSIT, WITHDRAW, etc.)",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "status": {
                            "type": "string",
                            "description": "Current status of the transaction (PENDING, COMPLETED, etc.)",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false,
                            "enum": [
                              "PENDING",
                              "COMPLETED",
                              "FAILED",
                              "CANCELLED",
                              "REJECTED",
                              "EXPIRED"
                            ]
                          },
                          "amount": {
                            "type": "number",
                            "description": "Amount involved in the transaction",
                            "nullable": false
                          },
                          "fee": {
                            "type": "number",
                            "description": "Fee associated with the transaction",
                            "nullable": false
                          },
                          "description": {
                            "type": "string",
                            "description": "Description of the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "metadata": {
                            "type": "object",
                            "description": "Additional metadata of the transaction",
                            "nullable": true
                          },
                          "referenceId": {
                            "type": "string",
                            "description": "Reference ID of the transaction",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "trxId": {
                            "type": "string",
                            "description": "Transaction ID from the payment processor",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Transactions not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/transaction/{id}": {
      "get": {
        "summary": "Retrieves details of a specific transaction by reference ID",
        "description": "Fetches detailed information about a specific transaction based on its unique reference ID.",
        "operationId": "getTransaction",
        "tags": [
          "Finance",
          "Transactions"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The UUID of the transaction to retrieve",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of the transaction"
                    },
                    "userId": {
                      "type": "string",
                      "description": "ID of the user who created the transaction"
                    },
                    "walletId": {
                      "type": "string",
                      "description": "ID of the wallet associated with the transaction"
                    },
                    "type": {
                      "type": "string",
                      "description": "Type of the transaction"
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the transaction"
                    },
                    "amount": {
                      "type": "number",
                      "description": "Amount of the transaction"
                    },
                    "fee": {
                      "type": "number",
                      "description": "Fee charged for the transaction"
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the transaction"
                    },
                    "metadata": {
                      "type": "object",
                      "description": "Metadata of the transaction"
                    },
                    "referenceId": {
                      "type": "string",
                      "description": "Reference ID of the transaction"
                    },
                    "trxId": {
                      "type": "string",
                      "description": "Transaction ID from the payment processor"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Date and time when the transaction was created"
                    },
                    "updatedAt": {
                      "type": "string",
                      "description": "Date and time when the transaction was last updated"
                    },
                    "wallet": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "ID of the wallet"
                        },
                        "userId": {
                          "type": "string",
                          "description": "ID of the user who owns the wallet"
                        },
                        "currency": {
                          "type": "string",
                          "description": "Currency of the wallet"
                        },
                        "type": {
                          "type": "string",
                          "description": "Type of the wallet"
                        },
                        "balance": {
                          "type": "number",
                          "description": "Current balance of the wallet"
                        },
                        "createdAt": {
                          "type": "string",
                          "description": "Date and time when the wallet was created"
                        },
                        "updatedAt": {
                          "type": "string",
                          "description": "Date and time when the wallet was last updated"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Transaction not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/transfer": {
      "post": {
        "summary": "Performs a transfer transaction",
        "description": "Initiates a transfer transaction for the currently authenticated user",
        "operationId": "createTransfer",
        "tags": [
          "Finance",
          "Transfer"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fromType": {
                    "type": "string",
                    "description": "The type of wallet to transfer from"
                  },
                  "toType": {
                    "type": "string",
                    "description": "The type of wallet to transfer to"
                  },
                  "fromCurrency": {
                    "type": "string",
                    "description": "The currency to transfer from"
                  },
                  "toCurrency": {
                    "type": "string",
                    "description": "The currency to transfer to",
                    "nullable": true
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount to transfer"
                  },
                  "transferType": {
                    "type": "string",
                    "description": "Type of transfer: client or wallet"
                  },
                  "clientId": {
                    "type": "string",
                    "description": "Client UUID for client transfers",
                    "nullable": true
                  }
                },
                "required": [
                  "fromType",
                  "toType",
                  "amount",
                  "fromCurrency",
                  "transferType"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transfer transaction initiated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Withdraw Method not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/wallet": {
      "get": {
        "summary": "Lists all wallets with optional filters",
        "operationId": "listWallets",
        "tags": [
          "Finance",
          "Wallets"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "pnl",
            "in": "query",
            "description": "Fetch PnL data for the last 28 days",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of wallets with pagination metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the wallet",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of the wallet",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "currency": {
                            "type": "string",
                            "description": "Currency of the wallet",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "balance": {
                            "type": "number",
                            "description": "Current balance of the wallet",
                            "nullable": false
                          },
                          "inOrder": {
                            "type": "number",
                            "description": "Amount currently held in orders",
                            "nullable": false
                          },
                          "status": {
                            "type": "boolean",
                            "description": "Status of the wallet (active or inactive)"
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "User ID"
                              },
                              "firstName": {
                                "type": "string",
                                "description": "First name of the user"
                              },
                              "lastName": {
                                "type": "string",
                                "description": "Last name of the user"
                              },
                              "avatar": {
                                "type": "string",
                                "description": "Avatar URL of the user"
                              }
                            }
                          },
                          "transactions": {
                            "type": "array",
                            "description": "List of transactions associated with the wallet",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "Transaction ID"
                                },
                                "amount": {
                                  "type": "number",
                                  "description": "Amount of the transaction"
                                },
                                "fee": {
                                  "type": "number",
                                  "description": "Transaction fee"
                                },
                                "type": {
                                  "type": "string",
                                  "description": "Type of the transaction"
                                },
                                "status": {
                                  "type": "string",
                                  "description": "Status of the transaction"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "description": "Creation date of the transaction"
                                },
                                "metadata": {
                                  "type": "object",
                                  "description": "Metadata of the transaction"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Wallets not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/wallet/options": {
      "get": {
        "summary": "Get wallet types",
        "operationId": "getWalletTypes",
        "tags": [
          "Admin",
          "Wallets"
        ],
        "responses": {
          "200": {
            "description": "Wallet types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "types": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/finance/wallet/symbol": {
      "get": {
        "summary": "Retrieves details of a specific wallet",
        "description": "Fetches detailed information about a specific wallet based on its unique identifier.",
        "operationId": "getWallet",
        "tags": [
          "Finance",
          "Wallets"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "in": "query",
            "name": "type",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ECO",
                "SPOT"
              ]
            },
            "description": "The type of wallet to retrieve"
          },
          {
            "in": "query",
            "name": "currency",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The currency of the wallet to retrieve"
          },
          {
            "in": "query",
            "name": "pair",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The pair of the wallet to retrieve"
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet details retrieved successfully"
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Wallet not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/wallet/transfer-options": {
      "get": {
        "summary": "Get wallet types available for transfers",
        "operationId": "getTransferWalletTypes",
        "tags": [
          "Finance",
          "Transfer",
          "Wallets"
        ],
        "responses": {
          "200": {
            "description": "Available wallet types for transfers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "types": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "enum": [
                              "FIAT",
                              "SPOT",
                              "ECO",
                              "FUTURES"
                            ]
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/finance/wallet/{type}": {
      "get": {
        "summary": "Lists all wallets for a given type",
        "operationId": "listWalletsForType",
        "tags": [
          "Finance",
          "Wallets"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "type",
            "in": "path",
            "description": "Wallet type",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "FIAT",
                "SPOT",
                "ECO",
                "FUTURES"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of wallets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "ID of the wallet",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of the wallet",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "currency": {
                        "type": "string",
                        "description": "Currency of the wallet",
                        "maxLength": 255,
                        "minLength": 0,
                        "nullable": false
                      },
                      "balance": {
                        "type": "number",
                        "description": "Current balance of the wallet",
                        "nullable": false
                      },
                      "inOrder": {
                        "type": "number",
                        "description": "Amount currently held in orders",
                        "nullable": false
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Status of the wallet (active or inactive)"
                      },
                      "user": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "User ID"
                          },
                          "firstName": {
                            "type": "string",
                            "description": "First name of the user"
                          },
                          "lastName": {
                            "type": "string",
                            "description": "Last name of the user"
                          },
                          "avatar": {
                            "type": "string",
                            "description": "Avatar URL of the user"
                          }
                        }
                      },
                      "transactions": {
                        "type": "array",
                        "description": "List of transactions associated with the wallet",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Transaction ID"
                            },
                            "amount": {
                              "type": "number",
                              "description": "Amount of the transaction"
                            },
                            "fee": {
                              "type": "number",
                              "description": "Transaction fee"
                            },
                            "type": {
                              "type": "string",
                              "description": "Type of the transaction"
                            },
                            "status": {
                              "type": "string",
                              "description": "Status of the transaction"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "description": "Creation date of the transaction"
                            },
                            "metadata": {
                              "type": "object",
                              "description": "Metadata of the transaction"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Wallets not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/wallet/{type}/{currency}": {
      "get": {
        "summary": "Retrieves details of a specific wallet",
        "description": "Fetches detailed information about a specific wallet based on its unique identifier.",
        "operationId": "getWallet",
        "tags": [
          "Finance",
          "Wallets"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "type",
            "in": "path",
            "required": true,
            "description": "The type of wallet to retrieve",
            "schema": {
              "type": "string",
              "enum": [
                "FIAT",
                "SPOT",
                "ECO",
                "FUTURES"
              ]
            }
          },
          {
            "index": 1,
            "name": "currency",
            "in": "path",
            "required": true,
            "description": "The currency of the wallet to retrieve",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet details retrieved successfully"
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Wallet not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/withdraw/fiat": {
      "post": {
        "summary": "Performs a custom fiat withdraw transaction",
        "description": "Initiates a custom fiat withdraw transaction for the currently authenticated user",
        "operationId": "createCustomFiatWithdraw",
        "tags": [
          "Wallets"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "methodId": {
                    "type": "string",
                    "description": "Withdraw method ID"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount to withdraw"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency to withdraw"
                  },
                  "customFields": {
                    "type": "object",
                    "description": "Custom data for the withdraw"
                  }
                },
                "required": [
                  "methodId",
                  "amount",
                  "currency",
                  "customFields"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Custom withdraw transaction initiated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transaction": {
                      "type": "object"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "method": {
                      "type": "string"
                    },
                    "balance": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Withdraw Method not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/finance/withdraw/spot": {
      "post": {
        "summary": "Performs a withdraw transaction",
        "description": "Initiates a withdraw transaction for the currently authenticated user",
        "operationId": "createWithdraw",
        "tags": [
          "Wallets"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string",
                    "description": "Currency to withdraw"
                  },
                  "chain": {
                    "type": "string",
                    "description": "Withdraw method ID"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount to withdraw"
                  },
                  "toAddress": {
                    "type": "string",
                    "description": "Withdraw toAddress"
                  }
                },
                "required": [
                  "currency",
                  "chain",
                  "amount",
                  "toAddress"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Withdraw transaction initiated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Withdraw not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/locale/{lng}/{ns}": {
      "post": {
        "summary": "Adds missing translations for the specified language and namespace",
        "operationId": "addTranslations",
        "tags": [
          "Translations"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "lng",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Language code"
          },
          {
            "index": 1,
            "name": "ns",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Namespace"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Translations added successfully"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": []
      }
    },
    "/api/settings": {
      "get": {
        "summary": "Retrieves the application settings",
        "description": "This endpoint retrieves the application settings.",
        "operationId": "getSettings",
        "tags": [
          "Settings"
        ],
        "requiresAuth": false,
        "responses": {
          "200": {
            "description": "Application settings retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string",
                        "description": "Setting key"
                      },
                      "value": {
                        "type": "string",
                        "description": "Setting value"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Settings not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/upload/heic": {
      "post": {
        "summary": "Converts a HEIC image to JPEG format",
        "description": "Converts a HEIC image to JPEG format and returns the file URL",
        "operationId": "convertHeicFile",
        "tags": [
          "Conversion"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dir": {
                    "type": "string",
                    "description": "Directory to save the converted file"
                  },
                  "file": {
                    "type": "string",
                    "description": "Base64 encoded HEIC file data"
                  },
                  "mimeType": {
                    "type": "string",
                    "description": "MIME type of the file"
                  }
                },
                "required": [
                  "dir",
                  "file",
                  "mimeType"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File converted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "URL of the converted file"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Conversion not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/upload": {
      "post": {
        "summary": "Uploads a file to a specified directory",
        "description": "Uploads a file to a specified directory",
        "operationId": "uploadFile",
        "tags": [
          "Upload"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dir": {
                    "type": "string",
                    "description": "Directory to upload file to"
                  },
                  "file": {
                    "type": "string",
                    "description": "Base64 encoded file data"
                  },
                  "height": {
                    "type": "number",
                    "description": "Height of the image"
                  },
                  "width": {
                    "type": "number",
                    "description": "Width of the image"
                  },
                  "oldPath": {
                    "type": "string",
                    "description": "Path of the old image to remove"
                  }
                },
                "required": [
                  "dir",
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File uploaded successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "URL of the uploaded file"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Upload not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/analysis": {
      "post": {
        "summary": "Gets chart data for user analytics (all in POST body)",
        "operationId": "getAnalyticsData",
        "tags": [
          "User",
          "CRM",
          "User",
          "Analytics"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "timeframe": {
                    "type": "string"
                  },
                  "db": {
                    "type": "string"
                  },
                  "keyspace": {
                    "type": "string",
                    "nullable": true
                  },
                  "charts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "line",
                            "bar",
                            "pie",
                            "stackedBar",
                            "stackedArea"
                          ]
                        },
                        "model": {
                          "type": "string"
                        },
                        "metrics": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "kpis": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "metric": {
                          "type": "string"
                        },
                        "model": {
                          "type": "string"
                        },
                        "icon": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "modelConfig": {
                    "type": "object"
                  }
                },
                "required": [
                  "model",
                  "timeframe",
                  "charts",
                  "kpis"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Analytics data object matching your shape (kpis + chart keys)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kpis": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "value": {
                            "type": "number"
                          },
                          "change": {
                            "type": "number"
                          },
                          "trend": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "date": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "number"
                                }
                              }
                            }
                          },
                          "icon": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized access"
          }
        },
        "requiresAuth": true,
        "permission": "access.admin.dashboard",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/api-key": {
      "get": {
        "summary": "Lists all API keys",
        "description": "Retrieves all API keys associated with the authenticated user.",
        "operationId": "listApiKeys",
        "tags": [
          "API Key Management"
        ],
        "responses": {
          "200": {
            "description": "API keys retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "key": {
                        "type": "string"
                      },
                      "permissions": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "ipWhitelist": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Server error"
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Creates a new API key",
        "description": "Generates a new API key for the authenticated user.",
        "operationId": "createApiKey",
        "tags": [
          "API Key Management"
        ],
        "requestBody": {
          "description": "Data required to create a new API key",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the API key"
                  },
                  "permissions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Permissions associated with the API key"
                  },
                  "ipWhitelist": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "IP addresses whitelisted for the API key"
                  },
                  "ipRestriction": {
                    "type": "boolean",
                    "description": "Restrict access to specific IPs (true) or allow unrestricted access (false)"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "API key created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ipWhitelist": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ipRestriction": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "API key limit reached"
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Server error"
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/api-key/{id}": {
      "del": {
        "summary": "Deletes an API key",
        "description": "Deletes an API key by its ID.",
        "operationId": "deleteApiKey",
        "tags": [
          "API Key Management"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the API key to delete",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API key deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "API key not found"
          },
          "500": {
            "description": "Server error"
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "summary": "Updates an API key",
        "description": "Updates an API key's details such as permissions, IP whitelist, or IP restriction.",
        "operationId": "updateApiKey",
        "tags": [
          "API Key Management"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the API key to update",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Data for updating the API key",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "permissions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Updated permissions associated with the API key"
                  },
                  "ipWhitelist": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Updated IP whitelist for the API key"
                  },
                  "ipRestriction": {
                    "type": "boolean",
                    "description": "Updated IP restriction setting (true for restricted, false for unrestricted)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "API key updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ipWhitelist": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "ipRestriction": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "API key not found"
          },
          "500": {
            "description": "Server error"
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/kyc/application": {
      "get": {
        "summary": "Retrieves all KYC applications for the logged-in user",
        "description": "Fetches all Know Your Customer (KYC) applications for the currently authenticated user. This endpoint requires user authentication and returns an array with the user’s KYC application information, including the verification status and other details.",
        "operationId": "getUserKycApplications",
        "tags": [
          "KYC"
        ],
        "responses": {
          "200": {
            "description": "KYC applications retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number",
                        "description": "KYC ID"
                      },
                      "userId": {
                        "type": "number",
                        "description": "User ID associated with the KYC record"
                      },
                      "templateId": {
                        "type": "number",
                        "description": "ID of the KYC template used"
                      },
                      "data": {
                        "type": "object",
                        "description": "KYC data as a JSON object",
                        "nullable": true
                      },
                      "status": {
                        "type": "string",
                        "description": "Current status of the KYC verification",
                        "enum": [
                          "PENDING",
                          "APPROVED",
                          "REJECTED"
                        ]
                      },
                      "level": {
                        "type": "number",
                        "description": "Verification level"
                      },
                      "notes": {
                        "type": "string",
                        "description": "Administrative notes, if any",
                        "nullable": true
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Timestamp when the KYC record was created"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Timestamp when the KYC record was last updated"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Kyc not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Submit a KYC Application",
        "description": "Submits a new KYC application for the authenticated user. Expects a JSON payload with a valid levelId and a 'fields' object containing key/value pairs for each field as defined in the KYC level configuration.",
        "operationId": "submitKycApplication",
        "tags": [
          "KYC",
          "Application"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "levelId": {
                    "type": "string",
                    "description": "ID of the KYC level for this application"
                  },
                  "fields": {
                    "type": "object",
                    "description": "An object where keys are field IDs and values are the submitted data"
                  }
                },
                "required": [
                  "levelId",
                  "fields"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "KYC application submitted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "application": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "KYC Level not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/kyc/application/{id}": {
      "get": {
        "summary": "Retrieves a KYC application for the logged-in user",
        "description": "Fetches a specific Know Your Customer (KYC) application, identified by ID, for the currently authenticated user. This endpoint requires user authentication and returns the KYC application details, including the verification status and other information.",
        "operationId": "getUserKycApplication",
        "tags": [
          "KYC"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "The ID of the KYC record to retrieve",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "KYC application retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number",
                      "description": "KYC ID"
                    },
                    "userId": {
                      "type": "number",
                      "description": "User ID associated with the KYC record"
                    },
                    "templateId": {
                      "type": "number",
                      "description": "ID of the KYC template used"
                    },
                    "data": {
                      "type": "object",
                      "description": "KYC data as a JSON object",
                      "nullable": true
                    },
                    "status": {
                      "type": "string",
                      "description": "Current status of the KYC verification",
                      "enum": [
                        "PENDING",
                        "APPROVED",
                        "REJECTED"
                      ]
                    },
                    "level": {
                      "type": "number",
                      "description": "Verification level"
                    },
                    "notes": {
                      "type": "string",
                      "description": "Administrative notes, if any",
                      "nullable": true
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp when the KYC record was created"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Timestamp when the KYC record was last updated"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Kyc not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "summary": "Update a KYC Application",
        "description": "Updates an existing KYC application for the authenticated user. Expects a JSON payload with a 'fields' object containing key/value pairs for each field as defined in the KYC level configuration. The application to update is identified by the 'id' parameter in the path. The level is derived from the existing application record.",
        "operationId": "updateKycApplication",
        "tags": [
          "KYC",
          "Application"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "The ID of the KYC application to update",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fields": {
                    "type": "object",
                    "description": "An object where keys are field IDs and values are the submitted data"
                  }
                },
                "required": [
                  "fields"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "KYC application updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "application": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "KYC Application not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/kyc/level": {
      "get": {
        "summary": "Lists the active KYC levels",
        "description": "Fetches all currently active KYC (Know Your Customer) levels that are used for KYC processes. This endpoint is accessible without authentication and returns an array of levels that are marked as active in the system.",
        "operationId": "getActiveKycLevels",
        "tags": [
          "KYC"
        ],
        "responses": {
          "200": {
            "description": "Active KYC levels retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "number",
                        "description": "Level ID"
                      },
                      "title": {
                        "type": "string",
                        "description": "Level title"
                      },
                      "options": {
                        "type": "object",
                        "description": "Level options as JSON object",
                        "nullable": true
                      },
                      "status": {
                        "type": "boolean",
                        "description": "Active status of the level"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Kyc Level not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": false,
        "security": []
      }
    },
    "/api/user/kyc/level/{id}": {
      "get": {
        "summary": "Fetch a specific active KYC level by ID",
        "description": "Fetches an active KYC (Know Your Customer) level by its ID. This endpoint requires authentication.",
        "operationId": "getKycLevelById",
        "tags": [
          "KYC"
        ],
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "The ID of the KYC level to retrieve",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "KYC level retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "number",
                      "description": "Level ID"
                    },
                    "title": {
                      "type": "string",
                      "description": "Level title"
                    },
                    "options": {
                      "type": "object",
                      "description": "Level options as JSON object",
                      "nullable": true
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Active status of the level"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "KYC Level not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/notification": {
      "del": {
        "summary": "Delete All Notifications",
        "description": "Deletes all notifications for the authenticated creator.",
        "operationId": "deleteAllNotifications",
        "tags": [
          "ICO",
          "Creator",
          "Notifications"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "All notifications deleted successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "Get Notifications for Creator",
        "description": "Retrieves notifications for the authenticated creator along with aggregated statistics.",
        "operationId": "getCreatorNotifications",
        "tags": [
          "ICO",
          "Creator",
          "Notifications"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Notifications retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "notifications": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "stats": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "unread": {
                          "type": "number"
                        },
                        "types": {
                          "type": "object",
                          "properties": {
                            "investment": {
                              "type": "number"
                            },
                            "message": {
                              "type": "number"
                            },
                            "alert": {
                              "type": "number"
                            },
                            "system": {
                              "type": "number"
                            },
                            "user": {
                              "type": "number"
                            }
                          }
                        },
                        "trend": {
                          "type": "object",
                          "properties": {
                            "percentage": {
                              "type": "number"
                            },
                            "increasing": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/notification/mark-all-read": {
      "post": {
        "summary": "Mark All Notifications as Read",
        "description": "Marks all notifications as read for the authenticated creator.",
        "operationId": "markAllNotificationsRead",
        "tags": [
          "ICO",
          "Creator",
          "Notifications"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "All notifications marked as read successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/notification/{id}": {
      "del": {
        "summary": "Delete a Notification",
        "description": "Deletes the specified notification for the authenticated creator.",
        "operationId": "deleteNotification",
        "tags": [
          "ICO",
          "Creator",
          "Notifications"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Notification ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notification deleted successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Notification not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/notification/{id}/read": {
      "post": {
        "summary": "Mark Notification as Read",
        "description": "Marks the specified notification as read for the authenticated creator.",
        "operationId": "markNotificationRead",
        "tags": [
          "ICO",
          "Creator",
          "Notifications"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Notification ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notification marked as read successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Notification not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/notification/{id}/unread": {
      "post": {
        "summary": "Mark Notification as Unread",
        "description": "Marks the specified notification as unread for the authenticated creator.",
        "operationId": "markNotificationUnread",
        "tags": [
          "ICO",
          "Creator",
          "Notifications"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "description": "Notification ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notification marked as unread successfully."
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Notification not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/phone/send": {
      "post": {
        "summary": "Send phone verification code",
        "operationId": "sendPhoneVerificationCode",
        "tags": [
          "User",
          "Phone"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phoneNumber": {
                    "type": "string",
                    "description": "Phone number to verify"
                  }
                },
                "required": [
                  "phoneNumber"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Code sent"
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/phone/verify": {
      "post": {
        "summary": "Verify phone number with code",
        "operationId": "verifyPhoneNumber",
        "tags": [
          "User",
          "Phone"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Verification code sent to phone"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Phone verified"
          },
          "400": {
            "description": "Invalid or expired code"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/profile": {
      "get": {
        "summary": "Retrieves the profile of the current user",
        "description": "Fetches the profile of the currently authenticated user",
        "operationId": "getProfile",
        "tags": [
          "Auth"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "User profile retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID of the user"
                    },
                    "email": {
                      "type": "string",
                      "description": "Email of the user"
                    },
                    "firstName": {
                      "type": "string",
                      "description": "First name of the user"
                    },
                    "lastName": {
                      "type": "string",
                      "description": "Last name of the user"
                    },
                    "role": {
                      "type": "string",
                      "description": "Role of the user"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Date and time when the user was created"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Date and time when the user was last updated"
                    },
                    "featureAccess": {
                      "type": "array",
                      "description": "List of feature ids enabled for this user's KYC level",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "firstName",
                    "lastName",
                    "role",
                    "createdAt",
                    "updatedAt",
                    "featureAccess"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "summary": "Updates the profile of the current user",
        "description": "Updates the profile of the currently authenticated user",
        "operationId": "updateProfile",
        "tags": [
          "Auth"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": {
                    "type": "string",
                    "description": "First name of the user"
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name of the user"
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Metadata of the user"
                  },
                  "avatar": {
                    "type": "string",
                    "description": "Avatar of the user",
                    "nullable": true
                  },
                  "phone": {
                    "type": "string",
                    "description": "Phone number of the user"
                  },
                  "twoFactor": {
                    "type": "boolean",
                    "description": "Two-factor authentication status"
                  },
                  "profile": {
                    "type": "object",
                    "properties": {
                      "bio": {
                        "type": "string",
                        "description": "User bio"
                      },
                      "location": {
                        "type": "object",
                        "properties": {
                          "address": {
                            "type": "string",
                            "description": "User address"
                          },
                          "city": {
                            "type": "string",
                            "description": "User city"
                          },
                          "country": {
                            "type": "string",
                            "description": "User country"
                          },
                          "zip": {
                            "type": "string",
                            "description": "User zip code"
                          }
                        }
                      },
                      "social": {
                        "type": "object",
                        "properties": {
                          "twitter": {
                            "type": "string",
                            "description": "Twitter profile"
                          },
                          "dribbble": {
                            "type": "string",
                            "description": "Dribbble profile"
                          },
                          "instagram": {
                            "type": "string",
                            "description": "Instagram profile"
                          },
                          "github": {
                            "type": "string",
                            "description": "GitHub profile"
                          },
                          "gitlab": {
                            "type": "string",
                            "description": "GitLab profile"
                          },
                          "telegram": {
                            "type": "string",
                            "description": "Telegram username"
                          }
                        }
                      }
                    }
                  },
                  "settings": {
                    "type": "object",
                    "description": "Notification settings for the user",
                    "properties": {
                      "email": {
                        "type": "boolean",
                        "description": "Email notifications enabled or disabled"
                      },
                      "sms": {
                        "type": "boolean",
                        "description": "SMS notifications enabled or disabled"
                      },
                      "push": {
                        "type": "boolean",
                        "description": "Push notifications enabled or disabled"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User profile updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/profile/otp": {
      "post": {
        "summary": "Saves the OTP configuration for the user and generates recovery codes",
        "operationId": "saveOTP",
        "description": "Saves the OTP configuration for the user and generates 12 recovery codes for recovery",
        "tags": [
          "Profile"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "secret": {
                    "type": "string",
                    "description": "OTP secret"
                  },
                  "type": {
                    "type": "string",
                    "description": "Type of OTP",
                    "enum": [
                      "SMS",
                      "APP"
                    ]
                  }
                },
                "required": [
                  "secret",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP configuration and recovery codes saved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "example": 200
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "Success message"
                        },
                        "recoveryCodes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Array of generated recovery codes"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/profile/otp/secret": {
      "post": {
        "summary": "Generates an OTP secret and sends OTP via SMS or generates a QR code for OTP APP",
        "description": "Generates an OTP secret and sends OTP via SMS or generates a QR code for OTP APP",
        "operationId": "generateOTPSecret",
        "tags": [
          "Profile"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Type of OTP to generate",
                    "enum": [
                      "SMS",
                      "APP"
                    ]
                  },
                  "phoneNumber": {
                    "type": "string",
                    "description": "Phone number to send the OTP to"
                  },
                  "email": {
                    "type": "string",
                    "description": "Email to generate the QR code for OTP APP"
                  }
                },
                "required": [
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP secret generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "example": 200
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "secret": {
                          "type": "string",
                          "description": "OTP secret"
                        },
                        "qrCode": {
                          "type": "string",
                          "description": "QR code for OTP APP"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/profile/otp/status": {
      "post": {
        "summary": "Toggles the OTP feature for the user account",
        "operationId": "toggleOTP",
        "description": "Toggles the OTP feature for the user account",
        "tags": [
          "Profile"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "boolean",
                    "description": "Status of the OTP feature"
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP feature toggled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "example": 200
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "Message indicating the status of the OTP feature"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/profile/otp/verify": {
      "post": {
        "summary": "Verifies an OTP with the provided secret and type, and saves it if valid",
        "operationId": "verifyOTP",
        "description": "Verifies an OTP with the provided secret and type, and saves it if valid",
        "tags": [
          "Profile"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "otp": {
                    "type": "string",
                    "description": "OTP to verify"
                  },
                  "secret": {
                    "type": "string",
                    "description": "OTP secret"
                  },
                  "type": {
                    "type": "string",
                    "description": "Type of OTP",
                    "enum": [
                      "SMS",
                      "APP"
                    ]
                  }
                },
                "required": [
                  "otp",
                  "secret",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP verified and saved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "example": 200
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "Message indicating the status of the OTP verification"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/profile/wallet/connect": {
      "post": {
        "summary": "Registers a wallet address for the user",
        "description": "Registers a wallet address for the authenticated user",
        "operationId": "registerWallet",
        "tags": [
          "Auth"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Wallet address"
                  },
                  "chainId": {
                    "type": "number",
                    "description": "Blockchain chain ID"
                  }
                },
                "required": [
                  "address",
                  "chainId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wallet address registered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g., missing address or chainId)"
          },
          "401": {
            "description": "Unauthorized (e.g., user not authenticated)"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/profile/wallet/disconnect": {
      "post": {
        "summary": "Disconnects a wallet address for the user",
        "description": "Disconnects a wallet address for the authenticated user and removes the record from providerUser",
        "operationId": "disconnectWallet",
        "tags": [
          "Auth"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Wallet address"
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wallet address disconnected successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Success message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (e.g., missing address)"
          },
          "401": {
            "description": "Unauthorized (e.g., user not authenticated)"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/support/chat": {
      "del": {
        "summary": "End a live chat session",
        "description": "Ends the live chat session and closes the ticket",
        "operationId": "endLiveChat",
        "tags": [
          "Support"
        ],
        "requiresAuth": true,
        "requestBody": {
          "description": "Session to end",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sessionId": {
                    "type": "string"
                  }
                },
                "required": [
                  "sessionId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Live Chat Session updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Live Chat Session not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "Retrieves or creates a live chat ticket",
        "description": "Fetches the existing live chat ticket for the authenticated user, or creates a new one if none exists.",
        "operationId": "getOrCreateLiveChat",
        "tags": [
          "Support"
        ],
        "requiresAuth": true,
        "responses": {
          "200": {
            "description": "Support Ticket created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Send a message in live chat session",
        "description": "Sends a message to the live chat session",
        "operationId": "sendLiveChatMessage",
        "tags": [
          "Support"
        ],
        "requiresAuth": true,
        "requestBody": {
          "description": "The message to send",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sessionId": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string"
                  },
                  "sender": {
                    "type": "string",
                    "enum": [
                      "user",
                      "agent"
                    ]
                  }
                },
                "required": [
                  "sessionId",
                  "content",
                  "sender"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Live Chat Message updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Live Chat Message not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/support/ticket": {
      "get": {
        "summary": "Lists all tickets for the logged-in user",
        "operationId": "listTickets",
        "tags": [
          "Support"
        ],
        "description": "Fetches all support tickets associated with the currently authenticated user.",
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "description": "Filter criteria for records.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "description": "Number of records per page. Default: 10.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number. Default: 1.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "description": "Field name to sort by.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Order of sorting: asc or desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "showDeleted",
            "in": "query",
            "description": "Show deleted records. Default: false.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Posts retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "ID of the support ticket",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": true
                          },
                          "userId": {
                            "type": "string",
                            "description": "ID of the user who created the ticket",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "agentId": {
                            "type": "string",
                            "description": "ID of the agent assigned to the ticket",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "messages": {
                            "type": "object",
                            "description": "Messages associated with the chat"
                          },
                          "subject": {
                            "type": "string",
                            "description": "Subject of the ticket",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "importance": {
                            "type": "string",
                            "description": "Importance of the ticket",
                            "maxLength": 255,
                            "minLength": 0,
                            "nullable": false
                          },
                          "status": {
                            "type": "string",
                            "description": "Status of the ticket",
                            "enum": [
                              "PENDING",
                              "OPEN",
                              "REPLIED",
                              "CLOSED"
                            ]
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of the ticket",
                            "enum": [
                              "LIVE",
                              "TICKET"
                            ]
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "totalItems": {
                          "type": "integer",
                          "description": "Total number of users"
                        },
                        "currentPage": {
                          "type": "integer",
                          "description": "Current page number"
                        },
                        "perPage": {
                          "type": "integer",
                          "description": "Number of users per page"
                        },
                        "totalPages": {
                          "type": "integer",
                          "description": "Total number of pages"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Support Ticket not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "requiresAuth": true,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Creates a new support ticket",
        "description": "Creates a new support ticket for the currently authenticated user",
        "operationId": "createTicket",
        "tags": [
          "Support"
        ],
        "requiresAuth": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subject": {
                    "type": "string",
                    "description": "Subject of the ticket"
                  },
                  "message": {
                    "type": "string",
                    "description": "Content of the ticket"
                  },
                  "importance": {
                    "type": "string",
                    "enum": [
                      "LOW",
                      "MEDIUM",
                      "HIGH"
                    ]
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Ticket tags (optional)"
                  }
                },
                "required": [
                  "subject",
                  "message",
                  "importance"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Support Ticket created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/support/ticket/{id}/close": {
      "put": {
        "summary": "Closes a support ticket",
        "description": "Closes a support ticket identified by its UUID.",
        "operationId": "closeTicket",
        "tags": [
          "Support"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The UUID of the ticket to close",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Support Ticket updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Support Ticket not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/support/ticket/{id}": {
      "get": {
        "summary": "Retrieves a single ticket details for the logged-in user",
        "description": "Fetches detailed information about a specific support ticket identified by its ID, including associated chat details.",
        "operationId": "getTicket",
        "tags": [
          "Support"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the ticket to retrieve",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "statusCode": {
                      "type": "number",
                      "description": "HTTP status code",
                      "example": 200
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "ID of the ticket"
                        },
                        "userId": {
                          "type": "string",
                          "description": "ID of the user who created the ticket"
                        },
                        "agentId": {
                          "type": "string",
                          "description": "ID of the agent assigned to the ticket"
                        },
                        "subject": {
                          "type": "string",
                          "description": "Subject of the ticket"
                        },
                        "importance": {
                          "type": "string",
                          "description": "Importance level of the ticket"
                        },
                        "status": {
                          "type": "string",
                          "description": "Status of the ticket"
                        },
                        "messages": {
                          "type": "object",
                          "description": "Messages associated with the chat"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Date and time the ticket was created"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Date and time the ticket was updated"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Support Ticket not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Reply to a support ticket",
        "description": "Reply to a support ticket identified by its UUID.",
        "operationId": "replyTicket",
        "tags": [
          "Support"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The UUID of the ticket to reply to",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The message to send",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "client",
                      "agent"
                    ]
                  },
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "userId": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "attachment": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "time",
                  "userId",
                  "text"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Support Ticket updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Support Ticket not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/api/user/support/ticket/{id}/review": {
      "put": {
        "summary": "Set satisfaction rating for a ticket",
        "description": "Allows the ticket owner to submit a satisfaction rating (1-5)",
        "operationId": "reviewTicket",
        "tags": [
          "Support"
        ],
        "requiresAuth": true,
        "parameters": [
          {
            "index": 0,
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The UUID of the ticket to review",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The satisfaction rating",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "satisfaction": {
                    "type": "number"
                  }
                },
                "required": [
                  "satisfaction"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Support Ticket updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, admin permission required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Support Ticket not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {},
    "responses": {},
    "parameters": {},
    "requestBodies": {},
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    }
  },
  "tags": []
}