Repository navigation
✨ Release 0.9.0-pre-prod
Pre-release
Pre-release
·
5 commits
to develop
since this release
Changelog
[Feature] - Notification
Added
- Daily Notification Feature:
Implemented a new system to send daily notifications to users. The feature is designed to encourage users to complete their daily checkup and provide feedback to their coach. - Scheduled Task:
Added a background scheduled job (using APScheduler) that runs every day at 00:00 (midnight).
This task automatically creates a new daily notification for each user profile in the system.
The scheduler is started as part of the FastAPI app startup event to ensure it runs in the correct event loop. - New Notification Endpoints:
POST /notifications/create-daily
Allows an admin to manually trigger the creation of daily notifications for all users.
Useful for testing or manual re-triggering by administrators.GET /notifications/me
Retrieves all notifications for the currently authenticated user.POST /notifications/{notification_id}/read
Marks a specific notification as read by the user.
Changed
- Refactored the notification service and repository layer to support batch creation of notifications.
- Improved database session management to ensure safe usage in both request/response cycles and background jobs.
Technical Notes
- The scheduler uses APScheduler's AsyncIOScheduler and is launched within FastAPI's
startupevent. - When the scheduled job runs, it opens a dedicated async database session and creates notifications for all profiles.
- The background job and the manual admin endpoint both use the same service logic for consistency.
Example:
- Every day at 00:00, all users receive a new notification titled "Daily Checkup" prompting them to fill out their daily feedback.
- Admins can use the new endpoint to manually generate these notifications if needed.
Tags
- Version:
0.9.0-pre-prod
Docker Package
# Pull specific version
docker pull ghcr.io/track-train/api:0.9.0-pre-prod
# Pull latest pre-release
docker pull ghcr.io/track-train/api:pre-releaseInformation
- PR Title:
#feat notification #43 - Version Type: New Features
- Source branch:
Feat/notification-#43 - Target branch:
develop - Release type: Pre-production
- PR author: @Baptiste-Ferrand