Skip to content

Commit

Permalink
docs(salary): document parameters of salariesFromLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Sep 12, 2024
1 parent 8f50749 commit ee4913e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/compensations/utils/salary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ export function maxSalariesExaminationYear(salaries: Salaries): number {
return Math.max(...examinationYearsFromSalaries(salaries));
}

/**
* Retrieves salary data for a specific location and year.
*
* @param year - The year for which to retrieve salary data.
* @param locationId - The string from the `_ref` property of a location reference used in the salaries object.
* @param salariesByLocation - An array of salary data organized by location.
* @returns A Result containing either the Salaries object or an error message.
*
* @remarks
* This function searches for salary data based on the provided location and year.
* The locationId should match the _ref property of a location reference in the salariesByLocation array.
* If the data is found and valid, it returns a ResultOk with the parsed Salaries object.
* If the data is not found or invalid, it returns a ResultError with an appropriate error message.
*/
export function salariesFromLocation(
year: number,
locationId: string,
Expand Down

0 comments on commit ee4913e

Please sign in to comment.