{"id":27857318,"url":"https://github.com/ereh11/bug-ticketing-system","last_synced_at":"2026-04-18T17:32:12.467Z","repository":{"id":290647571,"uuid":"975146883","full_name":"Ereh11/Bug-Ticketing-System","owner":"Ereh11","description":"Bug Ticketing System is an ASP.NET Core API for tracking software issues. It features JWT authentication, role-based access (Admin/Developer/Tester), and project/bug management. Teams can assign bugs, add attachments, and monitor status changes (Open→Closed).","archived":false,"fork":false,"pushed_at":"2025-05-01T06:04:26.000Z","size":635,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-04T13:17:26.328Z","etag":null,"topics":["asp-net-core","asp-net-core-web-api","csharp","database","efcore","sql-server"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ereh11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-29T21:26:03.000Z","updated_at":"2025-05-01T06:04:29.000Z","dependencies_parsed_at":"2025-04-29T22:44:46.245Z","dependency_job_id":null,"html_url":"https://github.com/Ereh11/Bug-Ticketing-System","commit_stats":null,"previous_names":["ereh11/bug-ticketing-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ereh11%2FBug-Ticketing-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ereh11%2FBug-Ticketing-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ereh11%2FBug-Ticketing-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ereh11%2FBug-Ticketing-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ereh11","download_url":"https://codeload.github.com/Ereh11/Bug-Ticketing-System/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252337856,"owners_count":21731852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net-core","asp-net-core-web-api","csharp","database","efcore","sql-server"],"created_at":"2025-05-04T13:17:29.353Z","updated_at":"2026-04-18T17:32:12.408Z","avatar_url":"https://github.com/Ereh11.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bug Ticketing System\n## 📚 Table of Contents\n\n- [📖 Overview](#-overview)\n- [💼 Business Context](#-business-context)\n  - [⚡ Key Features](#key-features)\n- [📂 Project Structure](#-project-structure)\n- [🔌 API Endpoints](#-api-endpoints)\n  - [🔐 Authentication Flow](#-authentication-flow)\n  - [👥 Users](#-users)\n  - [🧩 Projects](#-projects)\n  - [🐞 Bugs](#-bugs)\n  - [🐞 User-Bug Relationships](#-user-bug-relationships)\n  - [🗂️ File Management](#️-file-management)\n  - [🛡️ Role Management](#️-role-management)\n  - [👥 User Role Assignment](#-user-role-assignment)\n- [⚠️ Error Handling](#️-error-handling)\n- [🚀 Getting Started](#-getting-started)\n- [📄 License](#-license)\n\n## 📖 Overview\n\nWelcome to The Bug Ticketing System is a complete ticket management platform built with ASP.NET Core Web API. It enables software teams to efficiently log, track, assign, and resolve bugs during the development lifecycle.\n\nWhether you're a developer, tester, QA engineer, or project manager, this system provides:\n\n- 🎯 Bug ticketing and assignment to team members (developers/testers)\n\n- 🔥 Prioritization and severity classification for issues\n\n- 🛠️ Status management (Open ➡️ In Progress ➡️ Resolved ➡️ Closed)\n\n- 🧑‍💻 User roles: Admin, Developer, Tester, Project Manager\n\n- 📈 Upload attachments (images, files) to bugs\n\n- 🔐 JWT-based secure authentication\n\n## 💼 Business Context\n\nBug tracking is a critical aspect of software development that ensures quality and reliability. This system serves:\n\n#### ⚡Key Features\n\n- Create, update, and delete bug tickets\n\n- Assign bugs to specific developers or testers\n\n- Add comments and attachments to bug tickets\n\n- Track bug lifecycle status transitions\n\n- Monitor team performance and bug trends\n\n- Manage projects and team members\n\nThe API supports a complete bug lifecycle from creation to resolution, with features for prioritization, assignment, categorization, and reporting.\n\n## 📂 Project Structure\n\n```\n├── /BugTicketingSystem.API         # API project containing controllers and startup configuration\n│   ├── /Controllers                # API endpoint controllers\n│   ├── /Extensions                 # Extension methods for services configuration\n│   ├── /Middlewares                # Custom middleware components\n│   ├── Program.cs                  # Application entry point\n│   └── appsettings.json            # Configuration settings\n├── /BugTicketingSystem.BL          # Core business logic and domain models\n│   ├── /DTOs                       # Data Transfer Objects\n│   ├── /Managers                   # Business logic implementation\n│   ├── /Enums                      # Enumeration types\n│   ├── /Validators                 # Validations classes for validate DTOs\n├── /BugTrackingSystem.DAL          # Data access and external services implementation\n│   ├── /Context                    # Database context\n|   ├── /EntitiesConfiguration      # Entity configuration for database models\n|   ├── /Enums                      # Enumeration types for data layer\n|   ├── /Models                     # Database entity models\n|   ├── /UnitOfWork                 # Unit of work pattern implementation\n│   └── /Repositories               # Repository implementations\n└── BugTrackingSystem.sln           # Solution file\n```\n\n## 🔌 API Endpoints\n\n### 🔐 Authentication Flow\n\n#### 📁 Endpoints Summary\n\n| Action        | Endpoint                   | Description                                |\n|---------------|----------------------------|--------------------------------------------|\n| 🔑 Login      | `POST /api/users/login`    | Authenticate user and generate JWT token   |\n| 📝 Register   | `POST /api/users/register` | Register a new user and receive JWT token  |\n\n#### `POST /api/users/login`\n\n- **Description**: Authenticate user and generate JWT token\n- **Request Body**:\n\n  ```json\n  {\n    \"email\": \"user@example.com\",\n    \"password\": \"securePassword123\"\n  }\n- **Response**: JWT token and user information\n\n  ```json\n    {\n      {\n      \"data\": {\n          \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjBhZWQ1NjNkLTkwYmMtNDVkNC0wN2YwLTA4ZGQ4NTY5NWFkYiIsInN1YiI6IkhhbnlAZ21haWwuY29tIiwianRpIjoiNjlmZTJiYjYtNzBmMi00NjFmLThiYzgtMjczM2JkYTc3ZjZmIiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZSI6IkhhbnkgQWJkb3UiLCJmaXJzdE5hbWUiOiJIYW55IiwibGFzdE5hbWUiOiJBYmRvdSIsInVzZXJJZCI6IjBhZWQ1NjNkLTkwYmMtNDVkNC0wN2YwLTA4ZGQ4NTY5NWFkYiIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6IkFkbWluIiwiZXhwIjoxNzQ1OTY2NDgwLCJpc3MiOiJCdWdUcmFja2luZ1N5c3RlbUFwaSIsImF1ZCI6IkJ1Z1RyYWNraW5nU3lzdGVtQ2xpZW50In0.EP4VYlVliLPctd9YUM_mYg0gf8pAXPoW7jH4gZM3h3Y\",\n          \"refreshToken\": \"\",\n          \"expiration\": \"2025-04-30T01:41:21.2741724+03:00\",\n          \"userId\": \"0aed563d-90bc-45d4-07f0-08dd85695adb\",\n          \"email\": \"Hany@gmail.com\",\n          \"roles\": [\n              \"Admin\"\n          ]\n      },\n      \"success\": true,\n      \"message\": \"Login successful\",\n      \"errors\": null\n    }\n  }\n\n#### `POST /api/users/register`\n\n- **Description**: Register a new user account\n- **Request Body**:\n\n  ```json\n  {\n    \"email\": \"user@example.com\",\n    \"password\": \"securePassword123\",\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\",\n  }\n  ```\n\n- **Response**: User object with JWT token\n\n  ```json\n    {\n      \"data\": {\n          \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjlkYjJhM2VmLWMwMWYtNDlmOC1kMTFkLTA4ZGQ4NzVlODY1NSIsInN1YiI6ImhhbnlzQGdtYWlsLmNvbSIsImp0aSI6IjJhOTIyMjQ4LTQ4NjgtNDU4YS1hMGUzLTdlZDlhZTA1MTUwYiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWUiOiJIYW55IFNhYWQiLCJmaXJzdE5hbWUiOiJIYW55IiwibGFzdE5hbWUiOiJTYWFkIiwidXNlcklkIjoiOWRiMmEzZWYtYzAxZi00OWY4LWQxMWQtMDhkZDg3NWU4NjU1IiwiZXhwIjoxNzQ1OTY2NjIxLCJpc3MiOiJCdWdUcmFja2luZ1N5c3RlbUFwaSIsImF1ZCI6IkJ1Z1RyYWNraW5nU3lzdGVtQ2xpZW50In0.b183Pwrgg-Qa3WB9K7eMEPlvZJKiGvRlHqLp2Cm3gqk\",\n          \"refreshToken\": \"\",\n          \"expiration\": \"2025-04-30T01:43:41.6303716+03:00\",\n          \"userId\": \"9db2a3ef-c01f-49f8-d11d-08dd875e8655\",\n          \"email\": \"hanys@gmail.com\",\n          \"roles\": []\n      },\n      \"success\": true,\n      \"message\": \"Registration successful\",\n      \"errors\": null\n  } \n\n### 👥 Users\n\n#### 📁 Endpoints Summary\n\n| Action     | Endpoint              | Description                        |\n|------------|-----------------------|------------------------------------|\n| 📄 Get All | `GET /api/users`      | Retrieve all registered users      |\n| 📄 Get By Id | `GET /api/users/{id}`      | Retrieve the specific registered users|\n| 🛠 Update  | `PUT /api/users/{id}` | Update a specific user's info      |\n| ❌ Delete  | `DELETE /api/users/{id}` | Delete a specific user          |\n\n#### `GET /api/users`\n\n- **Description**: Get all registerd users\n- **Response**: Users objects with details about their roles and assigned bugs\n\n#### `DELETE /api/users/{id}`\n\n- **Description**: delete the user with provided Id\n- **Response**: Object Represent the status of deletion.\n\n#### `PUT /api/users/{id}`\n\n- **Description**: Update the data of user with provided Id\n- **Request Body**:\n\n  ```json\n  {\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\",\n    \"isActive\": true,\n  }\n  ```\n\n- **Response**: Object Represent the status of update.\n\n#### `GET /api/users/{id}`\n\n- **Description**: Get specific user's data\n- **Response**: User object with details about their roles and assigned bugs.\n\n### 🧩 Projects\n\n#### 📁 Endpoints Summary\n\n| Action     | Endpoint                  | Description                     |\n|------------|---------------------------|---------------------------------|\n| 📄 Get All | `GET /api/projects`       | Retrieve all projects           |\n| 🔍 Get One | `GET /api/projects/{id}`  | Get specific project details    |\n| 🧱 Create  | `POST /api/projects`      | Create a new project (auth)     |\n| 🛠 Update  | `PUT /api/projects/{id}`  | Update project info (auth)      |\n| ❌ Delete  | `DELETE /api/projects/{id}` | Delete a project (auth)       |\n\n#### `GET /api/projects`\n\n- **Description**: Get all projects\n- **Response**: list of projects\n\n  ```json\n  [\n    {\n        \"projectId\": \"7e07d988-e45c-451d-6d1e-08dd8270c6e4\",\n        \"name\": \"Project1\",\n        \"description\": \"TestProject\",\n        \"status\": 1,\n        \"startDate\": \"2022-08-01T00:00:00\",\n        \"endDate\": \"2023-04-06T00:00:00\",\n        \"isActive\": true,\n        \"users\": [\n            {\n                \"id\": \"6bc0f5d0-b34a-4304-59aa-08dd81b764ce\",\n                \"firstName\": \"Hany\",\n                \"lastName\": \"Saad\",\n                \"email\": \"hanysaadstd@gmail.com\",\n                \"isActive\": true\n            }\n        ],\n        \"bugs\": [\n            {\n                \"id\": \"f2087d96-cdac-4e57-d380-08dd82738c67\",\n                \"title\": \"gg\",\n                \"description\": \"ggDec\",\n                \"status\": 1,\n                \"priority\": 1\n            },\n            {\n                \"id\": \"7f4d54f1-92d0-4e4f-51f6-08dd86055e36\",\n                \"title\": \"test2\",\n                \"description\": \"test-Desc\",\n                \"status\": 1,\n                \"priority\": 1\n            }\n        ]\n    },\n    {\n        \"projectId\": \"305b3cf3-4693-473c-874b-08dd8563036c\",\n        \"name\": \"tt\",\n        \"description\": \"Test-Desc\",\n        \"status\": 4,\n        \"startDate\": \"2021-06-05T00:00:00\",\n        \"endDate\": \"2023-06-07T00:00:00\",\n        \"isActive\": false,\n        \"users\": [],\n        \"bugs\": [\n            {\n                \"id\": \"ad6389ef-c2c6-427f-219e-08dd86b7ab0e\",\n                \"title\": \"test02\",\n                \"description\": \"testDesc02\",\n                \"status\": 1,\n                \"priority\": 1\n            }\n        ]\n    },\n  ]\n\n#### `GET /api/projects/{id}`\n\n- **Description**: Get project details by ID\n- **Response**: Project details with associated bugs\n\n#### `POST /api/projects`\n\n- **Description**: Create a new project\n- **Headers**: Authorization Bearer [token]\n- **Request Body**:\n\n  ```json\n  {\n    \"name\": \"project name\",\n    \"description\": \"project data\",\n    \"status\": 1,\n    \"startDate\": \"2022-05-06\",\n    \"endDate\": \"2023-06-06\",\n    \"isActive\": true\n  }\n  ```\n\n- **Response**: Created project object\n\n#### `PUT /api/projects/{id}`\n\n- **Description**: Update existing project\n- **Headers**: Authorization Bearer [token]\n- **Request Body**:\n\n  ```json\n  {\n    \"name\": \"project name\",\n    \"description\": \"project data\",\n    \"status\": 1,\n    \"startDate\": \"2022-05-06\",\n    \"endDate\": \"2023-06-06\",\n    \"isActive\": true\n  }\n- **Response**: Updated project object\n\n#### `DELETE /api/projects/{id}`\n\n- **Description**: Delete project\n- **Headers**: Authorization Bearer [token]\n- **Response**: Success message\n\n### 🐞 Bugs\n\n#### 📁 Endpoints Summary\n\n| Action         | Endpoint              | Description                       |\n|----------------|-----------------------|-----------------------------------|\n| 📄 Get All     | `GET /api/bugs`       | Retrieve all bugs                 |\n| 🔍 Get One     | `GET /api/bugs/{id}`  | Retrieve detailed bug info        |\n| 🐛 Create      | `POST /api/bugs`      | Create a new bug report           |\n| 📝 Update      | `PUT /api/bugs/{id}`  | Update existing bug info          |\n| ❌ Delete      | `DELETE /api/bugs/{id}` | Delete a bug (auth required)     |\n\n#### `GET /api/bugs`\n\n- **Description**: Get all bugs\n- **Response**: List of bugs\n\n#### `GET /api/bugs/{id}`\n\n- **Description**: Get detailed bug information\n- **Response**: Detailed bug data including its attachments\n  ```json\n  {\n    \"data\": {\n        \"id\": \"e1904520-ea11-4c88-3cfb-08dd8785765b\",\n        \"title\": \"Bug Updated\",\n        \"description\": \"It's just Test\",\n        \"status\": 1,\n        \"priority\": 1,\n        \"project\": {\n            \"projectId\": \"17d6b305-5799-42bb-cd44-08dd8785256b\",\n            \"name\": \"ProjectProgramming\"\n        },\n        \"attachments\": [\n            {\n                \"attachmentId\": \"38a3a21d-69b1-4b5d-b456-910e041a6b27\",\n                \"fileName\": \"API Project.pdf\",\n                \"filePath\": \"/attachments/b98aa617-0332-4867-92bf-7726f039a857.pdf\",\n                \"createdDate\": \"2025-04-30T13:45:43.768\"\n            },\n            {\n                \"attachmentId\": \"e85290af-e8c9-43da-bc39-fa5e08997810\",\n                \"fileName\": \"SSDLC Certification.pdf\",\n                \"filePath\": \"/attachments/9176f0df-bc96-4918-bae1-de154c493b1f.pdf\",\n                \"createdDate\": \"2025-04-30T01:26:17.768\"\n            }\n        ]\n    },\n    \"success\": true,\n    \"message\": \"Bug retrieved successfully.\",\n    \"errors\": null\n  }\n\n#### `POST /api/bugs`\n\n- **Description**: Create new bug report\n- **Request Body**:\n\n  ```json\n  {\n    \"title\": \"Bug title\",\n    \"description\": \"Detailed bug description\",\n    \"projectId\": \"project123\",\n    \"status\": 1,\n    \"priority\": 3,\n  }\n- **Response**: Created bug object\n\n#### `PUT /api/bugs/{id}`\n\n- **Description**: Update bug information\n- **Request Body**:\n\n  ```json\n  {\n    \"title\": \"Bug title\",\n    \"description\": \"Detailed bug description\",\n    \"projectId\": \"project123\",\n    \"status\": 1,\n    \"priority\": 3,\n  }\n- **Response**: Updated bug object\n\n#### `DELETE /api/bugs/{id}`\n\n- **Description**: Delete bug\n- **Headers**: Authorization Bearer [token]\n- **Response**: Success message\n\n### 🐞 User-Bug Relationships\n\n#### 📁 Endpoints Summary\n\n| Action              | Endpoint                                  | Description                                  |\n|---------------------|-------------------------------------------|----------------------------------------------|\n| ➕ Assign Bug        | `POST /api/bugs/{id}/assignees`            | Assign a bug to a user                       |\n| ❌ Unassign Bug      | `DELETE /api/bugs/{id}/assignees/{id}`    | Unassign a specific user from a specific bug |\n\n#### `POST /api/bugs/{id}/assignees`\n\n- **Description**: Assign bug to user\n- **Headers**: Authorization Bearer [token]\n- **Request Body**:\n\n  ```json\n  {\n    \"userId\": \"45d15845-7123-472a-0ff2-08dd87844aae\",\n    \"assignedDate\": \"2025-04-29\"\n  }\n- **Response**: Object with message successfully or failed\n\n#### `DELETE /api/bugs/{id}/assignees/{id}`\n\n- **Description**: Unassign specific user from a specific bug.\n- **Headers**: Authorization Bearer [token]\n- **Response**: Object with message successfully or failed\n\n### 🗂️ File Management\n\nManage file attachments related to bug reports.\n\n| Action               | Endpoint                                              | Description                                           |\n|----------------------|-------------------------------------------------------|-------------------------------------------------------|\n| 📤 Upload Attachment | `POST /api/bugs/:id/attachments`                      | Attach a file (image, log, etc.) to a bug            |\n| 📂 Get Attachments   | `GET /api/bugs/:id/attachments`                       | Retrieve all attachments linked to a specific bug    |\n| 🗑️ Delete Attachment | `DELETE /api/bugs/:id/attachments/:attachmentId`     | Remove a specific attachment from a bug              |\n\n#### `POST /api/bugs/{id}/attachments`\n\n- **Description**: Attach a file (image, log, etc.) to a specific bug.\n- **Headers**: Authorization Bearer [token], Content-Type: multipart/form-data\n- **Request Form Data**:\n  - `file`: The file to upload\n- **Response**:\n\n  ```json\n  {\n      \"data\": {\n          \"attachmentId\": \"024ebc69-a038-434c-82a4-5bf5fcdf0512\",\n          \"fileName\": \"WhatsApp Image 2024-12-19 at 8.14.38 PM.jpeg\",\n          \"filePath\": \"http://localhost:5279/attachments/a71c0da4-1846-472e-8543-78574222ed4f.jpeg\",\n          \"createdDate\": \"2025-04-29T20:54:38.3461079Z\"\n      },\n      \"success\": true,\n      \"message\": \"Attachment uploaded successfully\",\n      \"errors\": null\n  }\n\n#### `DELETE /api/Bugs/{bugId}/attachments/{attachmentId}`\n\n- **Description**: Delete attachment from the bug.\n- **Response**:\n\n  ```json\n  {\n    \"success\": true,\n    \"message\": \"Attachment deleted successfully\",\n    \"errors\": null\n  }\n\n#### `GET /api/Bugs/{bugId}/attachments`\n\n- **Description**: Get all attachment of the specific bug.\n- **Response**: List of all attachments of specific bug\n\n### 🛡️ Role Management\n\n#### 📁 Endpoints Summary\n\n| Action          | Endpoint                | Description                      |\n|-----------------|-------------------------|----------------------------------|\n| ➕ Create Role   | `POST /api/Roles`       | Create a new role               |\n| 📄 Get All Roles| `GET /api/Roles`        | Retrieve a list of all roles     |\n\n#### `POST /api/Roles`\n\n- **Description**: Create a new role in the system.\n- **Headers**: Authorization Bearer [token]\n- **Request Body**:\n\n  ```json\n  {\n    \"name\": \"Admin\",\n    \"description\": \"Administrator role with full permissions\"\n  }\n\n#### `GET /api/Roles`\n\n- **Description**: GET all roles in the system.\n- **Headers**: Authorization Bearer [token]\n- **Request Body**:\n\n  ```json\n  [\n    {\n        \"id\": \"8ff8905b-e969-49e2-6134-08dd81dcd4d9\",\n        \"name\": \"Developer\",\n        \"description\": \"Work with codes, and make debuging and tracing for it\"\n    },\n    {\n        \"id\": \"cf810305-be5d-46c3-737c-08dd84d0eef1\",\n        \"name\": \"Admin\",\n        \"description\": \"It's Super Admin Test\"\n    }\n  ]\n\n### 👥 User Role Assignment\n\n#### 📁 Endpoints Summary\n\n| Action               | Endpoint                   | Description                          |\n|----------------------|----------------------------|--------------------------------------|\n| ➕ Assign Role        | `POST /api/UserRoles`      | Assign a role to a user              |\n| 📄 Get User Roles     | `GET /api/UserRoles`       | Get list of all user-role mappings   |\n| ❌ Unassign Role      | `DELETE /api/UserRoles`    | Remove a role from a user            |\n\n#### `POST /api/UserRoles`\n\n- **Description**: Assign a role to a user.\n- **Headers**: Authorization Bearer [token]\n- **Request Body**:\n\n  ```json\n  {\n    \"userId\": \"user123\",\n    \"roleId\": \"role456\",\n    \"assignedDate\": \"2025-04-29T12:00:00Z\"\n  }\n\n#### `GET /api/UserRoles`\n\n- **Description**: Get all data of the UserRoles tabl.\n- **Headers**: Authorization Bearer [token]\n- **Request Body**:\n\n  ```json\n  {\n    \"data\": [\n        {\n            \"userId\": \"6bc0f5d0-b34a-4304-59aa-08dd81b764ce\",\n            \"roleId\": \"8ff8905b-e969-49e2-6134-08dd81dcd4d9\",\n            \"assignedDate\": \"2020-06-08T00:00:00\"\n        },\n        {\n            \"userId\": \"6bc0f5d0-b34a-4304-59aa-08dd81b764ce\",\n            \"roleId\": \"cf810305-be5d-46c3-737c-08dd84d0eef1\",\n            \"assignedDate\": \"2025-04-27T00:00:00\"\n        },\n        {\n            \"userId\": \"4fdcb2c5-da53-4652-336b-08dd84d1cddd\",\n            \"roleId\": \"cf810305-be5d-46c3-737c-08dd84d0eef1\",\n            \"assignedDate\": \"2022-01-01T00:00:00\"\n        },\n        {\n            \"userId\": \"0aed563d-90bc-45d4-07f0-08dd85695adb\",\n            \"roleId\": \"cf810305-be5d-46c3-737c-08dd84d0eef1\",\n            \"assignedDate\": \"2025-04-27T00:00:00\"\n        }\n    ],\n    \"success\": true,\n    \"message\": \"User roles retrieved successfully\",\n    \"errors\": null\n  }\n\n#### `DELETE /api/UserRoles`\n\n- **Description**: Delete a specific role from a specific user.\n- **Headers**: Authorization Bearer [token]\n- **Request Body**:\n\n  ```json\n  {\n    \"userId\": \"user123\",\n    \"roleId\": \"role456\",\n  }\n\n## ⚠️ Error Handling\n\n- All API endpoints follow a consistent error response format:\n\n  ```json\n  {\n    \"data\": [], //Return List of the data if exist any data need to return.\n    \"message\": \"message\", // Custom message\n    \"success\": true // true if no error and false if there is an error,\n    \"errors\": [] //List of All errors if exist or null if there is not error\n  }\n\nCommon HTTP status codes:\n\n- `200`: Success\n- `201`: Resource created\n- `400`: Bad request / Invalid input\n- `401`: Unauthorized / Invalid token\n- `403`: Forbidden / Insufficient permissions\n- `404`: Resource not found\n- `500`: Server error\n\n## 🚀 Getting Started\n\n### 📦Prerequisites\n\n- .NET 6 SDK or later\n- SQL Server or SQL Server Express\n- Visual Studio 2022 or VS Code\n\n### ⚙️Setup Instructions\n\n1. Clone the repository\n\n   ```\n   git clone https://github.com/Ereh11/Bug-Ticketing-System.git\n   ```\n\n2. Update database connection string in `appsettings.json`\n\n3. Run database migrations\n\n   ```\n   dotnet ef database update\n   ```\n\n4. Run the application\n\n   ```\n   dotnet run --project BugTrackingSystem.API\n   ```\n\n5. API will be available at `https://localhost:5279` or `http://localhost:5000`\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fereh11%2Fbug-ticketing-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fereh11%2Fbug-ticketing-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fereh11%2Fbug-ticketing-system/lists"}