Files
teamwallet/docs/superpowers/specs/2026-08-01-team-cash-flow-presentation-design.md
2026-08-01 19:48:50 +02:00

24 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Team Cash Flow Presentation Design
## Goal
Display transaction amounts consistently from the team wallet's perspective in every modern-frontend transaction history.
## Semantics
- A player payment and a team-wallet credit are real inflows: green with an explicit plus sign.
- A team-wallet expense and a negative player-payment reversal are real outflows: red with a mathematical minus sign.
- Player fines, levies, fees, and player credits do not move team-wallet cash: grey and unsigned.
- Unknown transaction types are neutral to avoid claiming a cash movement that the application cannot prove.
- Player payouts remain general team-wallet expenses with the player's name in the note; no new transaction type is introduced.
## Design
Replace the existing debit-only amount helper with a context-aware cash-flow presenter. A shared standalone Angular component owns formatting, semantic color, signs, and accessible labels. Cashbox and overview activities pass `team` or `player` based on `isTeamWalletTransaction`; private and public player histories always pass `player`.
No backend API, database, balance calculation, booking form, balance card, or legacy-frontend behavior changes.
## Accessibility and Testing
The visible amount uses `+`, ``, or no sign and Material semantic color tokens. The amount exposes an accessible German label identifying Einzahlung, Auszahlung, or keine Kassenbewegung. Unit tests cover numeric, string, and object transaction types plus reversals and unknown types; component and view tests prove consistent rendering in all four histories.