diff --git a/dist/clients/student/openapi.yaml b/dist/clients/student/openapi.yaml
index c63f2c0..493e89d 100644
--- a/dist/clients/student/openapi.yaml
+++ b/dist/clients/student/openapi.yaml
@@ -3406,40 +3406,7 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
tags:
- Student
- /surveys:
- get:
- operationId: Surveys_getSurveys
- summary: Get surveys | Mostra survey
- parameters: []
- responses:
- '200':
- description: The request has succeeded.
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Survey'
- required:
- - data
- '400':
- description: The server could not understand the request due to invalid syntax.
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- '500':
- description: Server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- tags:
- - Surveys
- /ticket-faqs:
+ /student/ticket-faqs:
get:
operationId: TicketFAQs_searchTicketFAQs
summary: Search ticket FAQs | Ricerca FAQ ticket
@@ -3488,7 +3455,7 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
tags:
- Tickets
- /ticket-topics:
+ /student/ticket-topics:
get:
operationId: TicketTopics_getTicketTopics
summary: List ticket topics | Elenca ambiti ticket
@@ -3521,7 +3488,7 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
tags:
- Tickets
- /tickets:
+ /student/tickets:
get:
operationId: Tickets_getTickets
summary: List tickets | Elenca ticket
@@ -3590,7 +3557,7 @@ paths:
multipart/form-data:
schema:
$ref: '#/components/schemas/CreateTicketRequest'
- /tickets/{ticketId}:
+ /student/tickets/{ticketId}:
get:
operationId: Tickets_getTicket
summary: Show a ticket | Mostra un ticket
@@ -3626,7 +3593,7 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
tags:
- Tickets
- /tickets/{ticketId}/attachments/{attachmentId}:
+ /student/tickets/{ticketId}/attachments/{attachmentId}:
get:
operationId: Tickets_getTicketAttachment
summary: Download ticket attachment | Scarica allegato del ticket
@@ -3667,10 +3634,10 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
tags:
- Tickets
- /tickets/{ticketId}/close:
- put:
- operationId: Tickets_markTicketAsClosed
- summary: Mark a ticket as closed | Segna un ticket come chiuso
+ /student/tickets/{ticketId}/feedback:
+ post:
+ operationId: Tickets_provideTicketFeedback
+ summary: Provide feedback about a ticket | Fornisci feedback su un ticket
parameters:
- name: ticketId
in: path
@@ -3678,8 +3645,17 @@ paths:
schema:
type: integer
responses:
- '204':
- description: 'There is no content to send for this request, but the headers may be useful. '
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ data:
+ type: boolean
+ required:
+ - data
'400':
description: The server could not understand the request due to invalid syntax.
content:
@@ -3694,7 +3670,13 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
tags:
- Tickets
- /tickets/{ticketId}/read:
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/TicketFeedbackRequest'
+ /student/tickets/{ticketId}/read:
put:
operationId: Tickets_markTicketAsRead
summary: Mark a ticket as read | Segna un ticket come letto
@@ -3721,7 +3703,7 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
tags:
- Tickets
- /tickets/{ticketId}/replies:
+ /student/tickets/{ticketId}/replies:
post:
operationId: Tickets_replyToTicket
summary: Reply to a ticket | Rispondi ad un ticket
@@ -3754,7 +3736,7 @@ paths:
multipart/form-data:
schema:
$ref: '#/components/schemas/ReplyTicketRequest'
- /tickets/{ticketId}/replies/{replyId}/attachments/{attachmentId}:
+ /student/tickets/{ticketId}/replies/{replyId}/attachments/{attachmentId}:
get:
operationId: Tickets_getTicketReplyAttachment
summary: Download ticket reply attachment | Scarica allegato di una risposta al ticket
@@ -3800,7 +3782,7 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
tags:
- Tickets
- /tickets/{ticketId}/replies/{replyId}/feedback:
+ /student/tickets/{ticketId}/replies/{replyId}/feedback:
put:
operationId: Tickets_setTicketReplyFeedback
summary: Give feedback on a ticket reply | Fornisci feedback su una risposta al ticket
@@ -3821,6 +3803,42 @@ paths:
schema:
type: boolean
explode: false
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ data:
+ type: boolean
+ required:
+ - data
+ '400':
+ description: The server could not understand the request due to invalid syntax.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ '500':
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ tags:
+ - Tickets
+ /student/tickets/{ticketId}/resolve:
+ put:
+ operationId: Tickets_markTicketAsClosed
+ summary: Mark a ticket as resolved | Segna un ticket come risolto
+ parameters:
+ - name: ticketId
+ in: path
+ required: true
+ schema:
+ type: integer
responses:
'204':
description: 'There is no content to send for this request, but the headers may be useful. '
@@ -3838,6 +3856,39 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
tags:
- Tickets
+ /surveys:
+ get:
+ operationId: Surveys_getSurveys
+ summary: Get surveys | Mostra survey
+ parameters: []
+ responses:
+ '200':
+ description: The request has succeeded.
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/Survey'
+ required:
+ - data
+ '400':
+ description: The server could not understand the request due to invalid syntax.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ '500':
+ description: Server error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorResponse'
+ tags:
+ - Surveys
/unreadEmails:
get:
operationId: StudentNs_getUnreadEmailsNumber
@@ -5793,6 +5844,22 @@ components:
fcmRegistrationToken:
type: string
example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
+ FeedbackProvided:
+ type: object
+ required:
+ - rating
+ - createdAt
+ properties:
+ rating:
+ type: number
+ example: 3
+ createdAt:
+ type: string
+ format: date-time
+ example: '2022-08-31T14:00:00Z'
+ example:
+ rating: 3
+ createdAt: '2022-08-31T14:00:00Z'
Floor:
type: object
required:
@@ -7394,6 +7461,8 @@ components:
- updatedAt
- replies
- attachments
+ - needsFeedback
+ - duplicateId
properties:
id:
type: number
@@ -7435,6 +7504,13 @@ components:
type: array
items:
$ref: '#/components/schemas/TicketAttachment'
+ needsFeedback:
+ type: boolean
+ feedbackProvided:
+ $ref: '#/components/schemas/FeedbackProvided'
+ duplicateId:
+ type: integer
+ nullable: true
TicketAttachment:
type: object
required:
@@ -7480,6 +7556,17 @@ components:
id: 3623
question: Ho dimenticato il mio nome utente e/o la password e non riesco più ad accedere ad Apply@Polito. Come posso fare?
answer: Clicca sul link "Codice e/o Password dimenticata?" presente sulla pagina di Log-in e segui le istruzioni.
+ TicketFeedbackRequest:
+ type: object
+ required:
+ - rating
+ properties:
+ rating:
+ type: integer
+ example: 4
+ comment:
+ type: string
+ example: La risposta è stata molto utile, grazie!
TicketOverview:
type: object
required:
@@ -7530,7 +7617,7 @@ components:
id: 1145890
subject: Sostituzione esame in piano carriera
message: Buongiorno, vi contatto per sostituire A con B
- status: new
+ status: open
hasAttachments: true
isFromAgent: false
agentId: null
@@ -7595,9 +7682,13 @@ components:
TicketStatus:
type: string
enum:
- - new
+ - open
- pending
- - closed
+ - waiting_user
+ - incoming
+ - resolved
+ - autoresolved
+ - duplicate
TicketSubtopic:
type: object
required:
diff --git a/src/examples/student/tickets.tsp b/src/examples/student/tickets.tsp
index 13f2ca8..c65917b 100644
--- a/src/examples/student/tickets.tsp
+++ b/src/examples/student/tickets.tsp
@@ -25,11 +25,16 @@ const _ex_ticket_attachment = #{
sizeInKiloBytes: 305,
};
+const _ex_feedback_provided = #{
+ rating: 3,
+ createdAt: utcDateTime.fromISO("2022-08-31T14:00:00Z"),
+};
+
const _ex_ticket_overview = #{
id: 1145890,
subject: "Sostituzione esame in piano carriera",
message: "Buongiorno, vi contatto per sostituire A con B",
- status: TicketStatus.new,
+ status: TicketStatus.open,
hasAttachments: true,
isFromAgent: false,
agentId: null,
diff --git a/src/routes/student/tickets.tsp b/src/routes/student/tickets.tsp
index 2180a14..c8aa142 100644
--- a/src/routes/student/tickets.tsp
+++ b/src/routes/student/tickets.tsp
@@ -36,9 +36,13 @@ model TicketTopic {
}
enum TicketStatus {
- new: "new",
+ open: "open",
pending: "pending",
- closed: "closed",
+ waiting_user: "waiting_user",
+ incoming: "incoming",
+ resolved: "resolved",
+ autoresolved: "autoresolved",
+ duplicate: "duplicate",
}
@example(_ex_ticket_attachment)
@@ -56,6 +60,15 @@ model TicketAttachment {
sizeInKiloBytes: integer;
}
+@example(_ex_feedback_provided)
+model FeedbackProvided {
+ @example(3)
+ rating: numeric;
+
+ @example(utcDateTime.fromISO("2022-08-31T14:00:00Z"))
+ createdAt: utcDateTime;
+}
+
@example(_ex_ticket_overview)
model TicketOverview {
@example(1145890)
@@ -123,6 +136,9 @@ model Ticket {
...TicketOverview;
replies: TicketReply[];
attachments: TicketAttachment[];
+ needsFeedback: boolean;
+ feedbackProvided?: FeedbackProvided;
+ duplicateId: integer | null;
}
model CreateTicketRequest {
@@ -137,8 +153,16 @@ model ReplyTicketRequest {
attachment?: HttpPart;
}
+model TicketFeedbackRequest {
+ @example(4)
+ rating: integer;
+
+ @example("La risposta è stata molto utile, grazie!")
+ comment?: string;
+}
+
@tag("Tickets")
-@route("/ticket-faqs")
+@route("/student/ticket-faqs")
interface TicketFAQs {
@get
@summary("Search ticket FAQs | Ricerca FAQ ticket")
@@ -151,7 +175,7 @@ interface TicketFAQs {
}
@tag("Tickets")
-@route("/ticket-topics")
+@route("/student/ticket-topics")
interface TicketTopics {
@get
@summary("List ticket topics | Elenca ambiti ticket")
@@ -159,7 +183,7 @@ interface TicketTopics {
}
@tag("Tickets")
-@route("/tickets")
+@route("/student/tickets")
interface Tickets {
@get
@summary("List tickets | Elenca ticket")
@@ -182,11 +206,19 @@ interface Tickets {
@summary("Mark a ticket as read | Segna un ticket come letto")
markTicketAsRead(@path ticketId: integer): NoContentResponse | BaseErrors;
- @route("/{ticketId}/close")
+ @route("/{ticketId}/resolve")
@put
- @summary("Mark a ticket as closed | Segna un ticket come chiuso")
+ @summary("Mark a ticket as resolved | Segna un ticket come risolto")
markTicketAsClosed(@path ticketId: integer): NoContentResponse | BaseErrors;
+ @route("/{ticketId}/feedback")
+ @post
+ @summary("Provide feedback about a ticket | Fornisci feedback su un ticket")
+ provideTicketFeedback(
+ @path ticketId: integer,
+ @body body: TicketFeedbackRequest,
+ ): OkDataResponse | BaseErrors;
+
@route("/{ticketId}/attachments/{attachmentId}")
@get
@summary("Download ticket attachment | Scarica allegato del ticket")
@@ -215,7 +247,7 @@ interface Tickets {
@path ticketId: integer,
@path replyId: integer,
@query positive: boolean,
- ): NoContentResponse | BaseErrors;
+ ): OkDataResponse | BaseErrors;
@route("/{ticketId}/replies/{replyId}/attachments/{attachmentId}")
@get