diff --git a/api/app/GraphQL/Mutations/PoolCandidateSnapshot.graphql b/api/app/GraphQL/Mutations/PoolCandidateSnapshot.graphql index 546c6aedc67..f8c38c6b8f1 100644 --- a/api/app/GraphQL/Mutations/PoolCandidateSnapshot.graphql +++ b/api/app/GraphQL/Mutations/PoolCandidateSnapshot.graphql @@ -45,14 +45,6 @@ query getProfile($userId: UUID!) { fr } } - expectedGenericJobTitles { - id - key - name { - en - fr - } - } isWoman hasDisability isIndigenous @@ -63,16 +55,6 @@ query getProfile($userId: UUID!) { locationPreferences locationExemptions acceptedOperationalRequirements - expectedSalary - expectedClassifications { - id - name { - en - fr - } - group - level - } positionDuration userSkills { id diff --git a/api/app/GraphQL/Queries/CountPoolCandidatesByPool.php b/api/app/GraphQL/Queries/CountPoolCandidatesByPool.php index a54c80b2f13..0ec2babe9a8 100644 --- a/api/app/GraphQL/Queries/CountPoolCandidatesByPool.php +++ b/api/app/GraphQL/Queries/CountPoolCandidatesByPool.php @@ -73,11 +73,6 @@ public function __invoke($_, array $args) User::scopePositionDuration($userQuery, $filters['positionDuration']); } - // expectedClassifications - if (array_key_exists('expectedClassifications', $filters)) { - User::scopeExpectedClassifications($userQuery, $filters['expectedClassifications']); - } - // skills if (array_key_exists('skills', $filters)) { User::scopeSkillsAdditive($userQuery, $filters['skills']); diff --git a/api/app/Http/Resources/UserResource.php b/api/app/Http/Resources/UserResource.php index 9be979034c4..58fbfd40f40 100644 --- a/api/app/Http/Resources/UserResource.php +++ b/api/app/Http/Resources/UserResource.php @@ -80,8 +80,6 @@ public function toArray($request) 'govEmployeeType' => $this->gov_employee_type, 'department' => $this->department ? (new DepartmentResource(Department::find($this->department))) : null, 'currentClassification' => (new ClassificationResource($this->currentClassification)), - 'expectedClassifications' => ClassificationResource::collection($this->expectedClassifications), - 'expectedGenericJobTitles' => GenericJobTitleResource::collection($this->expectedGenericJobTitles), 'isWoman' => $this->is_woman, 'hasDisability' => $this->has_disability, 'isIndigenous' => $this->is_indigenous, @@ -92,7 +90,6 @@ public function toArray($request) 'locationPreferences' => $this->location_preferences, 'locationExemptions' => $this->location_exemptions, 'acceptedOperationalRequirements' => $this->accepted_operational_requirements, - 'expectedSalary' => $this->expected_salary, 'positionDuration' => $this->position_duration, 'poolCandidates' => PoolCandidateResource::collection($this->poolCandidates), 'experiences' => $collection, diff --git a/api/app/Listeners/StoreApplicationSnapshot.php b/api/app/Listeners/StoreApplicationSnapshot.php index f107831e5e7..c1ff685c52e 100644 --- a/api/app/Listeners/StoreApplicationSnapshot.php +++ b/api/app/Listeners/StoreApplicationSnapshot.php @@ -31,8 +31,6 @@ public function handle(ApplicationSubmitted $event) $user = User::with([ 'department', 'currentClassification', - 'expectedClassifications', - 'expectedGenericJobTitles', 'userSkills.skill', 'awardExperiences', 'awardExperiences.skills', diff --git a/api/app/Models/PoolCandidate.php b/api/app/Models/PoolCandidate.php index ca282633d60..e6f8f205534 100644 --- a/api/app/Models/PoolCandidate.php +++ b/api/app/Models/PoolCandidate.php @@ -214,30 +214,6 @@ public static function scopeQualifiedClassifications(Builder $query, ?array $cla return $query; } - /** - * scopeExpectedClassifications - * - * Scopes the query to only include applicants who have expressed interest in any of $classifications. - * - * @param Builder $query - * @param array|null $classifications - * @return Builder - */ - public function scopeExpectedClassifications(Builder $query, ?array $classifications): Builder - { - // if no filters provided then return query unchanged - if (empty($classifications)) { - return $query; - } - - // pointing to the classification scope on the User model - // that scope also contains filterByClassificationToSalary and filterByClassificationToGenericJobTitles - $query->whereHas('user', function ($query) use ($classifications) { - User::scopeExpectedClassifications($query, $classifications); - }); - return $query; - } - /** * Scope Publishing Groups * @@ -502,8 +478,6 @@ public function createSnapshot() $user = User::with([ 'department', 'currentClassification', - 'expectedClassifications', - 'expectedGenericJobTitles', 'awardExperiences', 'awardExperiences.skills', 'communityExperiences', diff --git a/api/app/Models/PoolCandidateFilter.php b/api/app/Models/PoolCandidateFilter.php index 26be93069f3..6d8ab521159 100644 --- a/api/app/Models/PoolCandidateFilter.php +++ b/api/app/Models/PoolCandidateFilter.php @@ -19,7 +19,6 @@ * @property boolean $is_woman * @property string $language_ability * @property array $work_regions - * @property array $expected_salary * @property array $operational_requirements * @property Illuminate\Support\Carbon $created_at * @property Illuminate\Support\Carbon $updated_at diff --git a/api/app/Models/User.php b/api/app/Models/User.php index cc6cabf9f38..1a9b69a3e83 100644 --- a/api/app/Models/User.php +++ b/api/app/Models/User.php @@ -53,7 +53,6 @@ * @property boolean $has_diploma * @property array $location_preferences * @property string $location_exemptions - * @property array $expected_salary * @property array $position_duration * @property array $accepted_operational_requirements * @property string $gov_employee_type @@ -81,7 +80,6 @@ class User extends Model implements Authenticatable, LaratrustUser protected $casts = [ 'location_preferences' => 'array', - 'expected_salary' => 'array', 'accepted_operational_requirements' => 'array', 'position_duration' => 'array', 'indigenous_communities' => 'array', @@ -108,14 +106,6 @@ public function currentClassification(): BelongsTo { return $this->belongsTo(Classification::class, "current_classification"); } - public function expectedClassifications(): BelongsToMany - { - return $this->belongsToMany(Classification::class, 'classification_user')->withTimestamps(); - } - public function expectedGenericJobTitles(): BelongsToMany - { - return $this->belongsToMany(GenericJobTitle::class, 'generic_job_title_user')->withTimestamps(); - } /** * @deprecated */ @@ -247,7 +237,6 @@ public static function scopeIsProfileComplete(Builder $query, ?bool $isProfileCo $query->whereNotNull('location_preferences'); $query->whereJsonLength('location_preferences', '>', 0); $query->whereJsonLength('position_duration', '>', 0); - $query->has('expectedGenericJobTitles'); $query->whereNotNull('citizenship'); $query->whereNotNull('armed_forces_status'); } @@ -471,52 +460,6 @@ public static function scopeQualifiedStreams(Builder $query, ?array $streams): B return $query; } - /** - * scopeExpectedClassifications - * - * Scopes the query to only return applicants who have expressed interest in any of $classifications. - * Applicants have been able to record this interest in various ways, so this scope may consider three fields on - * the user: expectedClassifications, expectedSalary, and expectedGenericJobTitles. - * - * @param Builder $query - * @param array|null $classifications Each classification is an object with a group and a level field. - * @return Builder - */ - public static function scopeExpectedClassifications(Builder $query, ?array $classifications): Builder - { - // if no filters provided then return query unchanged - if (empty($classifications)) { - return $query; - } - - // Classifications act as an OR filter. The query should return candidates with any of the classifications. - // A single whereHas clause for the relationship, containing multiple orWhere clauses accomplishes this. - $query->where(function ($query) use ($classifications) { - $query->whereHas('expectedClassifications', function ($query) use ($classifications) { - foreach ($classifications as $index => $classification) { - if ($index === 0) { - // First iteration must use where instead of orWhere - $query->where(function ($query) use ($classification) { - $query->where('group', $classification['group'])->where('level', $classification['level']); - }); - } else { - $query->orWhere(function ($query) use ($classification) { - $query->where('group', $classification['group'])->where('level', $classification['level']); - }); - } - } - }); - $query->orWhere(function ($query) use ($classifications) { - self::filterByClassificationToSalary($query, $classifications); - }); - $query->orWhere(function ($query) use ($classifications) { - self::filterByClassificationToGenericJobTitles($query, $classifications); - }); - }); - - return $query; - } - /** * Scope Publishing Groups * @@ -556,104 +499,6 @@ public static function scopeInITPublishingGroup(Builder $query) return $query; } - public static function filterByClassificationToGenericJobTitles(Builder $query, ?array $classifications): Builder - { - // if no filters provided then return query unchanged - if (empty($classifications)) { - return $query; - } - // Classifications act as an OR filter. The query should return candidates with any of the classifications. - // A single whereHas clause for the relationship, containing multiple orWhere clauses accomplishes this. - - // group these in a subquery to properly handle "OR" condition - $query->whereHas('expectedGenericJobTitles', function ($query) use ($classifications) { - $query->whereHas('classification', function ($query) use ($classifications) { - foreach ($classifications as $index => $classification) { - if ($index === 0) { - // First iteration must use where instead of orWhere - $query->where(function ($query) use ($classification) { - $query->where('group', $classification['group'])->where('level', $classification['level']); - }); - } else { - $query->orWhere(function ($query) use ($classification) { - $query->where('group', $classification['group'])->where('level', $classification['level']); - }); - } - } - }); - }); - - return $query; - } - private static function filterByClassificationToSalary(Builder $query, ?array $classifications): Builder - { - // When managers search for a classification, also return any users whose expected salary - // ranges overlap with the min/max salaries of any of those classifications. - // Since salary ranges are text enums a custom SQL subquery is used to convert them to - // numeric values and compare them to specified classifications - - // This subquery only works for a non-zero number of filter classifications. - // If passed zero classifications then return same query builder unchanged. - if (empty($classifications)) { - return $query; - } - - $parameters = []; - $sql = <<= u.min_salary - AND c.min_salary <= u.max_salary - WHERE ( - -RAWSQL1; - - foreach ($classifications as $index => $classification) { - if ($index === 0) { - // First iteration must use where instead of orWhere - $sql .= '(c.group = ? AND c.level = ?)'; - } else { - $sql .= ' OR (c.group = ? AND c.level = ?)'; - } - array_push($parameters, [$classification['group'], $classification['level']]); - } - - $sql .= <<whereRaw('EXISTS (' . $sql . ')', $parameters); - } - public static function scopeHasDiploma(Builder $query, ?bool $hasDiploma): Builder { if ($hasDiploma) { diff --git a/api/database/factories/UserFactory.php b/api/database/factories/UserFactory.php index da00b6d2a75..a792ebfb9e9 100644 --- a/api/database/factories/UserFactory.php +++ b/api/database/factories/UserFactory.php @@ -103,7 +103,7 @@ public function definition() ]), 'is_gov_employee' => $isGovEmployee, 'department' => $isGovEmployee && $randomDepartment ? $randomDepartment->id : null, - 'current_classification' => $randomClassification ? $randomClassification->id : null, + 'current_classification' => $isGovEmployee && $randomClassification ? $randomClassification->id : null, 'is_woman' => $this->faker->boolean(), 'has_disability' => $this->faker->boolean(), 'is_visible_minority' => $this->faker->boolean(), @@ -122,22 +122,11 @@ public function definition() 3 ), 'location_exemptions' => "{$this->faker->city()}, {$this->faker->city()}, {$this->faker->city()}", - 'expected_salary' => $this->faker->randomElements( - [ - '_50_59K', - '_60_69K', - '_70_79K', - '_80_89K', - '_90_99K', - '_100K_PLUS', - ], - 3 - ), 'position_duration' => $this->faker->boolean() ? [ApiEnums::POSITION_DURATION_PERMANENT, ApiEnums::POSITION_DURATION_TEMPORARY] : [ApiEnums::POSITION_DURATION_PERMANENT], // always accepting PERMANENT 'accepted_operational_requirements' => $this->faker->optional->randomElements(ApiEnums::operationalRequirements(), 2), - 'gov_employee_type' => $this->faker->randomElement(ApiEnums::govEmployeeTypes()), + 'gov_employee_type' => $isGovEmployee ? $this->faker->randomElement(ApiEnums::govEmployeeTypes()) : null, 'citizenship' => $this->faker->randomElement(ApiEnums::citizenshipStatuses()), 'armed_forces_status' => $this->faker->randomElement(ApiEnums::armedForcesStatuses()), 'has_priority_entitlement' => $hasPriorityEntitlement, @@ -148,18 +137,6 @@ public function definition() ]; } - /** - * GenericJobTitleSeeder must have already been run. - */ - public function withExpectedGenericJobTitles() - { - return $this->afterCreating(function (User $user) { - $user->expectedGenericJobTitles()->saveMany( - GenericJobTitle::inRandomOrder()->take(3)->get() - ); - }); - } - public function withExperiences($count = 10) { $types = [ @@ -198,13 +175,37 @@ public function withSkills($count = 10) }); } + /** + * Is government employee. + */ + public function asGovEmployee($isGovEmployee = true) + { + return $this->state(function () use ($isGovEmployee) { + if (!$isGovEmployee) { + return [ + 'is_gov_employee' => false, + 'current_classification' => null, + 'gov_employee_type' => null, + 'department' => null, + + ]; + } + $randomClassification = Classification::inRandomOrder()->first(); + $randomDepartment = Department::inRandomOrder()->first(); + return [ + 'is_gov_employee' => true, + 'current_classification' => $randomClassification ? $randomClassification->id : null, + 'gov_employee_type' => $this->faker->randomElement(ApiEnums::govEmployeeTypes()), + 'department' => $randomDepartment ? $randomDepartment->id : null, + + ]; + }); + } + public function configure() { return $this->afterCreating(function (User $user) { $user->addRole('base_user'); - $user->expectedGenericJobTitles()->saveMany( - GenericJobTitle::inRandomOrder()->take(1)->get() - ); }); } diff --git a/api/database/seeders/DatabaseSeeder.php b/api/database/seeders/DatabaseSeeder.php index 0b8ea5acfce..9125dd615a7 100644 --- a/api/database/seeders/DatabaseSeeder.php +++ b/api/database/seeders/DatabaseSeeder.php @@ -17,7 +17,6 @@ use App\Models\AwardExperience; use App\Models\CommunityExperience; use App\Models\EducationExperience; -use App\Models\GenericJobTitle; use App\Models\PersonalExperience; use App\Models\WorkExperience; use Faker; @@ -35,7 +34,6 @@ public function run() { $faker = Faker\Factory::create(); - $this->truncateTables(); // seed a test team and random teams @@ -44,7 +42,6 @@ public function run() $this->call(RolePermissionSeeder::class); $this->call(ClassificationSeeder::class); $this->call(DepartmentSeeder::class); - $this->call(GenericJobTitleSeeder::class); $this->call(SkillFamilySeeder::class); $this->call(SkillSeeder::class); $this->call(TeamSeederLocal::class); @@ -63,40 +60,19 @@ public function run() $digitalTalentPool = Pool::where('name->en', 'CMO Digital Careers')->sole(); + // Government employees (see asGovEmployee function in UserFactory for fields that are related to a user being a current Government of Canada employee). User::factory() - ->count(150) + ->count(75) ->withExperiences() + ->asGovEmployee() ->afterCreating(function (User $user) use ($faker, $digitalTalentPool) { - $genericJobTitles = GenericJobTitle::inRandomOrder()->limit(2)->pluck('id')->toArray(); - $user->expectedGenericJobTitles()->sync($genericJobTitles); - // pick a published pool in which to place this user // temporarily rig seeding to be biased towards slotting pool candidates into Digital Talent // digital careers is always published and strictly defined in PoolSeeder $randomPool = Pool::whereNotNull('published_at')->inRandomOrder()->first(); $pool = $faker->boolean(25) ? $digitalTalentPool : $randomPool; - // are they a government user? - if (rand(0, 1)) { - // government users have a current classification and expected classifications but no salary - $classification = Classification::inRandomOrder()->limit(1)->pluck('id')->toArray(); - $user->expectedClassifications()->sync($classification); - $user->expected_salary = []; - $user->save(); - - $user->expectedClassifications()->sync( - $pool->classifications()->pluck('classifications.id')->toArray() - ); - } else { - // non-government users have no current classification or expected classifications but have salary - $user->current_classification = null; - $user->expected_salary = $faker->randomElements(ApiEnums::salaryRanges(), 2); - $user->save(); - - $user->expectedClassifications()->sync([]); - } - // create a pool candidate in the pool - are they suspended? if (rand(0, 4) == 4) { $this->seedSuspendedCandidate($user, $pool); @@ -124,6 +100,28 @@ public function run() $applicantUserSkill->save(); } + // Not government employees (see asGovEmployee function in UserFactory for fields that are related to a user being a current Government of Canada employee). + User::factory() + ->count(75) + ->withExperiences() + ->asGovEmployee(false) + ->afterCreating(function (User $user) use ($faker, $digitalTalentPool) { + + // pick a published pool in which to place this user + // temporarily rig seeding to be biased towards slotting pool candidates into Digital Talent + // digital careers is always published and strictly defined in PoolSeeder + $randomPool = Pool::whereNotNull('published_at')->inRandomOrder()->first(); + $pool = $faker->boolean(25) ? $digitalTalentPool : $randomPool; + + // create a pool candidate in the pool - are they suspended? + if (rand(0, 4) == 4) { + $this->seedSuspendedCandidate($user, $pool); + } else { + $this->seedPoolCandidate($user, $pool); + } + }) + ->create(); + // attach either a work or education experience to a pool candidate to meet minimum criteria PoolCandidate::all()->load('user')->each(function ($poolCandidate) { $educationRequirementOption = $poolCandidate->education_requirement_option; diff --git a/api/database/seeders/UserSeederLocal.php b/api/database/seeders/UserSeederLocal.php index 7546037533f..22899a9c4e2 100644 --- a/api/database/seeders/UserSeederLocal.php +++ b/api/database/seeders/UserSeederLocal.php @@ -46,6 +46,7 @@ public function run() ->asPoolOperator(['digital-community-management', 'test-team']) ->withExperiences() ->withSkills() + ->asGovEmployee() ->create([ 'first_name' => 'Admin', 'last_name' => 'Test', @@ -57,6 +58,7 @@ public function run() ->asApplicant() ->asAdmin() ->withExperiences() + ->asGovEmployee() ->create([ 'first_name' => 'Platform', 'last_name' => 'Admin', @@ -68,6 +70,7 @@ public function run() ->asApplicant() ->asRequestResponder() ->withExperiences() + ->asGovEmployee() ->create([ 'first_name' => 'Request', 'last_name' => 'Responder', @@ -79,6 +82,7 @@ public function run() ->asApplicant() ->asPoolOperator(['digital-community-management', 'test-team']) ->withExperiences() + ->asGovEmployee() ->create([ 'first_name' => 'Pool', 'last_name' => 'Operator', @@ -109,6 +113,7 @@ public function run() User::factory() ->asApplicant() ->asAdmin() + ->asGovEmployee() ->create([ 'email' => 'petertgiles' . $fakeEmailDomain, 'sub' => '4810df0d-fcb6-4353-af93-b25c0a5a9c3e', @@ -116,6 +121,7 @@ public function run() User::factory() ->asApplicant() ->asAdmin() + ->asGovEmployee() ->create([ 'email' => 'yonikid15' . $fakeEmailDomain, 'sub' => 'c65dd054-db44-4bf6-af39-37eedb39305d', @@ -123,6 +129,7 @@ public function run() User::factory() ->asApplicant() ->asAdmin() + ->asGovEmployee() ->create([ 'email' => 'JamesHuf' . $fakeEmailDomain, 'sub' => 'e64b8057-0eaf-4a19-a14a-4a93fa2e8a04', @@ -130,6 +137,7 @@ public function run() User::factory() ->asApplicant() ->asAdmin() + ->asGovEmployee() ->create([ 'email' => 'brindasasi' . $fakeEmailDomain, 'sub' => '2e72b97b-017a-4ed3-a803-a8773c2e1b14', @@ -137,6 +145,7 @@ public function run() User::factory() ->asApplicant() ->asAdmin() + ->asGovEmployee() ->create([ 'email' => 'tristan-orourke' . $fakeEmailDomain, 'sub' => 'd9f27aca-b2ea-4c4a-9459-25bb7a7b77f6', @@ -144,6 +153,7 @@ public function run() User::factory() ->asApplicant() ->asAdmin() + ->asGovEmployee() ->create([ 'email' => 'vd1992' . $fakeEmailDomain, 'sub' => '2f3ee3fb-91ab-478e-a675-c56fdc043dc6', @@ -151,6 +161,7 @@ public function run() User::factory() ->asApplicant() ->asAdmin() + ->asGovEmployee() ->create([ 'email' => 'mnigh' . $fakeEmailDomain, 'sub' => 'c736bdff-c1f2-4538-b648-43a9743481a3', @@ -158,6 +169,7 @@ public function run() User::factory() ->asApplicant() ->asAdmin() + ->asGovEmployee() ->create([ 'email' => 'patcon' . $fakeEmailDomain, 'sub' => '88f7d707-01df-4f56-8eed-a823d16c232c', diff --git a/api/graphql/schema.graphql b/api/graphql/schema.graphql index 05b10e80ee9..02ad6f351ad 100644 --- a/api/graphql/schema.graphql +++ b/api/graphql/schema.graphql @@ -95,8 +95,12 @@ type User { locationExemptions: String @rename(attribute: "location_exemptions") acceptedOperationalRequirements: [OperationalRequirement] @rename(attribute: "accepted_operational_requirements") - expectedSalary: [SalaryRange] @rename(attribute: "expected_salary") - expectedClassifications: [Classification] @belongsToMany + expectedSalary: [SalaryRange] + @rename(attribute: "expected_salary") + @deprecated(reason: "Expected role and salary removed") + expectedClassifications: [Classification] + @belongsToMany + @deprecated(reason: "Expected role and salary removed") wouldAcceptTemporary: Boolean @rename(attribute: "would_accept_temporary") @deprecated(reason: "replaced with positionDuration") @@ -129,7 +133,9 @@ type User { ) # Pools a user owns # Profile Status isProfileComplete: Boolean - expectedGenericJobTitles: [GenericJobTitle] @belongsToMany + expectedGenericJobTitles: [GenericJobTitle] + @belongsToMany + @deprecated(reason: "Expected role and salary removed") priorityWeight: Int @rename(attribute: "priority_weight") # teams and roles roleAssignments: [RoleAssignment!] @hasMany @@ -559,8 +565,6 @@ type ApplicantFilter { @rename(attribute: "would_accept_temporary") @deprecated(reason: "replaced with positionDuration") positionDuration: [PositionDuration] @rename(attribute: "position_duration") - expectedClassifications: [Classification] # Filters applicants based on the classifications they've expressed interest in. - @belongsToMany(relation: "classifications") skills: [Skill] @belongsToMany # request creation connects to qualifiedClassifications qualifiedClassifications: [Classification] @belongsToMany # Filters applicants based on the classifications pools they've qualified in. @@ -813,8 +817,6 @@ input UserFilterInput { # Changes to this input will require some manual updates to api/app/GraphQL/Queries/CountPoolCandidatesByPool.php since it doesn't use the directives for automatic resolution input ApplicantFilterInput { equity: EquitySelectionsInput @scope - expectedClassifications: [ClassificationFilterInput] # Filters applicants based on the classifications they've expressed interest in. - @scope(name: "expectedClassifications") hasDiploma: Boolean @scope languageAbility: LanguageAbility @scope locationPreferences: [WorkRegion] @scope @@ -1084,9 +1086,6 @@ input CreateUserInput { locationExemptions: String @rename(attribute: "location_exemptions") acceptedOperationalRequirements: [OperationalRequirement] @rename(attribute: "accepted_operational_requirements") - expectedSalary: [SalaryRange] @rename(attribute: "expected_salary") - expectedClassifications: ClassificationBelongsToMany - expectedGenericJobTitles: GenericJobTitleBelongsToMany positionDuration: [PositionDuration] @rename(attribute: "position_duration") # Experiences @@ -1155,9 +1154,6 @@ input UpdateUserAsAdminInput locationExemptions: String @rename(attribute: "location_exemptions") acceptedOperationalRequirements: [OperationalRequirement] @rename(attribute: "accepted_operational_requirements") - expectedSalary: [SalaryRange] @rename(attribute: "expected_salary") - expectedClassifications: ClassificationBelongsToMany - expectedGenericJobTitles: GenericJobTitleBelongsToMany positionDuration: [PositionDuration] @rename(attribute: "position_duration") # Experiences @@ -1224,9 +1220,6 @@ input UpdateUserAsUserInput locationExemptions: String @rename(attribute: "location_exemptions") acceptedOperationalRequirements: [OperationalRequirement] @rename(attribute: "accepted_operational_requirements") - expectedSalary: [SalaryRange] @rename(attribute: "expected_salary") - expectedClassifications: ClassificationBelongsToMany - expectedGenericJobTitles: GenericJobTitleBelongsToMany positionDuration: [PositionDuration] @rename(attribute: "position_duration") # Experiences @@ -1342,8 +1335,6 @@ input CreateApplicantFilterInput { @rename(attribute: "operational_requirements") locationPreferences: [WorkRegion] @rename(attribute: "location_preferences") positionDuration: [PositionDuration] @rename(attribute: "position_duration") - expectedClassifications: ClassificationBelongsToMany - @rename(attribute: "classifications") skills: SkillBelongsToMany pools: PoolBelongsToMany citizenship: CitizenshipStatus diff --git a/api/storage/app/lighthouse-schema.graphql b/api/storage/app/lighthouse-schema.graphql index b04077059a3..acdd92139fc 100755 --- a/api/storage/app/lighthouse-schema.graphql +++ b/api/storage/app/lighthouse-schema.graphql @@ -198,8 +198,8 @@ type User { locationPreferences: [WorkRegion] locationExemptions: String acceptedOperationalRequirements: [OperationalRequirement] - expectedSalary: [SalaryRange] - expectedClassifications: [Classification] + expectedSalary: [SalaryRange] @deprecated(reason: "Expected role and salary removed") + expectedClassifications: [Classification] @deprecated(reason: "Expected role and salary removed") wouldAcceptTemporary: Boolean @deprecated(reason: "replaced with positionDuration") positionDuration: [PositionDuration] poolCandidates: [PoolCandidate] @@ -212,7 +212,7 @@ type User { userSkills: [UserSkill!] pools: [Pool] @deprecated(reason: "Pools are now associated with a Team more than a single User. Use User.roles.team.pools instead.") isProfileComplete: Boolean - expectedGenericJobTitles: [GenericJobTitle] + expectedGenericJobTitles: [GenericJobTitle] @deprecated(reason: "Expected role and salary removed") priorityWeight: Int roleAssignments: [RoleAssignment!] unreadNotifications: [Notification!] @@ -608,7 +608,6 @@ type ApplicantFilter { locationPreferences: [WorkRegion] wouldAcceptTemporary: Boolean @deprecated(reason: "replaced with positionDuration") positionDuration: [PositionDuration] - expectedClassifications: [Classification] skills: [Skill] qualifiedClassifications: [Classification] qualifiedStreams: [PoolStream] @@ -848,7 +847,6 @@ input UserFilterInput { input ApplicantFilterInput { equity: EquitySelectionsInput - expectedClassifications: [ClassificationFilterInput] hasDiploma: Boolean languageAbility: LanguageAbility locationPreferences: [WorkRegion] @@ -938,9 +936,6 @@ input CreateUserInput { locationPreferences: [WorkRegion] locationExemptions: String acceptedOperationalRequirements: [OperationalRequirement] - expectedSalary: [SalaryRange] - expectedClassifications: ClassificationBelongsToMany - expectedGenericJobTitles: GenericJobTitleBelongsToMany positionDuration: [PositionDuration] workExperiences: WorkExperienceHasMany personalExperiences: PersonalExperienceHasMany @@ -987,9 +982,6 @@ input UpdateUserAsAdminInput { locationPreferences: [WorkRegion] locationExemptions: String acceptedOperationalRequirements: [OperationalRequirement] - expectedSalary: [SalaryRange] - expectedClassifications: ClassificationBelongsToMany - expectedGenericJobTitles: GenericJobTitleBelongsToMany positionDuration: [PositionDuration] workExperiences: WorkExperienceHasMany personalExperiences: PersonalExperienceHasMany @@ -1035,9 +1027,6 @@ input UpdateUserAsUserInput { locationPreferences: [WorkRegion] locationExemptions: String acceptedOperationalRequirements: [OperationalRequirement] - expectedSalary: [SalaryRange] - expectedClassifications: ClassificationBelongsToMany - expectedGenericJobTitles: GenericJobTitleBelongsToMany positionDuration: [PositionDuration] workExperiences: WorkExperienceHasMany personalExperiences: PersonalExperienceHasMany @@ -1144,7 +1133,6 @@ input CreateApplicantFilterInput { operationalRequirements: [OperationalRequirement] locationPreferences: [WorkRegion] positionDuration: [PositionDuration] - expectedClassifications: ClassificationBelongsToMany skills: SkillBelongsToMany pools: PoolBelongsToMany citizenship: CitizenshipStatus diff --git a/api/tests/Feature/ApplicantFilterTest.php b/api/tests/Feature/ApplicantFilterTest.php index 845d54526d2..160ad11bbcc 100644 --- a/api/tests/Feature/ApplicantFilterTest.php +++ b/api/tests/Feature/ApplicantFilterTest.php @@ -67,12 +67,6 @@ protected function filterToInput(ApplicantFilter $filter) 'operationalRequirements' => $filter->operational_requirements, 'locationPreferences' => $filter->location_preferences, 'positionDuration' => $filter->position_duration, - 'expectedClassifications' => $filter->classifications->map(function ($classification) { - return [ - 'group' => $classification->group, - 'level' => $classification->level, - ]; - })->toArray(), 'skills' => $filter->skills->map($onlyId)->toArray(), 'pools' => $filter->pools->map($onlyId)->toArray(), 'qualifiedClassifications' => $filter->qualifiedClassifications->map(function ($classification) { @@ -88,9 +82,6 @@ protected function filterToInput(ApplicantFilter $filter) protected function filterToCreateInput(ApplicantFilter $filter) { $input = $this->filterToInput($filter); - $input['expectedClassifications'] = [ - 'sync' => $filter->classifications->pluck('id')->toArray() - ]; $input['skills'] = [ 'sync' => $filter->skills->pluck('id')->toArray() ]; @@ -268,13 +259,6 @@ public function testQueryRelationships() query { applicantFilters { id - expectedClassifications { - id - name { - en - fr - } - } skills { id name { @@ -303,7 +287,6 @@ public function testQueryRelationships() ); // Assert that each relationship collection has the right size. foreach ($response->json('data.applicantFilters') as $filter) { - $this->assertCount($filters->find($filter['id'])->classifications->count(), $filter['expectedClassifications']); $this->assertCount($filters->find($filter['id'])->qualifiedClassifications->count(), $filter['qualifiedClassifications']); $this->assertCount($filters->find($filter['id'])->skills->count(), $filter['skills']); $this->assertCount($filters->find($filter['id'])->pools->count(), $filter['pools']); @@ -316,12 +299,6 @@ public function testQueryRelationships() 'applicantFilters' => [ [ 'id' => $firstFilterModel->id, - 'expectedClassifications' => [ - [ - 'id' => $firstFilterModel->classifications->first()->id, - 'name' => $firstFilterModel->classifications->first()->name, - ], - ], 'qualifiedClassifications' => [ [ 'id' => $firstFilterModel->qualifiedClassifications->first()->id, @@ -467,9 +444,6 @@ public function testFilterCanBeStoredAndRetrievedWithoutChangingResults() 'operational_requirements' => $candidate->user->accepted_operational_requirements, ] ); - $filter->classifications()->saveMany( - $candidate->user->expectedGenericJobTitles->pluck('classification')->unique() - ); $filter->qualifiedClassifications()->saveMany( $pool->classifications->unique() ); @@ -556,10 +530,6 @@ public function testFilterCanBeStoredAndRetrievedWithoutChangingResults() operationalRequirements positionDuration qualifiedStreams - expectedClassifications { - group - level - } qualifiedClassifications { group level diff --git a/api/tests/Feature/ApplicantTest.php b/api/tests/Feature/ApplicantTest.php index d9a29938775..bcb2676142f 100644 --- a/api/tests/Feature/ApplicantTest.php +++ b/api/tests/Feature/ApplicantTest.php @@ -353,106 +353,6 @@ public function testCountApplicantsQueryLanguage(): void ]); } - public function testCountApplicantsQuerySalaryClassifications(): void - { - // Recycling salary/classification tests // - $user = User::All()->first(); - $pool1 = Pool::factory()->candidatesAvailableInSearch()->create([ - 'user_id' => $user['id'], - ]); - - PoolCandidate::factory()->count(1)->create([ - 'pool_id' => $pool1['id'], - 'expiry_date' => config('constants.far_future_date'), - 'pool_candidate_status' => ApiEnums::CANDIDATE_STATUS_QUALIFIED_AVAILABLE, - 'user_id' => User::factory([ - 'expected_salary' => [], - ]) - ]); - - PoolCandidate::factory()->count(2)->sequence(fn () => [ - 'pool_id' => $pool1->id, - 'expiry_date' => config('constants.far_future_date'), - 'pool_candidate_status' => ApiEnums::CANDIDATE_STATUS_QUALIFIED_AVAILABLE, - 'user_id' => User::factory([ - 'expected_salary' => ['_50_59K', '_70_79K'], - ]) - ])->for($user)->afterCreating(function (PoolCandidate $candidate) use ($user) { - $classificationLvl1 = Classification::factory()->create([ - 'group' => 'ZZ', - 'level' => 1, - 'min_salary' => 50000, - 'max_salary' => 69000, - ]); - $candidate->user->expectedClassifications()->sync($classificationLvl1); - })->create(); - - PoolCandidate::factory()->count(4)->sequence(fn () => [ - 'pool_id' => $pool1->id, - 'expiry_date' => config('constants.far_future_date'), - 'pool_candidate_status' => ApiEnums::CANDIDATE_STATUS_QUALIFIED_AVAILABLE, - 'user_id' => User::factory([ - 'expected_salary' => ['_60_69K', '_80_89K'], - ]) - ])->for($user)->afterCreating(function (PoolCandidate $candidate) use ($user) { - $candidate->user->expectedClassifications()->delete(); - })->create(); - - PoolCandidate::factory()->count(11)->sequence(fn () => [ - 'pool_id' => $pool1->id, - 'expiry_date' => config('constants.far_future_date'), - 'pool_candidate_status' => ApiEnums::CANDIDATE_STATUS_QUALIFIED_AVAILABLE, - 'user_id' => User::factory([ - 'expected_salary' => ['_90_99K', '_100K_PLUS'] - ]) - ])->for($user)->afterCreating(function (PoolCandidate $candidate) use ($user) { - $candidate->user->expectedClassifications()->delete(); - })->create(); - - // Assert query with just pool filter - $this->graphQL( - /** @lang GraphQL */ - ' - query countApplicants($where: ApplicantFilterInput) { - countApplicants (where: $where) - } - ', - [ - 'where' => [ - 'pools' => [ - ['id' => $pool1['id']] - ], - ] - ] - )->assertJson([ - 'data' => [ - 'countApplicants' => 18 - ] - ]); - - // Assert query to test classification-salary - $this->graphQL( - /** @lang GraphQL */ - ' - query countApplicants($where: ApplicantFilterInput) { - countApplicants (where: $where) - } - ', - [ - 'where' => [ - 'pools' => [ - ['id' => $pool1['id']] - ], - 'expectedClassifications' => [['group' => 'ZZ', 'level' => 1]], - ] - ] - )->assertJson([ - 'data' => [ - 'countApplicants' => 6 - ] - ]); - } - public function testCountApplicantsQueryEducation(): void { $user = User::All()->first(); @@ -1681,7 +1581,6 @@ public function testNullFilterEqualsUndefinedPoolCandidate() 'where' => [ 'applicantFilter' => [ 'equity' => null, - 'expectedClassifications' => null, 'hasDiploma' => null, 'languageAbility' => null, 'locationPreferences' => null, diff --git a/api/tests/Feature/CountPoolCandidatesByPoolTest.php b/api/tests/Feature/CountPoolCandidatesByPoolTest.php index de06157ea73..e2ba2440f6c 100644 --- a/api/tests/Feature/CountPoolCandidatesByPoolTest.php +++ b/api/tests/Feature/CountPoolCandidatesByPoolTest.php @@ -496,68 +496,6 @@ public function testWouldAcceptTemporary() ]); } - // test classifications - // creates a three users various expected classifications and filter for the classifications on two of them - public function testClassifications() - { - $pool = Pool::factory()->candidatesAvailableInSearch()->create($this->poolData()); - $classifications = Classification::factory(3) - ->create( - ['min_salary' => 0, 'max_salary' => 0] // avoid classification/salary cross-matching - ); - $users = User::factory(3) - ->afterCreating(function ($user) use ($pool) { - PoolCandidate::factory()->create($this->poolCandidateData($pool, $user)); - }) - ->create([]); - $users[0]->expectedClassifications()->sync([ - $classifications[0]->id, - $classifications[1]->id - ]); - $users[1]->expectedClassifications()->sync([ - $classifications[1]->id, - $classifications[2]->id - ]); - $users[2]->expectedClassifications()->sync([ - $classifications[2]->id - ]); - - $this->graphQL( - /** @lang GraphQL */ - ' - query ($where: ApplicantFilterInput) { - countPoolCandidatesByPool(where: $where) { - pool { id } - candidateCount - } - } - ', - [ - 'where' => [ - 'expectedClassifications' => [ - [ - 'group' => $classifications[0]->group, - 'level' => $classifications[0]->level, - ], - [ - 'group' => $classifications[1]->group, - 'level' => $classifications[1]->level, - ] - ] - ] - ] - )->assertSimilarJson([ - 'data' => [ - 'countPoolCandidatesByPool' => [ - [ - 'pool' => ['id' => $pool->id], - 'candidateCount' => 2 - ] - ] - ] - ]); - } - // test skills // creates a three users various skills and filter for the skills on two of them // filtering is OR using User::scopeSkillsAdditive diff --git a/api/tests/Feature/PoolApplicationTest.php b/api/tests/Feature/PoolApplicationTest.php index 0dc0f34965d..f089032bd49 100644 --- a/api/tests/Feature/PoolApplicationTest.php +++ b/api/tests/Feature/PoolApplicationTest.php @@ -126,8 +126,6 @@ protected function setUp(): void 'email' => 'applicant-user@test.com', 'sub' => 'applicant-user@test.com', ]); - // Add generic job title for submission - $this->applicantUser->expectedGenericJobTitles()->sync([GenericJobTitle::first()->id]); $this->responderUser = User::factory() ->asApplicant() diff --git a/api/tests/Feature/UserTest.php b/api/tests/Feature/UserTest.php index d35121b4dc1..c136d460132 100644 --- a/api/tests/Feature/UserTest.php +++ b/api/tests/Feature/UserTest.php @@ -49,7 +49,6 @@ protected function setUp(): void 'looking_for_english' => null, 'looking_for_french' => null, 'looking_for_bilingual' => null, - 'expected_salary' => [], 'accepted_operational_requirements' => null, 'location_preferences' => [], 'has_diploma' => false, @@ -754,385 +753,6 @@ public function testFilterByLanguageAbility(): void ]); } - public function testFilterByClassification(): void - { - // Create initial data. - User::factory()->count(5)->create([ - 'expected_salary' => [], // remove salaries to avoid accidental classification-to-salary matching - ]); - - // Create new classification and attach to two new users. - $classification = Classification::factory()->create([ - 'group' => 'ZZ', - 'level' => 1, - ]); - User::factory()->count(2)->create()->each(function ($user) use ($classification) { - $user->expectedClassifications()->save($classification); - }); - - // Assert query with no classifications filter will return all users - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 8 - ] - ] - ] - ]); - - // Assert query with classification filter will return correct number of users - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [ - 'applicantFilter' => [ - 'expectedClassifications' => [['group' => 'ZZ', 'level' => 1]], - ] - ] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 2 - ] - ] - ] - ]); - - // Assert query with unknown classification filter will return zero - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [ - 'applicantFilter' => [ - 'expectedClassifications' => [['group' => 'UNKNOWN', 'level' => 1324234]], - ] - ] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 0 - ] - ] - ] - ]); - } - - public function testFilterByClassificationToSalary(): void - { - // Create initial data. - User::factory()->count(5)->create([ - 'expected_salary' => [] - ]); - - // Create new classification. - $classificationLvl1 = Classification::factory()->create([ - 'group' => 'ZZ', - 'level' => 1, - 'min_salary' => 50000, - 'max_salary' => 69000, - ]); - - // Attach new users that are in the expected salary range. - $user1 = User::factory()->create([ - 'expected_salary' => ['_50_59K', '_70_79K'] - ]); - $user1->expectedClassifications()->delete(); - $user1->expectedClassifications()->save($classificationLvl1); - - // Attach new users that overlap the expected salary range. - $user2 = User::factory()->create([ - 'expected_salary' => ['_60_69K', '_80_89K'] - ]); - $user2->expectedClassifications()->delete(); - - // Attach new users that are over the expected salary range. - $user3 = User::factory()->create([ - 'expected_salary' => ['_90_99K', '_100K_PLUS'] - ]); - $user3->expectedClassifications()->delete(); - - // Assert query with no classifications filter will return all users - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 9 - ] - ] - ] - ]); - - // Assert query with classification filter will return users in range and overlapping. - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [ - 'applicantFilter' => [ - 'expectedClassifications' => [['group' => 'ZZ', 'level' => 1]], - ] - ] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 2 - ] - ] - ] - ]); - - // Assert query with unknown classification filter will return zero - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [ - 'applicantFilter' => [ - 'expectedClassifications' => [['group' => 'UNKNOWN', 'level' => 1324234]], - ] - ] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 0 - ] - ] - ] - ]); - } - - public function testFilterByClassificationToGenericJobTitle(): void - { - // Create initial data. - User::factory()->count(5)->create([ - 'expected_salary' => [] - ]); - - - // Create classifications and Generics - $this->seed(ClassificationSeeder::class); - $this->seed(GenericJobTitleSeeder::class); - - // Create 3 users which correspond to IT-03 - User::factory()->count(1)->create(['expected_salary' => []])->each(function ($user) { - $user->expectedGenericJobTitles()->sync( - GenericJobTitle::where('key', ApiEnums::GENERIC_JOB_TITLE_KEY_TEAM_LEADER_IT03)->get() - ); - }); - User::factory()->count(2)->create(['expected_salary' => []])->each(function ($user) { - $user->expectedGenericJobTitles()->sync( - GenericJobTitle::where('key', ApiEnums::GENERIC_JOB_TITLE_KEY_TECHNICAL_ADVISOR_IT03)->get() - ); - }); - // Create 4 users which correspond to IT-04 - User::factory()->count(4)->create(['expected_salary' => []])->each(function ($user) { - $user->expectedGenericJobTitles()->sync( - GenericJobTitle::where('key', ApiEnums::GENERIC_JOB_TITLE_KEY_SENIOR_ADVISOR_IT04)->get() - ); - }); - // Create 7 users which correspond to both IT-03 and IT-04 - User::factory()->count(7)->create(['expected_salary' => []])->each(function ($user) { - $user->expectedGenericJobTitles()->sync( - GenericJobTitle::whereIn('key', [ - ApiEnums::GENERIC_JOB_TITLE_KEY_SENIOR_ADVISOR_IT04, - ApiEnums::GENERIC_JOB_TITLE_KEY_TECHNICAL_ADVISOR_IT03 - ])->get() - ); - }); - - - // Assert query with no classifications filter will return all users - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 20 - ] - ] - ] - ]); - - // Assert query with one classification filter will return correct number of users. - $results = $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [ - 'applicantFilter' => [ - 'expectedClassifications' => [['group' => 'IT', 'level' => 3]], - ] - ] - ] - ); - $results->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 10 - ] - ] - ] - ]); - - // Assert query with two classification filters will return correct number of users - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [ - 'applicantFilter' => [ - 'expectedClassifications' => [ - ['group' => 'IT', 'level' => 3], - ['group' => 'IT', 'level' => 4] - ] - ] - ] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 14 - ] - ] - ] - ]); - - // Assert that adding an unknown classification to query to classification won't reduce number of users - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [ - 'applicantFilter' => [ - 'expectedClassifications' => [ - ['group' => 'IT', 'level' => 3], - ['group' => 'IT', 'level' => 4], - ['group' => 'QQ', 'level' => 9] - ] - ] - ] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 14 - ] - ] - ] - ]); - } - public function testFilterByOperationalRequirements(): void { // Create initial data. @@ -1620,9 +1240,6 @@ public function testFilterByProfileComplete(): void // Create some complete users. User::factory()->count(3) - ->afterCreating(function ($user) { - $user->expectedGenericJobTitles()->sync([GenericJobTitle::first()->id]); - }) ->create([ 'current_province' => 'ONTARIO', 'location_preferences' => ['PRAIRIE'], @@ -1632,7 +1249,6 @@ public function testFilterByProfileComplete(): void 'telephone' => '+15407608748', 'current_city' => 'Somewhere random', 'is_gov_employee' => false, - 'expected_salary' => ['_50_59K'], ]); // Assert query no isProfileComplete filter will return all users @@ -2081,195 +1697,6 @@ public function testOrdering(): void ]); } - public function testFilterByClassificationToSalaryWithPools(): void - { - // myPool will be people we're querying for and should be returned - $myPool = Pool::factory()->create(['name' => 'myPool']); - // otherPool will be people we're not querying for and should not be returned - $otherPool = Pool::factory()->create(['name' => 'otherPool']); - - // myClassification is the classification we will be querying for - $myClassification = Classification::factory()->create([ - 'group' => 'ZZ', - 'level' => 1, - 'min_salary' => 55000, - 'max_salary' => 64999, - ]); - - // *** first make three users in the right pool - 1 has an exact classification match, 1 has a salary to classification match, 1 has no match - // attach AVAILABLE status to ensure filtering by pools doesn't filter by status - // Attach new user in the pool with the desired classification - PoolCandidate::factory()->create([ - 'user_id' => User::factory()->afterCreating(function ($user) use ($myClassification) { - $user->expectedClassifications()->delete(); - $user->expectedClassifications()->save($myClassification); - })->create([ - 'expected_salary' => [] - ]), - 'pool_id' => $myPool->id, - 'expiry_date' => config('constants.far_future_date'), - 'pool_candidate_status' => ApiEnums::CANDIDATE_STATUS_QUALIFIED_AVAILABLE, - ]); - - // Attach new user in the pool that overlaps the expected salary range and has a matching class group (but not level). - PoolCandidate::factory()->create([ - 'user_id' => User::factory()->afterCreating(function ($user) { - $user->expectedClassifications()->delete(); - })->create([ - 'expected_salary' => ['_60_69K'] - ]), - 'pool_id' => $myPool->id, - 'expiry_date' => config('constants.far_future_date'), - 'pool_candidate_status' => ApiEnums::CANDIDATE_STATUS_QUALIFIED_AVAILABLE, - ]); - - // Attach new user in the pool that is over the expected salary range and has a matching class group (but not level). - PoolCandidate::factory()->create([ - 'user_id' => User::factory()->afterCreating(function ($user) { - $user->expectedClassifications()->delete(); - })->create([ - 'expected_salary' => ['_90_99K', '_100K_PLUS'] - ]), - 'pool_id' => $myPool->id, - 'expiry_date' => config('constants.far_future_date'), - 'pool_candidate_status' => ApiEnums::CANDIDATE_STATUS_QUALIFIED_AVAILABLE, - ]); - - // *** now make the same three users in the wrong pool - - // Attach new user in the pool with the desired classification WRONG POOL - PoolCandidate::factory()->create([ - 'user_id' => User::factory()->afterCreating(function ($user) use ($myClassification) { - $user->expectedClassifications()->delete(); - $user->expectedClassifications()->save($myClassification); - })->create([ - 'expected_salary' => [] - ]), - 'pool_id' => $otherPool->id, - 'expiry_date' => config('constants.far_future_date'), - 'pool_candidate_status' => ApiEnums::CANDIDATE_STATUS_QUALIFIED_AVAILABLE, - ]); - - // Attach new user in the pool that overlaps the expected salary range and has a matching class group (but not level). WRONG POOL - PoolCandidate::factory()->create([ - 'user_id' => User::factory()->afterCreating(function ($user) { - $user->expectedClassifications()->delete(); - })->create([ - 'expected_salary' => ['_60_69K'] - ]), - 'pool_id' => $otherPool->id, - 'expiry_date' => config('constants.far_future_date'), - 'pool_candidate_status' => ApiEnums::CANDIDATE_STATUS_QUALIFIED_AVAILABLE, - ]); - - // Attach new user in the pool that is over the expected salary range and has a matching class group (but not level). WRONG POOL - PoolCandidate::factory()->create([ - 'user_id' => User::factory()->afterCreating(function ($user) { - $user->expectedClassifications()->delete(); - })->create([ - 'expected_salary' => ['_90_99K', '_100K_PLUS'] - ]), - 'pool_id' => $otherPool->id, - 'expiry_date' => config('constants.far_future_date'), - 'pool_candidate_status' => ApiEnums::CANDIDATE_STATUS_QUALIFIED_AVAILABLE, - ]); - - // Assert query with just pool filters will return all users in that pool - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [ - 'applicantFilter' => [ - 'pools' => [ - ['id' => $myPool->id], - ] - ] - ] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 3 - ] - ] - ] - ]); - - // Assert query with classification filter will return users in range and overlapping in that pool - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [ - 'applicantFilter' => [ - 'pools' => [ - ['id' => $myPool->id], - ], - 'expectedClassifications' => [['group' => 'ZZ', 'level' => 1]] - ], - ] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 2 - ] - ] - ] - ]); - - // Assert query with unknown classification filter will return zero - $this->actingAs($this->platformAdmin, 'api')->graphQL( - /** @lang GraphQL */ - ' - query getUsersPaginated($where: UserFilterInput) { - usersPaginated(where: $where) { - paginatorInfo { - total - } - } - } - ', - [ - 'where' => [ - 'applicantFilter' => [ - 'pools' => [ - ['id' => $myPool->id] - ], - 'expectedClassifications' => [['group' => 'UNKNOWN', 'level' => 1324234]], - ], - ] - ] - )->assertJson([ - 'data' => [ - 'usersPaginated' => [ - 'paginatorInfo' => [ - 'total' => 0 - ] - ] - ] - ]); - } - public function testCountApplicantsQuery(): void { // Get the ID of the base admin user @@ -2777,7 +2204,6 @@ public function testNullFiltersEqualToUndefined(): void 'operationalRequirements' => null, 'locationPreferences' => null, 'positionDuration' => null, - 'expectedClassifications' => null, 'skills' => null, 'pools' => null, ], diff --git a/apps/e2e/cypress/e2e/talentsearch/submit-application-iap.cy.js b/apps/e2e/cypress/e2e/talentsearch/submit-application-iap.cy.js index 050df8fe7a5..89e2662df21 100644 --- a/apps/e2e/cypress/e2e/talentsearch/submit-application-iap.cy.js +++ b/apps/e2e/cypress/e2e/talentsearch/submit-application-iap.cy.js @@ -50,9 +50,6 @@ describe("Submit Application for IAP Workflow Tests", () => { hasPriorityEntitlement: false, locationPreferences: WorkRegion.Ontario, positionDuration: PositionDuration.Permanent, - expectedGenericJobTitles: { - sync: testGenericJobTitleIds, - }, }).as("testUser"); }); diff --git a/apps/e2e/cypress/e2e/talentsearch/submit-application.cy.js b/apps/e2e/cypress/e2e/talentsearch/submit-application.cy.js index a9cdb356f44..ff7e2a1121c 100644 --- a/apps/e2e/cypress/e2e/talentsearch/submit-application.cy.js +++ b/apps/e2e/cypress/e2e/talentsearch/submit-application.cy.js @@ -62,9 +62,6 @@ describe("Submit Application Workflow Tests", () => { hasPriorityEntitlement: false, locationPreferences: WorkRegion.Ontario, positionDuration: PositionDuration.Permanent, - expectedGenericJobTitles: { - sync: testGenericJobTitleIds, - }, }).as("testUser"); }); diff --git a/apps/e2e/cypress/support/searchRequestHelpers.js b/apps/e2e/cypress/support/searchRequestHelpers.js index 301e779786f..e9843b4d1ff 100644 --- a/apps/e2e/cypress/support/searchRequestHelpers.js +++ b/apps/e2e/cypress/support/searchRequestHelpers.js @@ -18,9 +18,6 @@ export function createSearchRequest({ create: { hasDiploma: true, locationPreferences: [WorkRegion.Ontario], - expectedClassifications: { - sync: [classificationId], - }, pools: { sync: [poolId], }, diff --git a/apps/e2e/cypress/support/userCommands.js b/apps/e2e/cypress/support/userCommands.js index 7d2de519cd2..f618b772f90 100644 --- a/apps/e2e/cypress/support/userCommands.js +++ b/apps/e2e/cypress/support/userCommands.js @@ -45,8 +45,6 @@ const defaultUser = { locationPreferences: undefined, locationExemptions: undefined, acceptedOperationalRequirements: undefined, - expectedSalary: undefined, - expectedClassifications: [], positionDuration: undefined, }; diff --git a/apps/e2e/cypress/support/userHelpers.js b/apps/e2e/cypress/support/userHelpers.js index 04f730256f1..915e4dbda14 100644 --- a/apps/e2e/cypress/support/userHelpers.js +++ b/apps/e2e/cypress/support/userHelpers.js @@ -36,9 +36,6 @@ export function createApplicant({ OperationalRequirement.OvertimeOccasional, ], positionDuration: [PositionDuration.Permanent], - expectedGenericJobTitles: { - sync: [genericJobTitle.id], - }, personalExperiences: { create: [ { diff --git a/apps/web/src/components/PoolCandidatesTable/usePoolCandidateCsvData.tsx b/apps/web/src/components/PoolCandidatesTable/usePoolCandidateCsvData.tsx index 11e90920078..5fdef9ffa29 100644 --- a/apps/web/src/components/PoolCandidatesTable/usePoolCandidateCsvData.tsx +++ b/apps/web/src/components/PoolCandidatesTable/usePoolCandidateCsvData.tsx @@ -21,7 +21,6 @@ import { employeeTypeToString, getLocationPreference, getOperationalRequirements, - getExpectedClassifications, flattenExperiencesToSkills, skillKeyAndJustifications, getExperienceTitles, @@ -376,14 +375,6 @@ const usePoolCandidateCsvData = ( description: "CSV Header, Disabled column", }), }, - { - key: "expectedClassification", - label: intl.formatMessage({ - defaultMessage: "Role/Salary Expectation", - id: "iIZS1K", - description: "CSV Header, Role/Salary Expectation column", - }), - }, { key: "educationRequirementOption", label: intl.formatMessage({ @@ -513,10 +504,6 @@ const usePoolCandidateCsvData = ( ), isVisibleMinority: yesOrNo(user.isVisibleMinority, intl), hasDisability: yesOrNo(user.hasDisability, intl), - expectedClassification: getExpectedClassifications( - user.expectedGenericJobTitles, - intl, - ), educationRequirementOption: educationRequirementOption ? intl.formatMessage( getEducationRequirementOption(educationRequirementOption), diff --git a/apps/web/src/components/ProfileDocument/ProfileDocument.tsx b/apps/web/src/components/ProfileDocument/ProfileDocument.tsx index 39777af1fee..11130947393 100644 --- a/apps/web/src/components/ProfileDocument/ProfileDocument.tsx +++ b/apps/web/src/components/ProfileDocument/ProfileDocument.tsx @@ -14,7 +14,6 @@ import { getCitizenshipStatusesAdmin, getEmploymentEquityGroup, getEmploymentEquityStatement, - getGenericJobTitles, getIndigenousCommunity, getLanguageProficiency, getLocale, @@ -36,7 +35,6 @@ import { } from "@gc-digital-talent/graphql"; import isEmpty from "lodash/isEmpty"; import { anyCriteriaSelected as anyCriteriaSelectedDiversityEquityInclusion } from "~/validators/profile/diversityEquityInclusion"; -import { anyCriteriaSelected as anyCriteriaSelectedRoleSalarySection } from "~/validators/profile/roleSalary"; interface ProfileDocumentProps { results: User[] | PoolCandidate[]; @@ -162,17 +160,6 @@ const ProfileDocument = React.forwardRef( (c) => c !== IndigenousCommunity.LegacyIsIndigenous, ) || []; - const expectedClassificationArray = - result.expectedGenericJobTitles - ? result.expectedGenericJobTitles.map((es) => ( -
  • - {es - ? intl.formatMessage(getGenericJobTitles(es.key)) - : ""} -
  • - )) - : null; - return (
    @@ -666,27 +653,6 @@ const ProfileDocument = React.forwardRef( )} - - - {intl.formatMessage( - navigationMessages.roleSalaryExpectations, - )} - - {anyCriteriaSelectedRoleSalarySection(result) && ( -
    -

    - {intl.formatMessage({ - defaultMessage: - "Would like to be referred for jobs at the following levels:", - id: "sYuMO8", - description: - "Label for Role and salary expectations sections", - })} -

    -
      {expectedClassificationArray}
    -
    - )} -
    {intl.formatMessage( diff --git a/apps/web/src/components/UserProfile/ProfileSections/RoleSalarySection.tsx b/apps/web/src/components/UserProfile/ProfileSections/RoleSalarySection.tsx deleted file mode 100644 index 69d1dbf98c8..00000000000 --- a/apps/web/src/components/UserProfile/ProfileSections/RoleSalarySection.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import React from "react"; -import { useIntl } from "react-intl"; - -import { Link, Well } from "@gc-digital-talent/ui"; -import { commonMessages, getGenericJobTitles } from "@gc-digital-talent/i18n"; - -import { User } from "~/api/generated"; -import { - anyCriteriaSelected, - hasAllEmptyFields, -} from "~/validators/profile/roleSalary"; - -const RoleSalarySection = ({ - user, - editPath, -}: { - user: Pick; - editPath?: string; -}) => { - const intl = useIntl(); - const { expectedGenericJobTitles } = user; - const expectedClassificationArray = expectedGenericJobTitles - ? expectedGenericJobTitles.map((es) => ( -
  • - {es ? intl.formatMessage(getGenericJobTitles(es.key)) : ""} -
  • - )) - : null; - - return ( - -
    - {anyCriteriaSelected(user) && ( -
    -

    - {intl.formatMessage({ - defaultMessage: - "I would like to be referred for jobs at the following levels:", - id: "e2Rfn/", - description: "Label for Role and salary expectations sections", - })} -

    -
      - {expectedClassificationArray} -
    -
    - )} - {hasAllEmptyFields(user) && editPath && ( - <> -
    -

    - {intl.formatMessage({ - defaultMessage: "You haven't added any information here yet.", - id: "SCCX7B", - description: - "Message for when no data exists for the section", - })} -

    -
    -
    -

    - {intl.formatMessage(commonMessages.requiredFieldsMissing)}{" "} - - {intl.formatMessage({ - defaultMessage: - "Edit your role and salary expectation options.", - id: "BPiMTY", - description: - "Link text to edit role and salary expectations on profile.", - })} - -

    -
    - - )} - {hasAllEmptyFields(user) && !editPath && ( -
    -

    - {intl.formatMessage({ - defaultMessage: "No information has been provided.", - id: "kjX7mF", - description: - "Message on Admin side when user not filled RoleSalary section.", - })} -

    -
    - )} -
    -
    - ); -}; - -export default RoleSalarySection; diff --git a/apps/web/src/components/UserProfile/UserProfile.stories.tsx b/apps/web/src/components/UserProfile/UserProfile.stories.tsx index 1f45d3990bb..a3875f2d042 100644 --- a/apps/web/src/components/UserProfile/UserProfile.stories.tsx +++ b/apps/web/src/components/UserProfile/UserProfile.stories.tsx @@ -26,7 +26,6 @@ const TemplateUserProfile: Story = (args) => { workLocation: { isVisible: true }, workPreferences: { isVisible: true }, employmentEquity: { isVisible: true }, - roleSalary: { isVisible: true }, careerTimelineAndRecruitment: { isVisible: true }, }} /> @@ -86,8 +85,6 @@ UserProfileNull.args = { locationPreferences: null, locationExemptions: null, acceptedOperationalRequirements: null, - expectedSalary: null, - expectedClassifications: null, positionDuration: null, armedForcesStatus: null, citizenship: null, diff --git a/apps/web/src/components/UserProfile/UserProfile.tsx b/apps/web/src/components/UserProfile/UserProfile.tsx index 157eae3a861..8f6ef31e733 100644 --- a/apps/web/src/components/UserProfile/UserProfile.tsx +++ b/apps/web/src/components/UserProfile/UserProfile.tsx @@ -1,7 +1,6 @@ import React from "react"; import { useIntl } from "react-intl"; import ChatBubbleLeftRightIcon from "@heroicons/react/24/outline/ChatBubbleLeftRightIcon"; -import CurrencyDollarIcon from "@heroicons/react/24/outline/CurrencyDollarIcon"; import BuildingLibraryIcon from "@heroicons/react/24/outline/BuildingLibraryIcon"; import LightBulbIcon from "@heroicons/react/24/outline/LightBulbIcon"; import BoltIcon from "@heroicons/react/24/outline/BoltIcon"; @@ -25,7 +24,6 @@ import { diversityEquityInclusionSectionHasEmptyRequiredFields, governmentInformationSectionHasEmptyRequiredFields, languageInformationSectionHasEmptyRequiredFields, - roleSalarySectionHasEmptyRequiredFields, workLocationSectionHasEmptyRequiredFields, workPreferencesSectionHasEmptyRequiredFields, } from "~/validators/profile"; @@ -37,7 +35,6 @@ import AboutSection from "./ProfileSections/AboutSection"; import DiversityEquityInclusionSection from "./ProfileSections/DiversityEquityInclusionSection"; import GovernmentInformationSection from "./ProfileSections/GovernmentInformationSection"; import LanguageInformationSection from "./ProfileSections/LanguageInformationSection"; -import RoleSalarySection from "./ProfileSections/RoleSalarySection"; import WorkLocationSection from "./ProfileSections/WorkLocationSection"; import WorkPreferencesSection from "./ProfileSections/WorkPreferencesSection"; import { PAGE_SECTION_ID } from "./constants"; @@ -57,7 +54,6 @@ interface UserProfileProps { hiringPools?: SectionControl; language?: SectionControl; myStatus?: SectionControl; - roleSalary?: SectionControl; careerTimelineAndRecruitment?: SectionControl; workLocation?: SectionControl; workPreferences?: SectionControl; @@ -250,23 +246,6 @@ const UserProfile = ({ )} - {showSection("roleSalary") && ( - - - - - - )} {showSection("careerTimelineAndRecruitment") && ( )} - {showSection("roleSalary") && ( - - -
    - - {intl.formatMessage( - navigationMessages.roleSalaryExpectations, - )} - -
    - {sections.roleSalary?.editUrl && ( - - )} -
    - {sections.roleSalary?.override ? ( - sections.roleSalary.override - ) : ( - - )} -
    - )} {showSection("careerTimelineAndRecruitment") && ( une langue autochtone ", "description": "Button text displayed for Indigenous languages dropdown" }, - "kjX7mF": { - "defaultMessage": "Aucune information n'a été fournie.", - "description": "Message on Admin side when user not filled RoleSalary section." - }, "knmaAL": { "defaultMessage": "Les personnes ne se résument pas à leur formation et à leur expérience professionnelle. Nous voulons vous permettre de faire part de ce que vous avez appris à partir d’autres expériences. Pour protéger votre vie privée, veuillez ne pas indiquer de renseignements sensibles sur vous-même ou sur d’autres personnes.", "description": "Description blurb for Personal Experience Details form" @@ -7816,10 +7800,6 @@ "defaultMessage": "Statut", "description": "Title of the 'Status' column for the table on view-user page" }, - "sYuMO8": { - "defaultMessage": "Aimerait être référé à des emplois aux niveaux suivants :", - "description": "Label for Role and salary expectations sections" - }, "sZHcsV": { "defaultMessage": "Courriel", "description": "Label displayed on the user form email field." diff --git a/apps/web/src/pages/AdminDashboardPage/adminDashboardOperations.graphql b/apps/web/src/pages/AdminDashboardPage/adminDashboardOperations.graphql index abcdf435142..41de925398b 100644 --- a/apps/web/src/pages/AdminDashboardPage/adminDashboardOperations.graphql +++ b/apps/web/src/pages/AdminDashboardPage/adminDashboardOperations.graphql @@ -76,15 +76,6 @@ fragment poolCandidateSearchRequest on PoolCandidateSearchRequest { operationalRequirements locationPreferences positionDuration - expectedClassifications { - id - name { - en - fr - } - group - level - } skills { id key diff --git a/apps/web/src/pages/Applications/applicationOperations.graphql b/apps/web/src/pages/Applications/applicationOperations.graphql index 809ebb59d45..e530150f83f 100644 --- a/apps/web/src/pages/Applications/applicationOperations.graphql +++ b/apps/web/src/pages/Applications/applicationOperations.graphql @@ -132,14 +132,6 @@ query GetApplication($id: UUID!) { fr } } - expectedGenericJobTitles { - id - key - name { - en - fr - } - } isWoman hasDisability isIndigenous @@ -150,16 +142,6 @@ query GetApplication($id: UUID!) { locationPreferences locationExemptions acceptedOperationalRequirements - expectedSalary - expectedClassifications { - id - name { - en - fr - } - group - level - } positionDuration experiences { id diff --git a/apps/web/src/pages/Applications/profileStep/profileStepValidation.tsx b/apps/web/src/pages/Applications/profileStep/profileStepValidation.tsx index 3cdafc05acb..555c3b88644 100644 --- a/apps/web/src/pages/Applications/profileStep/profileStepValidation.tsx +++ b/apps/web/src/pages/Applications/profileStep/profileStepValidation.tsx @@ -14,7 +14,6 @@ import { PartialUserLanguage, PartialUserLocation, PartialUserPreferences, - PartialUserRoleSalary, } from "~/validators/profile"; type PartialUser = PartialUserAbout & @@ -22,8 +21,7 @@ type PartialUser = PartialUserAbout & PartialUserGovernment & PartialUserLanguage & PartialUserLocation & - PartialUserPreferences & - PartialUserRoleSalary; + PartialUserPreferences; const stepHasError = (user: PartialUser, pool: Pool) => { const hasEmptyRequiredFields = diff --git a/apps/web/src/pages/PoolCandidates/IndexPoolCandidatePage/poolCandidatesOperations.graphql b/apps/web/src/pages/PoolCandidates/IndexPoolCandidatePage/poolCandidatesOperations.graphql index fcad76a039c..7ff22f79679 100644 --- a/apps/web/src/pages/PoolCandidates/IndexPoolCandidatePage/poolCandidatesOperations.graphql +++ b/apps/web/src/pages/PoolCandidates/IndexPoolCandidatePage/poolCandidatesOperations.graphql @@ -65,16 +65,6 @@ fragment poolCandidateTable on PoolCandidate { locationPreferences locationExemptions acceptedOperationalRequirements - expectedSalary - expectedClassifications { - id - name { - en - fr - } - group - level - } # Experiences experiences { id @@ -248,17 +238,8 @@ fragment selectedPoolCandidates on PoolCandidate { hasDisability citizenship armedForcesStatus - expectedSalary currentCity currentProvince - expectedGenericJobTitles { - id - key - name { - en - fr - } - } department { id departmentNumber @@ -545,7 +526,6 @@ query getCandidateProfile($id: UUID!) { indigenousDeclarationSignature isVisibleMinority hasDisability - expectedSalary department { id departmentNumber diff --git a/apps/web/src/pages/Profile/ProfilePage/profileOperations.graphql b/apps/web/src/pages/Profile/ProfilePage/profileOperations.graphql index a48a79eac8e..eb23cf81f50 100644 --- a/apps/web/src/pages/Profile/ProfilePage/profileOperations.graphql +++ b/apps/web/src/pages/Profile/ProfilePage/profileOperations.graphql @@ -45,14 +45,6 @@ query getMe { fr } } - expectedGenericJobTitles { - id - key - name { - en - fr - } - } isWoman hasDisability isIndigenous @@ -63,16 +55,6 @@ query getMe { locationPreferences locationExemptions acceptedOperationalRequirements - expectedSalary - expectedClassifications { - id - name { - en - fr - } - group - level - } positionDuration userSkills { id diff --git a/apps/web/src/pages/ProfileAndApplicationsPage/applicantOperations.graphql b/apps/web/src/pages/ProfileAndApplicationsPage/applicantOperations.graphql index e535937e1bf..4f612e8a896 100644 --- a/apps/web/src/pages/ProfileAndApplicationsPage/applicantOperations.graphql +++ b/apps/web/src/pages/ProfileAndApplicationsPage/applicantOperations.graphql @@ -80,14 +80,6 @@ query ApplicantInformation { fr } } - expectedGenericJobTitles { - id - key - name { - en - fr - } - } isWoman hasDisability isIndigenous @@ -100,16 +92,6 @@ query ApplicantInformation { locationPreferences locationExemptions acceptedOperationalRequirements - expectedSalary - expectedClassifications { - id - name { - en - fr - } - group - level - } positionDuration isProfileComplete experiences { diff --git a/apps/web/src/pages/SearchRequests/RequestPage/components/RequestForm.tsx b/apps/web/src/pages/SearchRequests/RequestPage/components/RequestForm.tsx index 02fb893e352..2dd6245eec5 100644 --- a/apps/web/src/pages/SearchRequests/RequestPage/components/RequestForm.tsx +++ b/apps/web/src/pages/SearchRequests/RequestPage/components/RequestForm.tsx @@ -222,7 +222,6 @@ export const RequestForm = ({ __typename: "ApplicantFilter", id: "", // Set Id to empty string since the PoolCandidateSearchRequest doesn't exist yet. ...applicantFilter, - expectedClassifications: undefined, qualifiedClassifications: applicantFilter?.qualifiedClassifications?.map( (qualifiedClassification) => { diff --git a/apps/web/src/pages/SearchRequests/SearchPage/components/SearchContainer.tsx b/apps/web/src/pages/SearchRequests/SearchPage/components/SearchContainer.tsx index 9534370e529..47772afe92e 100644 --- a/apps/web/src/pages/SearchRequests/SearchPage/components/SearchContainer.tsx +++ b/apps/web/src/pages/SearchRequests/SearchPage/components/SearchContainer.tsx @@ -57,9 +57,6 @@ const applicantFilterToQueryArgs = ( where: { ...filter, equity: { ...filter?.equity }, - expectedClassifications: filter?.expectedClassifications - ? pickMap(filter.expectedClassifications, ["group", "level"]) - : undefined, qualifiedClassifications: filter?.qualifiedClassifications ? pickMap(filter.qualifiedClassifications, ["group", "level"]) : undefined, diff --git a/apps/web/src/pages/SearchRequests/ViewSearchRequestPage/components/SearchRequestCandidatesTable.tsx b/apps/web/src/pages/SearchRequests/ViewSearchRequestPage/components/SearchRequestCandidatesTable.tsx index cf5a8584a40..c7763497685 100644 --- a/apps/web/src/pages/SearchRequests/ViewSearchRequestPage/components/SearchRequestCandidatesTable.tsx +++ b/apps/web/src/pages/SearchRequests/ViewSearchRequestPage/components/SearchRequestCandidatesTable.tsx @@ -60,8 +60,6 @@ const transformApplicantFilterToPoolCandidateSearchInput = ( equity: omitIdAndTypename, qualifiedClassifications: (classifications) => classifications?.filter(notEmpty).map(classificationToInput), - expectedClassifications: (classifications) => - classifications?.filter(notEmpty).map(classificationToInput), hasDiploma: identity, languageAbility: identity, locationPreferences: identity, diff --git a/apps/web/src/pages/SearchRequests/poolCandidateSearchRequestOperations.graphql b/apps/web/src/pages/SearchRequests/poolCandidateSearchRequestOperations.graphql index aed9cd61567..dab1071374e 100644 --- a/apps/web/src/pages/SearchRequests/poolCandidateSearchRequestOperations.graphql +++ b/apps/web/src/pages/SearchRequests/poolCandidateSearchRequestOperations.graphql @@ -67,15 +67,6 @@ fragment poolCandidateSearchRequest on PoolCandidateSearchRequest { operationalRequirements locationPreferences positionDuration - expectedClassifications { - id - name { - en - fr - } - group - level - } skills { id key diff --git a/apps/web/src/pages/Users/AdminUserProfilePage/AdminUserProfilePage.tsx b/apps/web/src/pages/Users/AdminUserProfilePage/AdminUserProfilePage.tsx index 231108d7220..d338f9f48d2 100644 --- a/apps/web/src/pages/Users/AdminUserProfilePage/AdminUserProfilePage.tsx +++ b/apps/web/src/pages/Users/AdminUserProfilePage/AdminUserProfilePage.tsx @@ -53,7 +53,6 @@ export const AdminUserProfile = ({ user }: AdminUserProfileProps) => { workLocation: { isVisible: true }, workPreferences: { isVisible: true }, employmentEquity: { isVisible: true }, - roleSalary: { isVisible: true }, careerTimelineAndRecruitment: { isVisible: true }, }} /> diff --git a/apps/web/src/pages/Users/IndexUserPage/components/UserTable.tsx b/apps/web/src/pages/Users/IndexUserPage/components/UserTable.tsx index c7f1f7dd3fe..48adca29966 100644 --- a/apps/web/src/pages/Users/IndexUserPage/components/UserTable.tsx +++ b/apps/web/src/pages/Users/IndexUserPage/components/UserTable.tsx @@ -65,10 +65,6 @@ function transformFormValuesToUserFilterInput( ): UserFilterInput { return { applicantFilter: { - expectedClassifications: data.classifications.map((classification) => { - const splitString = classification.split("-"); - return { group: splitString[0], level: Number(splitString[1]) }; - }), languageAbility: data.languageAbility[0] ? stringToEnumLanguage(data.languageAbility[0]) : undefined, @@ -103,10 +99,6 @@ function transformUserFilterInputToFormValues( input: UserFilterInput | undefined, ): FormValues { return { - classifications: - input?.applicantFilter?.expectedClassifications - ?.filter(notEmpty) - .map((c) => `${c.group}-${c.level}`) ?? [], languageAbility: input?.applicantFilter?.languageAbility ? [input?.applicantFilter?.languageAbility] : [], diff --git a/apps/web/src/pages/Users/IndexUserPage/components/UserTableFilterDialog/UserTableFilterDialog.tsx b/apps/web/src/pages/Users/IndexUserPage/components/UserTableFilterDialog/UserTableFilterDialog.tsx index 2ab44ebce00..f3fde862c9e 100644 --- a/apps/web/src/pages/Users/IndexUserPage/components/UserTableFilterDialog/UserTableFilterDialog.tsx +++ b/apps/web/src/pages/Users/IndexUserPage/components/UserTableFilterDialog/UserTableFilterDialog.tsx @@ -20,7 +20,6 @@ type Option = { value: string; label: string }; export type FormValues = { pools: Option["value"][]; languageAbility: Option["value"][]; - classifications: Option["value"][]; operationalRequirement: Option["value"][]; workRegion: Option["value"][]; // TODO: Make mandatory once data model settles. diff --git a/apps/web/src/pages/Users/IndexUserPage/hooks/useUserCsvData.tsx b/apps/web/src/pages/Users/IndexUserPage/hooks/useUserCsvData.tsx index 535aa725cd4..efff6b4f322 100644 --- a/apps/web/src/pages/Users/IndexUserPage/hooks/useUserCsvData.tsx +++ b/apps/web/src/pages/Users/IndexUserPage/hooks/useUserCsvData.tsx @@ -13,7 +13,6 @@ import { import { employeeTypeToString, flattenExperiencesToSkills, - getExpectedClassifications, getIndigenousCommunities, getLocationPreference, getLookingForLanguage, @@ -221,14 +220,6 @@ const useUserCsvData = (users: User[]) => { description: "CSV Header, Disabled column", }), }, - { - key: "expectedClassification", - label: intl.formatMessage({ - defaultMessage: "Role/Salary Expectation", - id: "iIZS1K", - description: "CSV Header, Role/Salary Expectation column", - }), - }, { key: "skills", label: intl.formatMessage(adminMessages.skills), @@ -264,7 +255,6 @@ const useUserCsvData = (users: User[]) => { indigenousCommunities, isVisibleMinority, hasDisability, - expectedGenericJobTitles, experiences, }) => ({ firstName: firstName || "", @@ -317,10 +307,6 @@ const useUserCsvData = (users: User[]) => { ), isVisibleMinority: yesOrNo(isVisibleMinority, intl), hasDisability: yesOrNo(hasDisability, intl), - expectedClassification: getExpectedClassifications( - expectedGenericJobTitles, - intl, - ), skills: flattenExperiencesToSkills(experiences, locale), }), ); diff --git a/apps/web/src/pages/Users/userOperations.graphql b/apps/web/src/pages/Users/userOperations.graphql index 6f35b092aec..36347b5169c 100644 --- a/apps/web/src/pages/Users/userOperations.graphql +++ b/apps/web/src/pages/Users/userOperations.graphql @@ -111,18 +111,6 @@ mutation CreateUser($user: CreateUserInput!) { locationPreferences locationExemptions acceptedOperationalRequirements - expectedSalary - expectedClassifications { - id - name { - en - fr - } - group - level - minSalary - maxSalary - } positionDuration } } @@ -184,18 +172,6 @@ mutation UpdateUserAsUser($id: ID!, $user: UpdateUserAsUserInput!) { locationPreferences locationExemptions acceptedOperationalRequirements - expectedSalary - expectedClassifications { - id - name { - en - fr - } - group - level - minSalary - maxSalary - } positionDuration } } @@ -257,18 +233,6 @@ mutation UpdateUserAsAdmin($id: ID!, $user: UpdateUserAsAdminInput!) { locationPreferences locationExemptions acceptedOperationalRequirements - expectedSalary - expectedClassifications { - id - name { - en - fr - } - group - level - minSalary - maxSalary - } positionDuration } } @@ -309,7 +273,6 @@ query GetViewUserData($id: UUID!) { hasDisability isVisibleMinority isWoman - expectedSalary poolCandidates { id status @@ -333,14 +296,6 @@ query GetViewUserData($id: UUID!) { stream } } - expectedGenericJobTitles { - id - key - name { - en - fr - } - } department { id departmentNumber @@ -516,15 +471,6 @@ query selectedUsers($ids: [ID]!) { hasDisability citizenship armedForcesStatus - expectedSalary - expectedGenericJobTitles { - id - key - name { - en - fr - } - } department { id departmentNumber diff --git a/apps/web/src/utils/csvUtils.tsx b/apps/web/src/utils/csvUtils.tsx index 4c237db223e..0fcabdd6545 100644 --- a/apps/web/src/utils/csvUtils.tsx +++ b/apps/web/src/utils/csvUtils.tsx @@ -11,7 +11,6 @@ import { } from "@gc-digital-talent/graphql"; import { Locales, - getGenericJobTitles, getIndigenousCommunity, getOperationalRequirement, getSimpleGovEmployeeType, @@ -209,31 +208,6 @@ export const getOperationalRequirements = ( return listOrEmptyString(accepted.filter(notEmpty)); }; -/** - * Converts a possible array of generic job titles - * to a comma separated list or empty string - * - * @param genericTitles Maybe[]> - * @param intl react-intl object - * @returns string - */ -export const getExpectedClassifications = ( - genericTitles: User["expectedGenericJobTitles"], - intl: IntlShape, -) => { - const expected = genericTitles - ?.map((title) => - title ? intl.formatMessage(getGenericJobTitles(title.key)) : undefined, - ) - .filter(notEmpty); - - if (!expected) { - return ""; - } - - return listOrEmptyString(expected.filter(notEmpty)); -}; - /** * Converts a possible array of experiences to * a flattened comma separated list of skills diff --git a/apps/web/src/validators/profile/index.ts b/apps/web/src/validators/profile/index.ts index 2e634309f01..6aaddbe56d4 100644 --- a/apps/web/src/validators/profile/index.ts +++ b/apps/web/src/validators/profile/index.ts @@ -19,11 +19,6 @@ import { PartialUser as PartialUserLanguage, } from "./languageInformation"; -import { - hasEmptyRequiredFields as roleSalarySectionHasEmptyRequiredFields, - PartialUser as PartialUserRoleSalary, -} from "./roleSalary"; - import { hasEmptyRequiredFields as workLocationSectionHasEmptyRequiredFields, PartialUser as PartialUserLocation, @@ -46,7 +41,6 @@ export { governmentInformationSectionHasEmptyRequiredFields, languageInformationSectionHasEmptyRequiredFields, languageInformationSectionHasUnsatisfiedRequirements, - roleSalarySectionHasEmptyRequiredFields, workLocationSectionHasEmptyRequiredFields, workPreferencesSectionHasEmptyRequiredFields, careerTimelineIsIncomplete, @@ -58,5 +52,4 @@ export { PartialUserLanguage, PartialUserLocation, PartialUserPreferences, - PartialUserRoleSalary, }; diff --git a/apps/web/src/validators/profile/roleSalary.ts b/apps/web/src/validators/profile/roleSalary.ts deleted file mode 100644 index b46c1e8d00f..00000000000 --- a/apps/web/src/validators/profile/roleSalary.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { User } from "@gc-digital-talent/graphql"; -import isEmpty from "lodash/isEmpty"; - -export type PartialUser = Pick; - -export function anyCriteriaSelected({ expectedGenericJobTitles }: PartialUser) { - return !isEmpty(expectedGenericJobTitles); -} - -export function hasAllEmptyFields(applicant: PartialUser): boolean { - return !anyCriteriaSelected(applicant); -} - -export function hasEmptyRequiredFields(applicant: PartialUser): boolean { - return !anyCriteriaSelected(applicant); -} diff --git a/packages/fake-data/src/fakeApplicantFilters.ts b/packages/fake-data/src/fakeApplicantFilters.ts index dad1fa21631..9ccb2906f24 100644 --- a/packages/fake-data/src/fakeApplicantFilters.ts +++ b/packages/fake-data/src/fakeApplicantFilters.ts @@ -26,7 +26,6 @@ const generateApplicantFilters = ( __typename: "ApplicantFilter", id: faker.string.uuid(), pools: faker.helpers.arrayElements(pools), - expectedClassifications: faker.helpers.arrayElements(classifications), equity: { isIndigenous: faker.datatype.boolean(), isVisibleMinority: faker.datatype.boolean(), diff --git a/packages/fake-data/src/fakeUsers.ts b/packages/fake-data/src/fakeUsers.ts index cf04c10fee8..1ab4bccfbaa 100644 --- a/packages/fake-data/src/fakeUsers.ts +++ b/packages/fake-data/src/fakeUsers.ts @@ -12,7 +12,6 @@ import { OperationalRequirement, Pool, WorkRegion, - SalaryRange, GovEmployeeType, Department, CitizenshipStatus, @@ -157,16 +156,9 @@ const generateUser = ( faker.helpers.arrayElements( Object.values(OperationalRequirement), ), - expectedSalary: faker.helpers.arrayElements( - Object.values(SalaryRange), - ), - expectedClassifications: - faker.helpers.arrayElements(classifications), positionDuration: faker.datatype.boolean() ? [PositionDuration.Permanent] : [PositionDuration.Permanent, PositionDuration.Temporary], - expectedGenericJobTitles: - faker.helpers.arrayElements(genericJobTitles), poolCandidates, experiences: [ diff --git a/packages/i18n/src/lang/fr.json b/packages/i18n/src/lang/fr.json index 79d0d88a673..b744df381b6 100644 --- a/packages/i18n/src/lang/fr.json +++ b/packages/i18n/src/lang/fr.json @@ -1120,10 +1120,6 @@ "defaultMessage": "Août", "description": "Name of the eighth month" }, - "lp/ZEr": { - "defaultMessage": "Rôle et salaire escomptés", - "description": "Name of Role and salary expectations page" - }, "lr2+2R": { "defaultMessage": "Autre", "description": "declaring one to be neither a citizen or permanent resident of Canada" diff --git a/packages/i18n/src/messages/navigationMessages.ts b/packages/i18n/src/messages/navigationMessages.ts index 5595f6b4177..e6b8deeee3e 100644 --- a/packages/i18n/src/messages/navigationMessages.ts +++ b/packages/i18n/src/messages/navigationMessages.ts @@ -56,11 +56,6 @@ const navigationMessages = defineMessages({ id: "nnMYWr", description: "Name of Work preferences page", }, - roleSalaryExpectations: { - defaultMessage: "Role and salary expectations", - id: "lp/ZEr", - description: "Name of Role and salary expectations page", - }, careerTimelineAndRecruitment: { defaultMessage: "Career timeline and recruitment", id: "Icl1fF",