Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the trainee-profile “strikes” feature to introduce explicit domain models and API DTO types, adds mapping utilities between the two, centralizes React Query keys, and moves strike mutations into a dedicated module.
Changes:
- Introduces a
Strikedomain model +StrikeRequest/StrikeResponseAPI types, with mappers between them. - Adds a
strikeKeysfactory and updates strikes queries/mutations to use it. - Extracts add/edit/delete strike mutations into
data/mutations.tsand updates consumers.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/features/trainee-profile/education/strikes/models/strike.ts | Adds strikes domain model + reason enum. |
| client/src/features/trainee-profile/education/strikes/data/strike-queries.ts | Updates strikes query hook to use key factory. |
| client/src/features/trainee-profile/education/strikes/data/mutations.ts | New file: centralized strike mutations + cache invalidation. |
| client/src/features/trainee-profile/education/strikes/data/keys.ts | New file: query key factory for strikes. |
| client/src/features/trainee-profile/education/strikes/api/types.ts | New file: request/response DTOs for strikes API. |
| client/src/features/trainee-profile/education/strikes/api/mapper.ts | New file: maps strikes DTOs ↔ domain model. |
| client/src/features/trainee-profile/education/strikes/api/api.ts | Refactors strikes API calls to accept DTO request type. |
| client/src/features/trainee-profile/education/strikes/StrikesList.tsx | Updates UI to consume new strike model fields. |
| client/src/features/trainee-profile/education/strikes/StrikesComponent.tsx | Updates imports to new hooks/types; removes manual invalidation. |
| client/src/features/trainee-profile/education/strikes/StrikeDetailsModal.tsx | Refactors form state typing and save payload construction. |
| client/src/data/types/Trainee.ts | Removes Strike and StrikeReason from shared Trainee types. |
| client/src/data/tanstack/tanstackClient.ts | Centralizes react-query auth redirect error handling for both queries and mutations. |
| .vscode/settings.json | Editor config formatting update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
client/src/features/trainee-profile/education/strikes/api/api.ts
Outdated
Show resolved
Hide resolved
client/src/features/trainee-profile/education/strikes/StrikesList.tsx
Outdated
Show resolved
Hide resolved
client/src/features/trainee-profile/education/strikes/StrikeDetailsModal.tsx
Show resolved
Hide resolved
Contributor
Author
|
not ready :) |
stasel
approved these changes
Feb 19, 2026
f77c19b to
6783c33
Compare
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.
Refactored api calls for the strike componets.
Added a model (buisness type) and API request and response type for a clear separation between frontend and backend.
Also added mappers to bridge between the two
Added a key factory for strikes
Move mutations to their own file