Files
EmailBill/.sisyphus/notepads/statistics-year-selection/issues.md
SunCheng e93c3d6bae
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 27s
Docker Build & Deploy / Deploy to Production (push) Successful in 9s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 2s
Docker Build & Deploy / WeChat Notification (push) Successful in 2s
测试覆盖率
2026-01-28 17:00:58 +08:00

1.1 KiB

Issues - Statistics Year Selection Enhancement

[2026-01-28] Backend Repository Limitation

Issue

TransactionRecordRepository.BuildQuery() requires both year AND month parameters to be present. Year-only queries (month=null or month=0) are not supported.

Impact

  • Cannot query full-year statistics from the frontend
  • Current implementation only supports month-level granularity
  • All statistics endpoints rely on QueryAsync(year, month, ...)

Solution

Modify BuildQuery() method in Repository/TransactionRecordRepository.cs to support:

  1. Year-only queries (when year provided, month is null or 0)
  2. Month-specific queries (when both year and month provided - current behavior)

Implementation Location

  • File: Repository/TransactionRecordRepository.cs
  • Method: BuildQuery() lines 81-86
  • Also need to update service layer to handle month=0 or null

Testing Requirements

  • Test year-only query returns all transactions for that year
  • Test month-specific query still works as before
  • Test edge cases: leap years, year boundaries
  • Verify all statistics endpoints work with year-only mode