Skip to content

Releases: kipcole9/money

Money version 2.8.0

28 Aug 22:37
Compare
Choose a tag to compare

Enhancements

  • Separates the caching of etags from the caching of exchange rates. Previously the same cache behaviour (and therefore each implementation) was expected to support a key/value store but this is an unreasonable assumption. Etags are now cached in an ets table separate from the exchange rates cache. As a result, the get/1 and put/2 functions are removed from the Money.ExchangeRates.Cache behaviour. Thanks to @LostKobrakai. Closes #74.

Money version 2.7.3

28 Aug 10:41
Compare
Choose a tag to compare

Bug Fixes

  • Fixes the implementation of Money.ExchangeRates.last_update/0 to match the documentation. Thanks to @xavier. Closes #77.

  • Updates ex_doc dependency.

Money version 2.7.2

20 Aug 23:25
Compare
Choose a tag to compare

Bug Fixes

  • Converting from currency to a binary to_currency is a no-op as it already is for an atom to_currency. Thanks to @LostKobrakai. Closes #76.

Money version 2.7.1

15 Aug 21:50
Compare
Choose a tag to compare

Bug Fixes

  • Correct the name of the Subscription exception modules. Thanks to @Joe-noh. Closes #75.

Money version 2.7.0

19 Jul 22:33
Compare
Choose a tag to compare

Enhancements

  • Added tests for Gingotts.Protocol

  • Separates the Ecto migrations from the SQL contained therein so that non-Ecto users can leverage the DDL to create/drop the money_with_currency type and the creation/deletion of aggregate functions for money_with_currency. See the module Money.DDL.

Money version 2.6.1

31 May 03:14
Compare
Choose a tag to compare

Enhancements

  • Moves the Jason.Encoder protocol implementation to the protocol implementation file. This prevents some circular compilation issues when using the :cldr compiler.

Money version 2.6.0

30 May 12:10
Compare
Choose a tag to compare

Enhancements

  • Change the definition of the money_with_currency composite Postgres type from numeric(20,8) to numeric. This provides for a much wider precision and scale. It also means that retrieving Money.t data from the database will be returned with the same scale as when it was stored. Closes #67. Thanks to @doughsay.

  • Relaxes the requirements for ex_cldr and ex_cldr_numbers

  • Adds json encoding for Money.t for jason and poison

Money version 2.5.0

09 Apr 16:40
Compare
Choose a tag to compare

Enhancements

  • Adds support for ISO4217 "X" currency codes. Currency codes that start with "X" followed by two alphabetic characters are considered valid currency codes. Some codes are defined, like "XAU" for "Gold". The undefined codes are available for application-specific usage. Note that from a Cldr perspective these codes are considered valid, but unknown. This means they can be used anywhere as a currency for Money. But Cldr.known_currency?/1 will return false for these codes since there is no definition for them in CLDR.

  • Adds basic support for Postgres aggregation functions using the Money.Ecto.Composite.Type type definition. This allows expression in Ecto such as:

  iex> q = Ecto.Query.select Ledger, [l], type(sum(l.amount), l.amount)
  #Ecto.Query<from l in Ledger, select: type(sum(l.amount), l.amount)>
  iex> Repo.all q
  [debug] QUERY OK source="ledgers" db=6.1ms
  SELECT sum(l0."amount")::money_with_currency FROM "ledgers" AS l0 []
  [#Money<:USD, 600.00000000>]

This release supports only the sum aggregate function and only for Postgres. A migration generator is provided that when executed with mix ecto.migrate will add the relevant functions to the Postgres database to support this functionality. See the README for more information.

Money version 2.4.0

29 Mar 01:20
Compare
Choose a tag to compare

Enhancements

  • Update ex_cldr dependency to version 1.5.0 which uses CLDR data version 33.

  • Update ex_cldr_numbers dependency to 1.4.0

  • Clarify the examples of Money.to_string/2 to note that the default locale is "en-001". Thanks to @snewcomer. Closes #61.

Money version 2.3.0

23 Mar 23:48
Compare
Choose a tag to compare

Bug Fixes

  • Fix the protocol implementation for String.Chars

Enhancements

This version introduces a new module Money.Subscription that supports applications that manage subscriptions. These appications often need to support upgrading and downgrading plans. This action involves the calculation of a credit amount from the current plan that is then applied to the new plan. See Money.Subscription and Money.Subscription.change_plan/3.

  • Add Money.Subscription.new/3 and Money.Subscription.new!/3 to create a new subscription with its inital plan
  • Add Money.Subscription.Plan.new/3 and Money.Subscription.Plan.new!/3 to create a new plan
  • Add Money.Subscription.change_plan/3 and Money.Subscription.change_plan!/3to change subscription plans and apply any credit for unused parts of the current period
  • Add Money.Subscription.plan_days/3 to return the number of days in a plan interval
  • Add Money.Subscription.days_remaining/4 to return the number of days remaining in the current interval for a plan
  • Add Money.Subscription.next_interval_starts/3 to return the next interval start date for a subscription to a plan
  • Add Money.zero/1 that returns a Money.t with a zero amount in the given currency