feat: Add Projects management feature with CRUD API, tests, and UI#471
Open
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Open
feat: Add Projects management feature with CRUD API, tests, and UI#471devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Conversation
- Add projects table to database with name, description, client_id, start_date, status fields - Add Joi validation schemas for project creation and update - Add CRUD API endpoints at /api/projects (GET, GET/:id, POST, PUT/:id, DELETE/:id) - Add 29 backend tests covering all endpoints and error cases - Add Project types and API client methods in frontend - Add ProjectsPage with table view and create/edit/delete dialog - Add Projects nav item to sidebar layout - Add /projects route to App.tsx
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- POST /api/projects now validates clientId belongs to authenticated user - PUT /api/projects/:id now validates clientId belongs to authenticated user - Added 5 new tests covering ownership validation and error cases - Follows existing pattern from workEntries routes
…field Changes description coercion from || undefined to || null so users can clear a project's description when editing. Updated API client and mutation type signatures to accept string | null for description.
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.
Summary
Adds a full "Projects" management feature to the timesheet app. Each project has a name, description, optional client assignment, start date, and status (
active/completed/on-hold).Backend:
projectstable in SQLite with foreign keys toclients(ON DELETE SET NULL) andusers(ON DELETE CASCADE), plus a CHECK constraint on status valuesprojectSchema,updateProjectSchema)/api/projects— GET all, GET by id, POST, PUT, DELETE — following the same patterns as the existing/api/clientsroutesclient_namein responsesclientIdis provided, the route verifies the client belongs to the authenticated user before proceeding (matching the pattern inworkEntries.js)Frontend:
ProjectsPagewith MUI table, color-coded status chips, and a create/edit dialog with client dropdown + date picker/projects) and sidebar nav item addedTests:
Updates since last revision
SELECT id FROM clients WHERE id = ? AND user_email = ?before inserting/updating, returning 400 if the client doesn't belong to the user. Added 5 new tests for these paths.description: formData.description || undefinedto|| nullinhandleSubmitso that clearing a project's description in the edit dialog actually persists the change. The previous|| undefinedcoercion causedJSON.stringifyto strip the field entirely, so the backend's dynamic query builder would skip it. Updated API client and mutation type signatures to acceptstring | nullfordescription.Review & Testing Checklist for Human
insertProject/performUpdate) — trace the control flow inprojects.jsPOST and PUT handlers to confirm all code paths correctly gate on the ownership check and that no early-return is missedprojectstable usesON DELETE SET NULLforclient_id— confirm this is the desired behavior when a client is deleted (projects remain but lose their client assignment)Notes
CreateProjectRequest/UpdateProjectRequestTypeScript interfaces are defined intypes/api.tsbut the API client uses inline type annotations instead — these could be consolidated in a follow-upLink to Devin session: https://partner-workshops.devinenterprise.com/sessions/e7ab84755ba340be8da72aa963d0e105