🎫 Ticket Service

API Endpoints Documentation

📋 Service Information

Service Name: Ticket Service

Port: 8053

Base URL: http://localhost:8053

Description: Handles ticket booking, management, status updates, and live panel data

Features: Ticket booking, status management, hold/transfer tickets, live panel integration, Kafka event streaming

🎫 Ticket Management Endpoints
POST /api/tickets/book

Book Ticket

Create a new ticket for a service

📝 Request Example:

curl -X POST http://localhost:8053/api/tickets/book \ -H "Content-Type: application/json" \ -d '{ "userId": "550e8400-e29b-41d4-a716-446655440000", "agencyId": "660e8400-e29b-41d4-a716-446655440001", "serviceId": "770e8400-e29b-41d4-a716-446655440002", "bookingType": "WALK_IN" }'
201 - Created 400 - Bad Request 500 - Server Error
GET /api/tickets/getTicket/{id}

Get Ticket by ID

Retrieve ticket details by ticket ID

📝 Request Example:

curl -X GET http://localhost:8053/api/tickets/getTicket/{id}
📌 Path Parameters:

id - Ticket ID (UUID)

200 - Success 404 - Not Found
GET /api/tickets/getTicketList

Get Ticket List

Get all tickets with pagination, search, and filters

📝 Request Example:

curl -X GET "http://localhost:8053/api/tickets/getTicketList?page=0&size=10&search=term&status=waiting&userId={uuid}&serviceId={uuid}"
📌 Query Parameters:

page - Page number (default: 0)

size - Page size (default: 10)

search - Search term (optional)

status - Filter by status (optional)

userId - Filter by user ID (optional, UUID)

serviceId - Filter by service ID (optional, UUID)

sortBy - Sort field (default: created_at)

sortDir - Sort direction: asc/desc (default: asc)

200 - Success
GET /api/tickets/getTicketsByService

Get Tickets by Service

Get tickets filtered by userId, agencyId, and serviceId

📝 Request Example:

curl -X GET "http://localhost:8053/api/tickets/getTicketsByService?userId={uuid}&agencyId={uuid}&serviceId={uuid}&page=0&size=100&status=waiting"
📌 Query Parameters:

userId - User ID (required, UUID)

agencyId - Agency ID (required, UUID)

serviceId - Service ID (required, UUID)

page - Page number (default: 0)

size - Page size (default: 100)

status - Filter by status (optional)

200 - Success
GET /api/tickets/getTicketsByUserAndBranch

Get Tickets by User and Branch

Get tickets filtered by userId and agencyId (branch-wise and user-wise)

📝 Request Example:

curl -X GET "http://localhost:8053/api/tickets/getTicketsByUserAndBranch?userId={uuid}&agencyId={uuid}&page=0&size=10&status=waiting"
📌 Query Parameters:

userId - User ID (required, UUID)

agencyId - Agency/Branch ID (required, UUID)

page - Page number (default: 0)

size - Page size (default: 10)

status - Filter by status (optional)

search - Search term (optional)

200 - Success
GET /api/tickets/getTicketHistory

Get Ticket History

Get all ticket history with filters

📝 Request Example:

curl -X GET "http://localhost:8053/api/tickets/getTicketHistory?page=0&size=10&search=term&bookingType=WALK_IN&status=completed&userId={uuid}"
📌 Query Parameters:

page - Page number (default: 0)

size - Page size (default: 10)

search - Search term (optional)

bookingType - Filter by booking type (optional)

status - Filter by status (optional)

userId - Filter by user ID (optional, UUID)

200 - Success
PUT /api/tickets/update/{id}

Update Ticket

Update ticket information

📝 Request Example:

curl -X PUT http://localhost:8053/api/tickets/update/{id} \ -H "Content-Type: application/json" \ -d '{ ... }'
📌 Path Parameters:

id - Ticket ID (UUID)

200 - Success 404 - Not Found
PATCH /api/tickets/status/{ticketId}

Change Ticket Status

Update ticket status (waiting, called, serving, completed, etc.)

📝 Request Example:

curl -X PATCH http://localhost:8053/api/tickets/status/{ticketId} \ -H "Content-Type: application/json" \ -d '{"status": "called"}'
📌 Path Parameters:

ticketId - Ticket ID (UUID)

200 - Success 404 - Not Found
PATCH /api/tickets/hold/{ticketId}

Hold Ticket

Put a ticket on hold

📝 Request Example:

curl -X PATCH http://localhost:8053/api/tickets/hold/{ticketId} \ -H "Content-Type: application/json" \ -d '{"reason": "Customer request"}'
200 - Success 404 - Not Found
PUT /api/tickets/transfer/{ticketId}

Transfer Ticket

Transfer a ticket to another service or agency

📝 Request Example:

curl -X PUT http://localhost:8053/api/tickets/transfer/{ticketId} \ -H "Content-Type: application/json" \ -d '{"serviceId": "{newServiceId}", "reason": "Transfer reason"}'
200 - Success 404 - Not Found
GET /api/tickets/getHoldTicketList

Get Hold Tickets

Get all tickets that are on hold

📝 Request Example:

curl -X GET "http://localhost:8053/api/tickets/getHoldTicketList?page=0&size=10&search=term&status=hold"
200 - Success
GET /api/tickets/getTransferTicketList

Get Transfer Tickets

Get all tickets that have been transferred

📝 Request Example:

curl -X GET "http://localhost:8053/api/tickets/getTransferTicketList?page=0&size=10&search=term&status=transfer"
200 - Success
GET /api/tickets/details/{agencyId}

Get Agency Summary

Get ticket details and summary for an agency

📝 Request Example:

curl -X GET http://localhost:8053/api/tickets/details/{agencyId}
📌 Path Parameters:

agencyId - Agency ID (UUID)

200 - Success
📺 QMS Live Panel Endpoints
GET /api/qms-live-panel/logo

Get Logo Path

Get the logo URL for the live panel

📝 Request Example:

curl -X GET http://localhost:8053/api/qms-live-panel/logo
200 - Success
GET /api/qms-live-panel/branding-color

Get Branding Color

Get the branding color for the live panel

📝 Request Example:

curl -X GET http://localhost:8053/api/qms-live-panel/branding-color
200 - Success
GET /api/qms-live-panel/advertisements

Get Advertisements

Get list of advertisement video URLs

📝 Request Example:

curl -X GET http://localhost:8053/api/qms-live-panel/advertisements
200 - Success
GET /api/qms-live-panel/marquee-texts

Get Marquee Texts

Get list of marquee texts for display

📝 Request Example:

curl -X GET http://localhost:8053/api/qms-live-panel/marquee-texts
200 - Success
GET /api/qms-live-panel/live-tickets

Get Live Tickets

Get currently called/live tickets for display

📝 Request Example:

curl -X GET http://localhost:8053/api/qms-live-panel/live-tickets
200 - Success