Skip to content

Commit 969cd1b

Browse files
committed
added seeds for grading
1 parent a6127a1 commit 969cd1b

8 files changed

Lines changed: 826 additions & 11 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- AlterTable
2+
ALTER TABLE "public"."Snapshot" ADD COLUMN "content" TEXT;
3+
4+
ALTER TABLE "public"."Snapshot" ADD CONSTRAINT "Snapshot_content_matches_type" CHECK (("type" = 'CONTENT') = ("content" IS NOT NULL));

prisma/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ model Snapshot {
278278
id String @id @unique @default(cuid())
279279
taskId String
280280
type SnapshotType
281+
content String?
281282
createdAt DateTime @default(now())
282283
283284
task Task @relation(fields: [taskId], references: [id], onDelete: Cascade)
Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
1-
export const assessmentsData = [
1+
import type { AssessmentStatus } from '@/generated/prisma';
2+
3+
export const assessmentsData: Array<{
4+
id: string;
5+
candidateId: string;
6+
assessmentTemplateId: string;
7+
assignedAt: Date;
8+
submittedAt: Date | null;
9+
deadline: Date;
10+
reviewerIds: string[];
11+
applicationStatus: AssessmentStatus;
12+
}> = [
213
{
314
id: 'assessment_carter_001',
15+
candidateId: 'cand_carter_herman_001',
416
assessmentTemplateId: 'assessment_template_general_001',
17+
assignedAt: new Date('2026-04-06T14:00:00Z'),
18+
submittedAt: new Date('2026-04-12T17:30:00Z'),
519
deadline: new Date('2026-04-13T03:59:59Z'),
20+
reviewerIds: ['user_laith_taher_001', 'user_brad_derby_001'],
21+
applicationStatus: 'GRADED',
622
},
723
{
824
id: 'assessment_laith_001',
25+
candidateId: 'cand_laith_taher_001',
926
assessmentTemplateId: 'assessment_template_general_001',
27+
assignedAt: new Date('2026-04-06T14:00:00Z'),
28+
submittedAt: null,
1029
deadline: new Date('2026-04-13T03:59:59Z'),
30+
reviewerIds: [],
31+
applicationStatus: 'NOT_STARTED',
1132
},
1233
];

prisma/seed-data/comments.seed.ts

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
export const commentsData = [
2+
// ---- Two Sum (Laith's review) ----
3+
{
4+
id: 'comment_laith_two_sum_001',
5+
reviewId: 'review_laith_carter_two_sum_001',
6+
line: 2,
7+
content: 'Good call reaching for a hash map up front. Gets us O(n) instead of O(n^2).',
8+
reviewedAt: new Date('2026-04-13T15:08:00Z'),
9+
},
10+
{
11+
id: 'comment_laith_two_sum_002',
12+
reviewId: 'review_laith_carter_two_sum_001',
13+
line: 6,
14+
content: 'Returning indices in insertion order is clean. Nice.',
15+
reviewedAt: new Date('2026-04-13T15:12:00Z'),
16+
},
17+
{
18+
id: 'comment_laith_two_sum_003',
19+
reviewId: 'review_laith_carter_two_sum_001',
20+
line: 8,
21+
content:
22+
'Trailing `return []` is defensive but unreachable given the prompt guarantees a solution. Minor nit.',
23+
reviewedAt: new Date('2026-04-13T15:18:00Z'),
24+
},
25+
26+
// ---- Two Sum (Brad's review) ----
27+
{
28+
id: 'comment_brad_two_sum_001',
29+
reviewId: 'review_brad_carter_two_sum_001',
30+
line: 3,
31+
content: '`enumerate` over the loop is the right move.',
32+
reviewedAt: new Date('2026-04-13T16:32:00Z'),
33+
},
34+
{
35+
id: 'comment_brad_two_sum_002',
36+
reviewId: 'review_brad_carter_two_sum_001',
37+
line: 7,
38+
content:
39+
'Storing the index after the check avoids using the same element twice. Nicely handled.',
40+
reviewedAt: new Date('2026-04-13T16:35:00Z'),
41+
},
42+
43+
// ---- Reverse String (Laith's review) ----
44+
{
45+
id: 'comment_laith_reverse_001',
46+
reviewId: 'review_laith_carter_reverse_string_001',
47+
line: 2,
48+
content:
49+
'`s.reverse()` mutates in place — correct, but then returning `s` is a bit redundant.',
50+
reviewedAt: new Date('2026-04-13T15:27:00Z'),
51+
},
52+
{
53+
id: 'comment_laith_reverse_002',
54+
reviewId: 'review_laith_carter_reverse_string_001',
55+
line: 10,
56+
content:
57+
'Since reverse_string mutates s in place, the return value is unused here. Worth pointing out in interview.',
58+
reviewedAt: new Date('2026-04-13T15:30:00Z'),
59+
},
60+
61+
// ---- Reverse String (Brad's review) ----
62+
{
63+
id: 'comment_brad_reverse_001',
64+
reviewId: 'review_brad_carter_reverse_string_001',
65+
line: 2,
66+
content: 'In-place reverse satisfies the O(1) memory constraint. Good.',
67+
reviewedAt: new Date('2026-04-13T16:41:00Z'),
68+
},
69+
70+
// ---- Valid Palindrome (Laith's review) ----
71+
{
72+
id: 'comment_laith_palindrome_001',
73+
reviewId: 'review_laith_carter_palindrome_001',
74+
line: 5,
75+
content:
76+
'String concatenation in a loop is O(n^2) in Python. A list + join would be cleaner.',
77+
reviewedAt: new Date('2026-04-13T15:53:00Z'),
78+
},
79+
{
80+
id: 'comment_laith_palindrome_002',
81+
reviewId: 'review_laith_carter_palindrome_001',
82+
line: 8,
83+
content:
84+
'Bug: an empty string after stripping non-alphanumerics IS a palindrome per the prompt. Returning False here fails the " " test case.',
85+
reviewedAt: new Date('2026-04-13T15:57:00Z'),
86+
},
87+
{
88+
id: 'comment_laith_palindrome_003',
89+
reviewId: 'review_laith_carter_palindrome_001',
90+
line: 9,
91+
content:
92+
'Slice comparison is a clear approach. Two-pointer would avoid the extra allocation but is not required.',
93+
reviewedAt: new Date('2026-04-13T16:02:00Z'),
94+
},
95+
96+
// ---- Valid Palindrome (Brad's review) ----
97+
{
98+
id: 'comment_brad_palindrome_001',
99+
reviewId: 'review_brad_carter_palindrome_001',
100+
line: 7,
101+
content:
102+
'The empty-string guard inverts the expected behavior — see the failing test case.',
103+
reviewedAt: new Date('2026-04-13T16:52:00Z'),
104+
},
105+
{
106+
id: 'comment_brad_palindrome_002',
107+
reviewId: 'review_brad_carter_palindrome_001',
108+
line: 15,
109+
content:
110+
'`readline` vs `read` should not matter for single-line input, but worth confirming with the candidate.',
111+
reviewedAt: new Date('2026-04-13T16:55:00Z'),
112+
},
113+
];

prisma/seed-data/reviews.seed.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
export const reviewsData = [
2+
// Two Sum — clean solution, high marks from both reviewers
3+
{
4+
id: 'review_laith_carter_two_sum_001',
5+
taskId: 'task_carter_two_sum_001',
6+
reviewerId: 'user_laith_taher_001',
7+
score: 90,
8+
createdAt: new Date('2026-04-13T15:05:00Z'),
9+
updatedAt: new Date('2026-04-13T15:18:00Z'),
10+
},
11+
{
12+
id: 'review_brad_carter_two_sum_001',
13+
taskId: 'task_carter_two_sum_001',
14+
reviewerId: 'user_brad_derby_001',
15+
score: 100,
16+
createdAt: new Date('2026-04-13T16:30:00Z'),
17+
updatedAt: new Date('2026-04-13T16:35:00Z'),
18+
},
19+
20+
// Reverse String — solid, with minor stylistic feedback
21+
{
22+
id: 'review_laith_carter_reverse_string_001',
23+
taskId: 'task_carter_reverse_string_001',
24+
reviewerId: 'user_laith_taher_001',
25+
score: 80,
26+
createdAt: new Date('2026-04-13T15:25:00Z'),
27+
updatedAt: new Date('2026-04-13T15:30:00Z'),
28+
},
29+
{
30+
id: 'review_brad_carter_reverse_string_001',
31+
taskId: 'task_carter_reverse_string_001',
32+
reviewerId: 'user_brad_derby_001',
33+
score: 90,
34+
createdAt: new Date('2026-04-13T16:40:00Z'),
35+
updatedAt: new Date('2026-04-13T16:42:00Z'),
36+
},
37+
38+
// Valid Palindrome — failed an edge-case test, reviewers note the bug
39+
{
40+
id: 'review_laith_carter_palindrome_001',
41+
taskId: 'task_carter_palindrome_001',
42+
reviewerId: 'user_laith_taher_001',
43+
score: 60,
44+
createdAt: new Date('2026-04-13T15:50:00Z'),
45+
updatedAt: new Date('2026-04-13T16:02:00Z'),
46+
},
47+
{
48+
id: 'review_brad_carter_palindrome_001',
49+
taskId: 'task_carter_palindrome_001',
50+
reviewerId: 'user_brad_derby_001',
51+
score: 70,
52+
createdAt: new Date('2026-04-13T16:50:00Z'),
53+
updatedAt: new Date('2026-04-13T16:55:00Z'),
54+
},
55+
];

0 commit comments

Comments
 (0)