mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-12-02 08:48:47 +00:00
refactor: Add ExchangeRateService interface and format currency types with consistent alignment
- Add ExchangeRateService interface with GetExchangeRate, ConvertAmount, GetRateHistory, UpdateExchangeRate, GetSupportedCurrencies, ValidateCurrencyPair, and RefreshRates methods - Add CurrencyRevenue struct with currency and revenue fields - Add TransactionTypeStats struct with type, count, amount, and currency fields - Align struct field tags consistently across Currency, ExchangeRate, Transaction, and request/response types
This commit is contained in:
@@ -39,6 +39,17 @@ type ExchangeRateProvider interface {
|
||||
RefreshRates(ctx context.Context) error
|
||||
}
|
||||
|
||||
// ExchangeRateService defines the interface for exchange rate operations
|
||||
type ExchangeRateService interface {
|
||||
GetExchangeRate(ctx context.Context, fromCurrency, toCurrency string) (*ExchangeRate, error)
|
||||
ConvertAmount(ctx context.Context, amount float64, fromCurrency, toCurrency string) (*CurrencyConversionResponse, error)
|
||||
GetRateHistory(ctx context.Context, fromCurrency, toCurrency string, days int) ([]*ExchangeRate, error)
|
||||
UpdateExchangeRate(ctx context.Context, rate *ExchangeRate) error
|
||||
GetSupportedCurrencies(ctx context.Context) ([]*Currency, error)
|
||||
ValidateCurrencyPair(ctx context.Context, fromCurrency, toCurrency string) error
|
||||
RefreshRates(ctx context.Context) error
|
||||
}
|
||||
|
||||
// BillingService defines the interface for multi-currency billing operations
|
||||
type BillingService interface {
|
||||
ProcessBilling(ctx context.Context, req *BillingRequest) (*BillingResponse, error)
|
||||
|
||||
Reference in New Issue
Block a user