Returns a view of the authenticated user's wallet history with a running balance, plus overall balance and refill thresholds.
GET/wallet/history
Implementation details:
- Base query filters
UserWalletrows by the current user'sUserIdand usesAsNoTracking(). - Overall balance is computed as
SUM(Balance)across all the user's entries. - For windowed queries: filters by
UpdatedbetweenrangeFromandrangeTo(inclusive). If no window is specified, selects the last 10 byUpdated(DESC). - To compute the running balance, materializes the visible window ascending by
Updated, computes an opening balance as the sum of all entries before the first day in the window (UTC), then projects each row with cumulativeRunning. - Results are returned newest-first (
CreatedDESC).
Intended for authenticated clients; suitable for history views and lightweight polling.
Request
Responses
- 200
- 401
- 403
OK
Unauthorized - missing or invalid credentials.
Forbidden - authenticated but missing required role or policy.