|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace App\Http\Requests; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Foundation\Http\FormRequest; |
|
6
|
|
|
use App\Services\Validation\Rules\ValidIdRule; |
|
7
|
|
|
use App\Models\Lookup\Frequency; |
|
8
|
|
|
use App\Models\Lookup\Department; |
|
9
|
|
|
use App\Services\Validation\Rules\LinkedInUrlRule; |
|
10
|
|
|
use App\Services\Validation\Rules\TwitterHandleRule; |
|
11
|
|
|
|
|
12
|
|
|
class UpdateManagerApi extends FormRequest |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* Determine if the user is authorized to make this request. |
|
16
|
|
|
* |
|
17
|
|
|
* @return bool |
|
18
|
|
|
*/ |
|
19
|
|
|
public function authorize() |
|
20
|
|
|
{ |
|
21
|
|
|
return true; |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Get the validation rules that apply to the request. |
|
26
|
|
|
* |
|
27
|
|
|
* @return array |
|
28
|
|
|
*/ |
|
29
|
|
|
public function rules() |
|
30
|
|
|
{ |
|
31
|
|
|
$frequencyRule = new ValidIdRule(Frequency::class); |
|
32
|
|
|
return [ |
|
33
|
|
|
'department_id' => ['nullable', new ValidIdRule(Department::class)], |
|
34
|
|
|
'gov_email' => [ |
|
35
|
|
|
'nullable', |
|
36
|
|
|
'string', |
|
37
|
|
|
'max:191', |
|
38
|
|
|
'email', |
|
39
|
|
|
], |
|
40
|
|
|
'twitter_username' => [ |
|
41
|
|
|
'nullable', // Some people may not have a handle. |
|
42
|
|
|
new TwitterHandleRule, |
|
43
|
|
|
], |
|
44
|
|
|
'linkedin_url' => [ |
|
45
|
|
|
'nullable', // Some people may not be on LinkedIn. |
|
46
|
|
|
new LinkedInUrlRule |
|
47
|
|
|
], |
|
48
|
|
|
'work_review_frequency_id' => ['nullable', $frequencyRule], |
|
49
|
|
|
'stay_late_frequency_id' => ['nullable', $frequencyRule], |
|
50
|
|
|
'engage_team_frequency_id' => ['nullable', $frequencyRule], |
|
51
|
|
|
'development_opportunity_frequency_id' => ['nullable', $frequencyRule], |
|
52
|
|
|
'refuse_low_value_work_frequency_id' => ['nullable', $frequencyRule], |
|
53
|
|
|
'years_experience' => 'nullable|numeric', |
|
54
|
|
|
|
|
55
|
|
|
'en.about_me' => 'nullable|string', |
|
56
|
|
|
'en.greatest_accomplishment' => 'nullable|string', |
|
57
|
|
|
'en.division' => 'nullable|string', |
|
58
|
|
|
'en.position' => 'nullable|string', |
|
59
|
|
|
'en.leadership_style' => 'nullable|string', |
|
60
|
|
|
'en.employee_learning' => 'nullable|string', |
|
61
|
|
|
'en.expectations' => 'nullable|string', |
|
62
|
|
|
'en.education' => 'nullable|string', |
|
63
|
|
|
'en.career_journey' => 'nullable|string', |
|
64
|
|
|
'en.learning_path' => 'nullable|string', |
|
65
|
|
|
|
|
66
|
|
|
'fr.about_me' => 'nullable|string', |
|
67
|
|
|
'fr.greatest_accomplishment' => 'nullable|string', |
|
68
|
|
|
'fr.division' => 'nullable|string', |
|
69
|
|
|
'fr.position' => 'nullable|string', |
|
70
|
|
|
'fr.leadership_style' => 'nullable|string', |
|
71
|
|
|
'fr.employee_learning' => 'nullable|string', |
|
72
|
|
|
'fr.expectations' => 'nullable|string', |
|
73
|
|
|
'fr.education' => 'nullable|string', |
|
74
|
|
|
'fr.career_journey' => 'nullable|string', |
|
75
|
|
|
'fr.learning_path' => 'nullable|string', |
|
76
|
|
|
]; |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|