Makes feature flags admin-configurable

This commit is contained in:
2023-02-02 08:48:07 -08:00
parent 7fd95d9175
commit d08253e5fa
4 changed files with 35 additions and 6 deletions

View File

@@ -66,9 +66,10 @@
id (or (:db/id client) "new-client")
signature-file (upload-signature-data (:signature_data edit_client))
_ (when client
(audit-transact (into
(mapv (fn [lm] [:db/retractEntity (:db/id lm)]) (:client/location-matches client))
(mapv (fn [m] [:db/retract (:db/id client) :client/matches m]) (:client/matches client)))
(audit-transact (-> []
(into (mapv (fn [lm] [:db/retractEntity (:db/id lm)]) (:client/location-matches client)))
(into (mapv (fn [m] [:db/retract (:db/id client) :client/matches m]) (:client/matches client)))
(into (mapv (fn [m] [:db/retract (:db/id client) :client/feature-flags m]) (:client/feature-flags client))))
(:id context)))
reverts (-> []
(into (->> (:bank_accounts edit_client)
@@ -129,6 +130,7 @@
:address/city (:city (:address edit_client))
:address/state (:state (:address edit_client))
:address/zip (:zip (:address edit_client))})
:client/feature-flags (:feature_flags edit_client)
:client/bank-accounts (map #(remove-nils
(cond-> {:db/id (:id %)
:bank-account/code (:code %)
@@ -155,6 +157,7 @@
(:bank_accounts edit_client))
})
[:reset id :client/emails (map #(remove-nils
{:db/id (or (:id %)
(str (UUID/randomUUID)))
@@ -474,6 +477,7 @@
:name {:type 'String}
:locked_until {:type :iso_date}
:code {:type 'String}
:feature_flags {:type '(list String)}
:square_auth_token {:type 'String}
:signature_file {:type 'String}
:square_integration_status {:type :integration_status}
@@ -562,6 +566,7 @@
:locked_until {:type :iso_date}
:code {:type 'String}
:square_auth_token {:type 'String}
:feature_flags {:type '(list String)}
:signature_data {:type 'String}
:email {:type 'String}
:emails {:type '(list :edit_email_contact)}