Skip to content

Knowledge Base & Surveys

@nx/helpdesk cung cấp một knowledge base để khách hàng tự giải quyết vấn đề, một hệ thống khảo sát CSAT được kích hoạt tự động khi ticket đóng, và một bảng feature-request có vote.

Knowledge Base

Data Model

ArticleCategory

CộtTypeMô tả
idbigintSnowflake ID
merchantIdbigintPhạm vi tenant
namejsonbTên category (i18n: {en, vi})
slugvarcharSlug thân thiện URL (đã slugify)
parentIdbigintFK → ArticleCategory (phân cấp)
isActivebooleanCờ hiển thị
sortOrdersmallintThứ tự hiển thị

Article

CộtTypeMô tả
idbigintSnowflake ID
merchantIdbigintPhạm vi tenant
categoryIdbigintFK → ArticleCategory
titlejsonbTiêu đề (i18n: {en, vi})
slugvarcharSlug thân thiện URL
contentjsonbNội dung body (i18n, rich text)
statusenumDRAFT / PUBLISHED / ARCHIVED
viewCountintTổng số view
helpfulCountintSố feedback "hữu ích"
notHelpfulCountintSố feedback "không hữu ích"
publishedAttimestampMốc thời gian xuất bản

ArticleView

Theo dõi từng lượt view article:

CộtTypeMô tả
articleIdbigintFK → Article
userIdbigintNgười xem (null nếu ẩn danh)
sessionIdvarcharSession ID cho theo dõi ẩn danh
viewedAttimestampMốc thời gian view

ArticleFeedback

CộtTypeMô tả
articleIdbigintFK → Article
userIdbigintTác giả feedback
isHelpfulbooleantrue = hữu ích, false = không hữu ích
commenttextBình luận tùy chọn

REST API

Articles và article category — tham khảo endpoint đầy đủ render trực tiếp từ /v1/api/helpdesk/doc/openapi.json. Phục vụ bởi ArticleControllerArticleCategoryController. Bảng endpoint cố ý không duy trì thủ công.

Use Cases — Articles

Use CaseMô tả
CreateArticleUseCaseTạo article với status DRAFT
UpdateArticleUseCaseCập nhật nội dung/metadata
PublishArticleUseCaseChuyển sang PUBLISHED
DeleteArticleUseCaseSoft-delete
GetArticleUseCaseLấy chi tiết + ghi nhận view
ListArticlesUseCaseTìm kiếm và lọc
SubmitArticleFeedbackUseCaseGửi feedback hữu ích/không hữu ích
RecordArticleViewUseCaseGhi nhận một event view
CreateArticleCategoryUseCaseTạo một category
UpdateArticleCategoryUseCaseCập nhật một category
DeleteArticleCategoryUseCaseGỡ một category
ListArticleCategoriesUseCaseLiệt kê category phân cấp

Khảo sát CSAT

Khảo sát hài lòng được kích hoạt tự động khi một ticket đóng.

Data Model

Survey

CộtTypeMô tả
idbigintSnowflake ID
merchantIdbigintPhạm vi tenant
namejsonbTên survey (i18n)
triggerEventenumEvent trigger (ví dụ TICKET_CLOSED)
isActivebooleanCờ active

SurveyQuestion

CộtTypeMô tả
surveyIdbigintFK → Survey
questionTextjsonbVăn bản câu hỏi (i18n)
questionTypeenumRATING / TEXT / MULTIPLE_CHOICE
optionsjsonbLựa chọn (cho MULTIPLE_CHOICE)
isRequiredbooleanCâu trả lời có bắt buộc không
sortOrdersmallintThứ tự hiển thị

SurveyResponse

CộtTypeMô tả
surveyIdbigintFK → Survey
ticketIdbigintTicket liên quan
respondentIdbigintID người trả lời
answersjsonbCâu trả lời đã gửi (map questionId → answer)
submittedAttimestampMốc thời gian gửi

REST API

Surveys, questions, và responses — tham khảo endpoint đầy đủ render trực tiếp từ /v1/api/helpdesk/doc/openapi.json. Phục vụ bởi SurveyController. Bảng endpoint cố ý không duy trì thủ công.

Survey Worker

survey-trigger.worker (hàng đợi helpdesk.survey-trigger) chạy TriggerSurveyUseCase khi một ticket đạt trạng thái cuối và gửi khảo sát CSAT tới khách hàng qua kênh thông báo đã cấu hình.


Feature Requests

Data Model

FeatureRequest

CộtTypeMô tả
idbigintSnowflake ID
merchantIdbigintPhạm vi tenant
titlevarcharTiêu đề request
descriptiontextMô tả chi tiết
statusenumOPEN / UNDER_REVIEW / PLANNED / COMPLETED / REJECTED
voteCountintTổng số vote
requesterIdbigintID người tạo

FeatureVote

Bảng junction ghi nhận một vote mỗi user mỗi request (unique theo user + request):

CộtTypeMô tả
featureRequestIdbigintFK → FeatureRequest
userIdbigintNgười vote
votedAttimestampMốc thời gian vote

REST API

Feature request và vote — tham khảo endpoint đầy đủ render trực tiếp từ /v1/api/helpdesk/doc/openapi.json. Phục vụ bởi FeatureRequestController. Bảng endpoint cố ý không duy trì thủ công.

Trang liên quan

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.