Skip to content

Commit

Permalink
removing months from the age
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGoC committed Dec 6, 2024
1 parent d3fe1a6 commit 6e24afb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions utils/api/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ export function OasEligibility(
yearsInCanada++
}

// If client is n years + months. #219890
// the oas should be 65 exactly not 65 plus months
age =
age > minAgeEligibility && age < minAgeEligibility + 1
? Math.floor(age)
: age

ageOfEligibility =
yearsInCanadaAtStart < minYearsOfResEligibility ? age : Math.floor(age)

Expand Down Expand Up @@ -269,6 +276,7 @@ export function evaluateOASInput(input) {
const age = input.age // 66.42
const ageJuly2013 = calculate2013Age(age, input.clientBirthDate)
const yearsInCanada = input.yearsInCanadaSince18

let eliObj = OasEligibility(
age,
yearsInCanada,
Expand Down

0 comments on commit 6e24afb

Please sign in to comment.