mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 01:54:34 +03:00
10d9e3b083
* Add revenue goal option to goal creation This commit adds a currency field to the goals form. Goals that have a currency set are now revenue goals, and are cached with sites to later be used during ingestion. Co-authored-by: Robert Joonas <robertjoonas16@gmail.com> * Enable feature flag in tests --------- Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
21 lines
495 B
Elixir
21 lines
495 B
Elixir
defmodule Plausible.ExchangeRateMock do
|
|
@moduledoc false
|
|
@behaviour Money.ExchangeRates
|
|
|
|
def init(config) do
|
|
config
|
|
end
|
|
|
|
def decode_rates(rates) do
|
|
Money.ExchangeRates.OpenExchangeRates.decode_rates(rates)
|
|
end
|
|
|
|
def get_latest_rates(_config) do
|
|
{:ok, %{BRL: Decimal.new("0.7"), EUR: Decimal.new("1.2"), USD: Decimal.new(1)}}
|
|
end
|
|
|
|
def get_historic_rates(_date, _config) do
|
|
{:ok, %{BRL: Decimal.new("0.8"), EUR: Decimal.new("1.3"), USD: Decimal.new(2)}}
|
|
end
|
|
end
|