Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enhances type safety and input validation for the ESC Project Tracker API, adds comprehensive mock data for testing, and includes dependency metadata updates.
- Added UUID validation to project router endpoints for improved input validation
- Made department filter optional in project filtering to support broader query capabilities
- Added comprehensive SQL mock data file with test data for 15 projects across all project types
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Documents deprecation notice for AWS SDK credential provider package version 3.917.0 |
| mock_data.sql | New file containing comprehensive test data with user accounts, projects across all types, and user-project relationships |
| apps/api/src/trpc/routers/project.router.ts | Added explicit type annotation for appRouter and UUID validation for userId, projectId, and owner parameters; changed department filter to optional enum type |
| apps/api/src/project_/project_.service.ts | Made department parameter optional and added null checks for both department and status filters |
| apps/api/src/main.ts | Added console logging for server startup confirmation |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| NOW() - INTERVAL '5 days', | ||
| NOW() - INTERVAL '1 day' | ||
| ), | ||
| -- Project 9: PR_MARGETING_AFFAIR (60) - CONTINUE |
There was a problem hiding this comment.
Spelling error: "MARGETING" should be "MARKETING".
Suggested change
| -- Project 9: PR_MARGETING_AFFAIR (60) - CONTINUE | |
| -- Project 9: PR_MARKETING_AFFAIR (60) - CONTINUE |
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.
What?
Validate projectId as UUID in project router mutations
Make department optional in findProjectsWithFilter and handle it safely in service
Why?
Stop leaking UUID errors from service layer
Allow “all departments” filtering to return real data
How?
Switch router input schema to z.string().uuid()
Guard query builder with if (department && department !== 'ALL')
Testing?
GET /trpc/project.findProjectsWithFilter?input={"status":"CONTINUE"}
GET /trpc/project.findProjectsWithFilter?input={"status":"CONTINUE","department":"40"}
POST /trpc/project.deleteProject with invalid UUID → fails fast