Skip to content

Cross-Cutting Concerns


CC-001 — GraphQL DataLoaders for N+1 prevention

  • [x] Implemented

Files:

  • Edit: src/config/context.ts — add DataLoaders for: producerById, talentById, jobById, applicationsByJobId

Description: Every resolver that loads a related entity by ID must use a DataLoader (per PATTERNS.md). Audit all resolvers after Epic 2–8 are implemented and add loaders where missing.


CC-002 — Rate limiting on auth and mutation endpoints

  • [x] Implemented

Files:

  • Edit: src/middleware/rateLimiter.ts — add stricter limits for register, login, socialLogin, applyToJob

CC-003 — Input validation with Zod on all service functions

  • [x] Implemented

Files: All new service files under src/services/*/

Description: Every new service function that accepts external input must validate with Zod before touching the DB. This is a pattern requirement from PATTERNS.md.


CC-004 — i18n coverage for all new UI strings

  • [x] Implemented

Files:

  • Edit: packages/i18n/src/messages.ts — add keys for all new UI text
  • Edit: all new frontend component files — use useTranslations() from next-intl (landing) or equivalent for app

Note: The Figma has EN-US variants (Talento Fluxo_en-US, Produtor Fluxo_en-US) confirming the app must be fully bilingual (PT + EN at minimum).


CC-005 — E2E type safety: GraphQL codegen

  • [x] Implemented

Files:

  • Create: castyou-frontend/codegen.ts@graphql-codegen/cli config
  • Create: castyou-frontend/apps/app/src/gql/ — generated types output

Description: Add @graphql-codegen/cli to generate TypeScript types from the backend schema. Run as part of pnpm dev pipeline. Replace all manual gql string queries with generated typed documents and hooks. This eliminates type drift between frontend and backend.