Skip to content

Conversation

@WatthanakornR
Copy link

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

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 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
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Spelling error: "MARGETING" should be "MARKETING".

Suggested change
-- Project 9: PR_MARGETING_AFFAIR (60) - CONTINUE
-- Project 9: PR_MARKETING_AFFAIR (60) - CONTINUE

Copilot uses AI. Check for mistakes.
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.

2 participants