Skip to content

feat(ticketing): add service layer, config hook, and utilities for V2#111

Draft
TristanHourtoulle wants to merge 5 commits intodevfrom
feature/tri-91-92
Draft

feat(ticketing): add service layer, config hook, and utilities for V2#111
TristanHourtoulle wants to merge 5 commits intodevfrom
feature/tri-91-92

Conversation

@TristanHourtoulle
Copy link
Member

Summary

Foundation work for the ticketing V2 rebuild. Adds the service layer, configuration hook, file upload utilities, and toast translations needed by upcoming ticket pages.

Type of Change

  • Feature
  • Bug Fix
  • Refactoring
  • Documentation
  • Performance
  • Other

Changes Overview

Service Layer

  • services/ticket.ts: Rewritten ticket service using the V2 API contract with typed methods for CRUD operations, comments, attachments, and status transitions

Configuration Hook

  • hooks/useTicketConfig.ts: New hook for fetching ticketing configuration (categories, priorities, statuses)

File Upload Utilities

  • lib/utils/file-upload.ts: Reworked file upload utilities adapted for the V2 ticketing API

Toast Translations

  • lib/toast.ts: Added French toast messages for all ticketing operations (creation, update, deletion, comments, attachments)

Types & Schemas

  • lib/types/ticket.ts: V2 type definitions for tickets, comments, attachments, and configuration
  • lib/schemas/ticket.ts: Zod validation schemas for ticket creation and updates

Technical Details

Files Changed: 25 files
Main Areas:

  • services/ticket.ts: V2 ticket service
  • hooks/useTicketConfig.ts: Configuration hook
  • lib/utils/file-upload.ts: File upload utilities
  • lib/toast.ts: Toast translations
  • lib/types/ticket.ts: Type definitions
  • lib/schemas/ticket.ts: Zod schemas

Testing

  • Tested locally
  • No regression in existing features

Breaking Changes

None — this PR only adds new modules. V1 cleanup and V2 pages are handled in separate PRs.

Deployment Notes

No special steps required.

Remove all frontend ticketing code (types, services, hooks, components,
pages, tests, docs) and clean up references in navigation, toasts, and
role permissions. This clears the way for the TICKETING-V2 rebuild.

Closes TRI-85
…tilities for V2

Lay the frontend foundations for the ticketing V2 system:
- Types and interfaces aligned with backend MongoDB schemas
- Zod validation schemas for ticket and message creation forms
- File utilities for validation, image compression, and Base64 conversion
…ons for V2

Implements the full service layer with CRUD operations, admin endpoints,
config hook for ticket metadata, and French toast translations.
@TristanHourtoulle TristanHourtoulle added the feature New feature label Feb 28, 2026
@TristanHourtoulle TristanHourtoulle self-assigned this Feb 28, 2026
@github-actions
Copy link

github-actions bot commented Feb 28, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 70.29% 523 / 744
🔵 Statements 70.75% 554 / 783
🔵 Functions 55.93% 99 / 177
🔵 Branches 66.56% 221 / 332
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
hooks/useTicketConfig.ts 97.61% 88.88% 100% 100% 80
lib/toast.ts 19.79% 10% 1.78% 19.79% 91, 97, 106, 117-152, 299-352, 358-367, 371-377, 381-386, 391-394, 399-402, 406-413, 418-441
lib/utils/file-upload.ts 48.93% 60% 75% 47.72% 54-76, 91, 94, 111-133
services/ticket.ts 62.76% 50% 73.33% 59.77% 68-73, 123-124, 135-136, 143-151, 167-168, 176-185, 200-201, 217-218, 225-234, 243-251, 267-268
Generated in workflow #11 for commit 3cb495e by the Vitest Coverage Report Action

…dependencies

- Add JSDoc to useTicketConfig and useTicketService custom hooks
- Add axios status/statusText logging in logError per service-logging standard
- Use useRef for ticketService to stabilize fetchConfigs/refetch references
…file upload

- tests/unit/services/ticket.test.ts: 12 tests for all service methods
- tests/unit/hooks/useTicketConfig.test.ts: 7 tests for config fetching, filtering, refetch
- tests/unit/lib/file-upload.test.ts: 12 tests for validation, compression, base64 conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant