Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ§ͺ Add a seeded verified employee profile #12484

Closed
2 tasks
JoshBeveridge opened this issue Jan 14, 2025 · 2 comments Β· Fixed by #12556
Closed
2 tasks

πŸ§ͺ Add a seeded verified employee profile #12484

JoshBeveridge opened this issue Jan 14, 2025 · 2 comments Β· Fixed by #12556
Assignees
Labels
tests Procedures intended to establish the quality, performance, or reliability of something.

Comments

@JoshBeveridge
Copy link
Member

JoshBeveridge commented Jan 14, 2025

πŸ•΅οΈ Details

Looking to test @mnigh's PR #12433 but struggled to access employee tools post-build because of verification limitations (and my own DB limitations).

πŸ™‹β€β™€οΈ Proposed Solution

Add an [email protected] user with:

  • a pre-verified work email
  • employee profile
  • one current government work experience

Remove any employee-specific stuff from the default [email protected] user

βœ… Acceptance Criteria

  • Seeder creates [email protected] user with:
    • a pre-verified work email
    • employee profile
    • one current government work experience
  • [email protected] user does not get withEmployeeProfile when seeded, does not have verified work email, does not have any gov work experiences
@JoshBeveridge JoshBeveridge added feature New feature or request. tests Procedures intended to establish the quality, performance, or reliability of something. labels Jan 14, 2025
@brindasasi brindasasi moved this to 🏭 Ready for Estimate in GC Digital Talent Jan 16, 2025
@tristan-orourke tristan-orourke removed the feature New feature or request. label Jan 20, 2025
@mnigh
Copy link
Contributor

mnigh commented Jan 21, 2025

@esizer would it make sense to modify the function withEmployeeProfile so that it verifies user there or create a new function called something like withVerifiedEmails that does the work there? That way, we wouldn't need to create a new seeder user, we could use [email protected]. Thoughts?

public function withEmployeeProfile()
{
return $this->afterCreating(function (User $user) {
$community = Community::inRandomOrder()->first();
if (is_null($community)) {
$community = Community::factory()->withWorkStreams()->create();
}
$classification = Classification::inRandomOrder()->first();
if (is_null($classification)) {
$classification = Classification::factory()->create();
}
$workStream = $this->faker->randomElement($community->workStreams);
$departments = Department::inRandomOrder()->limit($this->faker->numberBetween(1, 3))->get();
$user->employeeProfile->dreamRoleDepartments()->sync($departments);
$user->employeeProfile()->update([
'career_planning_organization_type_interest' => $this->faker->randomElements(array_column(OrganizationTypeInterest::cases(), 'name'), null),
'career_planning_move_interest' => $this->faker->randomElements(array_column(MoveInterest::cases(), 'name'), null),
'career_planning_mentorship_status' => $this->faker->optional(weight: 70)->randomElements(array_column(Mentorship::cases(), 'name'), null),
'career_planning_mentorship_interest' => $this->faker->optional(weight: 70)->randomElements(array_column(Mentorship::cases(), 'name'), null),
'career_planning_exec_interest' => $this->faker->boolean(),
'career_planning_exec_coaching_status' => $this->faker->optional(weight: 80)->randomElements(array_column(ExecCoaching::cases(), 'name'), null),
'career_planning_exec_coaching_interest' => $this->faker->optional(weight: 80)->randomElements(array_column(ExecCoaching::cases(), 'name'), null),
'career_planning_about_you' => $this->faker->paragraph(),
'career_planning_career_goals' => $this->faker->paragraph(),
'career_planning_learning_goals' => $this->faker->paragraph(),
'career_planning_work_style' => $this->faker->paragraph(),
'dream_role_title' => $this->faker->words(3, true),
'dream_role_additional_information' => $this->faker->paragraph(),
'dream_role_community_id' => $community->id,
'dream_role_classification_id' => $classification->id,
'dream_role_work_stream_id' => $workStream?->id,
]);
});
}

User::factory()
->asApplicant()
->withSkillsAndExperiences()
->withEmployeeProfile()
->withCommunityInterests([$testCommunityId])
->create([
'first_name' => 'Gul',
'last_name' => 'Fields',
'email' => '[email protected]',
'sub' => '[email protected]',
]);

@esizer
Copy link
Member

esizer commented Jan 21, 2025

@esizer would it make sense to modify the function withEmployeeProfile so that it verifies user there or create a new function called something like withVerifiedEmails that does the work there? That way, we wouldn't need to create a new seeder user, we could use [email protected]. Thoughts?

Modifying withEmployee profile makes sense as long as we document it. Since uswers can't even add an employee profile without being verified makes sense to me πŸ‘

@tristan-orourke tristan-orourke moved this from 🏭 Ready for Estimate to πŸ“‹ Ready for Dev in GC Digital Talent Jan 22, 2025
@esizer esizer self-assigned this Jan 22, 2025
@esizer esizer moved this from πŸ“‹ Ready for Dev to πŸ— In progress in GC Digital Talent Jan 22, 2025
@esizer esizer moved this from πŸ— In progress to πŸ‘€ In review in GC Digital Talent Jan 22, 2025
@github-project-automation github-project-automation bot moved this from πŸ‘€ In review to βœ… Done in GC Digital Talent Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Procedures intended to establish the quality, performance, or reliability of something.
Projects
Status: βœ… Done
Development

Successfully merging a pull request may close this issue.

4 participants