partway through transaction rules

This commit is contained in:
Bryce Covert
2020-08-24 20:54:51 -07:00
parent 84137161bf
commit ace220672d
21 changed files with 118 additions and 105 deletions

View File

@@ -806,6 +806,6 @@
{:ids (->> results
(drop (:start args 0))
(take (:count args default-pagination-size))
(take (:count args (or (:per-page args) default-pagination-size)))
(map last))
:count (count results)})

View File

@@ -465,6 +465,7 @@
:amount_gte {:type :money}
:invoice_number_like {:type 'String}
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}}
:resolve :get-invoice-page}
@@ -500,6 +501,7 @@
:amount_gte {:type :money}
:description {:type 'String}
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}
:approval_status {:type :transaction_approval_status}}
@@ -509,6 +511,7 @@
:args {:client_id {:type :id}
:vendor_id {:type :id}
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}
:asc {:type 'Boolean}}
:resolve :get-transaction-rule-page}
@@ -525,6 +528,7 @@
:from_numeric_code {:type 'Int}
:to_numeric_code {:type 'Int}
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}}
:resolve :get-ledger-page}
@@ -535,6 +539,7 @@
:total_lte {:type :money}
:total_gte {:type :money}
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}}
:resolve :get-sales-order-page}
@@ -548,6 +553,7 @@
:check_number_like {:type 'String}
:invoice_number {:type 'String}
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}}
:resolve :get-payment-page}

View File

@@ -367,3 +367,19 @@
(require '[mount.core :as mount])
(require '[auto-ap.server])
(mount/start-without #'auto-ap.server/jetty))
(defn entity-history [i]
(vec (sort-by first (d/query
{:query {:find ['?tx '?z '?v ]
:in ['?i '$]
:where ['[?i ?a ?v ?tx ?ad]
'[?a :db/ident ?z]
'[(= ?ad true)]]}
:args [i (d/history (d/db (d/connect uri)))]}))))
(defn tx-detail [i]
(map (juxt :e #(d/ident (d/db (d/connect uri)) (:a %)) :v)
(:data (first
(d/tx-range (d/log (d/connect uri))
i
(inc i))))))