Skip to content

Commit

Permalink
null case added (#12283)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6b070a3)
  • Loading branch information
vd1992 authored and brindasasi committed Dec 12, 2024
1 parent e939389 commit eb85571
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions api/app/Traits/Generator/GeneratesUserDoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ public function experience(Section $section, AwardExperience|CommunityExperience
$this->localize('experiences.seniority_role'),
$this->localizeEnum($experience->ext_role_seniority, ExternalRoleSeniority::class)
);
}
if ($experience->employment_category === EmploymentCategory::CANADIAN_ARMED_FORCES->name) {
} elseif ($experience->employment_category === EmploymentCategory::CANADIAN_ARMED_FORCES->name) {
$section->addTitle(
sprintf(
'%s %s %s',
Expand All @@ -361,8 +360,7 @@ public function experience(Section $section, AwardExperience|CommunityExperience
$this->localize('experiences.rank_category'),
$this->localizeEnum($experience->caf_rank, CafRank::class)
);
}
if ($experience->employment_category === EmploymentCategory::GOVERNMENT_OF_CANADA->name) {
} elseif ($experience->employment_category === EmploymentCategory::GOVERNMENT_OF_CANADA->name) {
/** @var Department | null $department */
$department = Department::find($experience->department_id);
$section->addTitle(
Expand Down Expand Up @@ -424,6 +422,11 @@ public function experience(Section $section, AwardExperience|CommunityExperience
$classification ? $classification->group.'-'.$classification->level : Lang::get('common.not_found', [], $this->lang),
);
}
} else {
// null case, so experiences prior to adding employment_category
$section->addTitle($experience->getTitle($this->lang), $headingRank);
$section->addText($experience->getDateRange($this->lang));
$this->addLabelText($section, $this->localize('experiences.team_group_division'), $experience->division);
}
}

Expand Down

0 comments on commit eb85571

Please sign in to comment.