Skip to content

Slice 18: Multi-Currency — Apply Conversion to Burn Rate - #42

Merged
rghvgrv merged 1 commit into
mainfrom
slice-18-fx-conversion
Jul 12, 2026
Merged

Slice 18: Multi-Currency — Apply Conversion to Burn Rate#42
rghvgrv merged 1 commit into
mainfrom
slice-18-fx-conversion

Conversation

@rghvgrv

@rghvgrv rghvgrv commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wire currency conversion into the burn-rate response: every subscription's native-currency cost is converted to the user's preferred_currency via cached fx_rates before summing into weekly/monthly/yearly totals.
  • BurnRateResult now reports homeCurrency and unresolvedSubscriptionIds (currency pairs with no cached rate — excluded from totals rather than failing the request).
  • Added IFxRateService.GetRateAsync (cache-only read, no live API call) and IUserRepository.GetPreferredCurrencyAsync (new, minimal — needed to resolve the caller's home currency in DashboardController).
  • Conversion remains a read-time projection only; stored cost_amount/currency on user_subscriptions are never mutated.

Test plan

  • dotnet test tests/SubVora.Application.Tests — 10/10 pass, including new ConvertsMixedCurrencySubscriptionsToHomeCurrencyBeforeSumming and MissingFxRateForAPair_ExcludesThatSubscriptionAndFlagsIt
  • dotnet test tests/SubVora.Api.Tests — 49/49 pass (DashboardController tests unaffected, single-currency behavior preserved)
  • dotnet test tests/SubVora.Infrastructure.Tests — 19/19 pass

Closes #19

Every subscription's native-currency cost now converts to the user's
preferred_currency via cached fx_rates before summing into burn-rate
totals; a currency pair with no cached rate is excluded and flagged
via UnresolvedSubscriptionIds instead of failing the whole request.
Stored cost_amount/currency remain untouched (read-time projection).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@rghvgrv
rghvgrv merged commit 4029386 into main Jul 12, 2026
@rghvgrv
rghvgrv deleted the slice-18-fx-conversion branch July 12, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slice 18: Multi-Currency — Apply Conversion to Burn Rate

1 participant