Skip to content

TO-291: Add notifications model#639

Open
almeidaraul wants to merge 8 commits intomainfrom
TO-291/add-notifications-table
Open

TO-291: Add notifications model#639
almeidaraul wants to merge 8 commits intomainfrom
TO-291/add-notifications-table

Conversation

@almeidaraul
Copy link
Contributor

@almeidaraul almeidaraul commented Mar 11, 2026

Description

This PR is the first in TO-291. It creates a notifications table and model.

A notification has:

  • A user id of the user being notified
  • A notification type (an enum representing what the notification refers to)
  • An optional target URL (the link the notification points to)
  • A dismissed_at timestamp representing when the notification was marked as read by the user (null if it wasn't)

Resolved issues

Part of TO-291

Web service API changes

Added a migration

@almeidaraul almeidaraul changed the title Add notifications model TO-291: Add notifications model Mar 11, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Notification model and database table for user notifications, with support for notification types, optional target URLs, and dismissal tracking.

Changes:

  • New NotificationType enum with two values for artefact and environment review assignments
  • New Notification SQLAlchemy model with user foreign key, notification type, target URL, and dismissed timestamp
  • Alembic migration to create the notification table with an index on user_id
  • Pydantic response models for the notifications API

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
backend/test_observer/data_access/models_enums.py Adds NotificationType enum
backend/test_observer/data_access/models.py Adds Notification model
backend/test_observer/controllers/notifications/models.py Adds Pydantic response schemas
backend/migrations/versions/2026_03_10_1618-983168a63271_add_notifications.py Alembic migration for notification table

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Notification model and corresponding database migration for a user notification system, along with Pydantic response models for the API layer.

Changes:

  • New Notification SQLAlchemy model with user foreign key, notification type enum, optional target URL, and dismissed timestamp
  • New NotificationType enum with two values for artefact and environment review assignments
  • Alembic migration to create the notification table

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
backend/test_observer/data_access/models_enums.py Adds NotificationType enum
backend/test_observer/data_access/models.py Adds Notification model
backend/test_observer/controllers/notifications/models.py Adds Pydantic response models for notifications
backend/migrations/versions/2026_03_10_1618-983168a63271_add_notifications.py Alembic migration to create the notification table

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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.

2 participants