{
  "swagger": "2.0",
  "info": {
    "description": "A RESTful API for Todo management built with Go and PostgreSQL",
    "title": "Go Boilerplate Beginner Project",
    "termsOfService": "http://swagger.io/terms/",
    "contact": {
      "name": "API Support",
      "url": "http://www.example.com/support",
      "email": "support@example.com"
    },
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    },
    "version": "1.0"
  },
  "host": "localhost:8080",
  "basePath": "/api/v1",
  "paths": {
    "/auth/login": {
      "post": {
        "description": "Login a user with the provided credentials",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "auth"
        ],
        "summary": "Login a user",
        "parameters": [
          {
            "description": "User login data",
            "name": "user",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/dtos.LoginUserDto"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User logged in successfully",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "401": {
            "description": "Invalid credentials",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          }
        }
      }
    },
    "/auth/register": {
      "post": {
        "description": "Register a new user with the provided details",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "auth"
        ],
        "summary": "Register a new user",
        "parameters": [
          {
            "description": "User registration data",
            "name": "user",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/dtos.RegisterUserDto"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "User registered successfully",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          }
        }
      }
    },
    "/todo/create-todo-item": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Create a new Todo Item with the provided details",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "todo"
        ],
        "summary": "Create a new Todo Item",
        "parameters": [
          {
            "description": "Todo item data",
            "name": "todo",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/dtos.CreateTodoItemDto"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Todo item created successfully",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          }
        }
      }
    },
    "/todo/create-todo-note": {
      "post": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Create a new Todo Note for an existing Todo Item",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "todo"
        ],
        "summary": "Create a new Todo Note",
        "parameters": [
          {
            "description": "Todo note data",
            "name": "todo",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/dtos.CreateTodoNoteDto"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Todo note created successfully",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          }
        }
      }
    },
    "/todo/delete-todo-item": {
      "delete": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Delete an existing Todo Item by ID",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "todo"
        ],
        "summary": "Delete an existing Todo Item",
        "parameters": [
          {
            "description": "Todo item deletion data",
            "name": "todo",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/dtos.DeleteTodoItemDto"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Todo item deleted successfully",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          }
        }
      }
    },
    "/todo/get-todos": {
      "get": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Get all Todo Items from the database",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "todo"
        ],
        "summary": "Get all Todo Items",
        "responses": {
          "200": {
            "description": "Todo items retrieved successfully",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          }
        }
      }
    },
    "/todo/update-todo-item": {
      "put": {
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Update an existing Todo Item with the provided details",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "tags": [
          "todo"
        ],
        "summary": "Update an existing Todo Item",
        "parameters": [
          {
            "description": "Todo item update data",
            "name": "todo",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/dtos.UpdateTodoItemDto"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Todo item updated successfully",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          },
          "500": {
            "description": "Internal server error",
            "schema": {
              "$ref": "#/definitions/dtos.StructuredResponse"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "dtos.CreateTodoItemDto": {
      "description": "Data for creating a new todo item",
      "type": "object",
      "properties": {
        "description": {
          "description": "Optional description with details (max 255 characters)\n@example Milk, eggs, bread, and cheese",
          "type": "string",
          "maxLength": 255,
          "example": "Milk, eggs, bread, and cheese"
        },
        "title": {
          "description": "Title of the todo item (3-255 characters)\n@example Buy groceries",
          "type": "string",
          "example": "Buy groceries"
        },
        "userId": {
          "description": "User ID associated with the todo item\n@example 1",
          "type": "integer",
          "example": 1
        }
      }
    },
    "dtos.CreateTodoNoteDto": {
      "description": "Data for creating a new note attached to a todo item",
      "type": "object",
      "properties": {
        "note": {
          "description": "Content of the note\n@example Don't forget to check expiration dates",
          "type": "string",
          "example": "Don't forget to check expiration dates"
        },
        "todoItemId": {
          "description": "ID of the todo item this note belongs to\n@example 1",
          "type": "integer",
          "example": 1
        }
      }
    },
    "dtos.DeleteTodoItemDto": {
      "type": "object",
      "properties": {
        "id": {
          "description": "ID of the todo item to delete\n@example 1",
          "type": "integer",
          "example": 1
        }
      }
    },
    "dtos.LoginUserDto": {
      "description": "Login credentials for authenticating a user",
      "type": "object",
      "required": [
        "email",
        "password"
      ],
      "properties": {
        "email": {
          "description": "User's email address\n@example john.doe@example.com",
          "type": "string",
          "example": "john.doe@example.com"
        },
        "password": {
          "description": "User's password\n@example SecureP@ssw0rd",
          "type": "string",
          "example": "SecureP@ssw0rd"
        }
      }
    },
    "dtos.RegisterUserDto": {
      "description": "Registration data for creating a new user account",
      "type": "object",
      "required": [
        "confirmPassword",
        "email",
        "name",
        "password"
      ],
      "properties": {
        "confirmPassword": {
          "description": "Confirmation of the password\n@example SecureP@ssw0rd",
          "type": "string",
          "example": "SecureP@ssw0rd"
        },
        "email": {
          "description": "User's email address\n@example john.doe@example.com",
          "type": "string",
          "example": "john.doe@example.com"
        },
        "name": {
          "description": "User's full name\n@example John Doe",
          "type": "string",
          "example": "John Doe"
        },
        "password": {
          "description": "User's password (min 8 characters)\n@example SecureP@ssw0rd",
          "type": "string",
          "example": "SecureP@ssw0rd"
        }
      }
    },
    "dtos.StructuredResponse": {
      "description": "Standard response format containing success status, HTTP status code, message, and optional payload",
      "type": "object",
      "properties": {
        "message": {
          "description": "Human-readable message\n@example Operation completed successfully",
          "type": "string",
          "example": "Operation completed successfully"
        },
        "payload": {
          "description": "Optional payload containing response data\n@example {\"id\":1,\"name\":\"Example Item\"}"
        },
        "status": {
          "description": "HTTP status code\n@example 200",
          "type": "integer",
          "example": 200
        },
        "success": {
          "description": "Whether the operation was successful\n@example true",
          "type": "boolean",
          "example": true
        }
      }
    },
    "dtos.UpdateTodoItemDto": {
      "description": "Data for updating an existing todo item",
      "type": "object",
      "properties": {
        "description": {
          "description": "Updated description (max 255 characters)\n@example Milk, eggs, bread, cheese, and cleaning supplies",
          "type": "string",
          "maxLength": 255,
          "example": "Milk, eggs, bread, cheese, and cleaning supplies"
        },
        "id": {
          "description": "ID of the todo item to update\n@example 1",
          "type": "integer",
          "example": 1
        },
        "isCompleted": {
          "description": "Updated completion status\n@example true",
          "type": "boolean",
          "example": true
        },
        "title": {
          "description": "Updated title (3-255 characters)\n@example Buy groceries and household items",
          "type": "string",
          "example": "Buy groceries and household items"
        },
        "userId": {
          "description": "User ID associated with the todo item\n@example 1",
          "type": "integer",
          "example": 1
        }
      }
    }
  },
  "securityDefinitions": {
    "BearerAuth": {
      "description": "Enter the token with the `Bearer: ` prefix, e.g. 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'",
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  }
}