Adds ability to filter by category, adds invoice allowance as an account option

This commit is contained in:
2023-01-31 08:51:10 -08:00
parent d94aac317e
commit e13a32b0aa
12 changed files with 199 additions and 134 deletions

View File

@@ -30,7 +30,7 @@
(->graphql (d-accounts/clientize result (:client_id args)))))
(defn upsert-account [context args _]
(let [{{:keys [id client-overrides numeric-code location applicability account-set name type]} :account} (<-graphql args)]
(let [{{:keys [id client-overrides numeric-code location applicability account-set name invoice-allowance type]} :account} (<-graphql args)]
(when-not id
(when (seq (d/query {:query {:find ['?e]
:in '[$ ?account-set ?numeric-code]
@@ -51,6 +51,8 @@
:account/type (keyword "account-type" (clojure.core/name type))
:account/applicability (or (enum->keyword applicability "account-applicability")
:account-applicability/global)
:account/invoice-allowance (some-> invoice-allowance (enum->keyword "allowance"))
:account/account-set account-set
:account/location location
:account/numeric-code (when-not id

View File

@@ -76,6 +76,7 @@
:total_gte {:type :money}
:type_name {:type 'String}
:processor {:type :processor}
:category {:type 'String}
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}}