{
  "openapi": "3.0.0",
  "info": {
    "title": "PMS API - Auth",
    "version": "1.0.0",
    "description": "API documentation for Authentication endpoints"
  },
  "servers": [
    {
      "url": "http://localhost:5000",
      "description": "Local server"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "paths": {
    "/api/auth/register": {
      "post": {
        "tags": ["Auth"],
        "summary": "Register a new user",
        "security": [{ "bearerAuth": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "firstName": { "type": "string", "example": "Rohit" },
                  "lastName": { "type": "string", "example": "Jain" },
                  "email": { "type": "string", "format": "email", "example": "rohit243@gmail.com" },
                  "password": { "type": "string", "example": "Rohit@1234" },
                  "phone": { "type": "string", "example": "9549230331" },
                  "roleSlug": { "type": "string", "example": "admin" },
                  "availability": { "type": "string", "example": "full-time" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Successful operation" }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": ["Auth"],
        "summary": "Login user",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": { "type": "string", "format": "email", "example": "admin@pms.com" },
                  "password": { "type": "string", "example": "Admin@pms123" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Successful operation" }
        }
      }
    },
    "/api/auth/forgot-password": {
      "post": {
        "tags": ["Auth"],
        "summary": "Forgot password",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": { "type": "string", "format": "email", "example": "rohit24@gmail.com" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Successful operation" }
        }
      }
    },
    "/api/auth/reset-password": {
      "post": {
        "tags": ["Auth"],
        "summary": "Reset password",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": { "type": "string", "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." },
                  "newPassword": { "type": "string", "example": "Rohit@333344" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Successful operation" }
        }
      }
    },
    "/api/auth/me": {
      "get": {
        "tags": ["Auth"],
        "summary": "Get current user info",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "Successful operation" }
        }
      }
    },
    "/api/auth/logout": {
      "post": {
        "tags": ["Auth"],
        "summary": "Logout user",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "Successful operation" }
        }
      }
    },
    "/api/auth/profile": {
      "patch": {
        "tags": ["Auth"],
        "summary": "Update profile",
        "security": [{ "bearerAuth": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "avatar": { "type": "string", "format": "binary", "description": "Profile picture" },
                  "firstName": { "type": "string", "example": "Super" },
                  "lastName": { "type": "string", "example": "Admin" },
                  "phone": { "type": "string", "example": "9694943432" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Successful operation" }
        }
      }
    },
    "/api/auth/change-password": {
      "post": {
        "tags": ["Auth"],
        "summary": "Change password",
        "security": [{ "bearerAuth": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "oldPassword": { "type": "string", "example": "Admin@pms1234" },
                  "newPassword": { "type": "string", "example": "Admin@pms123" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Successful operation" }
        }
      }
    },
    "/api/projects": {
      "post": {
    "tags": ["Projects"],
    "summary": "Create Project",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "projectName": {
                "type": "string",
                "example": "PMS Backend"
              },
              "description": {
                "type": "string",
                "example": "Project Management System Backend"
              },
              "clientId": {
                "type": "string",
                "example": "cmrstl6xo0004u30056r4mdjo"
              },
              "projectManagerId": {
                "type": "string",
                "example": "cmrstqcaa0005u300lfxzqkqq"
              },
              "teamLeaderId": {
                "type": "string",
                "example": "cmrstrvw1000cu300s1ux24v4"
              },
              "budget": {
                "type": "number",
                "example": 150000
              },
              "startDate": {
                "type": "string",
                "format": "date",
                "example": "2026-07-14"
              },
              "endDate": {
                "type": "string",
                "format": "date",
                "example": "2026-12-31"
              },
              "status": {
                "type": "string",
                "enum": [
                  "ACTIVE",
                  "INACTIVE",
                  "COMPLETED",
                  "ON_HOLD"
                ],
                "example": "ACTIVE"
              },
              "techStack": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "example": [
                  "Node.js",
                  "Express",
                  "Prisma",
                  "PostgreSQL"
                ]
              },
              "teamMembers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "type": "string"
                    },
                    "effectiveFrom": {
                      "type": "string",
                      "format": "date"
                    },
                    "effectiveTo": {
                      "type": "string",
                      "format": "date"
                    },
                    "costPerHour": {
                      "type": "number"
                    },
                    "billingRatePerHour": {
                      "type": "number"
                    },
                    "currency": {
                      "type": "string",
                      "example": "USD"
                    }
                  }
                }
              },
              "gitRepositoryUrl": {
                "type": "string",
                "example": "https://github.com/company/pms-backend"
              },
              "stagingUrl": {
                "type": "string",
                "example": "https://staging.company.com"
              },
              "productionUrl": {
                "type": "string",
                "example": "https://company.com"
              },
              "apiDocumentationUrl": {
                "type": "string",
                "example": "https://company.com/swagger"
              },
              "notes": {
                "type": "string",
                "example": "Initial development phase."
              }
            }
          }
        }
      }
    },
    "responses": {
      "201": {
        "description": "Project created successfully"
      }
    }
  },
  "get": {
    "tags": [
      "Projects"
    ],
    "summary": "Get All Projects",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "parameters": [
      {
        "name": "search",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "example": "PMS"
      }
    ],
    "responses": {
      "200": {
        "description": "Project list fetched successfully"
      }
    }
  }
},

"/api/projects/{id}": {
  "get": {
    "tags": [
      "Projects"
    ],
    "summary": "Get Project By Id",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "parameters": [
      {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "example": "cmrstutyj000ru3008102s9vg"
      }
    ],
    "responses": {
      "200": {
        "description": "Project fetched successfully"
      }
    }
  },
  "patch": {
    "tags": [
      "Projects"
    ],
    "summary": "Update Project",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "parameters": [
      {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "projectName": {
                "type": "string",
                "example": "PMS Backend45"
              },
              "description": {
                "type": "string"
              },
              "clientId": {
                "type": "string"
              },
              "projectManagerId": {
                "type": "string"
              },
              "teamLeaderId": {
                "type": "string"
              },
              "budget": {
                "type": "number"
              },
              "startDate": {
                "type": "string",
                "format": "date"
              },
              "endDate": {
                "type": "string",
                "format": "date"
              },
              "status": {
                "type": "string"
              },
              "techStack": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "teamMembers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "type": "string"
                    }
                  }
                }
              },
              "gitRepositoryUrl": {
                "type": "string"
              },
              "stagingUrl": {
                "type": "string"
              },
              "productionUrl": {
                "type": "string"
              },
              "apiDocumentationUrl": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              },
              "isArchive": {
                "type": "boolean",
                "example": true
              }
            }
          }
        }
      }
    },
    "responses": {
      "200": {
        "description": "Project updated successfully"
      }
    }
  },
  "delete": {
    "tags": [
      "Projects"
    ],
    "summary": "Delete Project",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "parameters": [
      {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "example": "cmrkbzzo30001u8r8uoi5xl3p"
      }
    ],
    "responses": {
      "200": {
        "description": "Project deleted successfully"
      }
    }
  }
},

"/api/projects/archived": {
  "get": {
    "tags": [
      "Projects"
    ],
    "summary": "Get Archived Projects",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "responses": {
      "200": {
        "description": "Archived projects fetched successfully"
      }
    }
  }
},

"/api/projects/{id}/toggle-archive": {
  "patch": {
    "tags": [
      "Projects"
    ],
    "summary": "Toggle Project Archive",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "parameters": [
      {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    ],
    "responses": {
      "200": {
        "description": "Project archive status updated successfully"
      }
      }
    }
  },
  "/api/dashboard/stats": {
    "get": {
    "tags": ["Dashboard"],
    "summary": "Get Dashboard Overview",
    "description": "Returns overall dashboard statistics including projects, users, tasks, milestones, sprints, leaves and other analytics.",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "responses": {
      "200": {
        "description": "Dashboard data fetched successfully"
      },
      "401": {
        "description": "Unauthorized"
      },
      "500": {
        "description": "Internal Server Error"
      }
    }
  }
},

"/api/clients": {
  "get": {
    "tags": ["Clients"],
    "summary": "Get all clients",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "page", "in": "query", "schema": { "type": "integer" }, "example": 1 },
      { "name": "limit", "in": "query", "schema": { "type": "integer" }, "example": 10 },
      { "name": "search", "in": "query", "schema": { "type": "string" }, "example": "Acme" },
      { "name": "isActive", "in": "query", "schema": { "type": "boolean" }, "example": true }
    ],
    "responses": {
      "200": { "description": "Clients fetched successfully" }
    }
  },
  "post": {
    "tags": ["Clients"],
    "summary": "Create a new client",
    "security": [{ "bearerAuth": [] }],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": { "type": "string", "example": "Acme Corp" },
              "code": { "type": "string", "example": "ACME" },
              "contactName": { "type": "string", "example": "John Doe" },
              "contactEmail": { "type": "string", "example": "john@acme.com" },
              "contactPhone": { "type": "string", "example": "+1 555-0123" },
              "companyWebsite": { "type": "string", "example": "https://acme.com" },
              "billingAddress": { "type": "string", "example": "123 Business Avenue, NY" },
              "notes": { "type": "string", "example": "Premium enterprise client" },
              "isActive": { "type": "boolean", "example": true }
            }
          }
        }
      }
    },
    "responses": {
      "201": { "description": "Client created successfully" }
    }
  }
},
"/api/clients/{id}": {
  "get": {
    "tags": ["Clients"],
    "summary": "Get Client by ID",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cms47225m000fu3vw91xgpv70" }
    ],
    "responses": {
      "200": { "description": "Client fetched successfully" }
    }
  },
  "patch": {
    "tags": ["Clients"],
    "summary": "Update Client",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cms47225m000fu3vw91xgpv70" }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "code": { "type": "string" },
              "contactName": { "type": "string" },
              "contactEmail": { "type": "string" },
              "contactPhone": { "type": "string" },
              "companyWebsite": { "type": "string" },
              "billingAddress": { "type": "string" },
              "notes": { "type": "string" },
              "isActive": { "type": "boolean" }
            }
          }
        }
      }
    },
    "responses": {
      "200": { "description": "Client updated successfully" }
    }
  },
  "delete": {
    "tags": ["Clients"],
    "summary": "Delete Client",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cms47225m000fu3vw91xgpv70" }
    ],
    "responses": {
      "200": { "description": "Client deleted successfully" }
    }
  }
},
"/api/settings/symbols": {
  "get": {
    "tags": ["Symbols"],
    "summary": "Get Symbols",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Symbols fetched successfully" }
    }
  },
  "post": {
    "tags": ["Symbols"],
    "summary": "Create Symbols",
    "security": [{ "bearerAuth": [] }],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": { "type": "string", "example": "US Dollar" },
              "code": { "type": "string", "example": "$" },
              "description": { "type": "string", "example": "Standard US currency symbol" },
              "isActive": { "type": "boolean", "example": true }
            }
          }
        }
      }
    },
    "responses": {
      "201": { "description": "Symbol created successfully" }
    }
  }
},
"/api/settings/symbols/{id}": {
  "get": {
    "tags": ["Symbols"],
    "summary": "Get Symbol by ID",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cms47sx5v0001u3mo7ycv1561" }
    ],
    "responses": {
      "200": { "description": "Symbol fetched successfully" }
    }
  },
  "patch": {
    "tags": ["Symbols"],
    "summary": "Update Symbol",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cms47sx5v0001u3mo7ycv1561" }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "code": { "type": "string" },
              "description": { "type": "string" },
              "isActive": { "type": "boolean" }
            }
          }
        }
      }
    },
    "responses": {
      "200": { "description": "Symbol updated successfully" }
    }
  },
  "delete": {
    "tags": ["Symbols"],
    "summary": "Delete Symbol",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cms47sb3e0000u3mo8hewzjo2" }
    ],
    "responses": {
      "200": { "description": "Symbol deleted successfully" }
    }
  }
},
"/api/permissions": {
  "get": {
    "tags": ["Permissions"],
    "summary": "Get Permissions",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Permissions fetched successfully" }
    }
  }
},
"/api/holidays": {
  "get": {
    "tags": ["Holidays"],
    "summary": "Get Holidays",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Holidays fetched successfully" }
    }
  },
  "post": {
    "tags": ["Holidays"],
    "summary": "Create Holiday",
    "security": [{ "bearerAuth": [] }],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": { "type": "string", "example": "Diwali" },
              "date": { "type": "string", "format": "date", "example": "2026-11-08" },
              "description": { "type": "string", "example": "Festival of lights" }
            }
          }
        }
      }
    },
    "responses": {
      "201": { "description": "Holiday created successfully" }
    }
  }
},
"/api/holidays/{id}": {
  "patch": {
    "tags": ["Holidays"],
    "summary": "Update Holiday",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "date": { "type": "string", "format": "date" },
              "description": { "type": "string" }
            }
          }
        }
      }
    },
    "responses": {
      "200": { "description": "Holiday updated successfully" }
    }
  },
  "delete": {
    "tags": ["Holidays"],
    "summary": "Delete Holiday",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Holiday deleted successfully" }
    }
  }
},
"/api/calendar/events": {
  "get": {
    "tags": ["Calendar"],
    "summary": "Get Calendar Events",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "month", "in": "query", "schema": { "type": "integer" }, "description": "Month number (1-12)" },
      { "name": "year", "in": "query", "schema": { "type": "integer" }, "description": "Year (e.g. 2026)" },
      { "name": "startDate", "in": "query", "schema": { "type": "string", "format": "date" } },
      { "name": "endDate", "in": "query", "schema": { "type": "string", "format": "date" } }
    ],
    "responses": {
      "200": { "description": "Calendar events fetched successfully" }
    }
  }
},
"/api/activity-log": {
  "get": {
    "tags": ["SystemActivityLog"],
    "summary": "Get Activity log",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { 
        "name": "type", 
        "in": "query", 
        "schema": { "type": "string" }, 
        "description": "TaskUpdates,StatusChanges,TeamAssignment,Comments,FileUploads,ProjectMods",
        "example": "ProjectMods"
      }
    ],
    "responses": {
      "200": { "description": "Activity log fetched successfully" }
    }
  }
},
"/api/reports/projects": {
  "get": {
    "tags": ["Reports & Analytics"],
    "summary": "Projects Reports",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Projects reports fetched successfully" }
    }
  }
},
"/api/reports/developers": {
  "get": {
    "tags": ["Reports & Analytics"],
    "summary": "Developers Reports",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Developers reports fetched successfully" }
    }
  }
},
"/api/reports/team": {
  "get": {
    "tags": ["Reports & Analytics"],
    "summary": "Team Reports",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Team reports fetched successfully" }
    }
  }
},
"/api/roles": {
  "get": {
    "tags": ["Roles"],
    "summary": "Listing",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Roles fetched successfully" }
    }
  },
  "post": {
    "tags": ["Roles"],
    "summary": "Create Role",
    "security": [{ "bearerAuth": [] }],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": { "type": "string", "example": "QA Engineer" },
              "permissionIds": { 
                "type": "array", 
                "items": { "type": "string" },
                "example": ["cmr4uep1s0000u81kb40gaska"]
              },
              "isActive": { "type": "boolean", "example": true }
            }
          }
        }
      }
    },
    "responses": {
      "201": { "description": "Role created successfully" }
    }
  }
},
"/api/roles/{id}": {
  "get": {
    "tags": ["Roles"],
    "summary": "Get role by id",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cmr4uep6n001qu81k0n9ufsyv" }
    ],
    "responses": {
      "200": { "description": "Role fetched successfully" }
    }
  },
  "patch": {
    "tags": ["Roles"],
    "summary": "Update Role",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cmrfudrju001qu3dsorsg9kef" }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": { "type": "string", "example": "Team Member2" },
              "description": { "type": "string", "example": "Updated team member role" },
              "isActive": { "type": "boolean", "example": false },
              "permissionIds": { 
                "type": "array", 
                "items": { "type": "string" },
                "example": [
                  "cmrfudrgz0000u3dsybzlay2l",
                  "cmrfudrhd0002u3dsmmj5xcp5"
                ]
              }
            }
          }
        }
      }
    },
    "responses": {
      "200": { "description": "Role updated successfully" }
    }
  },
  "delete": {
    "tags": ["Roles"],
    "summary": "Delete Role",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cmrd0bm9e0002u8c4x8095etb" }
    ],
    "responses": {
      "200": { "description": "Role deleted successfully" }
    }
  }
},
"/api/daily-reports": {
  "get": {
    "tags": ["DailyReports"],
    "summary": "GetReports",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Reports fetched successfully" }
    }
  },
  "post": {
    "tags": ["DailyReports"],
    "summary": "CreateReports",
    "security": [{ "bearerAuth": [] }],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "taskId": { "type": "string", "example": "cmrogl5t60003u8j0co6pvduj" },
              "hours": { "type": "integer", "example": 2 },
              "minutes": { "type": "integer", "example": 30 },
              "progressPercentage": { "type": "integer", "example": 40 },
              "workDoneToday": { "type": "string", "example": "Completed login API and JWT authentication. 2" },
              "planForTomorrow": { "type": "string", "example": "Implement refresh token API. 2" },
              "hasBlockers": { "type": "boolean", "example": true },
              "blockers": { "type": "string", "example": "Waiting for UI design. 2" },
              "comments": { "type": "string", "example": "Authentication module is workingdd. 2" },
              "status": { "type": "string", "example": "TESTING" }
            }
          }
        }
      }
    },
    "responses": {
      "201": { "description": "Report created successfully" }
    }
  }
},
"/api/daily-reports/{id}": {
  "get": {
    "tags": ["DailyReports"],
    "summary": "GetDailyReportsById",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Report fetched successfully" }
    }
  },
  "delete": {
    "tags": ["DailyReports"],
    "summary": "DeleteReports",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Report deleted successfully" }
    }
  }
},
"/api/daily-reports/download-excel": {
  "get": {
    "tags": ["DailyReports"],
    "summary": "download excel",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "date", "in": "query", "required": true, "schema": { "type": "string", "format": "date" }, "example": "2026-07-19" }
    ],
    "responses": {
      "200": { "description": "Excel file downloaded successfully" }
    }
  }
},
"/api/tasks": {
  "get": {
    "tags": ["Task"],
    "summary": "GetTask",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Tasks fetched successfully" }
    }
  },
  "post": {
    "tags": ["Task"],
    "summary": "CreateTask",
    "security": [{ "bearerAuth": [] }],
    "requestBody": {
      "required": true,
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "properties": {
              "title": { "type": "string", "example": "Login APaa" },
              "description": { "type": "string", "example": "Create login API using JWT" },
              "projectId": { "type": "string", "example": "cmrvobpd40001u31ohn1anylb" },
              "milestoneId": { "type": "string", "example": "cmrvocha50007u31ovvdw6fwc" },
              "sprintId": { "type": "string", "example": "cmrvod31s000du31oq6lszxf9" },
              "parentTaskId": { "type": "string" },
              "assignedDeveloperId": { "type": "string", "example": "cmrul921r0000u3mc7lm0zqi3" },
              "reviewerId": { "type": "string", "example": "cmrsttpw0000ju300exlojnf2" },
              "priority": { "type": "string", "example": "HIGH" },
              "status": { "type": "string", "example": "TODO" },
              "estimatedHours": { "type": "string", "example": "1" },
              "storyPointsc": { "type": "string", "example": "5" },
              "progressPercentage": { "type": "string", "example": "0" },
              "startDate": { "type": "string", "example": "2026-07-16" },
              "dueDate": { "type": "string", "example": "2026-07-20" },
              "labels": { "type": "string", "example": "[\"backend\",\"auth\",\"jwt\"]" },
              "files": { "type": "string", "format": "binary" },
              "completedDate": { "type": "string", "example": "2026-07-28" }
            }
          }
        }
      }
    },
    "responses": {
      "201": { "description": "Task created successfully" }
    }
  }
},
"/api/tasks/{id}": {
  "get": {
    "tags": ["Task"],
    "summary": "GetTaskById",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Task fetched successfully" }
    }
  },
  "patch": {
    "tags": ["Task"],
    "summary": "UpdateTask",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Task updated successfully" }
    }
  },
  "delete": {
    "tags": ["Task"],
    "summary": "Delete Task",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Task deleted successfully" }
    }
  }
},
"/api/tasks/{id}/toggle-archive": {
  "patch": {
    "tags": ["Task"],
    "summary": "Toggle archive",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Task archive toggled successfully" }
    }
  }
},
"/api/tasks/project/{id}/hierarchy": {
  "get": {
    "tags": ["Task"],
    "summary": "Get project hierarchy",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } },
      { "name": "milestoneId", "in": "query", "required": false, "schema": { "type": "string" }, "example": "cmrstvibq000wu300rvee6i29" }
    ],
    "responses": {
      "200": { "description": "Project task hierarchy fetched successfully" }
    }
  }
},
"/api/sprints": {
  "get": {
    "tags": ["Sprint"],
    "summary": "Get Sprints",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Sprints fetched successfully" }
    }
  },
  "post": {
    "tags": ["Sprint"],
    "summary": "Create Sprint",
    "security": [{ "bearerAuth": [] }],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "projectId": { "type": "string", "example": "cmrkfxdy90001u8ywds7adydg" },
              "milestoneId": { "type": "string", "example": "cmrklf5rr0001u8ncw82ldwxs" },
              "name": { "type": "string", "example": "Sprint 1" },
              "goal": { "type": "string", "example": "Complete Authentication Module" },
              "startDate": { "type": "string", "format": "date", "example": "2026-07-20" },
              "endDate": { "type": "string", "format": "date", "example": "2026-08-05" },
              "status": { "type": "string", "example": "PLANNING" },
              "capacity": { "type": "integer", "example": 120 },
              "velocity": { "type": "integer", "example": 100 },
              "storyPoints": { "type": "integer", "example": 45 },
              "progressPercentage": { "type": "integer", "example": 0 }
            }
          }
        }
      }
    },
    "responses": {
      "201": { "description": "Sprint created successfully" }
    }
  }
},
"/api/sprints/{id}": {
  "get": {
    "tags": ["Sprint"],
    "summary": "Get Sprint by ID",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Sprint fetched successfully" }
    }
  },
  "patch": {
    "tags": ["Sprint"],
    "summary": "Update Sprint",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "requestBody": {
      "required": false,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "milestoneId": { "type": "string", "example": "cmrklf5rr0001u8ncw82ldwxs" },
              "name": { "type": "string", "example": "Sprint 1 Update" },
              "goal": { "type": "string", "example": "Complete Authentication Module" },
              "startDate": { "type": "string", "format": "date", "example": "2026-07-20" },
              "endDate": { "type": "string", "format": "date", "example": "2026-08-05" },
              "status": { "type": "string", "example": "ACTIVE" },
              "capacity": { "type": "integer", "example": 120 },
              "velocity": { "type": "integer", "example": 100 },
              "storyPoints": { "type": "integer", "example": 45 },
              "progressPercentage": { "type": "integer", "example": 50 }
            }
          }
        }
      }
    },
    "responses": {
      "200": { "description": "Sprint updated successfully" }
    }
  },
  "delete": {
    "tags": ["Sprint"],
    "summary": "Delete Sprint",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Sprint deleted successfully" }
    }
  }
},
"/api/milestones": {
  "get": {
    "tags": ["Milestone"],
    "summary": "GetMileStones",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "search", "in": "query", "required": false, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Milestones fetched successfully" }
    }
  },
  "post": {
    "tags": ["Milestone"],
    "summary": "CreateMileStone",
    "security": [{ "bearerAuth": [] }],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "projectId": { "type": "string", "example": "cmrkfxdy90001u8ywds7adydg" },
              "title": { "type": "string", "example": "Backend API Development" },
              "description": { "type": "string", "example": "Complete all backend APIs" },
              "startDate": { "type": "string", "format": "date", "example": "2026-07-15" },
              "dueDate": { "type": "string", "format": "date", "example": "2026-08-15" },
              "responsibleUserIds": { 
                "type": "array", 
                "items": { "type": "string" },
                "example": ["cmr92kvwc0000u8xcombni6f8"]
              },
              "status": { "type": "string", "example": "PENDING" },
              "progressPercentage": { "type": "integer", "example": 0 },
              "notes": { "type": "string", "example": "Initial milestone" }
            }
          }
        }
      }
    },
    "responses": {
      "201": { "description": "Milestone created successfully" }
    }
  }
},
"/api/milestones/{id}": {
  "get": {
    "tags": ["Milestone"],
    "summary": "GetByIdMileStones",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cmrkjqgp50007u8c4n6pjlwp2" }
    ],
    "responses": {
      "200": { "description": "Milestone fetched successfully" }
    }
  },
  "patch": {
    "tags": ["Milestone"],
    "summary": "UpdateMileStones",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cmrkjqgp50007u8c4n6pjlwp2" }
    ],
    "requestBody": {
      "required": false,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "title": { "type": "string", "example": "Backend API Development" },
              "description": { "type": "string", "example": "Complete all backend APIs" },
              "startDate": { "type": "string", "format": "date", "example": "2026-07-15" },
              "dueDate": { "type": "string", "format": "date", "example": "2026-08-15" },
              "responsibleUserIds": { 
                "type": "array", 
                "items": { "type": "string" },
                "example": ["cmr92kvwc0000u8xcombni6f8"]
              },
              "status": { "type": "string", "example": "IN_PROGRESS" },
              "progressPercentage": { "type": "integer", "example": 50 },
              "notes": { "type": "string", "example": "Updated milestone notes" }
            }
          }
        }
      }
    },
    "responses": {
      "200": { "description": "Milestone updated successfully" }
    }
  },
  "delete": {
    "tags": ["Milestone"],
    "summary": "DeleteMileStones",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" }, "example": "cmrkjqgp50007u8c4n6pjlwp2" }
    ],
    "responses": {
      "200": { "description": "Milestone deleted successfully" }
    }
  }
},
"/api/leaves": {
  "get": {
    "tags": ["Leave"],
    "summary": "GetLeaves",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Leaves fetched successfully" }
    }
  },
  "post": {
    "tags": ["Leave"],
    "summary": "CreateLeaves",
    "security": [{ "bearerAuth": [] }],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "fromDate": { "type": "string", "format": "date-time", "example": "2025-12-27T00:00:00.000Z" },
              "toDate": { "type": "string", "format": "date-time", "example": "2025-12-27T23:59:59.000Z" },
              "leaveType": { "type": "string", "example": "HALF_DAY" },
              "reason": { "type": "string", "example": "Doctor appointment" }
            }
          }
        }
      }
    },
    "responses": {
      "201": { "description": "Leave created successfully" }
    }
  }
},
"/api/leaves/{id}": {
  "get": {
    "tags": ["Leave"],
    "summary": "GetByIdLeaves",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Leave fetched successfully" }
    }
  },
  "put": {
    "tags": ["Leave"],
    "summary": "UpdateLeaves",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "fromDate": { "type": "string", "format": "date-time", "example": "2025-12-27T00:00:00.000Z" },
              "toDate": { "type": "string", "format": "date-time", "example": "2025-12-27T23:59:59.000Z" },
              "leaveType": { "type": "string", "example": "HALF_DAY" },
              "reason": { "type": "string", "example": "Doctor appointment" }
            }
          }
        }
      }
    },
    "responses": {
      "200": { "description": "Leave updated successfully" }
    }
  },
  "delete": {
    "tags": ["Leave"],
    "summary": "DeleteLeaves",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Leave deleted successfully" }
    }
  }
},
"/api/users": {
  "get": {
    "tags": ["Users"],
    "summary": "GetUsers",
    "security": [{ "bearerAuth": [] }],
    "responses": {
      "200": { "description": "Users fetched successfully" }
    }
  },
  "post": {
    "tags": ["Users"],
    "summary": "CreateUsers",
    "security": [{ "bearerAuth": [] }],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "email": { "type": "string" },
              "roleId": { "type": "string" },
              "password": { "type": "string" }
            }
          }
        }
      }
    },
    "responses": {
      "201": { "description": "User created successfully" }
    }
  }
},
"/api/users/users-by-role": {
  "get": {
    "tags": ["Users"],
    "summary": "User by role",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "roleName", "in": "query", "required": false, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "Users fetched by role successfully" }
    }
  }
},
"/api/users/{id}": {
  "get": {
    "tags": ["Users"],
    "summary": "GetByIdUsers",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "User fetched successfully" }
    }
  },
  "patch": {
    "tags": ["Users"],
    "summary": "UpdateUsers",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "email": { "type": "string" },
              "roleId": { "type": "string" }
            }
          }
        }
      }
    },
    "responses": {
      "200": { "description": "User updated successfully" }
    }
  },
  "delete": {
    "tags": ["Users"],
    "summary": "DeleteUsers",
    "security": [{ "bearerAuth": [] }],
    "parameters": [
      { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
    ],
    "responses": {
      "200": { "description": "User deleted successfully" }
    }
  }
}
}
}