forked from topcoder-platform/challenge-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp-constants.js
105 lines (94 loc) · 3.34 KB
/
app-constants.js
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/**
* App constants
*/
const UserRoles = {
Admin: 'administrator',
Copilot: 'copilot',
Manager: 'Connect Manager',
User: 'Topcoder User'
}
const prizeSetTypes = {
ChallengePrizes: 'placement',
CopilotPayment: 'copilot',
ReviewerPayment: 'reviewer',
CheckpointPrizes: 'checkpoint'
}
const challengeStatuses = {
New: 'New',
Draft: 'Draft',
Cancelled: 'Cancelled',
Active: 'Active',
Completed: 'Completed',
Deleted: 'Deleted',
CancelledFailedReview: 'Cancelled - Failed Review',
CancelledFailedScreening: 'Cancelled - Failed Screening',
CancelledZeroSubmissions: 'Cancelled - Zero Submissions',
CancelledWinnerUnresponsive: 'Cancelled - Winner Unresponsive',
CancelledClientRequest: 'Cancelled - Client Request',
CancelledRequirementsInfeasible: 'Cancelled - Requirements Infeasible',
CancelledZeroRegistrations: 'Cancelled - Zero Registrations'
}
const validChallengeParams = {
UpdatedBy: 'updatedBy',
Updated: 'updated',
CreatedBy: 'createdBy',
Created: 'created',
EndDate: 'endDate',
StartDate: 'startDate',
ProjectId: 'projectId',
Name: 'name',
TypeId: 'typeId',
Prizes: 'overview.totalPrizes'
}
const EVENT_ORIGINATOR = 'topcoder-challenges-api'
const EVENT_MIME_TYPE = 'application/json'
const DiscussionTypes = {
Challenge: 'challenge'
}
// using a testing topc, should be changed to use real topics in comments when they are created
const Topics = {
ChallengeCreated: 'challenge.notification.create',
ChallengeUpdated: 'challenge.notification.update',
ChallengeDeleted: 'challenge.notification.delete',
ChallengeTypeCreated: 'test.new.bus.events', // 'challenge.action.type.created',
ChallengeTypeUpdated: 'test.new.bus.events', // 'challenge.action.type.updated',
ChallengePhaseCreated: 'test.new.bus.events', // 'challenge.action.phase.created',
ChallengePhaseUpdated: 'test.new.bus.events', // 'challenge.action.phase.updated',
ChallengePhaseDeleted: 'test.new.bus.events', // 'challenge.action.phase.deleted',
TimelineTemplateCreated: 'test.new.bus.events', // 'challenge.action.timeline.template.created',
TimelineTemplateUpdated: 'test.new.bus.events', // 'challenge.action.timeline.template.updated',
TimelineTemplateDeleted: 'test.new.bus.events', // 'challenge.action.timeline.template.deleted',
ChallengeTypeTimelineTemplateCreated: 'test.new.bus.events', // 'challenge.action.type.timeline.template.created',
ChallengeTypeTimelineTemplateUpdated: 'test.new.bus.events', // 'challenge.action.type.timeline.template.updated',
ChallengeTypeTimelineTemplateDeleted: 'test.new.bus.events', // 'challenge.action.type.timeline.template.deleted'
ChallengeAttachmentCreated: 'test.new.bus.events', // 'challenge.action.attachment.created',
ChallengeAttachmentUpdated: 'test.new.bus.events', // 'challenge.action.attachment.updated',
ChallengeAttachmentDeleted: 'test.new.bus.events' // 'challenge.action.attachment.deleted',
}
const challengeTracks = {
DEVELOP: 'DEVELOP',
DESIGN: 'DESIGN',
DATA_SCIENCE: 'DATA_SCIENCE',
QA: 'QA'
}
const challengeTextSortField = {
Name: 'name',
TypeId: 'typeId'
}
const reviewTypes = {
Community: 'COMMUNITY',
Internal: 'INTERNAL'
}
module.exports = {
UserRoles,
prizeSetTypes,
challengeStatuses,
validChallengeParams,
EVENT_ORIGINATOR,
EVENT_MIME_TYPE,
Topics,
challengeTracks,
challengeTextSortField,
DiscussionTypes,
reviewTypes
}