feat: extend notification system with batch sender, bulk dialog, and logging
Add NotificationLog schema extensions (nullable userId, email, roundId, projectId, batchId fields), batch notification sender service, and bulk notification dialog UI. Include utility scripts for debugging and seeding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
32
scripts/check-invites.cjs
Normal file
32
scripts/check-invites.cjs
Normal file
@@ -0,0 +1,32 @@
|
||||
const { PrismaClient } = require('@prisma/client');
|
||||
const p = new PrismaClient({ datasourceUrl: 'postgresql://mopc:devpassword@localhost:5433/mopc' });
|
||||
|
||||
(async () => {
|
||||
const members = await p.teamMember.findMany({
|
||||
orderBy: { joinedAt: 'desc' },
|
||||
take: 10,
|
||||
include: {
|
||||
user: { select: { id: true, name: true, email: true, status: true, inviteToken: true } },
|
||||
project: { select: { title: true } }
|
||||
}
|
||||
});
|
||||
for (const m of members) {
|
||||
console.log(m.role, '|', m.user.name, '|', m.user.email, '|', m.user.status, '|', m.project.title, '|', m.joinedAt.toISOString().slice(0,16), '| token:', m.user.inviteToken ? 'yes' : 'no');
|
||||
}
|
||||
|
||||
const logs = await p.notificationLog.findMany({
|
||||
where: { type: 'TEAM_INVITATION' },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
take: 5,
|
||||
});
|
||||
if (logs.length) {
|
||||
console.log('\n--- Notification logs:');
|
||||
for (const l of logs) {
|
||||
console.log(l.status, '|', l.channel, '|', l.errorMsg, '|', l.createdAt.toISOString().slice(0,16));
|
||||
}
|
||||
} else {
|
||||
console.log('\n--- No TEAM_INVITATION notification logs found');
|
||||
}
|
||||
|
||||
await p.$disconnect();
|
||||
})();
|
||||
Reference in New Issue
Block a user