1
|
|
|
/* eslint camelcase: "off", @typescript-eslint/camelcase: "off" */ |
2
|
|
|
import { |
3
|
|
|
Application, |
4
|
|
|
ApplicationNormalized, |
5
|
|
|
ApplicationReview, |
6
|
|
|
} from "../models/types"; |
7
|
|
|
|
8
|
|
|
export const fakeApplicationReview = ( |
9
|
|
|
overrides: Partial<ApplicationReview> = {}, |
10
|
|
|
): ApplicationReview => ({ |
11
|
|
|
id: 1, |
12
|
|
|
job_application_id: 1, |
13
|
|
|
review_status_id: 6, |
14
|
|
|
notes: "Here's some notes.", |
15
|
|
|
created_at: new Date("2020-01-02"), |
16
|
|
|
updated_at: new Date("2020-01-02"), |
17
|
|
|
review_status: { |
18
|
|
|
id: 6, |
19
|
|
|
name: "assessment_required", |
20
|
|
|
}, |
21
|
|
|
department_id: null, |
22
|
|
|
department: null, |
23
|
|
|
...overrides, |
24
|
|
|
}); |
25
|
|
|
|
26
|
|
|
export const fakeApplicationNormalized = ( |
27
|
|
|
overrides: Partial<ApplicationNormalized> = {}, |
28
|
|
|
): ApplicationNormalized => ({ |
29
|
|
|
id: 1, |
30
|
|
|
job_poster_id: 1, |
31
|
|
|
application_status_id: 1, |
32
|
|
|
citizenship_declaration_id: 1, |
33
|
|
|
veteran_status_id: 1, |
34
|
|
|
preferred_language_id: 1, |
35
|
|
|
applicant_id: 1, |
36
|
|
|
applicant_snapshot_id: 1, |
37
|
|
|
submission_signature: "signed", |
38
|
|
|
submission_date: "2020-01-01", |
39
|
|
|
experience_saved: true, |
40
|
|
|
created_at: new Date("2020-01-01"), |
41
|
|
|
updated_at: new Date("2020-01-01"), |
42
|
|
|
veteran_status: { |
43
|
|
|
id: 1, |
44
|
|
|
name: "none", |
45
|
|
|
}, |
46
|
|
|
citizenship_declaration: { |
47
|
|
|
id: 1, |
48
|
|
|
name: "citizen", |
49
|
|
|
}, |
50
|
|
|
applicant: { |
51
|
|
|
id: 1, |
52
|
|
|
personal_website: "www.somesite.com", |
53
|
|
|
tagline: "Tagline", |
54
|
|
|
twitter_username: "someperson", |
55
|
|
|
linkedin_url: "linkedin.com/someperson", |
56
|
|
|
user_id: 1, |
57
|
|
|
created_at: new Date("2019-12-31"), |
58
|
|
|
updated_at: new Date("2019-12-31"), |
59
|
|
|
user: { |
60
|
|
|
id: 1, |
61
|
|
|
first_name: "Frankie", |
62
|
|
|
last_name: "Lambda", |
63
|
|
|
full_name: "Frankie Lambda", |
64
|
|
|
email: "[email protected]", |
65
|
|
|
is_confirmed: true, |
66
|
|
|
user_role_id: 1, |
67
|
|
|
created_at: new Date("2019-12-31"), |
68
|
|
|
updated_at: new Date("2019-12-31"), |
69
|
|
|
is_priority: false, |
70
|
|
|
not_in_gov: false, |
71
|
|
|
gov_email: "[email protected]", |
72
|
|
|
department_id: 1, |
73
|
|
|
user_role: { |
74
|
|
|
id: 1, |
75
|
|
|
key: "basic", |
76
|
|
|
created_at: new Date("2019-01-01"), |
77
|
|
|
updated_at: new Date("2019-01-01"), |
78
|
|
|
name: { |
79
|
|
|
en: "Applicant", |
80
|
|
|
fr: "Applicant", |
81
|
|
|
}, |
82
|
|
|
}, |
83
|
|
|
}, |
84
|
|
|
}, |
85
|
|
|
meets_essential_criteria: true, |
86
|
|
|
...overrides, |
87
|
|
|
}); |
88
|
|
|
|
89
|
|
|
export const fakeApplication = ( |
90
|
|
|
overrides: Partial<Application> = {}, |
91
|
|
|
): Application => { |
92
|
|
|
const normalizedOverrides = { |
93
|
|
|
id: 1, |
94
|
|
|
...overrides, |
95
|
|
|
}; |
96
|
|
|
const reviewOverrides = { |
97
|
|
|
id: normalizedOverrides.id, |
98
|
|
|
job_application_id: normalizedOverrides.id, |
99
|
|
|
...(normalizedOverrides.application_review ?? {}), |
100
|
|
|
}; |
101
|
|
|
return { |
102
|
|
|
...fakeApplicationNormalized(normalizedOverrides), |
103
|
|
|
application_review: fakeApplicationReview(reviewOverrides), |
104
|
|
|
...overrides, |
105
|
|
|
}; |
106
|
|
|
}; |
107
|
|
|
|
108
|
|
|
export const fakeApplication1 = ( |
109
|
|
|
overrides: Partial<Application> = {}, |
110
|
|
|
): Application => { |
111
|
|
|
return fakeApplication({ id: 1, ...overrides }); |
112
|
|
|
}; |
113
|
|
|
|
114
|
|
|
export const fakeApplication2 = ( |
115
|
|
|
overrides: Partial<Application> = {}, |
116
|
|
|
): Application => { |
117
|
|
|
return fakeApplication({ |
118
|
|
|
id: 2, |
119
|
|
|
job_poster_id: 2, |
120
|
|
|
applicant_id: 2, |
121
|
|
|
...overrides, |
122
|
|
|
}); |
123
|
|
|
}; |
124
|
|
|
|
125
|
|
|
export const fakeApplication3 = ( |
126
|
|
|
overrides: Partial<Application> = {}, |
127
|
|
|
): Application => { |
128
|
|
|
return fakeApplication({ |
129
|
|
|
id: 3, |
130
|
|
|
job_poster_id: 3, |
131
|
|
|
applicant_id: 3, |
132
|
|
|
...overrides, |
133
|
|
|
}); |
134
|
|
|
}; |
135
|
|
|
|
136
|
|
|
const fakeApplications = (): Application[] => [ |
137
|
|
|
fakeApplication1(), |
138
|
|
|
fakeApplication2(), |
139
|
|
|
fakeApplication3(), |
140
|
|
|
]; |
141
|
|
|
|
142
|
|
|
export default fakeApplications; |
143
|
|
|
|