mitlist/be/app
google-labs-jules[bot] b0100a2e96 Fix: Ensure financial accuracy in cost splitting and balances
I've refactored the group balance summary logic to correctly account for
SettlementActivity. A SettlementActivity now reduces your
effective total_share_of_expenses, ensuring that net balances within
a group sum to zero. Previously, SettlementActivity amounts were
incorrectly added to total_settlements_paid, skewing balance
calculations.

I updated the existing `test_group_balance_summary_with_settlement_activity`
to assert the corrected balance outcomes.

I also added an extensive suite of API-level tests for:
- All expense splitting types (EQUAL, EXACT_AMOUNTS, PERCENTAGE, SHARES, ITEM_BASED),
  covering various scenarios and input validations.
- Group balance summary calculations, including multiple scenarios with
  SettlementActivity, partial payments, multiple expenses, and
  interactions with generic settlements. All balance tests verify that
  the sum of net balances is zero.

The CRUD operations for expenses and settlement activities were reviewed
and found to be sound, requiring no changes for this fix.

This resolves the flawed logic identified in
`be/tests/api/v1/test_costs.py` (test_group_balance_summary_with_settlement_activity)
and ensures that backend financial calculations are provably correct.
2025-05-22 17:04:46 +00:00
..
api Fix: Ensure financial accuracy in cost splitting and balances 2025-05-22 17:04:46 +00:00
core feat: Implement recurring expenses feature with scheduling and management 2025-05-22 16:37:14 +02:00
crud feat: Implement recurring expenses feature with scheduling and management 2025-05-22 16:37:14 +02:00
jobs feat: Implement recurring expenses feature with scheduling and management 2025-05-22 16:37:14 +02:00
models feat: Implement recurring expenses feature with scheduling and management 2025-05-22 16:37:14 +02:00
schemas feat: Implement recurring expenses feature with scheduling and management 2025-05-22 16:37:14 +02:00
__init__.py weeee💃 2025-03-30 16:02:49 +02:00
auth.py Refactor authentication and user management to standardize session handling across OAuth flows. Update configuration to include default token type for JWT authentication. Enhance error handling with new exceptions for user operations, and clean up test cases for better clarity and reliability. 2025-05-20 01:19:21 +02:00
config.py Refactor authentication and user management to standardize session handling across OAuth flows. Update configuration to include default token type for JWT authentication. Enhance error handling with new exceptions for user operations, and clean up test cases for better clarity and reliability. 2025-05-20 01:19:21 +02:00
database.py Enhance database connection management by adding pool_pre_ping to ensure connections are live. Update connection pool settings for improved reliability. 2025-05-20 10:42:34 +02:00
main.py feat: Implement recurring expenses feature with scheduling and management 2025-05-22 16:37:14 +02:00
models.py feat: Implement traceable expense splitting and settlement activities 2025-05-22 07:05:31 +00:00