Skip to content

feat: transactional outbox, auth rate limiting, and currency API docs - #1334

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
devzakari-sketch:fix/assigned-issues
Aug 26, 2026
Merged

feat: transactional outbox, auth rate limiting, and currency API docs#1334
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
devzakari-sketch:fix/assigned-issues

Conversation

@devzakari-sketch

Copy link
Copy Markdown
Contributor

Summary

Four changes:

  1. Transactional outbox for domain events — new event_outbox table, OutboxService, and OutboxRelayService. Producers (courses, enrollments, subscriptions, points) now persist events atomically with their state change instead of firing in-process EventEmitter2 emits before/around the write. The relay polls unpublished rows after commit and dispatches them at-least-once; the invoice consumer is now idempotent so redelivery never mints a duplicate invoice (cache invalidation and badge awarding were already idempotent). Includes migration CreateEventOutbox1798000000000 and unit tests.
  2. Rate limiting on auth endpointsCustomThrottleGuard applied to auth.controller.ts with the documented THROTTLE presets (STRICT for register, AUTH_LOGIN for login, REFRESH for refresh, AUTH_DEFAULT for logout); ThrottlerModule registered in auth.module.ts. Exceeding a limit returns 429.
  3. Rate limiting on social-auth endpoints — same guard on social-auth.controller.ts (AUTH_DEFAULT on the OAuth initiation routes, MODERATE on the callbacks).
  4. OpenAPI docs for currency endpoints — every endpoint now has @ApiOperation + @ApiResponse (including 4xx), with typed response DTOs (FormatPriceResponseDto, RefreshRatesResponseDto) so Swagger renders schemas correctly.

Validation

  • pnpm run lint:ci, pnpm run typecheck, pnpm run build pass.
  • migrations:check, migration:run, migration:generate:check (no schema drift), and migration:revert all pass.
  • New outbox unit tests pass; affected existing suites (courses, enrollments, invoices) pass.

Closes #1221
Closes #1322
Closes #1324
Closes #1320

… currency API

- Add an event_outbox table + OutboxService/OutboxRelayService so domain
  events are persisted atomically with their state change and delivered
  at-least-once after commit; wire producers (courses, enrollments,
  subscriptions, points) and make the invoice consumer idempotent
- Apply CustomThrottleGuard with documented THROTTLE presets to auth and
  social-auth endpoints, registering ThrottlerModule in AuthModule
- Complete OpenAPI annotations on all currency endpoints with typed response
  DTOs and 4xx responses
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@devzakari-sketch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 177efdc into rinafcode:main Aug 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants