Add Projects management feature with full CRUD#759
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
Add Projects management feature with full CRUD#759devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
Backend: - Add projects table with client FK, start_date, status, user_email scoping - Add Joi validation schemas (projectSchema, updateProjectSchema) - Add /api/projects routes (GET, GET/:id, POST, PUT/:id, DELETE/:id) - Register project routes in server.js - Add comprehensive test suite (30 tests) Frontend: - Add Project TypeScript interfaces - Add project CRUD methods to ApiClient - Add ProjectsPage with MUI table, dialog form, status chips - Add route and sidebar navigation entry
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:
|
- Extract PROJECT_SELECT, FIELD_MAP, verifyClientOwnership, buildDynamicUpdate, fetchProject helpers in routes/projects.js - Extract mock helpers (mockGetReturns, mockRunSucceeds, etc.) and shared constants (SAMPLE_PROJECT, VALID_INPUT) in tests - Use test.each for validation test cases
Backend: Extract handleDbError, parseIdParam, findOwnedRecord helpers to eliminate repeated error handling and ID parsing patterns. Frontend: Extract extractApiError utility and INITIAL_FORM constant, consolidate mutation callbacks via invalidateAndClose/invalidateOnly.
- Use projectId === null instead of !projectId to handle ID 0 correctly - Send description as-is (empty string) to allow clearing descriptions - Use local date extraction instead of toISOString() to avoid timezone off-by-one
|
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 complete "Projects" management feature to the timesheet application, following all existing codebase patterns. Each project has a name, description, client assignment, start date, and status (active/completed/on-hold).
Backend
projectstable indatabase/init.jswithid,name,description,client_id(FK),start_date,status,user_email(FK), and timestamps. Added indexes onclient_id,user_email, andstatus.projectSchemaandupdateProjectSchemaJoi schemas invalidation/schemas.jswithstatusconstrained toactive | completed | on-hold.routes/projects.jswith full CRUD —GET /,GET /:id,POST /,PUT /:id,DELETE /:id. Includes client ownership verification on create/update, dynamic SET clause for partial updates, and consistent response shapes. Uses extracted helpers (handleDbError,parseIdParam,findOwnedRecord,verifyClientOwnership,buildDynamicUpdate,fetchProject) to minimize duplication.app.use('/api/projects', projectRoutes)inserver.js.test.eachfor concise validation tests.Frontend
Project,CreateProjectRequest,UpdateProjectRequestinterfaces intypes/api.ts.getProjects,getProject,createProject,updateProject,deleteProjectmethods toApiClient.ProjectsPage.tsxwith MUI table, dialog form (name, client select, date picker, status select, description), status color chips, loading/empty/error states. Uses extractedextractApiError,formatLocalDateutilities,INITIAL_FORMconstant, andisSavingderived state./projectsroute inApp.tsxand sidebar nav entry withFolderSpecialicon inLayout.tsx.Review & Testing Checklist for Human
active,completed,on-hold) display with correct chip colorsNotes
Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/67bc01cacc714833a0ace61369709b40