Skip to content

SCRUM-325: fix(rewards) add null safety and unit tests for GetRewardAnalyticsQuery - #370

Merged
Moha-sami merged 1 commit into
mainfrom
fix/scrum-325-reward-analytics-safety-and-tests
Sep 18, 2026
Merged

Moha-sami merged 1 commit into
mainfrom
fix/scrum-325-reward-analytics-safety-and-tests

Conversation

@Moha-sami

Copy link
Copy Markdown
Owner

Summary

Follow-up fix for Jemy's PR #369 (\SCRUM-325-REWARD-EP-6).

Changes

  • Null Safety:
    • Made \RewardTransactionFilterQueryDto? Filter\ optional and defaulted parameters to null.
    • Added fallback \�ar filter = query.Filter ?? new RewardTransactionFilterQueryDto();\ in \GetRewardAnalyticsQueryHandler\ to prevent NRE.
    • Added inverted date range normalization in \ResolveDateBounds\ (\if (from > to) (from, to) = (to, from)).
    • Added .Include(r => r.Employee).ThenInclude(e => e.JobRole).ThenInclude(j => j!.Department)\ and safe navigation property checks in \BuildTransactionsAsync.
    • Added null check on
      .PointsTransaction != null ? Math.Abs(r.PointsTransaction.Amount) : 0.
  • Unit Tests:
    • Added 7 unit tests in \GetRewardAnalyticsQueryTests.cs\ covering 404 Not Found, default monthly timeline, weekly timeline aggregation, search filtering, null filters, inverted dates, and controller endpoint mappings.
    • Verified 726/726 tests pass locally.

@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hr-system Ready Ready Preview Sep 18, 2026 12:58am UTC

@github-actions

Copy link
Copy Markdown

Automated PR Validation Feedback

All Checks Passed!

  • Jira key / Task reference detected.
  • Code formatting passed (3 changed C# file(s)).
  • .NET 10 solution compiled successfully.
  • .NET analyzers passed.
  • Security scan skipped (no dependency changes in this PR).

Ready for maintainer review!

@Moha-sami
Moha-sami merged commit 5324a87 into main Sep 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant