-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug-round-report.ts
More file actions
33 lines (26 loc) · 1.29 KB
/
debug-round-report.ts
File metadata and controls
33 lines (26 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { loadBotEnv } from '@blog-study/shared';
import { getDb, rounds, attendance, members } from '@blog-study/shared/db';
import { eq } from 'drizzle-orm';
import { getCurrentRound } from './packages/bot/src/services/round.service';
import { getAttendanceSummariesForRound } from './packages/bot/src/schedulers/round-reporter';
async function main() {
loadBotEnv();
console.log('=== getCurrentRound() 확인 ===\n');
const currentRound = await getCurrentRound();
console.log(`현재 회차: ${currentRound.roundNumber} (ID: ${currentRound.id})`);
console.log('\n=== getAttendanceSummariesForRound() 확인 ===\n');
const summaries = await getAttendanceSummariesForRound(currentRound.id);
console.log(`attendanceSummaries: ${summaries.length}개`);
summaries.forEach((s, index) => {
console.log(`${index + 1}. ${s.name} (${s.status}) - ${s.postCount}개 포스트`);
});
console.log('\n=== 상태별 개수 ===');
const submitted = summaries.filter(s => s.status === 'SUBMITTED');
const late = summaries.filter(s => s.status === 'LATE');
const absent = summaries.filter(s => s.status === 'ABSENT');
console.log(`SUBMITTED: ${submitted.length}`);
console.log(`LATE: ${late.length}`);
console.log(`ABSENT: ${absent.length}`);
console.log(`총계: ${summaries.length}`);
}
main();