Skip to content

[Wave 200pts] Build Goals Module — Controller, HTTP Endpoints, Module Registration, Migration, and E2E Test Suite #258

@portableDD

Description

@portableDD

Summary

GoalsService has full business logic and unit tests, but GoalsController does not exist, GoalsModule is not registered in AppModule, and there is no database migration for the goals table. The feature is completely invisible.

Why This Matters

Goals is a user-facing savings feature with complete service logic already written and tested. The only missing pieces are the HTTP layer and registration — without them the entire feature is unreachable.

What Needs to Be Done

  • Build GoalsController with full CRUD: create, list, get by ID, update, delete, mark complete
  • Add linked wallet endpoint to associate goals with wallets
  • Write TypeORM migration for goals table
  • Register GoalsModule in AppModule
  • Build complete E2E test suite

Key Files

  • src/goals/goals.controller.ts — create with all endpoints
  • src/goals/goals.module.ts — create and register
  • src/app.module.ts — import GoalsModule
  • src/database/migrations/xxxx-create-goals.ts — migration
  • test/goals.e2e-spec.ts — E2E tests

Acceptance Criteria

  • POST /goals creates a goal and returns it with progressPercentage calculated
  • GET /goals returns only the authenticated user's goals
  • GET /goals/:id returns 404 for goals belonging to other users
  • PATCH /goals/:id updates fields and recalculates progressPercentage
  • POST /goals/:id/complete validates currentAmount >= targetAmount
  • DELETE /goals/:id soft-deletes and returns 204
  • Migration runs cleanly against a real PostgreSQL database
  • All E2E tests pass with a fresh test database

Constraints

  • Goal ownership must be enforced at service level, not just controller level
  • progressPercentage must always be computed, never stored
  • Complexity: High — 200 points

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions