Skip to content

Commit c3aa2d1

Browse files
committed
feat: Define types for contest and task pair (#2627)
1 parent 676c048 commit c3aa2d1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/lib/types/contest_task_pair.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
import type { ContestTaskPair as ContestTaskPairOrigin } from '@prisma/client';
22

3+
import type { TaskResult } from '$lib/types/task';
4+
35
export type ContestTaskPair = ContestTaskPairOrigin;
46

57
export type ContestTaskPairs = ContestTaskPair[];
8+
9+
// For CRUD operation parameter types
10+
export type ContestTaskPairCreate = {
11+
contestId: string;
12+
taskTableIndex: string;
13+
taskId: string;
14+
};
15+
16+
export type ContestTaskPairRead = ContestTaskPairCreate;
17+
18+
export type ContestTaskPairUpdate = ContestTaskPairCreate;
19+
20+
// For mapping and identification
21+
export type ContestTaskPairKey = `${string}:${string}`; // "contest_id:task_id"
22+
23+
export type TaskResultMapByContestTaskPair = Map<ContestTaskPairKey, TaskResult>;

0 commit comments

Comments
 (0)