Skip to content

feat: Support Ticket System with Risk Assessment (#464)#587

Merged
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
bigvictoh:feat/464-support-ticket-risk-assessment
May 29, 2026
Merged

feat: Support Ticket System with Risk Assessment (#464)#587
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
bigvictoh:feat/464-support-ticket-risk-assessment

Conversation

@bigvictoh
Copy link
Copy Markdown

Summary

Implements a Support Ticket System with an automated Risk Assessment engine that scores and classifies every ticket on submission.

Changes

Domain service src/lib/tickets/

  • types.ts — Zod-validated schemas for tickets, risk levels (low/medium/high/critical), categories, and priorities
  • risk-engine.ts — Deterministic scoring engine (0–100) weighing priority, category, and keyword signals (security, data loss, financial, auth, urgency, outage, broad impact); maps score to risk level
  • store.ts — Zustand client cache + typed API helpers (fetchTickets, createTicket, updateTicket)

API microservice src/app/api/v1/tickets/

  • route.ts — Edge-runtime GET (list) / POST (create + auto risk-assess) with rate limiting and Zod validation
  • [id]/route.ts — GET / PATCH (update + re-assess on priority change) / DELETE per-ticket

UI layer src/components/tickets/

  • RiskBadge — colour-coded pill (green/yellow/orange/red) with optional score display
  • TicketForm — accessible form with category/priority selectors
  • TicketList — ticket cards showing risk badge, status, and expandable risk factors for high/critical tickets

Page src/app/support/page.tsx — wires form and list together

Risk Assessment Model

Score Level Triggers
0–24 low Low priority, non-sensitive category
25–49 medium Medium priority or billing/account category
50–74 high High priority + sensitive category or keyword signals
75+ critical Critical priority + security/data/financial keywords

Acceptance Criteria

  • Support Ticket System properly implements Risk Assessment
  • No regression in existing functionality
  • Code follows project coding standards (edge runtime, Zod, rate limiting, Zustand)
  • Performance impact is minimal (client store is non-persistent, API is edge)
  • Accessibility guidelines followed (labels, roles, aria-label on badges)
  • Security considerations addressed (rate limiting, Zod validation, input length caps)

Closes #464

Nonso-Eze added 3 commits May 29, 2026 16:17
…code#462)

- Add consent domain service (src/lib/consent/): types, Zustand store,
  API client, and constants with 1-year TTL and localStorage persistence
- Add dedicated consent API endpoint (src/app/api/v1/consent/route.ts):
  edge-runtime GET/PUT/DELETE with rate limiting and Zod validation
- Add CookieConsentBanner: fixed bottom bar with accept-all, reject, and
  manage-preferences actions; hidden once a valid decision exists
- Add CookiePreferencesModal: granular per-category toggles (necessary,
  analytics, functional, marketing) using the existing Modal component
- Wire CookieConsentBanner into RootProviders as a lazy dynamic import
  (ssr: false) to avoid blocking initial render
- Add ticket domain service (src/lib/tickets/): Zod-validated types for
  tickets, risk levels, and categories; deterministic risk-engine scoring
  tickets 0-100 across priority, category, and keyword signals; Zustand
  store for client-side cache with API helpers
- Add ticket API microservice (src/app/api/v1/tickets/): edge-runtime
  GET/POST list+create route and GET/PATCH/DELETE per-ticket route; risk
  assessment runs automatically on create and re-runs on priority change
- Add UI components (src/components/tickets/): RiskBadge with colour-coded
  levels, TicketForm with category/priority selectors, TicketList showing
  risk badge + expandable risk factors for high/critical tickets
- Add /support page wiring TicketForm and TicketList together
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@bigvictoh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER RUKAYAT-CODER merged commit 5f43070 into rinafcode:main May 29, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

performance Support Ticket System : Risk Assessment

3 participants