feat(kb): top-ticket-driving-articles endpoint (PMS-485) #356
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-server!356
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-485-kb-top-driving"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Server slice of PMS-485. New tenant-scoped endpoint
GET /api/v1/kb/top-ticket-driving-articles?days=N&limit=M returning
{id, title, ticket_count} rows ordered by descending ticket_count.
SQL groups tickets joined to kb_articles on the PMS-452
tickets.source_kb_article_idFK; the partial index added inmigration 068 (
(tenant_id, source_kb_article_id) WHERE source_kb_article_id IS NOT NULL) keeps the predicate selective.Defaults: 90-day window, 20-row cap. Clamped: days in [1, 365],
limit in [1, 100], so a malformed query parameter can't widen the
scan beyond a year of tenant tickets or 100 rows.
Auth:
RequireKnowledgeBase(same agent-side surface that owns therest of the KB routes); never exposed under the portal tree.
Client widget on the KB landing page lands in the SPA repo.
#PMS-485
Server slice of PMS-485. New tenant-scoped endpoint GET /api/v1/kb/top-ticket-driving-articles?days=N&limit=M returning {id, title, ticket_count} rows ordered by descending ticket_count. SQL groups tickets joined to kb_articles on the PMS-452 `tickets.source_kb_article_id` FK; the partial index added in migration 068 (`(tenant_id, source_kb_article_id) WHERE source_kb_article_id IS NOT NULL`) keeps the predicate selective. Defaults: 90-day window, 20-row cap. Clamped: days in [1, 365], limit in [1, 100], so a malformed query parameter can't widen the scan beyond a year of tenant tickets or 100 rows. Auth: `RequireKnowledgeBase` (same agent-side surface that owns the rest of the KB routes); never exposed under the portal tree. Client widget on the KB landing page lands in the SPA repo. #PMS-485