Skip to content

feat(alerts): fix #122 by implementing alert acknowledgement system#196

Merged
mijinummi merged 5 commits into
MD-Creative-Production:mainfrom
TochukwuJustice:implement-alert
Jun 22, 2026
Merged

feat(alerts): fix #122 by implementing alert acknowledgement system#196
mijinummi merged 5 commits into
MD-Creative-Production:mainfrom
TochukwuJustice:implement-alert

Conversation

@TochukwuJustice

Copy link
Copy Markdown
Contributor

closes #122
This pull request implements the Alert Acknowledgement System to resolve issue #122.
Previously, there was no way for the security team to distinguish between unreviewed alerts and those that had been investigated. This caused potential overlap in work and confusion.

With this change, the Alert model now tracks acknowledgedAt and acknowledgedBy. An AcknowledgementsModule provides a new REST endpoint (POST /alerts/:id/acknowledge) allowing reviewers to explicitly mark alerts as acknowledged. To maintain data integrity and compliance, acknowledging an alert automatically appends an ALERT_ACKNOWLEDGED action to the system's AuditLog within a single atomic database transaction.

4. Changes Made

  • Modified schema.prisma to include acknowledgedAt and acknowledgedBy on the Alert model.
  • Added @nestjs/common and @nestjs/core to package dependencies to resolve project-wide TS compilation issues.
  • Created AlertsModule and AcknowledgementsModule following the NestJS module architecture.
  • Created AcknowledgementsController with a POST /alerts/:id/acknowledge endpoint.
  • Implemented AcknowledgementsService to handle the atomic acknowledgement and audit logging via Prisma $transaction.
  • Defined AcknowledgeAlertDto to capture reviewerId and reviewerName.
  • Registered AlertsModule into app.module.ts.

5. Testing

  • Executed npm run build:backend to ensure strict TypeScript compilation passes without errors.
  • Re-generated the Prisma client using pnpm dlx prisma generate and verified that schema changes were accurately reflected.
  • Verified the atomicity constraint in code (Prisma $transaction wrapper used for DB operations).

@mijinummi mijinummi merged commit de56cb6 into MD-Creative-Production:main Jun 22, 2026
13 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

Development

Successfully merging this pull request may close these issues.

Implement Alert Acknowledgement System

2 participants