Implement Agent Management System with CRUD Operations, Ticket Assignment, and Role-based Access Control #989
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR introduces an agent management system that includes:
Changes Made:
Agent Schema (
models/Agent.js
):Agent Controller (
controllers/agentController.js
):Agent Middleware (
middleware/agentMiddleware.js
):Agent Routes (
routes/agentRoutes.js
):GET /agents
: Fetches all agents.POST /agents
: Creates a new agent.GET /agents/:id
: Fetches an agent's details by ID.PUT /agents/:id
: Updates an agent's details by ID.DELETE /agents/:id
: Deletes an agent by ID.PATCH /agents/:id/assign-ticket
: Assigns a ticket to an agent.PATCH /agents/:id/unassign-ticket
: Unassigns a ticket from an agent.PATCH /agents/:id/status
: Updates an agent’s status (active/inactive).PATCH /agents/:id/assign-multiple-tickets
: Assigns multiple tickets to an agent.Files Changed:
models/Agent.js
: Agent schema definition.controllers/agentController.js
: Controller functions for managing agents.middleware/agentMiddleware.js
: Middleware for validating agents and permissions.routes/agentRoutes.js
: Routes for interacting with agents.