fix(report): approverName uses only included days
Move reviewer tracking logic inside the non-empty rows guard in both approved-only and include-unapproved modes. This ensures zero-row approved sheets don't pollute the reviewer set, fixing the approverName calculation to only consider reviewers from included ReportDays. Add test: approved sheet with zero rows and different reviewer correctly excluded from approver tracking. All 9 tests passing. Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -129,11 +129,11 @@ AccomplishmentReportData buildAccomplishmentReportData({
|
||||
(secondsByCategory[row.category] ?? 0) + row.seconds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Track reviewers for approved sheets
|
||||
if (sheet.status == DaySheetStatus.approved && sheet.reviewedBy != null) {
|
||||
allReviewers.add(sheet.reviewedBy!);
|
||||
// Track reviewers for included approved sheets only
|
||||
if (sheet.status == DaySheetStatus.approved && sheet.reviewedBy != null) {
|
||||
allReviewers.add(sheet.reviewedBy!);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -159,11 +159,11 @@ AccomplishmentReportData buildAccomplishmentReportData({
|
||||
(secondsByCategory[row.category] ?? 0) + row.seconds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Track reviewer
|
||||
if (sheet.reviewedBy != null) {
|
||||
allReviewers.add(sheet.reviewedBy!);
|
||||
// Track reviewer for included sheets only
|
||||
if (sheet.reviewedBy != null) {
|
||||
allReviewers.add(sheet.reviewedBy!);
|
||||
}
|
||||
}
|
||||
} else if (sheet.status == DaySheetStatus.pending) {
|
||||
excludedPending++;
|
||||
|
||||
Reference in New Issue
Block a user