Design: Expense Sharing System
Design the core classes User, Group, and Expense with their relationships and basic methods. Out of scope: UI, payment integration, notifications.
Functional Requirements
FR1: Users can create and join groups.
FR2: Users can add expenses to groups.
FR3: Each expense has a payer and multiple participants.
FR4: The system tracks who owes whom and how much.
FR5: Users can view their balance within each group.
Non-Functional Requirements
NFR1: Support up to 10,000 users and 1,000 groups.
NFR2: Expense addition and balance calculation latency under 200ms.
NFR3: System availability 99.9%.