feat: Implement alert creation service with FCM notifications
- Add AlertCreationService to handle alert creation and notifications. - Implement idempotency key support to prevent duplicate alerts. - Create alert notification service for sending FCM messages. - Add tests for alert creation and notification services. - Document FCM notification flow and alert creation process.
This commit is contained in:
10
backend/migrations/007_alert_creation_idempotency.sql
Normal file
10
backend/migrations/007_alert_creation_idempotency.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE IF NOT EXISTS alert_creation_requests (
|
||||
idempotency_key VARCHAR(255) PRIMARY KEY,
|
||||
request_hash CHAR(64) NOT NULL,
|
||||
alert_id INTEGER REFERENCES alerts(id) ON DELETE SET NULL,
|
||||
response_body JSONB,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_alert_creation_requests_created_at
|
||||
ON alert_creation_requests(created_at);
|
||||
Reference in New Issue
Block a user