Skip to content

Knowledge Base & Surveys

@nx/helpdesk provides a knowledge base so customers can self-resolve issues, a CSAT survey system triggered automatically when tickets close, and a feature-request board with voting.

Knowledge Base

Data Model

ArticleCategory

ColumnTypeDescription
idbigintSnowflake ID
merchantIdbigintTenant scope
namejsonbCategory name (i18n: {en, vi})
slugvarcharURL-friendly slug (slugified)
parentIdbigintFK → ArticleCategory (hierarchical)
isActivebooleanVisibility flag
sortOrdersmallintDisplay order

Article

ColumnTypeDescription
idbigintSnowflake ID
merchantIdbigintTenant scope
categoryIdbigintFK → ArticleCategory
titlejsonbTitle (i18n: {en, vi})
slugvarcharURL-friendly slug
contentjsonbBody content (i18n, rich text)
statusenumDRAFT / PUBLISHED / ARCHIVED
viewCountintTotal view count
helpfulCountint"Helpful" feedback count
notHelpfulCountint"Not helpful" feedback count
publishedAttimestampPublication timestamp

ArticleView

Tracks individual article views:

ColumnTypeDescription
articleIdbigintFK → Article
userIdbigintViewer (null if anonymous)
sessionIdvarcharSession ID for anonymous tracking
viewedAttimestampView timestamp

ArticleFeedback

ColumnTypeDescription
articleIdbigintFK → Article
userIdbigintFeedback author
isHelpfulbooleantrue = helpful, false = not helpful
commenttextOptional comment

REST API

Articles and article categories — full endpoint reference rendered live from /v1/api/helpdesk/doc/openapi.json. Served by ArticleController and ArticleCategoryController. Endpoint tables are intentionally not hand-maintained.

Use Cases — Articles

Use CaseDescription
CreateArticleUseCaseCreate article with DRAFT status
UpdateArticleUseCaseUpdate content/metadata
PublishArticleUseCaseTransition to PUBLISHED
DeleteArticleUseCaseSoft-delete
GetArticleUseCaseFetch details + record view
ListArticlesUseCaseSearch and filter
SubmitArticleFeedbackUseCaseSubmit helpful/not-helpful feedback
RecordArticleViewUseCaseRecord a view event
CreateArticleCategoryUseCaseCreate a category
UpdateArticleCategoryUseCaseUpdate a category
DeleteArticleCategoryUseCaseRemove a category
ListArticleCategoriesUseCaseList hierarchical categories

CSAT Surveys

Satisfaction surveys are triggered automatically when a ticket closes.

Data Model

Survey

ColumnTypeDescription
idbigintSnowflake ID
merchantIdbigintTenant scope
namejsonbSurvey name (i18n)
triggerEventenumTrigger event (e.g. TICKET_CLOSED)
isActivebooleanActive flag

SurveyQuestion

ColumnTypeDescription
surveyIdbigintFK → Survey
questionTextjsonbQuestion text (i18n)
questionTypeenumRATING / TEXT / MULTIPLE_CHOICE
optionsjsonbChoices (for MULTIPLE_CHOICE)
isRequiredbooleanWhether answer is mandatory
sortOrdersmallintDisplay order

SurveyResponse

ColumnTypeDescription
surveyIdbigintFK → Survey
ticketIdbigintRelated ticket
respondentIdbigintRespondent ID
answersjsonbSubmitted answers (questionId → answer map)
submittedAttimestampSubmission timestamp

REST API

Surveys, questions, and responses — full endpoint reference rendered live from /v1/api/helpdesk/doc/openapi.json. Served by SurveyController. Endpoint tables are intentionally not hand-maintained.

Survey Worker

survey-trigger.worker (helpdesk.survey-trigger queue) runs TriggerSurveyUseCase when a ticket reaches a terminal state and dispatches CSAT surveys to the customer via the configured notification channel.


Feature Requests

Data Model

FeatureRequest

ColumnTypeDescription
idbigintSnowflake ID
merchantIdbigintTenant scope
titlevarcharRequest title
descriptiontextDetailed description
statusenumOPEN / UNDER_REVIEW / PLANNED / COMPLETED / REJECTED
voteCountintTotal vote count
requesterIdbigintCreator's ID

FeatureVote

Junction table recording one vote per user per request (unique per user + request):

ColumnTypeDescription
featureRequestIdbigintFK → FeatureRequest
userIdbigintVoter
votedAttimestampVote timestamp

REST API

Feature requests and voting — full endpoint reference rendered live from /v1/api/helpdesk/doc/openapi.json. Served by FeatureRequestController. Endpoint tables are intentionally not hand-maintained.

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