Add read-only Noya admin panel with assignments and UX polish.
Ship admin auth, user overview, assessments, chats, assignment filters/export, security hardening, and a separate desktop admin shell with clearer assessment answers. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import { prisma, disconnectPrisma } from '../src/lib/prisma.js';
|
||||
import {
|
||||
backfillAssignmentsForCompletedSessions,
|
||||
seedAssignmentDefinitions,
|
||||
} from '../src/modules/assignments/assignments.service.js';
|
||||
|
||||
async function main() {
|
||||
await seedAssignmentDefinitions();
|
||||
const users = await prisma.user.findMany({ select: { id: true } });
|
||||
let total = 0;
|
||||
for (const u of users) {
|
||||
total += await backfillAssignmentsForCompletedSessions(u.id);
|
||||
}
|
||||
console.log('backfilled rows created', total);
|
||||
console.log('userAssignments', await prisma.userAssignment.count());
|
||||
|
||||
const sample = await prisma.userAssignment.findMany({
|
||||
take: 10,
|
||||
include: { definition: { select: { key: true, sessionOrder: true } }, user: { include: { identities: true } } },
|
||||
});
|
||||
console.log(
|
||||
sample.map((a) => ({
|
||||
email: a.user.identities[0]?.email,
|
||||
key: a.definition.key,
|
||||
session: a.definition.sessionOrder,
|
||||
status: a.status,
|
||||
})),
|
||||
);
|
||||
}
|
||||
|
||||
main()
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
process.exitCode = 1;
|
||||
})
|
||||
.finally(async () => {
|
||||
await disconnectPrisma();
|
||||
});
|
||||
Reference in New Issue
Block a user