Skip to content

Implement Multi-Currency Support for Donation Notifications, Summaries, and Analytics #115

Description

@grantfox-oss

Description

The Donation model already stores the donation currency, but several parts of the application still assume that every donation is made in XLM. This results in incorrect notification messages, inaccurate donation summaries, and analytics that do not properly represent multi-currency transactions.

This issue introduces full multi-currency support across the donation workflow, ensuring that the stored currency is respected everywhere donations are displayed, processed, or aggregated. Where values need to be compared or summarized across different currencies, conversion metadata should be stored and used instead of assuming a fixed currency.

Problem Statement

Current implementation issues include:

  • Notification messages always display donation amounts as XLM regardless of the actual currency.
  • Donation summaries aggregate values without considering different currencies.
  • Analytics and reporting assume all donations share the same currency, producing misleading totals.
  • No conversion metadata exists for generating normalized metrics or historical reports.

Expected Implementation

Business Logic

  • Update donation processing logic to use the currency stored on each Donation record.
  • Remove any hardcoded "XLM" references from services, helpers, and business logic.
  • Ensure all amount formatting functions accept both amount and currency.

Conversion Metadata

  • Introduce conversion metadata if required for reporting and analytics, such as:

    • baseCurrency
    • exchangeRate
    • convertedAmount
    • conversionTimestamp
  • Store conversion values at the time of donation to ensure historical reports remain consistent even if exchange rates change.

Notifications

  • Update all donation-related notifications to display the correct currency symbol or code.

  • Examples:

    • ✅ "You received 50 USDC"
    • ✅ "Thank you for donating 25 EUR"
    • ❌ "You received 50 XLM" (when the donation was USDC)

Donation Summaries

  • Ensure summary endpoints and dashboard widgets correctly handle multiple currencies.

  • Either:

    • Group totals by currency, or
    • Display normalized totals using stored conversion metadata, depending on the existing analytics design.
  • Prevent direct aggregation of different currencies without conversion.

Analytics

  • Update analytics queries and reporting logic to:

    • Support filtering and grouping by currency.
    • Generate accurate totals for each currency.
    • Use conversion metadata when a unified total is required.
    • Preserve historical accuracy by relying on stored exchange rates rather than live conversions.

API Responses

  • Verify that donation-related API responses expose the necessary currency information, including any conversion fields if implemented.
  • Maintain backward compatibility where possible while extending existing response objects.

Acceptance Criteria

  • All hardcoded XLM assumptions are removed from donation business logic.
  • Notifications display the correct donation currency.
  • Donation summaries correctly handle multiple currencies.
  • Analytics support multi-currency reporting without mixing raw values.
  • Conversion metadata is stored and used where normalized totals are required.
  • Existing tests are updated and new tests cover multi-currency scenarios.
  • No regression is introduced for existing XLM donation flows.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignenhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions