urembo-hub-api
Preparing search index...
tickets/tickets.controller
TicketsController
Class TicketsController
Index
Constructors
constructor
Methods
add
Response
create
Ticket
create
Ticket
Category
delete
Ticket
delete
Ticket
Category
get
All
Tickets
get
Ticket
By
Id
get
Ticket
Categories
get
Ticket
Stats
get
User
Tickets
search
Tickets
update
Ticket
update
Ticket
Category
Constructors
constructor
new
TicketsController
(
ticketsService
:
TicketsService
)
:
TicketsController
Parameters
ticketsService
:
TicketsService
Returns
TicketsController
Methods
add
Response
addResponse
(
id
:
string
,
createResponseDto
:
CreateTicketResponseDto
,
req
:
any
,
)
:
Promise
<
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
}
;
}
&
{
attachments
:
JsonValue
;
createdAt
:
Date
;
id
:
string
;
isInternal
:
boolean
;
message
:
string
;
ticketId
:
string
;
updatedAt
:
Date
;
userId
:
string
;
}
,
>
Parameters
id
:
string
createResponseDto
:
CreateTicketResponseDto
req
:
any
Returns
Promise
<
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
}
;
}
&
{
attachments
:
JsonValue
;
createdAt
:
Date
;
id
:
string
;
isInternal
:
boolean
;
message
:
string
;
ticketId
:
string
;
updatedAt
:
Date
;
userId
:
string
;
}
,
>
create
Ticket
createTicket
(
createTicketDto
:
CreateTicketDto
,
req
:
any
,
)
:
Promise
<
{
appointment
:
{
appointmentDate
:
Date
;
id
:
string
;
status
:
booking_status
;
}
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
order
:
{
currency
:
string
;
id
:
string
;
status
:
order_status
;
totalAmount
:
Decimal
;
}
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
,
>
Parameters
createTicketDto
:
CreateTicketDto
req
:
any
Returns
Promise
<
{
appointment
:
{
appointmentDate
:
Date
;
id
:
string
;
status
:
booking_status
;
}
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
order
:
{
currency
:
string
;
id
:
string
;
status
:
order_status
;
totalAmount
:
Decimal
;
}
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
,
>
create
Ticket
Category
createTicketCategory
(
data
:
{
color
?:
string
;
description
?:
string
;
icon
?:
string
;
name
:
string
;
}
,
req
:
any
,
)
:
Promise
<
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
,
>
Parameters
data
:
{
color
?:
string
;
description
?:
string
;
icon
?:
string
;
name
:
string
}
req
:
any
Returns
Promise
<
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
,
>
delete
Ticket
deleteTicket
(
id
:
string
,
req
:
any
)
:
Promise
<
{
message
:
string
}
>
Parameters
id
:
string
req
:
any
Returns
Promise
<
{
message
:
string
}
>
delete
Ticket
Category
deleteTicketCategory
(
id
:
string
,
req
:
any
,
)
:
Promise
<
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
,
>
Parameters
id
:
string
req
:
any
Returns
Promise
<
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
,
>
get
All
Tickets
getAllTickets
(
page
?:
string
,
limit
?:
string
,
status
?:
string
,
priority
?:
string
,
categoryId
?:
string
,
assignedTo
?:
string
,
createdBy
?:
string
,
)
:
Promise
<
{
pagination
:
{
limit
:
number
;
page
:
number
;
pages
:
number
;
total
:
number
;
}
;
tickets
:
(
{
_count
:
{
conversations
:
number
;
responses
:
number
}
;
appointment
:
{
appointmentDate
:
Date
;
id
:
string
;
status
:
booking_status
;
}
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
order
:
{
currency
:
string
;
id
:
string
;
status
:
order_status
;
totalAmount
:
Decimal
;
}
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
)
[]
;
}
,
>
Parameters
Optional
page
:
string
Optional
limit
:
string
Optional
status
:
string
Optional
priority
:
string
Optional
categoryId
:
string
Optional
assignedTo
:
string
Optional
createdBy
:
string
Returns
Promise
<
{
pagination
:
{
limit
:
number
;
page
:
number
;
pages
:
number
;
total
:
number
;
}
;
tickets
:
(
{
_count
:
{
conversations
:
number
;
responses
:
number
}
;
appointment
:
{
appointmentDate
:
Date
;
id
:
string
;
status
:
booking_status
;
}
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
order
:
{
currency
:
string
;
id
:
string
;
status
:
order_status
;
totalAmount
:
Decimal
;
}
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
)
[]
;
}
,
>
get
Ticket
By
Id
getTicketById
(
id
:
string
,
)
:
Promise
<
{
appointment
:
{
appointmentDate
:
Date
;
id
:
string
;
service
:
{
name
:
string
;
price
:
Decimal
}
;
status
:
booking_status
;
}
;
auditLogs
:
(
{
performedByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
}
;
}
&
{
actionType
:
string
;
id
:
string
;
metadata
:
JsonValue
;
newValue
:
string
;
performedAt
:
Date
;
performedBy
:
string
;
previousValue
:
string
;
ticketId
:
string
;
}
)
[]
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
conversations
:
(
{
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
attachments
:
JsonValue
;
createdAt
:
Date
;
createdBy
:
string
;
id
:
string
;
isInternal
:
boolean
;
message
:
string
;
ticketId
:
string
;
updatedAt
:
Date
;
}
)
[]
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
order
:
{
currency
:
string
;
customerEmail
:
string
;
id
:
string
;
status
:
order_status
;
totalAmount
:
Decimal
;
}
;
responses
:
(
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
attachments
:
JsonValue
;
createdAt
:
Date
;
id
:
string
;
isInternal
:
boolean
;
message
:
string
;
ticketId
:
string
;
updatedAt
:
Date
;
userId
:
string
;
}
)
[]
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
,
>
Parameters
id
:
string
Returns
Promise
<
{
appointment
:
{
appointmentDate
:
Date
;
id
:
string
;
service
:
{
name
:
string
;
price
:
Decimal
}
;
status
:
booking_status
;
}
;
auditLogs
:
(
{
performedByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
}
;
}
&
{
actionType
:
string
;
id
:
string
;
metadata
:
JsonValue
;
newValue
:
string
;
performedAt
:
Date
;
performedBy
:
string
;
previousValue
:
string
;
ticketId
:
string
;
}
)
[]
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
conversations
:
(
{
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
attachments
:
JsonValue
;
createdAt
:
Date
;
createdBy
:
string
;
id
:
string
;
isInternal
:
boolean
;
message
:
string
;
ticketId
:
string
;
updatedAt
:
Date
;
}
)
[]
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
order
:
{
currency
:
string
;
customerEmail
:
string
;
id
:
string
;
status
:
order_status
;
totalAmount
:
Decimal
;
}
;
responses
:
(
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
attachments
:
JsonValue
;
createdAt
:
Date
;
id
:
string
;
isInternal
:
boolean
;
message
:
string
;
ticketId
:
string
;
updatedAt
:
Date
;
userId
:
string
;
}
)
[]
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
,
>
get
Ticket
Categories
getTicketCategories
()
:
Promise
<
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
[]
,
>
Returns
Promise
<
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
[]
,
>
get
Ticket
Stats
getTicketStats
(
req
:
any
,
)
:
Promise
<
{
closedTickets
:
number
;
highPriorityTickets
:
number
;
inProgressTickets
:
number
;
openTickets
:
number
;
overdueTickets
:
number
;
resolvedTickets
:
number
;
totalTickets
:
number
;
}
,
>
Parameters
req
:
any
Returns
Promise
<
{
closedTickets
:
number
;
highPriorityTickets
:
number
;
inProgressTickets
:
number
;
openTickets
:
number
;
overdueTickets
:
number
;
resolvedTickets
:
number
;
totalTickets
:
number
;
}
,
>
get
User
Tickets
getUserTickets
(
req
:
any
,
page
?:
string
,
limit
?:
string
,
)
:
Promise
<
{
pagination
:
{
limit
:
number
;
page
:
number
;
pages
:
number
;
total
:
number
;
}
;
tickets
:
(
{
_count
:
{
conversations
:
number
;
responses
:
number
}
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
)
[]
;
}
,
>
Parameters
req
:
any
Optional
page
:
string
Optional
limit
:
string
Returns
Promise
<
{
pagination
:
{
limit
:
number
;
page
:
number
;
pages
:
number
;
total
:
number
;
}
;
tickets
:
(
{
_count
:
{
conversations
:
number
;
responses
:
number
}
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
)
[]
;
}
,
>
search
Tickets
searchTickets
(
req
:
any
,
query
:
string
,
)
:
Promise
<
(
{
_count
:
{
conversations
:
number
;
responses
:
number
}
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
)
[]
,
>
Parameters
req
:
any
query
:
string
Returns
Promise
<
(
{
_count
:
{
conversations
:
number
;
responses
:
number
}
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
)
[]
,
>
update
Ticket
updateTicket
(
id
:
string
,
updateTicketDto
:
UpdateTicketDto
,
req
:
any
,
)
:
Promise
<
{
appointment
:
{
appointmentDate
:
Date
;
id
:
string
;
status
:
booking_status
;
}
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
order
:
{
currency
:
string
;
id
:
string
;
status
:
order_status
;
totalAmount
:
Decimal
;
}
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
,
>
Parameters
id
:
string
updateTicketDto
:
UpdateTicketDto
req
:
any
Returns
Promise
<
{
appointment
:
{
appointmentDate
:
Date
;
id
:
string
;
status
:
booking_status
;
}
;
category
:
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
;
createdByProfile
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
order
:
{
currency
:
string
;
id
:
string
;
status
:
order_status
;
totalAmount
:
Decimal
;
}
;
}
&
{
appointmentId
:
string
;
assignedTo
:
string
;
categoryId
:
string
;
clientId
:
string
;
closedAt
:
Date
;
createdAt
:
Date
;
createdBy
:
string
;
description
:
string
;
dueDate
:
Date
;
escalatedAt
:
Date
;
feedback
:
string
;
id
:
string
;
lastActivityAt
:
Date
;
metadata
:
JsonValue
;
orderId
:
string
;
priority
:
string
;
resolvedAt
:
Date
;
satisfactionRating
:
number
;
status
:
string
;
tags
:
string
[]
;
ticketNumber
:
string
;
title
:
string
;
updatedAt
:
Date
;
}
,
>
update
Ticket
Category
updateTicketCategory
(
id
:
string
,
data
:
{
color
?:
string
;
description
?:
string
;
icon
?:
string
;
isActive
?:
boolean
;
name
?:
string
;
}
,
req
:
any
,
)
:
Promise
<
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
,
>
Parameters
id
:
string
data
:
{
color
?:
string
;
description
?:
string
;
icon
?:
string
;
isActive
?:
boolean
;
name
?:
string
;
}
req
:
any
Returns
Promise
<
{
color
:
string
;
createdAt
:
Date
;
description
:
string
;
icon
:
string
;
id
:
string
;
isActive
:
boolean
;
name
:
string
;
updatedAt
:
Date
;
}
,
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
add
Response
create
Ticket
create
Ticket
Category
delete
Ticket
delete
Ticket
Category
get
All
Tickets
get
Ticket
By
Id
get
Ticket
Categories
get
Ticket
Stats
get
User
Tickets
search
Tickets
update
Ticket
update
Ticket
Category
urembo-hub-api
Loading...