sdac-generate-sendback-summary
Purpose
Compiles validation errors into a numbered, copy-ready sendback summary with correction guidance.
Tool type
Deterministic (templated)
Tool ID
sdac-generate-sendback-summary
Inputs
report_id(string)include_warnings(boolean, optional)categories(string[], optional)output_format(TEXT|HTML|BULLET_POINTS|GROUPED, optional)
Outputs
summary_textitems(rule, row, correction)total_errors,total_warningsgrouped_summary(optional whenoutput_format=GROUPED)
Example output
{
"summary_text": "1. Row 72: Replacement references row 999, which is not present in the main roster. Please update the comment to identify the correct main roster row.",
"items": [
{
"rule": "REPLACEMENT_INVALID_LINK",
"row": 72,
"correction": "Update the replacement comment with the correct main roster row."
}
],
"total_errors": 1,
"total_warnings": 1,
"grouped_summary": {
"REPLACEMENT": [
"Row 72 has an invalid replacement link."
]
}
}
Functional details
- Runs a lightweight full-report validation and formats results for sendback.
- Groups issues by category and priority when requested.
- Adds Excel cell references for faster district correction.
Implementation details
- Calls
sdac-validate-full-reportwithcomplexity: SIMPLEandinclude_statistical_analysis: false. - Builds correction guidance via
ruleInstruction()mapping of rule IDs. - Can include warnings when
include_warnings=true. - Formats each line as
Row {n}: {message} Correction: {instruction}.
Code Location: packages/domain-sdac/src/tools/generate-sendback-summary.tool.ts