Repository navigation
Expand file tree
/
Copy pathcommunityTypes.ts
More file actions
72 lines (71 loc) · 2.22 KB
/
Copy pathcommunityTypes.ts
File metadata and controls
72 lines (71 loc) · 2.22 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/** Shapes shared by the community service and the browser page; no runtime imports so the client bundle stays node-free. */
import type { WebEnvironment } from './shared';
export type CommunityTaskStatus = 'open' | 'solved' | 'withdrawn';
export type CommunitySubmissionStatus = 'queued' | 'checking' | 'accepted' | 'rejected' | 'late';
export type CommunityTask = {
id: string;
title: string;
description: string;
environment: WebEnvironment;
prelude: string;
statement: string;
module: string;
file: string;
source: string;
basePoints: number;
openedAt: string;
status: CommunityTaskStatus;
tags: string[];
submissions: number;
solvedBy?: string;
solvedAt?: string;
solution?: string;
points?: number;
model?: string;
harness?: string;
};
export type CommunitySubmission = {
id: string;
taskId: string;
owner: string;
model: string;
harness: string;
source: string;
submittedAt: string;
points: number;
status: CommunitySubmissionStatus;
reason?: string;
checkedAt?: string;
};
export type CommunityActivity = {
at: string;
kind: 'published' | 'claimed' | 'released' | 'submitted' | 'accepted' | 'rejected' | 'late';
owner?: string;
taskId: string;
submissionId?: string;
points?: number;
model?: string;
harness?: string;
};
export type CommunityPublicTask = Omit<CommunityTask, 'solvedBy' | 'solution'> & {
currentPoints: number;
solver?: string;
solutionId?: string;
claims: number;
};
/** `unnamed` marks the row that collects solves whose model or harness was left blank. */
export type CommunityBoardRow = { name: string; points: number; solved: number; unnamed?: true };
export type CommunityBoards = {
people: CommunityBoardRow[];
models: CommunityBoardRow[];
harnesses: CommunityBoardRow[];
};
/** Top-level boards count every solve; `week` counts solves from the last seven days. `working` is distinct people holding a live claim. */
export type CommunityOverview = CommunityBoards & {
week: CommunityBoards;
activity: (Omit<CommunityActivity, 'owner'> & { who?: string })[];
tasks: CommunityPublicTask[];
totals: { tasks: number; open: number; solved: number; submissions: number; people: number; working: number };
checker: boolean;
readOnly?: true;
};