@@ -12,15 +12,15 @@ |
||
12 | 12 | * |
13 | 13 | * @return void |
14 | 14 | */ |
15 | - public function run() |
|
15 | + public function run () |
|
16 | 16 | { |
17 | - $skills = Skill::all(); |
|
17 | + $skills = Skill::all (); |
|
18 | 18 | |
19 | 19 | foreach ($skills as $skill) { |
20 | - $skill->classifications()->attach(Classification::inRandomOrder()->first()); |
|
21 | - $skill->is_culture_skill = (bool)random_int(0, 1); |
|
22 | - $skill->is_future_skill = (bool)random_int(0, 1); |
|
23 | - $skill->save(); |
|
20 | + $skill->classifications ()->attach (Classification::inRandomOrder ()->first ()); |
|
21 | + $skill->is_culture_skill = (bool) random_int (0, 1); |
|
22 | + $skill->is_future_skill = (bool) random_int (0, 1); |
|
23 | + $skill->save (); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | } |
@@ -12,10 +12,10 @@ |
||
12 | 12 | * |
13 | 13 | * @return void |
14 | 14 | */ |
15 | - public function run() |
|
15 | + public function run () |
|
16 | 16 | { |
17 | - factory(Manager::class, 10)->create(); |
|
18 | - factory(Applicant::class, 5)->create(); |
|
17 | + factory (Manager::class, 10)->create (); |
|
18 | + factory (Applicant::class, 5)->create (); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | } |
@@ -42,88 +42,88 @@ |
||
42 | 42 | * |
43 | 43 | * @return void |
44 | 44 | */ |
45 | - public function run() : void |
|
45 | + public function run () : void |
|
46 | 46 | { |
47 | - $adminUser = User::where('email', $this->adminEmail)->first(); |
|
47 | + $adminUser = User::where ('email', $this->adminEmail)->first (); |
|
48 | 48 | if ($adminUser === null) { |
49 | - $adminUser = factory(User::class)->state('admin')->create(['email' => $this->adminEmail]); |
|
49 | + $adminUser = factory (User::class)->state ('admin')->create (['email' => $this->adminEmail]); |
|
50 | 50 | } |
51 | 51 | |
52 | - $managerUser = User::where('email', $this->managerEmail)->first(); |
|
52 | + $managerUser = User::where ('email', $this->managerEmail)->first (); |
|
53 | 53 | // Create the test manager if it does not exist yet. |
54 | 54 | if ($managerUser === null) { |
55 | - $managerUser = factory(User::class)->state('upgradedManager')->create(['email' => $this->managerEmail]); |
|
56 | - $managerUser->manager()->save(factory(Manager::class)->create([ |
|
55 | + $managerUser = factory (User::class)->state ('upgradedManager')->create (['email' => $this->managerEmail]); |
|
56 | + $managerUser->manager ()->save (factory (Manager::class)->create ([ |
|
57 | 57 | 'user_id' => $managerUser->id |
58 | 58 | ])); |
59 | 59 | } |
60 | 60 | |
61 | - factory(JobPoster::class, 3)->state('published')->create([ |
|
61 | + factory (JobPoster::class, 3)->state ('published')->create ([ |
|
62 | 62 | 'manager_id' => $managerUser->manager->id |
63 | - ])->each(function ($job) : void { |
|
64 | - $job->job_applications()->saveMany(factory(JobApplication::class, 5))->create([ |
|
63 | + ])->each (function ($job) : void { |
|
64 | + $job->job_applications ()->saveMany (factory (JobApplication::class, 5))->create ([ |
|
65 | 65 | 'job_poster_id' => $job->id |
66 | 66 | ]); |
67 | 67 | // Then create one application with a priority user. |
68 | - $job->job_applications()->save(factory(JobApplication::class)->create([ |
|
68 | + $job->job_applications ()->save (factory (JobApplication::class)->create ([ |
|
69 | 69 | 'job_poster_id' => $job->id, |
70 | - 'applicant_id' => factory(Applicant::class)->create([ |
|
71 | - 'user_id' => factory(User::class)->state('priority')->create()->id |
|
70 | + 'applicant_id' => factory (Applicant::class)->create ([ |
|
71 | + 'user_id' => factory (User::class)->state ('priority')->create ()->id |
|
72 | 72 | ])->id |
73 | 73 | ])); |
74 | 74 | }); |
75 | - factory(JobPoster::class, 3)->state('closed')->create([ |
|
75 | + factory (JobPoster::class, 3)->state ('closed')->create ([ |
|
76 | 76 | 'manager_id' => $managerUser->manager->id |
77 | - ])->each(function ($job) : void { |
|
78 | - $job->job_applications()->saveMany(factory(JobApplication::class, 5))->create([ |
|
77 | + ])->each (function ($job) : void { |
|
78 | + $job->job_applications ()->saveMany (factory (JobApplication::class, 5))->create ([ |
|
79 | 79 | 'job_poster_id' => $job->id |
80 | 80 | ]); |
81 | 81 | // Then create one application with a priority user. |
82 | - $job->job_applications()->save(factory(JobApplication::class)->create([ |
|
82 | + $job->job_applications ()->save (factory (JobApplication::class)->create ([ |
|
83 | 83 | 'job_poster_id' => $job->id, |
84 | - 'applicant_id' => factory(Applicant::class)->create([ |
|
85 | - 'user_id' => factory(User::class)->state('priority')->create()->id |
|
84 | + 'applicant_id' => factory (Applicant::class)->create ([ |
|
85 | + 'user_id' => factory (User::class)->state ('priority')->create ()->id |
|
86 | 86 | ])->id |
87 | 87 | ])); |
88 | 88 | }); |
89 | - factory(JobPoster::class, 3)->state('draft')->create([ |
|
89 | + factory (JobPoster::class, 3)->state ('draft')->create ([ |
|
90 | 90 | 'manager_id' => $managerUser->manager->id |
91 | 91 | ]); |
92 | - factory(JobPoster::class, 3)->state('review_requested')->create([ |
|
92 | + factory (JobPoster::class, 3)->state ('review_requested')->create ([ |
|
93 | 93 | 'manager_id' => $managerUser->manager->id |
94 | 94 | ]); |
95 | 95 | |
96 | 96 | // Create a Job Poster with an Assessment Plan. |
97 | - $jobWithAssessment = factory(JobPoster::class)->state('draft')->create([ |
|
97 | + $jobWithAssessment = factory (JobPoster::class)->state ('draft')->create ([ |
|
98 | 98 | 'manager_id' => $managerUser->manager->id, |
99 | 99 | ]); |
100 | 100 | foreach ($jobWithAssessment->criteria as $criterion) { |
101 | 101 | // Create an assessment for each criterion. |
102 | - factory(Assessment::class)->state('withRatingGuide')->create([ |
|
102 | + factory (Assessment::class)->state ('withRatingGuide')->create ([ |
|
103 | 103 | 'criterion_id' => $criterion->id, |
104 | 104 | ]); |
105 | 105 | }; |
106 | 106 | |
107 | - $applicantUser = User::where('email', $this->applicantEmail)->first(); |
|
107 | + $applicantUser = User::where ('email', $this->applicantEmail)->first (); |
|
108 | 108 | if ($applicantUser === null) { |
109 | - $applicantUser = factory(User::class)->state('applicant')->create([ |
|
109 | + $applicantUser = factory (User::class)->state ('applicant')->create ([ |
|
110 | 110 | 'email' => $this->applicantEmail |
111 | 111 | ]); |
112 | - $applicantUser->applicant()->save(factory(Applicant::class)->create([ |
|
112 | + $applicantUser->applicant ()->save (factory (Applicant::class)->create ([ |
|
113 | 113 | 'user_id' => $applicantUser->id |
114 | 114 | ])); |
115 | 115 | } |
116 | 116 | |
117 | 117 | // Add to application profile. |
118 | - $applicantUser->applicant->references()->saveMany(factory(Reference::class, 3)->create([ |
|
118 | + $applicantUser->applicant->references ()->saveMany (factory (Reference::class, 3)->create ([ |
|
119 | 119 | 'applicant_id' => $applicantUser->applicant->id |
120 | 120 | ])); |
121 | 121 | |
122 | 122 | // Create several applications for test user. |
123 | - $applicantUser->applicant->job_applications()->saveMany(factory(JobApplication::class, 3)->create([ |
|
123 | + $applicantUser->applicant->job_applications ()->saveMany (factory (JobApplication::class, 3)->create ([ |
|
124 | 124 | 'applicant_id' => $applicantUser->applicant->id, |
125 | 125 | ])); |
126 | - $applicantUser->applicant->job_applications()->saveMany(factory(JobApplication::class, 2)->state('draft')->create([ |
|
126 | + $applicantUser->applicant->job_applications ()->saveMany (factory (JobApplication::class, 2)->state ('draft')->create ([ |
|
127 | 127 | 'applicant_id' => $applicantUser->applicant->id, |
128 | 128 | ])); |
129 | 129 | } |
@@ -6,19 +6,19 @@ |
||
6 | 6 | use App\Models\Skill; |
7 | 7 | use App\Models\Lookup\SkillLevel; |
8 | 8 | |
9 | -$faker_fr = Faker\Factory::create('fr'); |
|
9 | +$faker_fr = Faker\Factory::create ('fr'); |
|
10 | 10 | |
11 | -$factory->define(Criteria::class, function (Faker\Generator $faker) use ($faker_fr) { |
|
11 | +$factory->define (Criteria::class, function (Faker\Generator $faker) use ($faker_fr) { |
|
12 | 12 | return [ |
13 | - 'criteria_type_id' => CriteriaType::inRandomOrder()->first()->id, |
|
13 | + 'criteria_type_id' => CriteriaType::inRandomOrder ()->first ()->id, |
|
14 | 14 | 'job_poster_id' => function () { |
15 | - return factory(JobPoster::class)->create()->id; |
|
15 | + return factory (JobPoster::class)->create ()->id; |
|
16 | 16 | }, |
17 | - 'skill_id' => Skill::inRandomOrder()->first()->id, |
|
18 | - 'skill_level_id' => SkillLevel::inRandomOrder()->first()->id, |
|
19 | - 'description:en' => $faker->paragraphs(2, true), |
|
20 | - 'description:fr' => $faker_fr->paragraphs(2, true), |
|
21 | - 'specificity:en' => $faker->sentence(), |
|
22 | - 'specificity:fr' => $faker_fr->sentence(), |
|
17 | + 'skill_id' => Skill::inRandomOrder ()->first ()->id, |
|
18 | + 'skill_level_id' => SkillLevel::inRandomOrder ()->first ()->id, |
|
19 | + 'description:en' => $faker->paragraphs (2, true), |
|
20 | + 'description:fr' => $faker_fr->paragraphs (2, true), |
|
21 | + 'specificity:en' => $faker->sentence (), |
|
22 | + 'specificity:fr' => $faker_fr->sentence (), |
|
23 | 23 | ]; |
24 | 24 | }); |
@@ -15,163 +15,163 @@ |
||
15 | 15 | use App\Models\Lookup\TravelRequirement; |
16 | 16 | use App\Models\Lookup\OvertimeRequirement; |
17 | 17 | |
18 | -$faker_fr = Faker\Factory::create('fr'); |
|
18 | +$faker_fr = Faker\Factory::create ('fr'); |
|
19 | 19 | |
20 | -$factory->define(JobPoster::class, function (Faker\Generator $faker) use ($faker_fr) { |
|
21 | - $closeDate = $faker->dateTimeBetween('now', '1 months')->format('Y-m-d'); |
|
22 | - $openDate = $faker->dateTimeBetween('-1 months', 'now')->format('Y-m-d'); |
|
23 | - $startDate = $faker->dateTimeBetween('1 months', '2 months')->format('Y-m-d'); |
|
20 | +$factory->define (JobPoster::class, function (Faker\Generator $faker) use ($faker_fr) { |
|
21 | + $closeDate = $faker->dateTimeBetween ('now', '1 months')->format ('Y-m-d'); |
|
22 | + $openDate = $faker->dateTimeBetween ('-1 months', 'now')->format ('Y-m-d'); |
|
23 | + $startDate = $faker->dateTimeBetween ('1 months', '2 months')->format ('Y-m-d'); |
|
24 | 24 | $work_env_features = [ |
25 | - 'accessToExternal' => $faker->boolean(), |
|
26 | - 'assignedSeating' => $faker->boolean(), |
|
27 | - 'cafeteria' => $faker->boolean(), |
|
28 | - 'closeToTransit' => $faker->boolean(), |
|
29 | - 'collaboration' => $faker->boolean(), |
|
30 | - 'downtown' => $faker->boolean(), |
|
31 | - 'fileSharing' => $faker->boolean(), |
|
32 | - 'fitnessCenter' => $faker->boolean(), |
|
33 | - 'naturalLight' => $faker->boolean(), |
|
34 | - 'openConcept' => $faker->boolean(), |
|
35 | - 'parking' => $faker->boolean(), |
|
36 | - 'private' => $faker->boolean(), |
|
37 | - 'restaurants' => $faker->boolean(), |
|
38 | - 'smudging' => $faker->boolean(), |
|
39 | - 'taskManagement' => $faker->boolean(), |
|
40 | - 'versionControl' => $faker->boolean(), |
|
41 | - 'videoConferencing' => $faker->boolean(), |
|
42 | - 'windows' => $faker->boolean() |
|
25 | + 'accessToExternal' => $faker->boolean (), |
|
26 | + 'assignedSeating' => $faker->boolean (), |
|
27 | + 'cafeteria' => $faker->boolean (), |
|
28 | + 'closeToTransit' => $faker->boolean (), |
|
29 | + 'collaboration' => $faker->boolean (), |
|
30 | + 'downtown' => $faker->boolean (), |
|
31 | + 'fileSharing' => $faker->boolean (), |
|
32 | + 'fitnessCenter' => $faker->boolean (), |
|
33 | + 'naturalLight' => $faker->boolean (), |
|
34 | + 'openConcept' => $faker->boolean (), |
|
35 | + 'parking' => $faker->boolean (), |
|
36 | + 'private' => $faker->boolean (), |
|
37 | + 'restaurants' => $faker->boolean (), |
|
38 | + 'smudging' => $faker->boolean (), |
|
39 | + 'taskManagement' => $faker->boolean (), |
|
40 | + 'versionControl' => $faker->boolean (), |
|
41 | + 'videoConferencing' => $faker->boolean (), |
|
42 | + 'windows' => $faker->boolean () |
|
43 | 43 | ]; |
44 | 44 | return [ |
45 | - 'job_term_id' => JobTerm::inRandomOrder()->first()->id, |
|
46 | - 'chosen_lang' => $faker->randomElement(['en', 'fr']), |
|
47 | - 'term_qty' => $faker->numberBetween(1, 4), |
|
48 | - 'open_date_time' => ptDayStartToUtcTime($openDate), |
|
49 | - 'close_date_time' => ptDayEndToUtcTime($closeDate), |
|
50 | - 'start_date_time' => ptDayStartToUtcTime($startDate), |
|
51 | - 'review_requested_at' => $faker->dateTimeBetween('-2 months', '-1 months'), |
|
45 | + 'job_term_id' => JobTerm::inRandomOrder ()->first ()->id, |
|
46 | + 'chosen_lang' => $faker->randomElement (['en', 'fr']), |
|
47 | + 'term_qty' => $faker->numberBetween (1, 4), |
|
48 | + 'open_date_time' => ptDayStartToUtcTime ($openDate), |
|
49 | + 'close_date_time' => ptDayEndToUtcTime ($closeDate), |
|
50 | + 'start_date_time' => ptDayStartToUtcTime ($startDate), |
|
51 | + 'review_requested_at' => $faker->dateTimeBetween ('-2 months', '-1 months'), |
|
52 | 52 | 'published_at' => null, |
53 | - 'department_id' => Department::inRandomOrder()->first()->id, |
|
54 | - 'province_id' => Province::inRandomOrder()->first()->id, |
|
55 | - 'salary_min' => $faker->numberBetween(60000, 80000), |
|
56 | - 'salary_max' => $faker->numberBetween(80000, 100000), |
|
57 | - 'noc' => $faker->numberBetween(1, 9999), |
|
58 | - 'classification_id' => Classification::inRandomOrder()->first()->id, |
|
59 | - 'classification_level' => $faker->numberBetween(1, 6), |
|
60 | - 'security_clearance_id' => SecurityClearance::inRandomOrder()->first()->id, |
|
61 | - 'language_requirement_id' => LanguageRequirement::inRandomOrder()->first()->id, |
|
62 | - 'remote_work_allowed' => $faker->boolean(50), |
|
53 | + 'department_id' => Department::inRandomOrder ()->first ()->id, |
|
54 | + 'province_id' => Province::inRandomOrder ()->first ()->id, |
|
55 | + 'salary_min' => $faker->numberBetween (60000, 80000), |
|
56 | + 'salary_max' => $faker->numberBetween (80000, 100000), |
|
57 | + 'noc' => $faker->numberBetween (1, 9999), |
|
58 | + 'classification_id' => Classification::inRandomOrder ()->first ()->id, |
|
59 | + 'classification_level' => $faker->numberBetween (1, 6), |
|
60 | + 'security_clearance_id' => SecurityClearance::inRandomOrder ()->first ()->id, |
|
61 | + 'language_requirement_id' => LanguageRequirement::inRandomOrder ()->first ()->id, |
|
62 | + 'remote_work_allowed' => $faker->boolean (50), |
|
63 | 63 | 'manager_id' => function () { |
64 | - return factory(Manager::class)->create()->id; |
|
64 | + return factory (Manager::class)->create ()->id; |
|
65 | 65 | }, |
66 | - 'team_size' => $faker->numberBetween(5, 30), |
|
66 | + 'team_size' => $faker->numberBetween (5, 30), |
|
67 | 67 | 'work_env_features' => $work_env_features, |
68 | - 'fast_vs_steady' => $faker->numberBetween(1, 4), |
|
69 | - 'horizontal_vs_vertical' => $faker->numberBetween(1, 4), |
|
70 | - 'experimental_vs_ongoing' => $faker->numberBetween(1, 4), |
|
71 | - 'citizen_facing_vs_back_office' => $faker->numberBetween(1, 4), |
|
72 | - 'collaborative_vs_independent' => $faker->numberBetween(1, 4), |
|
73 | - 'telework_allowed_frequency_id' => Frequency::inRandomOrder()->first()->id, |
|
74 | - 'flexible_hours_frequency_id' => Frequency::inRandomOrder()->first()->id, |
|
75 | - 'travel_requirement_id' => TravelRequirement::inRandomOrder()->first()->id, |
|
76 | - 'overtime_requirement_id' => OvertimeRequirement::inRandomOrder()->first()->id, |
|
68 | + 'fast_vs_steady' => $faker->numberBetween (1, 4), |
|
69 | + 'horizontal_vs_vertical' => $faker->numberBetween (1, 4), |
|
70 | + 'experimental_vs_ongoing' => $faker->numberBetween (1, 4), |
|
71 | + 'citizen_facing_vs_back_office' => $faker->numberBetween (1, 4), |
|
72 | + 'collaborative_vs_independent' => $faker->numberBetween (1, 4), |
|
73 | + 'telework_allowed_frequency_id' => Frequency::inRandomOrder ()->first ()->id, |
|
74 | + 'flexible_hours_frequency_id' => Frequency::inRandomOrder ()->first ()->id, |
|
75 | + 'travel_requirement_id' => TravelRequirement::inRandomOrder ()->first ()->id, |
|
76 | + 'overtime_requirement_id' => OvertimeRequirement::inRandomOrder ()->first ()->id, |
|
77 | 77 | 'published' => false, |
78 | 78 | 'city:en' => $faker->city, |
79 | - 'title:en' => $faker->unique()->realText(27, 1), |
|
80 | - 'dept_impact:en' => $faker->paragraph(), |
|
81 | - 'team_impact:en' => $faker->paragraph(), |
|
82 | - 'hire_impact:en' => $faker->paragraph(), |
|
79 | + 'title:en' => $faker->unique ()->realText (27, 1), |
|
80 | + 'dept_impact:en' => $faker->paragraph (), |
|
81 | + 'team_impact:en' => $faker->paragraph (), |
|
82 | + 'hire_impact:en' => $faker->paragraph (), |
|
83 | 83 | 'division:en' => $faker->word, |
84 | - 'education:en' => $faker->sentence(), |
|
85 | - 'work_env_description:en' => $faker->paragraph(), |
|
86 | - 'culture_summary:en' => $faker->paragraph(), |
|
87 | - 'culture_special:en' => $faker->paragraph(), |
|
84 | + 'education:en' => $faker->sentence (), |
|
85 | + 'work_env_description:en' => $faker->paragraph (), |
|
86 | + 'culture_summary:en' => $faker->paragraph (), |
|
87 | + 'culture_special:en' => $faker->paragraph (), |
|
88 | 88 | 'city:fr' => $faker_fr->city, |
89 | - 'title:fr' => $faker_fr->unique()->realText(27, 1), |
|
90 | - 'dept_impact:fr' => $faker->paragraph(), |
|
91 | - 'team_impact:fr' => $faker->paragraph(), |
|
92 | - 'hire_impact:fr' => $faker->paragraph(), |
|
89 | + 'title:fr' => $faker_fr->unique ()->realText (27, 1), |
|
90 | + 'dept_impact:fr' => $faker->paragraph (), |
|
91 | + 'team_impact:fr' => $faker->paragraph (), |
|
92 | + 'hire_impact:fr' => $faker->paragraph (), |
|
93 | 93 | 'division:fr' => $faker_fr->word, |
94 | - 'education:fr' => $faker_fr->sentence(), |
|
95 | - 'work_env_description:fr' => $faker->paragraph(), |
|
96 | - 'culture_summary:fr' => $faker->paragraph(), |
|
97 | - 'culture_special:fr' => $faker->paragraph(), |
|
94 | + 'education:fr' => $faker_fr->sentence (), |
|
95 | + 'work_env_description:fr' => $faker->paragraph (), |
|
96 | + 'culture_summary:fr' => $faker->paragraph (), |
|
97 | + 'culture_special:fr' => $faker->paragraph (), |
|
98 | 98 | ]; |
99 | 99 | }); |
100 | 100 | |
101 | -$factory->afterCreating(JobPoster::class, function ($jp) : void { |
|
102 | - $jp->criteria()->saveMany(factory(Criteria::class, 5)->make([ |
|
101 | +$factory->afterCreating (JobPoster::class, function ($jp) : void { |
|
102 | + $jp->criteria ()->saveMany (factory (Criteria::class, 5)->make ([ |
|
103 | 103 | 'job_poster_id' => $jp->id |
104 | 104 | ])); |
105 | - $jp->job_poster_key_tasks()->saveMany(factory(JobPosterKeyTask::class, 5)->make([ |
|
105 | + $jp->job_poster_key_tasks ()->saveMany (factory (JobPosterKeyTask::class, 5)->make ([ |
|
106 | 106 | 'job_poster_id' => $jp->id |
107 | 107 | ])); |
108 | - $jp->job_poster_questions()->saveMany(factory(JobPosterQuestion::class, 2)->make([ |
|
108 | + $jp->job_poster_questions ()->saveMany (factory (JobPosterQuestion::class, 2)->make ([ |
|
109 | 109 | 'job_poster_id' => $jp->id |
110 | 110 | ])); |
111 | 111 | }); |
112 | 112 | |
113 | -$factory->state( |
|
113 | +$factory->state ( |
|
114 | 114 | JobPoster::class, |
115 | 115 | 'byUpgradedManager', |
116 | 116 | ['manager_id' => function () { |
117 | - return factory(Manager::class)->state('upgraded')->create()->id; |
|
117 | + return factory (Manager::class)->state ('upgraded')->create ()->id; |
|
118 | 118 | }] |
119 | 119 | ); |
120 | 120 | |
121 | -$factory->state( |
|
121 | +$factory->state ( |
|
122 | 122 | JobPoster::class, |
123 | 123 | 'published', |
124 | 124 | function (Faker\Generator $faker) { |
125 | 125 | return [ |
126 | 126 | 'published' => true, |
127 | - 'published_at' => $faker->dateTimeBetween('-1 months', '-3 weeks') |
|
127 | + 'published_at' => $faker->dateTimeBetween ('-1 months', '-3 weeks') |
|
128 | 128 | ]; |
129 | 129 | } |
130 | 130 | ); |
131 | 131 | |
132 | -$factory->state( |
|
132 | +$factory->state ( |
|
133 | 133 | JobPoster::class, |
134 | 134 | 'closed', |
135 | 135 | function (Faker\Generator $faker) { |
136 | 136 | return [ |
137 | 137 | 'published' => true, |
138 | - 'published_at' => $faker->dateTimeBetween('-1 months', '-3 weeks'), |
|
139 | - 'close_date_time' => ptDayEndToUtcTime($faker->dateTimeBetween('-5 days', '-3 days')->format('Y-m-d')), |
|
138 | + 'published_at' => $faker->dateTimeBetween ('-1 months', '-3 weeks'), |
|
139 | + 'close_date_time' => ptDayEndToUtcTime ($faker->dateTimeBetween ('-5 days', '-3 days')->format ('Y-m-d')), |
|
140 | 140 | ]; |
141 | 141 | } |
142 | 142 | ); |
143 | 143 | |
144 | -$factory->state( |
|
144 | +$factory->state ( |
|
145 | 145 | JobPoster::class, |
146 | 146 | 'draft', |
147 | 147 | function (Faker\Generator $faker) { |
148 | 148 | return [ |
149 | 149 | 'published' => false, |
150 | - 'open_date_time' => ptDayStartToUtcTime($faker->dateTimeBetween('5 days', '10 days')->format('Y-m-d')), |
|
151 | - 'close_date_time' => ptDayEndToUtcTime($faker->dateTimeBetween('3 weeks', '5 weeks')->format('Y-m-d')), |
|
150 | + 'open_date_time' => ptDayStartToUtcTime ($faker->dateTimeBetween ('5 days', '10 days')->format ('Y-m-d')), |
|
151 | + 'close_date_time' => ptDayEndToUtcTime ($faker->dateTimeBetween ('3 weeks', '5 weeks')->format ('Y-m-d')), |
|
152 | 152 | 'review_requested_at' => null, |
153 | 153 | 'published_at' => null, |
154 | 154 | ]; |
155 | 155 | } |
156 | 156 | ); |
157 | 157 | |
158 | -$factory->state( |
|
158 | +$factory->state ( |
|
159 | 159 | JobPoster::class, |
160 | 160 | 'review_requested', |
161 | 161 | function (Faker\Generator $faker) { |
162 | 162 | return [ |
163 | 163 | 'published' => false, |
164 | - 'open_date_time' => ptDayStartToUtcTime($faker->dateTimeBetween('5 days', '10 days')->format('Y-m-d')), |
|
165 | - 'close_date_time' => ptDayEndToUtcTime($faker->dateTimeBetween('3 weeks', '5 weeks')->format('Y-m-d')), |
|
166 | - 'review_requested_at' => $faker->dateTimeBetween('-2 days', '-1 days') |
|
164 | + 'open_date_time' => ptDayStartToUtcTime ($faker->dateTimeBetween ('5 days', '10 days')->format ('Y-m-d')), |
|
165 | + 'close_date_time' => ptDayEndToUtcTime ($faker->dateTimeBetween ('3 weeks', '5 weeks')->format ('Y-m-d')), |
|
166 | + 'review_requested_at' => $faker->dateTimeBetween ('-2 days', '-1 days') |
|
167 | 167 | ]; |
168 | 168 | } |
169 | 169 | ); |
170 | 170 | |
171 | -$factory->state(JobPoster::class, 'remote', [ |
|
171 | +$factory->state (JobPoster::class, 'remote', [ |
|
172 | 172 | 'remote_work_allowed' => true |
173 | 173 | ]); |
174 | 174 | |
175 | -$factory->state(JobPoster::class, 'local', [ |
|
175 | +$factory->state (JobPoster::class, 'local', [ |
|
176 | 176 | 'remote_work_allowed' => false |
177 | 177 | ]); |
@@ -10,39 +10,39 @@ |
||
10 | 10 | use App\Models\JobApplicationAnswer; |
11 | 11 | use App\Models\SkillDeclaration; |
12 | 12 | |
13 | -$factory->define(JobApplication::class, function (Faker\Generator $faker) { |
|
13 | +$factory->define (JobApplication::class, function (Faker\Generator $faker) { |
|
14 | 14 | return [ |
15 | 15 | 'job_poster_id' => function () { |
16 | - return factory(JobPoster::class)->states('published')->create()->id; |
|
16 | + return factory (JobPoster::class)->states ('published')->create ()->id; |
|
17 | 17 | }, |
18 | - 'application_status_id' => ApplicationStatus::where('name', 'submitted')->firstOrFail()->id, |
|
19 | - 'citizenship_declaration_id' => CitizenshipDeclaration::inRandomOrder()->first()->id, |
|
20 | - 'veteran_status_id' => VeteranStatus::inRandomOrder()->first()->id, |
|
21 | - 'preferred_language_id' => PreferredLanguage::inRandomOrder()->first()->id, |
|
22 | - 'submission_signature' => $faker->name(), |
|
23 | - 'submission_date' => $faker->dateTimeBetween('yesterday', 'tomorrow')->format('Y-m-d H:i:s'), |
|
18 | + 'application_status_id' => ApplicationStatus::where ('name', 'submitted')->firstOrFail ()->id, |
|
19 | + 'citizenship_declaration_id' => CitizenshipDeclaration::inRandomOrder ()->first ()->id, |
|
20 | + 'veteran_status_id' => VeteranStatus::inRandomOrder ()->first ()->id, |
|
21 | + 'preferred_language_id' => PreferredLanguage::inRandomOrder ()->first ()->id, |
|
22 | + 'submission_signature' => $faker->name (), |
|
23 | + 'submission_date' => $faker->dateTimeBetween ('yesterday', 'tomorrow')->format ('Y-m-d H:i:s'), |
|
24 | 24 | 'applicant_id' => function () { |
25 | - return factory(Applicant::class)->create()->id; |
|
25 | + return factory (Applicant::class)->create ()->id; |
|
26 | 26 | } |
27 | 27 | ]; |
28 | 28 | }); |
29 | 29 | |
30 | -$factory->state(JobApplication::class, 'draft', [ |
|
31 | - 'application_status_id' => ApplicationStatus::where('name', 'draft')->firstOrFail()->id, |
|
30 | +$factory->state (JobApplication::class, 'draft', [ |
|
31 | + 'application_status_id' => ApplicationStatus::where ('name', 'draft')->firstOrFail ()->id, |
|
32 | 32 | 'submission_signature' => null, |
33 | 33 | 'submission_date' => null |
34 | 34 | ]); |
35 | 35 | |
36 | -$factory->afterCreating(JobApplication::class, function ($application) : void { |
|
36 | +$factory->afterCreating (JobApplication::class, function ($application) : void { |
|
37 | 37 | foreach ($application->job_poster->job_poster_questions as $question) { |
38 | - $answer = factory(JobApplicationAnswer::class)->create([ |
|
38 | + $answer = factory (JobApplicationAnswer::class)->create ([ |
|
39 | 39 | 'job_poster_question_id' => $question->id, |
40 | 40 | 'job_application_id' => $application->id |
41 | 41 | ]); |
42 | - $application->job_application_answers()->save($answer); |
|
42 | + $application->job_application_answers ()->save ($answer); |
|
43 | 43 | } |
44 | 44 | foreach ($application->job_poster->criteria as $criterion) { |
45 | - factory(SkillDeclaration::class)->create([ |
|
45 | + factory (SkillDeclaration::class)->create ([ |
|
46 | 46 | 'skill_id' => $criterion->skill_id, |
47 | 47 | 'applicant_id' => $application->applicant_id, |
48 | 48 | ]); |
@@ -6,14 +6,14 @@ |
||
6 | 6 | use App\Models\Lookup\SkillLevel; |
7 | 7 | use App\Models\Applicant; |
8 | 8 | |
9 | -$factory->define(SkillDeclaration::class, function (Faker\Generator $faker) { |
|
9 | +$factory->define (SkillDeclaration::class, function (Faker\Generator $faker) { |
|
10 | 10 | return [ |
11 | - 'skill_id' => Skill::inRandomOrder()->first()->id, |
|
12 | - 'skill_status_id' => SkillStatus::inRandomOrder()->first()->id, |
|
13 | - 'skill_level_id' => SkillLevel::inRandomOrder()->first()->id, |
|
11 | + 'skill_id' => Skill::inRandomOrder ()->first ()->id, |
|
12 | + 'skill_status_id' => SkillStatus::inRandomOrder ()->first ()->id, |
|
13 | + 'skill_level_id' => SkillLevel::inRandomOrder ()->first ()->id, |
|
14 | 14 | 'applicant_id' => function () { |
15 | - return factory(Applicant::class)->create()->id; |
|
15 | + return factory (Applicant::class)->create ()->id; |
|
16 | 16 | }, |
17 | - 'description' => $faker->paragraphs(3, true), |
|
17 | + 'description' => $faker->paragraphs (3, true), |
|
18 | 18 | ]; |
19 | 19 | }); |
@@ -6,31 +6,31 @@ |
||
6 | 6 | use App\Models\Applicant; |
7 | 7 | use App\Models\Project; |
8 | 8 | |
9 | -$factory->define(Reference::class, function (Faker $faker) { |
|
9 | +$factory->define (Reference::class, function (Faker $faker) { |
|
10 | 10 | return [ |
11 | - 'name' => $faker->name(), |
|
12 | - 'email' => $faker->safeEmail(), |
|
13 | - 'description' => $faker->paragraphs(2, true), |
|
14 | - 'relationship_id' => Relationship::inRandomOrder()->first()->id, |
|
11 | + 'name' => $faker->name (), |
|
12 | + 'email' => $faker->safeEmail (), |
|
13 | + 'description' => $faker->paragraphs (2, true), |
|
14 | + 'relationship_id' => Relationship::inRandomOrder ()->first ()->id, |
|
15 | 15 | 'applicant_id' => function () { |
16 | - return factory(Applicant::class)->create()->id; |
|
16 | + return factory (Applicant::class)->create ()->id; |
|
17 | 17 | }, |
18 | 18 | ]; |
19 | 19 | }); |
20 | 20 | |
21 | -$factory->define(Project::class, function (Faker $faker) { |
|
21 | +$factory->define (Project::class, function (Faker $faker) { |
|
22 | 22 | return [ |
23 | - 'name' => $faker->sentence(), |
|
24 | - 'start_date' => $faker->dateTimeBetween('-3 years', '-1 years'), |
|
25 | - 'end_date' => $faker->dateTimeBetween('-1 years', '-1 day'), |
|
23 | + 'name' => $faker->sentence (), |
|
24 | + 'start_date' => $faker->dateTimeBetween ('-3 years', '-1 years'), |
|
25 | + 'end_date' => $faker->dateTimeBetween ('-1 years', '-1 day'), |
|
26 | 26 | 'applicant_id' => function () { |
27 | - return factory(Applicant::class)->create()->id; |
|
27 | + return factory (Applicant::class)->create ()->id; |
|
28 | 28 | }, |
29 | 29 | ]; |
30 | 30 | }); |
31 | 31 | |
32 | -$factory->afterCreating(Reference::class, function ($reference) : void { |
|
33 | - $reference->projects()->saveMany(factory(Project::class, 3)->make([ |
|
32 | +$factory->afterCreating (Reference::class, function ($reference) : void { |
|
33 | + $reference->projects ()->saveMany (factory (Project::class, 3)->make ([ |
|
34 | 34 | 'applicant_id' => $reference->applicant_id |
35 | 35 | ])); |
36 | 36 | }); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * |
17 | 17 | * @return void |
18 | 18 | */ |
19 | - public function __construct(User $user) |
|
19 | + public function __construct (User $user) |
|
20 | 20 | { |
21 | 21 | $this->user = $user; |
22 | 22 | } |