Members: view own transactions of past seasons

Open
#60 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
api, backend, frontend

Research direction

Start with ScoreController::getList() for GET /transfers, which currently calls findCurrentCycle() and then TransactionRepository::findOwnTransactions($user, $cycle), and check how GET /pastCycles lists cycles. Wait for the Symfony 7.4 upgrade in #57 before starting. Done means an optional cycle selector returns only the logged-in member's transactions for that cycle, with the default unchanged, 404 for unknown cycles, 400 for malformed ids, and tests for each case including anonymous 401.

Written by the indexing model from the issue text.

Description

Backend enhancement Frontend

Goal

Let members see their own transactions from past seasons. Today GET /transfers only returns transactions of the current cycle, and the redesigned "Aktivität" screen just points to Profil for older seasons. This is planned for the future, not part of the current redesign.

Current state

  • ScoreController::getList() (GET /transfers) loads findCurrentCycle() and calls TransactionRepository::findOwnTransactions($user, $cycle). Without an active cycle it returns [].
  • GET /pastCycles already lists the member's scores per cycle, so the frontend knows which cycles the member took part in.

What needs to be done

Backend

  • Accept an optional cycle selector, e.g. GET /transfers?cycle={id} (or a new GET /cycles/{id}/transfers). Without it, the current-season behaviour stays unchanged, so existing clients keep working.
  • Reuse findOwnTransactions($user, $cycle). It must only ever return the logged-in member's own transactions; transactions stay private.
  • Unknown cycle → 404, malformed id → 400 (not 500).
  • Tests: own past cycle, current cycle (unchanged default), a cycle the member had no transactions in (empty list), unknown cycle, and anonymous → 401. Assert that no other member's transactions leak.

Frontend

  • In "Aktivität", add a season selector (or "Ältere Saisons laden" at the end of the list) fed by /pastCycles. Remove the "Ältere Saisons findest du unter Profil" hint.

Impact

  • Compatibility: purely additive, because the default without a parameter stays as it is.
  • Privacy: same rule as today (own transactions only), just across seasons.
  • Data volume: one season per request, so no pagination is needed for now.
  • Depends on #57: implement it after the Symfony 7.4 upgrade. The API test suite from #57 covers the unchanged default.
Dominant language
PHP
Stars
1
Forks
0
Avg merge
7h 58m
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RunningJoke/allipunkte

All issues in RunningJoke/allipunkte

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.