mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
units,lesson as standalone
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
// Part 1A/1C — new learner-facing notification types for the task review
|
||||
// workflow, group assignment, and per-task completion. Seeded already-published
|
||||
// (status: 'sent') like every other is_system row in the original
|
||||
// 20260703000008 migration, so the trigger call sites work immediately without
|
||||
// requiring an admin to publish them first.
|
||||
|
||||
module.exports = {
|
||||
async up(queryInterface) {
|
||||
const now = new Date();
|
||||
await queryInterface.bulkInsert('notification_templates', [
|
||||
{
|
||||
type: 'task_submission_reviewed', notify_type: 'task', scope: 'user', is_system: true,
|
||||
label: 'Task Submission Reviewed', status: 'sent',
|
||||
title: 'Submission Reviewed',
|
||||
message: 'Your submission for "{{taskName}}" was {{statusLabel}}.{{reviewNoteSuffix}}',
|
||||
createdAt: now, updatedAt: now,
|
||||
},
|
||||
{
|
||||
type: 'task_assigned', notify_type: 'task', scope: 'user', is_system: true,
|
||||
label: 'Task List Assigned', status: 'sent',
|
||||
title: 'New Task Assigned',
|
||||
message: 'You have been assigned "{{taskListName}}" — {{taskCount}} task(s) to complete.',
|
||||
createdAt: now, updatedAt: now,
|
||||
},
|
||||
{
|
||||
type: 'task_completed', notify_type: 'task', scope: 'user', is_system: true,
|
||||
label: 'Task Completed', status: 'sent',
|
||||
title: 'Task Completed',
|
||||
message: 'You completed "{{taskName}}".',
|
||||
createdAt: now, updatedAt: now,
|
||||
},
|
||||
]);
|
||||
},
|
||||
|
||||
async down(queryInterface) {
|
||||
await queryInterface.bulkDelete('notification_templates', {
|
||||
type: ['task_submission_reviewed', 'task_assigned', 'task_completed'],
|
||||
});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user