Skip to content

Monorepo DTO & Input Validation Layer #85

@inteee

Description

@inteee

Context: Across all these APIs (Auth, Clinics, Users), we need strict runtime validation to prevent bad data from hitting our controllers or database.
Location: apps/api/src/middlewares/validate.middleware.ts
Requirements:

  1. Implement a generic Zod validation middleware: validateRequest(zodSchema).
  2. Apply Zod schemas to all Phase 1 routes (POST /auth/login, POST /clinics/register, POST /users).
  3. Return beautifully formatted 400 Bad Request errors detailing exactly which fields failed.
    Acceptance Criteria:
  • Missing passwords or invalid emails are caught before the controller logic runs.
  • The middleware is strongly typed, inferring req.body types for the controllers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions