Make it possible again to toggle the state of an application from "active" to "inactive".
Previously, the use of (merge-with #(or %2 %1)) meant that "updating" a boolean field would simply set that field to true as long as the old or new field was true (truth table of or). Replacing that with a simple (merge) solves the problem, as long as there can't be new nil fields.
To be able to write unit tests for that use-case, most of the changes in this PR are just extraction of existing features from create-or-update-application! into pure functions.
Make it possible again to toggle the state of an application from "active" to "inactive".
Previously, the use of
(merge-with #(or %2 %1))
meant that "updating" a boolean field would simply set that field to true as long as the old or new field was true (truth table ofor
). Replacing that with a simple(merge)
solves the problem, as long as there can't be newnil
fields.To be able to write unit tests for that use-case, most of the changes in this PR are just extraction of existing features from
create-or-update-application!
into pure functions.