Goals — Code Map
API
| File | Role |
|---|---|
apps/api/src/goals/goals.module.ts | Wiring |
apps/api/src/goals/goals.controller.ts | POST/GET/PATCH/DELETE /goals/me, GET /members/:membershipId/goals |
apps/api/src/goals/goals.service.ts | create, findMyGoals, update, remove, findMemberGoals, enrichGoal, resolveStartValue |
apps/api/src/goals/goals.progress.ts | Pure functions computeProgress(start, current, target, direction), defaultDirectionFor(dto) |
apps/api/src/goals/goals.progress.unit.spec.ts | Unit tests for the progress math |
apps/api/src/goals/dto/ | create-goal.dto.ts, update-goal.dto.ts |
DB
| File | Role |
|---|---|
libs/db/src/lib/schema/goals.ts | goals table + CHECK constraints |
libs/db/src/lib/schema/enums.ts | goalType, goalStatus, goalDirection |
Shared
| File | Role |
|---|---|
libs/shared/src/lib/schemas/goal.schema.ts | Zod schemas + types |
Web
| File | Role |
|---|---|
apps/web/src/components/member/goals/ | Member create/list components |
| Member detail tab | Staff read-only view of a member’s goals |