Skip to content

Commit

Permalink
Merge pull request #1125 from DTS-STN/219890-AgeAt65
Browse files Browse the repository at this point in the history
219890 - removing months from the age (partial fix ???)
  • Loading branch information
MarcoGoC authored Dec 10, 2024
2 parents d3fe1a6 + 6e24afb commit cc2b4e5
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 cc2b4e5

Please sign in to comment.