Skip to content

Conversation

@n1kolasM
Copy link
Contributor

No description provided.

Copy link

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 improves type safety in validation schemas by ensuring that validated parameters are properly converted to their expected branded types. The changes introduce branded string types for various ID types and convert unknown parameter types to properly validated types before passing them to provider methods.

  • Introduced brandedString helper function to transform plain strings into branded types
  • Changed parameter types from specific types to unknown in find methods to ensure runtime validation
  • Added proper type casting for NotificationType using z.nativeEnum

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/server/src/middleware/validate.ts Updated validation schemas to use branded types and modified find methods to accept unknown params that are validated and cast to proper types
packages/server/src/tests/middleware/validate.test.ts Updated test to validate date string coercion by passing raw string date and expecting coerced Date object

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Nikolay Marchuk <[email protected]>
@n1kolasM n1kolasM merged commit c367754 into main Oct 23, 2025
1 check passed
@kristina-fefelova kristina-fefelova deleted the improve-find-validation branch October 23, 2025 16:54
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.

3 participants