Skip to main content

sdac-validate-salaries

Purpose

Validates salary amounts, detects unusual values, and optionally performs statistical analysis.

Tool type

Deterministic (rule-based)

Tool ID

sdac-validate-salaries

Inputs

  • report_id (string)
  • record_ids (number[], optional)
  • include_statistical_analysis (boolean, optional, default: false)

Outputs

  • success, passed
  • error_count, warning_count
  • errors, warnings, executed_rules
  • statistics (optional)

Example output

{
"success": true,
"passed": false,
"error_count": 1,
"warning_count": 1,
"errors": [
{
"rule_id": "NEGATIVE_SALARY",
"row_number": 29,
"current_value": -500,
"message": "Claimable salary cannot be negative.",
"severity": "ERROR"
}
],
"warnings": [
{
"rule_id": "ZERO_SALARY_MISSING_COMMENT",
"row_number": 44,
"current_value": 0,
"message": "A $0 salary row should include an explanatory comment.",
"severity": "WARNING"
}
],
"executed_rules": [
"NEGATIVE_SALARY",
"ZERO_SALARY_MISSING_COMMENT"
],
"statistics": {
"total_salary": 1250000,
"median_salary": 48200,
"high_salary_threshold": 125000
}
}

Functional details

  • Flags salaries above configured thresholds.
  • Detects zero-claimable salaries lacking comments.
  • Optionally computes statistics and highlights outliers.

Implementation details

  • High-salary threshold: $50,000 claimable per quarter.
  • Zero claimable salary without comments triggers SALARY_ZERO_NO_COMMENT (warning).
  • Detects consecutive duplicate claimable salaries and emits SALARY_DUPLICATE_CONSECUTIVE.
  • When include_statistical_analysis=true, computes mean/median/std dev and flags SALARY_OUTLIER.
  • Uses a per-value map to group claimable salaries and checks consecutive row sequences.
  • Calculates statistics from non-zero claimable salaries only.

Code Location: packages/domain-sdac/src/tools/validate-salaries.tool.ts