Skip to content

feat(goals): implement goals module skeleton - #1133

Merged
Akanimoh12 merged 2 commits into
Akanimoh12:test-implement-dripsfrom
BernardOnuh:feat/goals-skeleton-1020
Aug 2, 2026
Merged

feat(goals): implement goals module skeleton#1133
Akanimoh12 merged 2 commits into
Akanimoh12:test-implement-dripsfrom
BernardOnuh:feat/goals-skeleton-1020

Conversation

@BernardOnuh

Copy link
Copy Markdown
Contributor

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 response
  • goals.schema.ts — Zod validation schemas for create/update/list query inputs
  • goals.service.ts — Business logic: createGoal, getGoalById, listGoals, updateGoal, cancelGoal (with ownership checks)
  • goals.controller.ts — Express request/response handlers with Zod error handling
  • goals.routes.ts — Router wiring: GET /, GET /:id (public), POST /, PATCH /:id, DELETE /:id (authenticated via requireAuth)
  • goals.test.ts — 14 tests covering all endpoints including auth enforcement and ownership verification

Modified files

  • backend/src/app.ts — Mounted goalsRouter at ${API_BASE_PATH}/goals

Endpoints

Method Path Auth Description
GET /goals No List goals (paginated, optional status filter)
GET /goals/:id No Get a single goal
POST /goals Yes Create a goal
PATCH /goals/:id Yes Update own goal (ownership check)
DELETE /goals/:id Yes Cancel own goal (ownership check)

Tests

  • 14 tests pass covering success, auth enforcement, authorization (ownership), and validation error cases
  • Typecheck and lint pass (0 errors)

Closes #1020

- 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
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Akanimoh12

Copy link
Copy Markdown
Owner

Please fix your

@Akanimoh12

Copy link
Copy Markdown
Owner

Please fix your conflicts

@Akanimoh12

Copy link
Copy Markdown
Owner

Fix the conflicts so I can merge

@BernardOnuh

Copy link
Copy Markdown
Contributor Author

Hi @Akanimoh12, the conflicts are resolved — the branch now merges cleanly into test-implement-drips (merge commit f6853e1). I kept the goals module implementation and integrated the updated base wiring. Note: the base branch currently has pre-existing type/build errors in unrelated modules (analytics, search, notifications, webhooks), so a full-repo typecheck won't pass regardless of this PR. The PR itself is now conflict-free and ready to merge.

@Akanimoh12
Akanimoh12 merged commit d68ff75 into Akanimoh12:test-implement-drips Aug 2, 2026
4 of 5 checks passed
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.

Goals: Goals module skeleton

2 participants