Commit Graph

2 Commits

Author SHA1 Message Date
Ho Ngoc Hai
c68883bd69 feat(contracts): add notification.requested event schema (GOO-173)
Phase 1 RFC-004 prep — define the event contract that the notifications
module will publish through the Phase 0 outbox + Redis Streams backbone.

- Add notification.requested.schema.json (JSON Schema 2020-12) covering
  notificationId, userId, category, template, params, channels, locale,
  priority, dedupeKey, requestedAt
- Add NotificationRequestedPayload + supporting union types
  (NotificationCategory, NotificationChannel, NotificationLocale,
  NotificationPriority) to @goodgo/contracts-events barrel
- Register 'notification.requested' in KNOWN_EVENT_TYPES

Pure contract addition; no producer/consumer wiring yet (follow-up commits
in this branch will introduce the publisher refactor + BullMQ worker).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 12:40:33 +07:00
Ho Ngoc Hai
fa3ba88f40 feat(auth): add row/size caps + streaming to export-user-data
- Add per-collection row cap (default 10k, env EXPORT_ROW_CAP) via Prisma
  take on all findMany calls
- Add total size cap (default 100MB, env EXPORT_SIZE_CAP_MB); throws
  PayloadTooLargeException (413) when exceeded
- Convert response to Node.js Readable stream piped via NestJS StreamableFile
  to avoid large in-memory buffers
- Export ExportUserDataResult interface (stream + truncated flag) from handler
- Update controller to set Content-Type/Content-Disposition headers and
  return StreamableFile
- Document EXPORT_ROW_CAP and EXPORT_SIZE_CAP_MB env vars in Swagger
- Extend tests: row-cap assertion (take arg), size-cap 413 path, stream assertions

Fixes GOO-223 (M-1 from GOO-200 audit).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-24 12:10:54 +07:00