Skip to content

Refactored strikes component#305

Merged
zalexa19 merged 15 commits intomainfrom
task/issue-298-usequery
Feb 20, 2026
Merged

Refactored strikes component#305
zalexa19 merged 15 commits intomainfrom
task/issue-298-usequery

Conversation

@zalexa19
Copy link
Contributor

  • 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

@HackYourFutures HackYourFutures temporarily deployed to dojo-task-issue-298-use-lcsxpm February 15, 2026 11:34 Inactive
@HackYourFutures HackYourFutures temporarily deployed to dojo-task-issue-298-use-imcmsy February 15, 2026 15:06 Inactive
@zalexa19 zalexa19 changed the title Refactored Refactored strikes component Feb 15, 2026
@stasel stasel requested a review from Copilot February 15, 2026 15:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Strike domain model + StrikeRequest/StrikeResponse API types, with mappers between them.
  • Adds a strikeKeys factory and updates strikes queries/mutations to use it.
  • Extracts add/edit/delete strike mutations into data/mutations.ts and 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.

@HackYourFutures HackYourFutures had a problem deploying to dojo-task-issue-298-use-imcmsy February 15, 2026 19:25 Failure
@HackYourFutures HackYourFutures temporarily deployed to dojo-task-issue-298-use-imcmsy February 15, 2026 19:34 Inactive
@zalexa19
Copy link
Contributor Author

not ready :)

@zalexa19 zalexa19 closed this Feb 15, 2026
@zalexa19 zalexa19 reopened this Feb 18, 2026
@HackYourFutures HackYourFutures temporarily deployed to dojo-task-issue-298-use-pc3hjh February 18, 2026 08:31 Inactive
@HackYourFutures HackYourFutures had a problem deploying to dojo-task-issue-298-use-pc3hjh February 18, 2026 10:07 Failure
@HackYourFutures HackYourFutures temporarily deployed to dojo-task-issue-298-use-pc3hjh February 19, 2026 19:38 Inactive
@zalexa19 zalexa19 force-pushed the task/issue-298-usequery branch from f77c19b to 6783c33 Compare February 20, 2026 19:58
@HackYourFutures HackYourFutures temporarily deployed to dojo-task-issue-298-use-pc3hjh February 20, 2026 19:58 Inactive
@zalexa19 zalexa19 merged commit 3220aa3 into main Feb 20, 2026
1 check passed
@zalexa19 zalexa19 deleted the task/issue-298-usequery branch February 20, 2026 20:08
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.

4 participants