Skip to content

SCRUM-326: fix(rewards) adopt Result pattern, fix enum status filter, add code search, and add unit tests for inventory query - #372

Merged
Moha-sami merged 1 commit into
mainfrom
fix/scrum-326-reward-inventory-safety-and-tests
Sep 19, 2026
Merged

Moha-sami merged 1 commit into
mainfrom
fix/scrum-326-reward-inventory-safety-and-tests

Conversation

@Moha-sami

Copy link
Copy Markdown
Owner

Summary

Follow-up fix for Jemy's PR #371 (SCRUM-326-REWARD-EP-7).

Changes

  • Result Pattern & 404 Handling:
    • Replaced throw new ValidationException with Result<PaginatedVouchersResponseDto>.NotFound.
    • Updated RewardsController.GetInventory to map Result states and corrected ProducesResponseType to PaginatedVouchersResponseDto.
    • Used Query(true) (AsNoTracking) for read check.
  • Filter & Search Bug Fixes:
    • Fixed enum status filtering (v.Status == parsedStatus instead of broken string comparison).
    • Fixed typo in VoucherInventoryFilterQueryDto (string? VoucherCode instead of VoucherStatus?).
    • Implemented VoucherCode substring search filter.
    • Added inverted date range normalization.
  • Pagination & Ordering:
    • Added explicit .OrderByDescending(v => v.CreatedAt) prior to Skip/Take.
    • Sanitized pageSize usage (Take(pageSize)).
  • Unit Tests:
    • Added 8 unit tests in GetRewardVoucherInventoryQueryTests.cs.
    • Verified 734/734 tests pass locally.

… add code search, and add unit tests for inventory query
@vercel

vercel Bot commented Sep 19, 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 19, 2026 10:26pm UTC

@github-actions

Copy link
Copy Markdown

Automated PR Validation Feedback

All Checks Passed!

  • Jira key / Task reference detected.
  • Code formatting passed (4 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 73bbdb2 into main Sep 19, 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