Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

ICurrencyService.cs

using Nop.Core.Domain.Directory;

namespace Nop.Services.Directory;

/// 
/// Currency service
/// 
public partial interface ICurrencyService
{
    #region Currency

    /// 
    /// Deletes currency
    /// 
    /// Currency
    /// A task that represents the asynchronous operation
    Task DeleteCurrencyAsync(Currency currency);

    /// 
    /// Gets a currency
    /// 
    /// Currency identifier
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the currency
    /// 
    Task GetCurrencyByIdAsync(int currencyId);

    /// 
    /// Gets a currency by code
    /// 
    /// Currency code
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the currency
    /// 
    Task GetCurrencyByCodeAsync(string currencyCode);

    /// 
    /// Gets all currencies
    /// 
    /// A value indicating whether to show hidden records
    /// Load records allowed only in a specified store; pass 0 to load all records
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the currencies
    /// 
    Task> GetAllCurrenciesAsync(bool showHidden = false, int storeId = 0);

    /// 
    /// Inserts a currency
    /// 
    /// Currency
    /// A task that represents the asynchronous operation
    Task InsertCurrencyAsync(Currency currency);

    /// 
    /// Updates the currency
    /// 
    /// Currency
    /// A task that represents the asynchronous operation
    Task UpdateCurrencyAsync(Currency currency);

    #endregion

    #region Conversions

    /// 
    /// Gets live rates regarding the passed currency
    /// 
    /// Currency code; pass null to use primary exchange rate currency
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the exchange rates
    /// 
    Task> GetCurrencyLiveRatesAsync(string currencyCode = null);

    /// 
    /// Converts currency
    /// 
    /// Amount
    /// Currency exchange rate
    /// Converted value
    decimal ConvertCurrency(decimal amount, decimal exchangeRate);

    /// 
    /// Converts to primary store currency 
    /// 
    /// Amount
    /// Source currency code
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the converted value
    /// 
    Task ConvertToPrimaryStoreCurrencyAsync(decimal amount, Currency sourceCurrencyCode);

    /// 
    /// Converts from primary store currency
    /// 
    /// Amount
    /// Target currency code
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the converted value
    /// 
    Task ConvertFromPrimaryStoreCurrencyAsync(decimal amount, Currency targetCurrencyCode);

    /// 
    /// Converts currency
    /// 
    /// Amount
    /// Source currency code
    /// Target currency code
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the converted value
    /// 
    Task ConvertCurrencyAsync(decimal amount, Currency sourceCurrencyCode, Currency targetCurrencyCode);

    /// 
    /// Converts to primary exchange rate currency 
    /// 
    /// Amount
    /// Source currency code
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the converted value
    /// 
    Task ConvertToPrimaryExchangeRateCurrencyAsync(decimal amount, Currency sourceCurrencyCode);

    /// 
    /// Converts from primary exchange rate currency
    /// 
    /// Amount
    /// Target currency code
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the converted value
    /// 
    Task ConvertFromPrimaryExchangeRateCurrencyAsync(decimal amount, Currency targetCurrencyCode);

    #endregion
}