{
  "schemes": ["http", "https"],
  "swagger": "2.0",
  "info": {
    "description": "Elysian Backend API provides user authentication, management, and health check endpoints. Built with Go and Gin framework.",
    "title": "Elysian Backend API",
    "termsOfService": "http://swagger.io/terms/",
    "contact": {
      "name": "API Support",
      "url": "http://www.swagger.io/support",
      "email": "support@swagger.io"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.0"
  },
  "host": "localhost:7777",
  "basePath": "/",
  "paths": {
    "/api/v1/auth/login": {
      "post": {
        "description": "Login with email and password",
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "tags": ["auth"],
        "summary": "Login",
        "parameters": [
          {
            "description": "Login Request",
            "name": "request",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/auth.LoginRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/handler.AuthResponse"
            }
          },
          "400": {
            "description": "Bad Request",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          }
        }
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "description": "Logout user",
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "tags": ["auth"],
        "summary": "Logout",
        "parameters": [
          {
            "description": "Logout Request",
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/handler.LogoutRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/handler.SuccessResponse"
            }
          }
        }
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "description": "Refresh access token using refresh token",
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "tags": ["auth"],
        "summary": "Refresh Access Token",
        "parameters": [
          {
            "description": "Refresh Token Request",
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/handler.RefreshTokenRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/handler.AuthResponse"
            }
          },
          "400": {
            "description": "Bad Request",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          }
        }
      }
    },
    "/api/v1/auth/register": {
      "post": {
        "description": "Register a new user with email and password",
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "tags": ["auth"],
        "summary": "Register a new user",
        "parameters": [
          {
            "description": "Register Request",
            "name": "request",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/auth.RegisterRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/handler.AuthResponse"
            }
          },
          "400": {
            "description": "Bad Request",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          },
          "409": {
            "description": "Conflict",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          }
        }
      }
    },
    "/api/v1/ping": {
      "get": {
        "description": "Simple ping endpoint",
        "produces": ["application/json"],
        "tags": ["health"],
        "summary": "Ping",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/handler.PingResponse"
            }
          }
        }
      }
    },
    "/api/v1/users": {
      "get": {
        "description": "Get list of users",
        "produces": ["application/json"],
        "tags": ["users"],
        "summary": "List users",
        "parameters": [
          {
            "type": "integer",
            "description": "Limit",
            "name": "limit",
            "in": "query"
          },
          {
            "type": "integer",
            "description": "Offset",
            "name": "offset",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/handler.UserListResponse"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          }
        }
      }
    },
    "/api/v1/users/email/{email}": {
      "get": {
        "description": "Get user details by email",
        "produces": ["application/json"],
        "tags": ["users"],
        "summary": "Get user by email",
        "parameters": [
          {
            "type": "string",
            "description": "User Email",
            "name": "email",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/domain.User"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          }
        }
      }
    },
    "/api/v1/users/me": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get details of currently logged in user",
        "produces": ["application/json"],
        "tags": ["users"],
        "summary": "Get current user",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/handler.UserResponse"
            }
          }
        }
      },
      "put": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Update details of currently logged in user",
        "consumes": ["application/json"],
        "produces": ["application/json"],
        "tags": ["users"],
        "summary": "Update current user",
        "parameters": [
          {
            "description": "Update Request",
            "name": "request",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/handler.UpdateUserRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/handler.UpdateUserResponse"
            }
          },
          "400": {
            "description": "Bad Request",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          }
        }
      },
      "delete": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Delete currently logged in user account",
        "produces": ["application/json"],
        "tags": ["users"],
        "summary": "Delete current user",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/handler.SuccessResponse"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          }
        }
      }
    },
    "/api/v1/users/{id}": {
      "get": {
        "description": "Get user details by ID",
        "produces": ["application/json"],
        "tags": ["users"],
        "summary": "Get user by ID",
        "parameters": [
          {
            "type": "string",
            "description": "User ID",
            "name": "id",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/domain.User"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/handler.ErrorResponse"
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "description": "Check the health of the application (database and cache)",
        "produces": ["application/json"],
        "tags": ["health"],
        "summary": "Health Check",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/handler.HealthResponse"
            }
          },
          "503": {
            "description": "Service Unavailable",
            "schema": {
              "$ref": "#/definitions/handler.HealthResponse"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "auth.LoginRequest": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    },
    "auth.RegisterRequest": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    },
    "domain.User": {
      "type": "object",
      "properties": {
        "avatar_url": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "deleted_at": {
          "type": "string",
          "format": "date-time"
        },
        "email": {
          "type": "string"
        },
        "email_verified_at": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "is_active": {
          "type": "boolean"
        },
        "last_login_at": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      }
    },
    "handler.AuthResponse": {
      "type": "object",
      "properties": {
        "access_token": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "refresh_token": {
          "type": "string"
        },
        "user": {
          "$ref": "#/definitions/domain.User"
        }
      }
    },
    "handler.CacheHealthResponse": {
      "type": "object",
      "properties": {
        "healthy": {
          "type": "boolean"
        },
        "stats": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "handler.DatabaseHealthResponse": {
      "type": "object",
      "properties": {
        "healthy": {
          "type": "boolean"
        },
        "stats": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "handler.ErrorResponse": {
      "type": "object",
      "properties": {
        "details": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "error": {
          "type": "string"
        }
      }
    },
    "handler.HealthResponse": {
      "type": "object",
      "properties": {
        "cache": {
          "$ref": "#/definitions/handler.CacheHealthResponse"
        },
        "database": {
          "$ref": "#/definitions/handler.DatabaseHealthResponse"
        },
        "environment": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "timestamp": {
          "type": "integer"
        }
      }
    },
    "handler.LogoutRequest": {
      "type": "object",
      "properties": {
        "refresh_token": {
          "type": "string"
        }
      }
    },
    "handler.Meta": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer"
        },
        "offset": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        }
      }
    },
    "handler.PingResponse": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },
    "handler.RefreshTokenRequest": {
      "type": "object",
      "required": ["refresh_token"],
      "properties": {
        "refresh_token": {
          "type": "string"
        }
      }
    },
    "handler.SuccessResponse": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        }
      }
    },
    "handler.UpdateUserRequest": {
      "type": "object",
      "properties": {
        "avatar_url": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "maxLength": 100,
          "minLength": 2
        }
      }
    },
    "handler.UpdateUserResponse": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "user": {
          "$ref": "#/definitions/handler.UserResponse"
        }
      }
    },
    "handler.UserListResponse": {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/domain.User"
          }
        },
        "meta": {
          "$ref": "#/definitions/handler.Meta"
        }
      }
    },
    "handler.UserResponse": {
      "type": "object",
      "properties": {
        "avatar_url": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "is_active": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        }
      }
    }
  },
  "securityDefinitions": {
    "BearerAuth": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  }
}
