Skip to content

feat(alerts): add price alerts management endpoints with jwt auth and ownership validation - #975

Open
chiomailekuba wants to merge 1 commit into
accesslayerorg:mainfrom
chiomailekuba:fix/issue-867-price-alerts
Open

chiomailekuba wants to merge 1 commit into
accesslayerorg:mainfrom
chiomailekuba:fix/issue-867-price-alerts

Conversation

@chiomailekuba

Copy link
Copy Markdown

closes #867

Summary of Changes

Implements price alert management endpoints with full JWT authentication, authorization, and validation:

  • Created PriceAlert entity and repository handling alert rules (asset, targetPrice, direction: ABOVE/BELOW, status: ACTIVE/TRIGGERED/CANCELLED).
  • Built Alert Controller and Service with CRUD operations:
    • POST /api/v1/alerts: Create a new price alert with threshold validation.
    • GET /api/v1/alerts: List alerts belonging to the authenticated user.
    • DELETE /api/v1/alerts/:id: Delete an alert with strict ownership checks (403/404 if not owned).
    • PATCH /api/v1/alerts/:id: Update alert parameters or toggle status.
  • Added input validation middleware using schemas ensuring positive target prices and valid direction enums.
  • Added integration test suite in src/modules/alerts/__tests__/alert.test.ts covering creation, listing, unauthorized access, cross-user isolation, and threshold checks.

Testing & Verification

  • Ran npm test -- src/modules/alerts/__tests__/alert.test.ts: all 15 integration tests passing.
  • TypeScript build and lint clean.

@drips-wave

drips-wave Bot commented Sep 26, 2026

Copy link
Copy Markdown

@chiomailekuba 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a price alerts management endpoint for users to create, list, and delete price threshold alerts

1 participant