feat(goals): implement goals module skeleton - #1133
Conversation
- Add goals.types.ts with GoalResponse, CreateGoalRequest, etc. - Add goals.schema.ts with Zod validation for create/update/list - Add goals.service.ts with CRUD + ownership checks - Add goals.controller.ts with Express route handlers - Add goals.routes.ts with public GET routes and authenticated POST/PATCH/DELETE - Add goals.test.ts with 14 tests covering all endpoints - Mount goalsRouter in app.ts at /api/v1/goals
|
@BernardOnuh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Please fix your |
|
Please fix your conflicts |
|
Fix the conflicts so I can merge |
|
Hi @Akanimoh12, the conflicts are resolved — the branch now merges cleanly into |
d68ff75
into
Akanimoh12:test-implement-drips
Summary
Implements the Goals module skeleton with full CRUD endpoints and ownership-based authorization.
Changes
New files under
backend/src/modules/goals/goals.types.ts— TypeScript interfaces for GoalResponse, request types, and paginated list responsegoals.schema.ts— Zod validation schemas for create/update/list query inputsgoals.service.ts— Business logic: createGoal, getGoalById, listGoals, updateGoal, cancelGoal (with ownership checks)goals.controller.ts— Express request/response handlers with Zod error handlinggoals.routes.ts— Router wiring:GET /,GET /:id(public),POST /,PATCH /:id,DELETE /:id(authenticated viarequireAuth)goals.test.ts— 14 tests covering all endpoints including auth enforcement and ownership verificationModified files
backend/src/app.ts— MountedgoalsRouterat${API_BASE_PATH}/goalsEndpoints
Tests
Closes #1020