feat(kb): top-ticket-driving-articles endpoint (PMS-485) #356

Merged
YousifShkara merged 1 commit from feat/PMS-485-kb-top-driving into main 2026-06-25 08:04:36 +02:00
Owner

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

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
feat(kb): top-ticket-driving-articles endpoint (PMS-485)
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 21s
Check / fmt + clippy + build + tests (pull_request) Successful in 1m38s
Integration / integration tests (pull_request) Successful in 8m33s
Create release / Create release from merged PR (pull_request) Successful in 3s
79300a1b34
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
YousifShkara deleted branch feat/PMS-485-kb-top-driving 2026-06-25 08:04:37 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!356
No description provided.