⚙️ Backend Services Tests (services)
These tests verify the business logic encapsulated in the service layer. They typically mock external dependencies (like the database or APIs) to test logic in isolation.
🎯 Purpose
To ensure that complex business rules (e.g., BRIM parsing logic, asset metadata merging, scheduled investment calculations) are implemented correctly.
🔑 Key Tests
- BRIM Providers: Tests parsing of sample CSV files for each supported broker.
- Asset Metadata: Tests the logic for merging and patching asset metadata.
- Asset Source: Provider registration, assignment validation, price fetching.
- Asset Source Refresh: Sync pipeline, event upsert with
provider_assignment_idfiltering, idempotency. - Asset Sync Counts: Verify
points_added,points_changed,points_unchangedcounters after sync operations. - Synthetic Yield: Scheduled Investment engine — simple/compound interest,
generate_interestauto-events,MATURITY_SETTLEMENT, late interest with grace period. - Synthetic Yield Integration: Full integration tests with multi-period schedules, maturation frequencies, coupon resets, late interest compounding.