Skip to content

Commit

Permalink
Release 1.2.16
Browse files Browse the repository at this point in the history
  • Loading branch information
siefca committed Nov 25, 2022
1 parent 31c39af commit a4e1c47
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 109 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
APPNAME = "bankster"
VERSION = "1.2.15"
VERSION = "1.2.16"

.PHONY: watch default docs deploy test test-clj sig jar pom clean tag

Expand Down
155 changes: 82 additions & 73 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
# History of Bankster releases

## 1.2.16 (2022-11-25)

- `io.randomseed.bankster.util.fs/default-encoding` is no longer private.
- nREPL server is no longer automatically started when loading `infra.clj`.
- Excluded `abs` from being aliased in `io.randomseed.bankster.money`.
- Removed Midje tests, added clojure.test.
- CircleCI configuration updated.
- Deps updated.

## 1.2.15 (2021-12-29)

- Deps updated (codox).

## 1.2.14 (2021-09-24)

- Nil punning added to: currency/ns-code, cuurrency/code, currency/weight,
currency/domain, currency/kind, currency/sc, currency/nr
- Nil punning added to: `currency/ns-code`, `currency/code`, `currency/weight`,
`currency/domain`, `currency/kind`, `currency/sc`, `currency/nr`.

## 1.2.13 (2021-09-23)

- Fixed a bug that caused an amount to be a kind of Money instead of BigDecimal
when money/value was called on currency and money.
- Fixed a bug that caused an amount to be a kind of `Money` instead of `BigDecimal`
when `money/value` was called on currency and money.

## 1.2.12 (2021-07-18)

- Type hinting and assertion tests improved in money/compare and money/compare-amount.
- Type hinting and assertion tests improved in `money/compare` and `money/compare-amount`.

## 1.2.10, 1.2.11 (2021-07-13)

Expand All @@ -27,119 +36,119 @@

## 1.2.9 (2021-07-06)

- Fixed type hinting in fs/absoute-path?.
- Fixed type hinting in `fs/absoute-path?`.

- Money comparators (money/compare and money/compare-amounts) now accept nil values.
- Monetary comparators (`money/compare` and `money/compare-amounts`) now accept `nil` values.

- Added money/round-to for interval-based rounding.
- Added `money/round-to` for interval-based rounding.

## 1.2.8 (2021-06-28)

- Rewritten fs/absolute-path? and fs/relative-path?
- Rewritten `fs/absolute-path?` and `fs/relative-path?`

## 1.2.7 (2021-06-17)

- Improved money/on-amount (now it rescales results to the scale of a money,
- Improved `money/on-amount` (now it rescales results to the scale of a money,
not the nominal scale of a currency).

- Added alias money/apply that points to money/on-amount.
- Added alias `money/apply` that points to `money/on-amount`.

- Added money/set-amount.
- Added `money/set-amount`.

## 1.2.6 (2021-06-02)

- Monetary implementation for Currency objects fixed for nil registry argument.
Affected function: currency/unit.
- `Monetary` implementation for `Currency` objects fixed for `nil` registry argument.
Affected function: `currency/unit`.

- Fixed type hinting in currency/sc and currency/nr.
- Fixed type hinting in `currency/sc` and `currency/nr`.

## 1.2.5 (2021-05-02)

- Monetary implementation for maps is more restrictive when registry is passed as an
- `Monetary` implementation for maps is more restrictive when registry is passed as an
argument. Previously maps were causing some functions to create *ad hoc*
currencies, now the `:id` key is used to get the existing currency from a registry.
This is in line with the protocol's guidelines. Affected functions: currency/unit,
currency/of-id.
This is in line with the protocol's guidelines. Affected functions: `currency/unit`,
`currency/of-id`.

- Monetary implementation for Currency objects is now fulfilling protocol
specification, making ID-only look-ups. Affected functions: currency/unit,
currency/of-id.
- `Monetary` implementation for `Currency` objects is now fulfilling protocol
specification, making ID-only look-ups. Affected functions: `currency/unit`,
`currency/of-id`.

- Monetary implementation for keywords now falls back to currency code look-up even
- `Monetary` implementation for keywords now falls back to currency code look-up even
if the given identifier is not namespace-qualified. Affected functions:
currency/unit, currency/present? It fixes *the chicken or the egg* problem during
`currency/unit`, `currency/present?`. It fixes *the chicken or the egg* problem during
registry building.

- Functions currency/add-countries, currency/remove-localized-properties,
currency/add-localized-properties, currency/add-weighted-code and currency/update
- Functions `currency/add-countries`, `currency/remove-localized-properties`,
`currency/add-localized-properties`, `currency/add-weighted-code` and `currency/update`
are now more strict and require currency ID to be given (not currency code).

**BREAKING CHANGES**:

- Low-level function currency/add-weighted-currency renamed to
currency/add-weighted-code.
- Low-level function `currency/add-weighted-currency` renamed to
`currency/add-weighted-code`.

## 1.2.4 (2021-04-18)

- Added money/data-readers and money/code-readers constants.
- Added `money/data-readers` and `money/code-readers` constants.

- Added data_readers_edn.clj (with generator in importer/readers-export) containing
- Added `data_readers_edn.clj` (with generator in `importer/readers-export`) containing
data readers for parsing EDN files.

- Fixed a bug causing registry to not be properly set in currency/with-registry and
registry/with.
- Fixed a bug causing registry to not be properly set in `currency/with-registry` and
`registry/with`.

- Added fs/get-resource utility function.
- Added `fs/get-resource` utility function.

**BREAKING CHANGES**:

- Data readers for tagged literals are split into code and data related handlers:

- Functions currency/code-literal and money/code-literal are now emitting Clojure
forms that are to be evaluated to produce Currency and Money objects.
- Functions `currency/code-literal` and `money/code-literal` are now emitting Clojure
forms that are to be evaluated to produce `Currency` and `Money` objects.

- Functions currency/data-literal and money/data-literal are now returning Currency
and Money objects.
- Functions `currency/data-literal` and `money/data-literal` are now returning `Currency`
and `Money` objects.

- Tagged literal handlers (for both Clojure code and data) can now be controlled by
the environment (e.g. dynamic variables for setting alternate registry or
rounding mode during parsing).

- Constant bankster/tagged-literals moved to money/tagged-literals.
- Constant `bankster/tagged-literals` moved to `money/tagged-literals`.

## 1.2.3 (2021-04-16)

- Fixed issue with data-readers file visibility by adding a copy to resources directory.

## 1.2.2 (2021-04-16)

- Added io.randomseed.bankster/data-readers map to expose tagged literal handlers.
- Added `io.randomseed.bankster/data-readers` map to expose tagged literal handlers.

## 1.2.1 (2021-04-15)

- Fixed a bug causing money/of-registry to not rescale amounts.
- Fixed a bug causing `money/of-registry` to not rescale amounts.

## 1.2.0 (2021-04-13)

- Function money/div-rem renamed to money/rem and improved to behave like div in
- Function `money/div-rem` renamed to `money/rem` and improved to behave like `money/div` in
terms of accepted argument types, rounding and rescaling.

- Added function money/abs.
- Added function `money/abs`.

- Added aliases: money/+, money/-, money/*, money//, money/min, money/max.
- Added aliases: `money/+`, `money/-`, `money/*`, `money//`, `money/min`, `money/max`.

- Added aliases: money/>, money/>=, money/<, money/<=, money/=, money/==.
- Added aliases: `money/>`, `money/>=`, `money/<`, `money/<=`, `money/=`, `money/==`.

- Added aliases: money/pos?, money/neg?, money/zero?.
- Added aliases: `money/pos?`, `money/neg?`, `money/zero?`.

- Conversion functions scale/->int, scale/->long, scale/->double, scale/->float,
scale/to-plain-string, scale/to-clojure-string, scale/to-symbol,
scale/to-clojure-symbol are now using scale/amount to get the actual amount of the
given scalable instead of expecting BigDecimal values.
- Conversion functions `scale/->int`, `scale/->long`, `scale/->double`, `scale/->float`,
`scale/to-plain-string`, `scale/to-clojure-string`, `scale/to-symbol`,
`scale/to-clojure-symbol` are now using `scale/amount` to get the actual amount of the
given scalable instead of expecting `BigDecimal` values.

**BREAKING CHANGES**:

- Function money/pos now returns its argument. Use money/abs to get the absolute
- Function `money/pos` now returns its argument. Use `money/abs` to get the absolute
value.

## 1.1.3 (2021-04-12)
Expand All @@ -148,17 +157,17 @@

## 1.1.2 (2021-04-05)

- Monetary protocol methods are now more strict about the origin of currency
- `Monetary` protocol methods are now more strict about the origin of currency
if a registry is given (by-ID resolving and getting from a registry happens
even for Currency objects).
even for `Currency` objects).

- Unary variants of money/div and money/div-scaled are now able to take money as an
argument (common operation when recalculating exchange rates).
- Unary variants of `money/div` and `money/div-scaled` are now able to take `Money` as
arguments (common operation when recalculating exchange rates).

- Protocol method implementations of money/value short-circuit on nil given as an
- Protocol method implementations of `money/value` short-circuit on `nil` given as an
amount.

- Added functions: money/auto-scaled?, money/of-registry and money/on-amount.
- Added functions: `money/auto-scaled?`, `money/of-registry` and `money/on-amount`.

- Fixed a bug causing division and multiplication of auto-scaled currencies to
rescale results to latest scales of the amounts instead of performing scale-free
Expand All @@ -174,48 +183,48 @@

## 1.1.0 (2021-03-25)

- Added currency/update for updating currencies with additional data preservation
- Added `currency/update` for updating currencies with additional data preservation
(localized properties, countries, etc.).
- Added money/cast for casting monetary amounts across currencies
- Added `money/cast` for casting monetary amounts across currencies
(different or slightly different, e.g. sourced in another registries).
- Added scale/to-clojure-string, scale/to-symbol, scale/to-clojure-symbol.
- Added money/->symbol, money/->clojure-symbol, money/->double, money/->float.
- Improved money/value to be more polymorphic (currency argument).
- Improved conversion functions: scale/->int, scale/->long, scale/->float, scale/->double.
- Added `scale/to-clojure-string`, `scale/to-symbol`, `scale/to-clojure-symbol`.
- Added `money/->symbol`, `money/->clojure-symbol`, `money/->double`, `money/->float`.
- Improved `money/value` to be more polymorphic (currency argument).
- Improved conversion functions: `scale/->int`, `scale/->long`, `scale/->float`, `scale/->double`.
- Type hinting improved in multiple functions and protocol methods.

**BREAKING CHANGES**:

- Conversion functions now have different arities:
scale/->int, scale/->long, scale/->float, scale/->double.
- Function scale/to-plain-string is now converting decimals to plain strings
without adding M suffix when there is too many digits. This functionality
was moved to scale/to-clojure-string.
`scale/->int`, `scale/->long`, `scale/->float`, `scale/->double`.
- Function `scale/to-plain-string` is now converting decimals to plain strings
without adding `M` suffix when there is too many digits. This functionality
was moved to `scale/to-clojure-string`.

## 1.0.8 (2021-03-23)

- Function money/convert now accepts a price and is more polymorphic.
- Added the function currency/localized-properties.
- Function `money/convert` now accepts a price and is more polymorphic.
- Added the function `currency/localized-properties`.

## 1.0.7 (2021-03-19)

- Improved and unified rescaling of Money objects when their currency is auto-scaled.
- Functions money/amount, money/stripped-amount and money/currency are now polymorphic.
- Improved and unified rescaling of `Money` objects when their currency is auto-scaled.
- Functions `money/amount`, `money/stripped-amount` and `money/currency` are now polymorphic.
- Currencies database updated.

## 1.0.6 (2021-03-19)

- Better printing of monetary amounts of big precisions (adding M letter to a number).
- Better parsing of monetary amounts of big precisions (early conversion to big decimals to avoid scientific notation).
- Better printing of monetary amounts of big precision (adding `M` letter to a number).
- Better parsing of monetary amounts of big precision (early conversion to big decimals to avoid scientific notation).

## 1.0.5 (2021-03-18)

- Fixed a bug reversing order of weighted currencies.

## 1.0.4 (2021-03-18)

- Added missing Monetary implementation functions for Money.
- Improved currency/id Monetary implementation to support currency codes.
- Added missing `Monetary` implementation functions for `Money`.
- Improved `currency/id` `Monetary` implementation to support currency codes.

## 1.0.3 (2021-03-17)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ To use Bankster in your project, add the following to dependencies section of
`project.clj` or `build.boot`:

```clojure
[io.randomseed/bankster "1.2.15"]
[io.randomseed/bankster "1.2.16"]
```

For `deps.edn` add the following as an element of a map under `:deps` or
`:extra-deps` key:

```clojure
io.randomseed/bankster {:mvn/version "1.2.15"}
io.randomseed/bankster {:mvn/version "1.2.16"}
```

Additionally, if you want to utilize specs and generators provided by the Bankster
Expand Down Expand Up @@ -565,7 +565,7 @@ final and the support for currencies is limited to the "official" ones.

## License

Copyright © 2021 Paweł Wilk
Copyright © 2021,2022 Paweł Wilk

Bankster is copyrighted software owned by Paweł Wilk ([email protected]). You may
redistribute and/or modify this software as long as you comply with the terms of
Expand Down
26 changes: 13 additions & 13 deletions bankster.jar.asc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIzBAABCAAdFiEElzhGBxSaMDOq9Z/XNjF6dNg249AFAmHMLacACgkQNjF6dNg2
49Cp8w/+N7IDBQEPeDpqfFoMHqH6OALWqmnsQ7FbT9Q7oyH6H7ob9ZeRLHmi5fjW
lNlHUs02nSSBCc+HAbssug6HqaOxi7bO/MnFmp4kc0pqp0s94B4dU4Wz5YXiEF8y
L9vde4HS9QamyAJZjMQMm9d0NbwhM32X8UKVddiru9TAiWSeVU9/CQo+DPYA2Hq6
0v2bDPzGlUGdZ9VSAvZfD9u0N7xv+sqwvvMhaK1hHCkkAJdogXtZ2v00uzQe3ZDB
JzcaGXsbOjcV6ZKR3tRoDXqGtyC4vHGy+6svzWm1tvgI3Vr05cY24EAZOEF0mbVK
g+PRuSYc13exe50P+NSNjq3ZLG540F90imeX9S9i8AIJ7I/kQ+NKX6Cd6i9NFo0N
5t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