feat(ticketing): add service layer, config hook, and utilities for V2#111
Draft
TristanHourtoulle wants to merge 5 commits intodevfrom
Draft
feat(ticketing): add service layer, config hook, and utilities for V2#111TristanHourtoulle wants to merge 5 commits intodevfrom
TristanHourtoulle wants to merge 5 commits intodevfrom
Conversation
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.
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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 transitionsConfiguration 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 APIToast 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 configurationlib/schemas/ticket.ts: Zod validation schemas for ticket creation and updatesTechnical Details
Files Changed: 25 files
Main Areas:
services/ticket.ts: V2 ticket servicehooks/useTicketConfig.ts: Configuration hooklib/utils/file-upload.ts: File upload utilitieslib/toast.ts: Toast translationslib/types/ticket.ts: Type definitionslib/schemas/ticket.ts: Zod schemasTesting
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.