A comprehensive ticketing/helpdesk microservice for the Minisource platform.
- Multi-tenant Support: Full tenant isolation for all data
- Ticket Management: Create, update, assign, transfer, and close tickets
- Department & Category Organization: Hierarchical departments and categories
- SLA Management: Configurable SLA policies with priority-based response/resolution times
- Agent Management: Agent roles, skills, availability, and workload management
- Canned Responses: Pre-defined responses for common queries
- Multiple ticket sources (web, email, phone, chat, API, social, widget)
- Multiple ticket types (question, incident, problem, feature request, task)
- Priority levels (low, medium, high, urgent, critical)
- Status workflow (open → in progress → pending → resolved → closed)
- Auto-assignment (round-robin, load-balanced, skill-based)
- Ticket transfer between departments
- Customer satisfaction rating
- File attachments
- Custom fields
- Tags and labels
- Related tickets
- Watchers
- Customer replies
- Agent replies
- Internal notes (private)
- System messages
- Auto-replies
- Dashboard with statistics
- Bulk operations (assign, status change, priority change, transfer, delete)
- SLA breach monitoring
- Due soon tickets
- Unassigned tickets queue
- Agent performance metrics
GET /health- Health checkGET /ready- Readiness checkGET /live- Liveness check
POST /api/v1/tickets- Create ticketGET /api/v1/tickets- List ticketsGET /api/v1/tickets/:id- Get ticketGET /api/v1/tickets/number/:number- Get ticket by numberPATCH /api/v1/tickets/:id- Update ticketDELETE /api/v1/tickets/:id- Delete ticketPATCH /api/v1/tickets/:id/status- Change statusPOST /api/v1/tickets/:id/rate- Rate ticketGET /api/v1/tickets/:id/messages- Get messagesPOST /api/v1/tickets/:id/messages- Add messageGET /api/v1/tickets/:id/history- Get historyGET /api/v1/tickets/stats- Get statisticsGET /api/v1/customers/:customer_id/tickets- Get customer tickets
POST /api/v1/tickets/:id/assign- Assign ticketPOST /api/v1/tickets/:id/transfer- Transfer ticketGET /api/v1/agents/:agent_id/tickets- Get agent tickets
POST /api/v1/admin/agents- Create agentGET /api/v1/admin/agents- List agentsGET /api/v1/admin/agents/:id- Get agentPATCH /api/v1/admin/agents/:id- Update agentDELETE /api/v1/admin/agents/:id- Delete agentPATCH /api/v1/admin/agents/:id/status- Update agent status
POST /api/v1/admin/departments- Create departmentGET /api/v1/admin/departments- List departmentsGET /api/v1/admin/departments/:id- Get departmentPATCH /api/v1/admin/departments/:id- Update departmentDELETE /api/v1/admin/departments/:id- Delete departmentGET /api/v1/admin/departments/:id/agents- Get department agentsPOST /api/v1/admin/departments/:id/agents- Add agent to departmentDELETE /api/v1/admin/departments/:id/agents/:agent_id- Remove agent from department
POST /api/v1/admin/categories- Create categoryGET /api/v1/admin/categories- List categoriesGET /api/v1/admin/categories/:id- Get categoryPATCH /api/v1/admin/categories/:id- Update categoryDELETE /api/v1/admin/categories/:id- Delete category
POST /api/v1/admin/sla-policies- Create SLA policyGET /api/v1/admin/sla-policies- List SLA policiesGET /api/v1/admin/sla-policies/:id- Get SLA policyPATCH /api/v1/admin/sla-policies/:id- Update SLA policyDELETE /api/v1/admin/sla-policies/:id- Delete SLA policy
POST /api/v1/admin/canned-responses- Create canned responseGET /api/v1/admin/canned-responses- List canned responsesGET /api/v1/admin/canned-responses/search- Search canned responsesGET /api/v1/admin/canned-responses/:id- Get canned responsePATCH /api/v1/admin/canned-responses/:id- Update canned responseDELETE /api/v1/admin/canned-responses/:id- Delete canned response
POST /api/v1/admin/tickets/bulk-assign- Bulk assign ticketsPOST /api/v1/admin/tickets/bulk-status- Bulk change statusPOST /api/v1/admin/tickets/bulk-priority- Bulk change priorityPOST /api/v1/admin/tickets/bulk-transfer- Bulk transfer departmentPOST /api/v1/admin/tickets/bulk-delete- Bulk delete tickets
GET /api/v1/admin/dashboard/stats- Get dashboard statisticsGET /api/v1/admin/dashboard/sla-breached- Get SLA breached ticketsGET /api/v1/admin/dashboard/due-soon- Get tickets due soonGET /api/v1/admin/dashboard/unassigned- Get unassigned tickets
Environment variables:
# Server
SERVER_PORT=5011
# MongoDB
MONGODB_URI=mongodb://localhost:27017
MONGODB_DATABASE=ticket_db
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
# Auth Service
AUTH_URL=http://localhost:5001
AUTH_CLIENT_ID=ticket-service
AUTH_CLIENT_SECRET=your-secret
# Notifier Service
NOTIFIER_URL=http://localhost:5003
NOTIFIER_ENABLED=true
# SLA Defaults (in hours)
SLA_DEFAULT_FIRST_RESPONSE_LOW=24
SLA_DEFAULT_FIRST_RESPONSE_MEDIUM=8
SLA_DEFAULT_FIRST_RESPONSE_HIGH=4
SLA_DEFAULT_FIRST_RESPONSE_URGENT=2
SLA_DEFAULT_FIRST_RESPONSE_CRITICAL=1
SLA_DEFAULT_RESOLUTION_LOW=72
SLA_DEFAULT_RESOLUTION_MEDIUM=48
SLA_DEFAULT_RESOLUTION_HIGH=24
SLA_DEFAULT_RESOLUTION_URGENT=8
SLA_DEFAULT_RESOLUTION_CRITICAL=4
# Logging
LOG_LEVEL=info
LOG_ENCODING=json
LOG_DEVELOPMENT=false
LOG_FILE_PATH=logs/ticket.log- Go 1.24+
- MongoDB 7+
- Redis 7+
# Download dependencies
make deps
# Run the service
make run
# Run with hot reload (requires air)
make dev# Start development environment
make docker-dev-up
# View logs
make docker-logs
# Stop containers
make docker-dev-down# Run tests
make test
# Run tests with coverage
make test-coverageticket/
├── api/
│ ├── router/ # HTTP router setup
│ └── v1/handlers/ # HTTP handlers
├── cmd/
│ └── main.go # Application entry point
├── config/ # Configuration
├── internal/
│ ├── database/ # Database connection
│ ├── middleware/ # HTTP middleware
│ ├── models/ # Domain models
│ ├── repository/ # Data access layer
│ └── usecase/ # Business logic
├── locales/ # i18n translations
├── Dockerfile
├── docker-compose.yml
├── docker-compose.dev.yml
├── Makefile
└── README.md
Copyright © Minisource