1
+ import { mockFormat , mockCertificateData , mockCourse , mockLearningModule , mockRatingCriteria } from "./course" ;
2
+ import { mockCommunity , metadata } from "./community" ;
3
+ import { reward } from "./reward" ;
4
+ import { Submission } from "@/types/bounty" ;
5
+ import { AdditionalInfo , Challenge } from "@/types/course" ;
6
+ import { TEAM_FORMATION } from "@/constants/challengeInfo" ;
7
+ import { Team , TeamMember } from "@/types/challenge" ;
8
+ import { Feedback } from "@/types/feedback" ;
9
+ import { mockUser } from "./user" ;
10
+
11
+
12
+
13
+ export const mockAdditionalInfo : { [ type : string ] : AdditionalInfo } = {
14
+ "type" : { type : "additional type" , text : "additional text" } ,
15
+ }
16
+
17
+ export const challenge : Challenge = {
18
+ id : "challenge" ,
19
+ ref : "challenge ref" ,
20
+ created_at : new Date ( "2022-05-01T12:00:00Z" ) ,
21
+ updated_at : new Date ( "2022-05-01T12:00:00Z" ) ,
22
+ hint : "Hint" ,
23
+ name : "challenge name" ,
24
+ format : mockFormat ,
25
+ description : "challenge description" ,
26
+ course : mockCourse ,
27
+ type : "course" ,
28
+ isTeamChallenge : false ,
29
+ objectives : [ "objectives 1" , "Objectives 2" , "Objectives 3" , "Objectives 4" ] ,
30
+ threshold : 8 ,
31
+ community : mockCommunity ,
32
+ reviewTime : 9 ,
33
+ metadata : metadata ,
34
+ level : 58 ,
35
+ courses : [ mockCourse ] ,
36
+ learningModules : [ mockLearningModule ] ,
37
+ expiresAt : "2025" ,
38
+ reward : reward ,
39
+ certificateIcon : "certificate" ,
40
+ certificateData : mockCertificateData ,
41
+ ratingCriteria : [ mockRatingCriteria ] ,
42
+ timestamp : 6 ,
43
+ maxPoints : 299 ,
44
+ minPoints : 9 ,
45
+ rewards : [ reward ] ,
46
+ feedbacks : { } ,
47
+ feedbackInfo : [ { } ] ,
48
+ bestSubmissions : [ { } ] ,
49
+ teamLimit : 5 ,
50
+ isHackathon : false ,
51
+ additionalInfo : {
52
+ [ TEAM_FORMATION ] : {
53
+ type : 'teamFormation' ,
54
+ text : 'Form your team details here'
55
+ }
56
+ }
57
+ } ;
58
+
59
+ export const submission : Submission = {
60
+ length : 0 ,
61
+ id : "submission_id" ,
62
+ ref : "reference" ,
63
+ created_at : new Date ( "2022-05-01T12:00:00Z" ) ,
64
+ updated_at : new Date ( "2022-05-01T12:00:00Z" ) ,
65
+ link : "/submissions/reference" ,
66
+ community : mockCommunity ,
67
+ user_id : "user_id" ,
68
+ challenge : challenge ,
69
+ text : "Submission" ,
70
+ reviewDeadline : new Date ( ) ,
71
+ metadata : {
72
+ evaluation : "" ,
73
+ applicableReward : {
74
+ ref : "" ,
75
+ amount : 0 ,
76
+ updated_at : "" ,
77
+ challenge : "" ,
78
+ created_at : "" ,
79
+ id : "" ,
80
+ type : "" ,
81
+ community : "" ,
82
+ timestamp : 0 ,
83
+ token : "" ,
84
+ } ,
85
+ reviewed : false ,
86
+ feedbacks : 0 ,
87
+ language : "" ,
88
+ } ,
89
+ timestamp : 0 ,
90
+ user : mockUser ,
91
+ reviewable : false ,
92
+ status : "" ,
93
+ reward : reward ,
94
+ map : function ( ) {
95
+ throw new Error ( "Function not implemented." ) ;
96
+ } ,
97
+ } ;
98
+
99
+ export const mockInvite = {
100
+ created_at : "tuesday" ,
101
+ id : "invite" ,
102
+ ref : "invitation ref" ,
103
+ status : "invitation status" ,
104
+ team_ref : "team reference" ,
105
+ timestamp : 3 ,
106
+ updated_at : "wednesday" ,
107
+ user : mockUser ,
108
+ user_id : "user id" ,
109
+ }
110
+
111
+ export const mockTeamMember : TeamMember = {
112
+ created_at : "created_at" ,
113
+ id : "id" ,
114
+ joined_on : "joined_on" ,
115
+ ref : "ref" ,
116
+ team_ref : "team reference" ,
117
+ timestamp : 3 ,
118
+ updated_at : "wednesday" ,
119
+ user : mockUser ,
120
+ }
121
+
122
+ export const mockTeam : Team = {
123
+ challenge : challenge ,
124
+ challenge_ref : "challenge ref" ,
125
+ created_at : "created at" ,
126
+ id : "id" ,
127
+ locked : true ,
128
+ name : "Master" ,
129
+ organizer : mockUser ,
130
+ organizer_id : "organizer id" ,
131
+ invites : [ mockInvite ] ,
132
+ members : [ mockTeamMember ] ,
133
+ ref : "" ,
134
+ timestamp : "" ,
135
+ updated_at : ""
136
+ }
137
+
138
+ export const mockFeedback : Feedback = {
139
+ submission : submission ,
140
+ id : "234-4231243" ,
141
+ ref : "feedbacks/234-4231243" ,
142
+ created_at : new Date ( ) ,
143
+ updated_at : "" ,
144
+ criteria : [ "criteria 1" , "criteria 2" ] ,
145
+ positive : false ,
146
+ name : "The person who made a submission" ,
147
+ challenge : "challenge name" ,
148
+ timestamp : undefined ,
149
+ user : mockUser ,
150
+ ranking : 0 ,
151
+ text : "I am providing a feedback"
152
+ }
0 commit comments