import batch next
This commit is contained in:
@@ -46,6 +46,8 @@
|
|||||||
:serialize #(or (:ident %) (:db/ident %) %)}
|
:serialize #(or (:ident %) (:db/ident %) %)}
|
||||||
:iso_date {:parse #(time/parse % time/iso-date)
|
:iso_date {:parse #(time/parse % time/iso-date)
|
||||||
:serialize #(time/unparse % time/iso-date)}
|
:serialize #(time/unparse % time/iso-date)}
|
||||||
|
:iso_date_time {:parse #(clj-time.coerce/to-date-time %)
|
||||||
|
:serialize #(str (clj-time.coerce/to-date-time %))}
|
||||||
:money {:parse #(cond (and (string? %)
|
:money {:parse #(cond (and (string? %)
|
||||||
(not (str/blank? %)))
|
(not (str/blank? %)))
|
||||||
(Double/parseDouble %)
|
(Double/parseDouble %)
|
||||||
@@ -459,22 +461,7 @@
|
|||||||
:start {:type 'Int}
|
:start {:type 'Int}
|
||||||
:end {:type 'Int}}}
|
:end {:type 'Int}}}
|
||||||
|
|
||||||
:import_batch {:fields {:user_name {:type 'String}
|
:transaction_rule_page {:fields {:transaction_rules {:type '(list :transaction_rule)}
|
||||||
:id {:type :id}
|
|
||||||
:date {:type :iso_date}
|
|
||||||
:imported {:type 'Int}
|
|
||||||
:extant {:type 'Int}
|
|
||||||
:suppressed {:type 'Int}
|
|
||||||
:status {:type :import_batch_status}
|
|
||||||
:source {:type :import_batch_source}}}
|
|
||||||
|
|
||||||
:import_batch_page {:fields {:data {:type '(list :import_batch)}
|
|
||||||
:count {:type 'Int}
|
|
||||||
:total {:type 'Int}
|
|
||||||
:start {:type 'Int}
|
|
||||||
:end {:type 'Int}}}
|
|
||||||
|
|
||||||
:transaction_rule_page {:fields {:transaction_rules {:type '(list :transaction_rule)}
|
|
||||||
:count {:type 'Int}
|
:count {:type 'Int}
|
||||||
:total {:type 'Int}
|
:total {:type 'Int}
|
||||||
:start {:type 'Int}
|
:start {:type 'Int}
|
||||||
@@ -655,10 +642,7 @@
|
|||||||
|
|
||||||
:resolve :get-transaction-page}
|
:resolve :get-transaction-page}
|
||||||
|
|
||||||
:import_batch_page {:type :import_batch_page
|
|
||||||
:args {:filters {:type :import_batch_filters}}
|
|
||||||
|
|
||||||
:resolve :get-import-batch-page}
|
|
||||||
|
|
||||||
:transaction_rule_page {:type :transaction_rule_page
|
:transaction_rule_page {:type :transaction_rule_page
|
||||||
:args {:client_id {:type :id}
|
:args {:client_id {:type :id}
|
||||||
@@ -748,9 +732,7 @@
|
|||||||
:sort {:type '(list :sort_item)}
|
:sort {:type '(list :sort_item)}
|
||||||
:approval_status {:type :transaction_approval_status}
|
:approval_status {:type :transaction_approval_status}
|
||||||
:unresolved {:type 'Boolean}}}
|
:unresolved {:type 'Boolean}}}
|
||||||
:import_batch_filters {:fields {:start {:type 'Int}
|
|
||||||
:per_page {:type 'Int}
|
|
||||||
:sort {:type '(list :sort_item)}}}
|
|
||||||
|
|
||||||
:ledger_filters {:fields {:client_id {:type :id}
|
:ledger_filters {:fields {:client_id {:type :id}
|
||||||
:vendor_id {:type :id}
|
:vendor_id {:type :id}
|
||||||
@@ -967,13 +949,8 @@
|
|||||||
{:enum-value :cash}
|
{:enum-value :cash}
|
||||||
{:enum-value :debit}]}
|
{:enum-value :debit}]}
|
||||||
|
|
||||||
:import_batch_source {:values [{:enum-value :intuit}
|
|
||||||
{:enum-value :yodlee}
|
|
||||||
{:enum-value :yodlee2}
|
|
||||||
{:enum-value :plaid}
|
|
||||||
{:enum-value :manual}]}
|
|
||||||
:import_batch_status {:values [{:enum-value :started}
|
|
||||||
{:enum-value :completed}]}
|
|
||||||
|
|
||||||
:processor {:values [{:enum-value :na}
|
:processor {:values [{:enum-value :na}
|
||||||
{:enum-value :doordash}
|
{:enum-value :doordash}
|
||||||
@@ -1373,7 +1350,6 @@
|
|||||||
:get-potential-unpaid-invoices-matches gq-transactions/get-potential-unpaid-invoices-matches
|
:get-potential-unpaid-invoices-matches gq-transactions/get-potential-unpaid-invoices-matches
|
||||||
:get-accounts gq-accounts/get-accounts
|
:get-accounts gq-accounts/get-accounts
|
||||||
:get-transaction-page gq-transactions/get-transaction-page
|
:get-transaction-page gq-transactions/get-transaction-page
|
||||||
:get-import-batch-page gq-import-batches/get-import-batch-page
|
|
||||||
:get-ledger-page gq-ledger/get-ledger-page
|
:get-ledger-page gq-ledger/get-ledger-page
|
||||||
:get-sales-order-page gq-sales-orders/get-sales-orders-page
|
:get-sales-order-page gq-sales-orders/get-sales-orders-page
|
||||||
:get-balance-sheet gq-ledger/get-balance-sheet
|
:get-balance-sheet gq-ledger/get-balance-sheet
|
||||||
@@ -1421,6 +1397,7 @@
|
|||||||
:mutation/request-import gq-requests/request-import
|
:mutation/request-import gq-requests/request-import
|
||||||
:get-vendor gq-vendors/get-graphql})
|
:get-vendor gq-vendors/get-graphql})
|
||||||
gq-plaid/attach
|
gq-plaid/attach
|
||||||
|
gq-import-batches/attach
|
||||||
schema/compile))
|
schema/compile))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
(ns auto-ap.graphql.import-batch
|
(ns auto-ap.graphql.import-batch
|
||||||
(:require
|
(:require [auto-ap.datomic
|
||||||
[clojure.tools.logging :as log]
|
:refer
|
||||||
|
[add-sorter-fields apply-pagination apply-sort-3 conn merge-query]]
|
||||||
[datomic.api :as d]
|
[auto-ap.graphql.utils
|
||||||
[auto-ap.datomic
|
:refer
|
||||||
:refer [add-sorter-fields apply-pagination apply-sort-3 merge-query conn]]
|
[<-graphql assert-admin ident->enum-f result->page]]
|
||||||
[auto-ap.graphql.utils :refer [<-graphql assert-admin ident->enum-f result->page]]))
|
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||||
|
[datomic.api :as d]))
|
||||||
|
|
||||||
(def default-read '[:db/id
|
(def default-read '[:db/id
|
||||||
:import-batch/external-id
|
:import-batch/external-id
|
||||||
@@ -60,4 +61,38 @@
|
|||||||
matching-count :data args)))
|
matching-count :data args)))
|
||||||
|
|
||||||
|
|
||||||
|
(defn attach [schema]
|
||||||
|
(->
|
||||||
|
(merge-with merge schema
|
||||||
|
{:objects {:import_batch {:fields {:user_name {:type 'String}
|
||||||
|
:id {:type :id}
|
||||||
|
:date {:type :iso_date_time}
|
||||||
|
:imported {:type 'Int}
|
||||||
|
:extant {:type 'Int}
|
||||||
|
:suppressed {:type 'Int}
|
||||||
|
:status {:type :import_batch_status}
|
||||||
|
:source {:type :import_batch_source}}}
|
||||||
|
|
||||||
|
:import_batch_page {:fields {:data {:type '(list :import_batch)}
|
||||||
|
:count {:type 'Int}
|
||||||
|
:total {:type 'Int}
|
||||||
|
:start {:type 'Int}
|
||||||
|
:end {:type 'Int}}}
|
||||||
|
|
||||||
|
}
|
||||||
|
:queries {:import_batch_page {:type :import_batch_page
|
||||||
|
:args {:filters {:type :import_batch_filters}}
|
||||||
|
|
||||||
|
:resolve :get-import-batch-page}}
|
||||||
|
:mutations {}
|
||||||
|
:input-objects {:import_batch_filters {:fields {:start {:type 'Int}
|
||||||
|
:per_page {:type 'Int}
|
||||||
|
:sort {:type '(list :sort_item)}}}}
|
||||||
|
:enums {:import_batch_status {:values [{:enum-value :started}
|
||||||
|
{:enum-value :completed}]}
|
||||||
|
:import_batch_source {:values [{:enum-value :intuit}
|
||||||
|
{:enum-value :yodlee}
|
||||||
|
{:enum-value :yodlee2}
|
||||||
|
{:enum-value :plaid}
|
||||||
|
{:enum-value :manual}]}}})
|
||||||
|
(attach-resolvers {:get-import-batch-page get-import-batch-page})))
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
(ns auto-ap.time
|
(ns auto-ap.time
|
||||||
(:require [clj-time.core :as time]
|
(:require [clj-time.core :as time]
|
||||||
[clj-time.format :as f]))
|
[clj-time.format :as f]
|
||||||
|
[clojure.tools.logging :as log]))
|
||||||
|
|
||||||
(defn localize [d]
|
(defn localize [d]
|
||||||
(time/to-time-zone d (time/time-zone-for-id "America/Los_Angeles")))
|
(time/to-time-zone d (time/time-zone-for-id "America/Los_Angeles")))
|
||||||
@@ -10,6 +11,7 @@
|
|||||||
|
|
||||||
(def normal-date "MM/dd/yyyy")
|
(def normal-date "MM/dd/yyyy")
|
||||||
(def iso-date "yyyy-MM-dd")
|
(def iso-date "yyyy-MM-dd")
|
||||||
|
(def iso-date-time (:date-hour-minute-second-ms f/formatters))
|
||||||
|
|
||||||
(defn parse [v format]
|
(defn parse [v format]
|
||||||
(try
|
(try
|
||||||
@@ -22,6 +24,7 @@
|
|||||||
(try
|
(try
|
||||||
(f/unparse (f/formatter format) v)
|
(f/unparse (f/formatter format) v)
|
||||||
(catch Exception e
|
(catch Exception e
|
||||||
|
(log/warn e)
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
(defn unparse-local [v format]
|
(defn unparse-local [v format]
|
||||||
|
|||||||
@@ -57,7 +57,6 @@
|
|||||||
|
|
||||||
(def is-year-month-day #"^\d{4}-\d{2}-\d{2}$")
|
(def is-year-month-day #"^\d{4}-\d{2}-\d{2}$")
|
||||||
|
|
||||||
|
|
||||||
(defn dates->date-times [x]
|
(defn dates->date-times [x]
|
||||||
(walk/postwalk
|
(walk/postwalk
|
||||||
(fn [node]
|
(fn [node]
|
||||||
@@ -65,7 +64,7 @@
|
|||||||
|
|
||||||
(and (string? node)
|
(and (string? node)
|
||||||
(re-matches is-8601 node))
|
(re-matches is-8601 node))
|
||||||
(format/parse (format/formatters :date-time) node)
|
(time/to-default-time-zone (format/parse (format/formatters :date-time) node))
|
||||||
|
|
||||||
(and (string? node)
|
(and (string? node)
|
||||||
(re-matches is-year-month-day node))
|
(re-matches is-year-month-day node))
|
||||||
|
|||||||
@@ -60,7 +60,12 @@
|
|||||||
[:a {:href (bidi/path-for routes/routes :admin-yodlee2), :class (str "item" (active-when ap = :admin-yodlee2))}
|
[:a {:href (bidi/path-for routes/routes :admin-yodlee2), :class (str "item" (active-when ap = :admin-yodlee2))}
|
||||||
[:span {:class "icon icon-saving-bank-1" :style {:font-size "25px"}}]
|
[:span {:class "icon icon-saving-bank-1" :style {:font-size "25px"}}]
|
||||||
[:span {:class "name"} "Yodlee 2 Link"]]]
|
[:span {:class "name"} "Yodlee 2 Link"]]]
|
||||||
|
|
||||||
|
[:li.menu-item
|
||||||
|
[:a {:href (bidi/path-for routes/routes :admin-plaid), :class (str "item" (active-when ap = :admin-plaid))}
|
||||||
|
[:span {:class "icon icon-saving-bank-1" :style {:font-size "25px"}}]
|
||||||
|
[:span {:class "name"} "Plaid Link"]]]
|
||||||
|
|
||||||
[:ul ]]
|
[:ul ]]
|
||||||
[:p.menu-label "History"]
|
[:p.menu-label "History"]
|
||||||
[:ul.menu-list
|
[:ul.menu-list
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
(ns auto-ap.views.pages.admin.import-batches.table
|
(ns auto-ap.views.pages.admin.import-batches.table
|
||||||
(:require
|
(:require [auto-ap.routes :as routes]
|
||||||
[auto-ap.status :as status]
|
[auto-ap.status :as status]
|
||||||
[auto-ap.subs :as subs]
|
[auto-ap.subs :as subs]
|
||||||
[auto-ap.views.components.buttons :as buttons]
|
[auto-ap.views.components.buttons :as buttons]
|
||||||
[auto-ap.views.components.grid :as grid]
|
[auto-ap.views.components.grid :as grid]
|
||||||
[auto-ap.views.pages.data-page :as data-page]
|
[auto-ap.views.pages.data-page :as data-page]
|
||||||
[auto-ap.views.utils :refer [date->str dispatch-event action-cell-width]]
|
[auto-ap.views.utils
|
||||||
[re-frame.core :as re-frame]
|
:refer
|
||||||
[reagent.core :as r]
|
[action-cell-width date->str dispatch-event pretty-long]]
|
||||||
[bidi.bidi :as bidi]
|
[bidi.bidi :as bidi]
|
||||||
[auto-ap.routes :as routes]
|
[cemerick.url :as url]
|
||||||
[cemerick.url :as url]))
|
[re-frame.core :as re-frame]
|
||||||
|
[reagent.core :as r]))
|
||||||
|
|
||||||
(re-frame/reg-sub
|
(re-frame/reg-sub
|
||||||
::specific-table-params
|
::specific-table-params
|
||||||
@@ -67,7 +68,7 @@
|
|||||||
(for [{:keys [date source status user-name id imported extant suppressed] :as r} (:data data)]
|
(for [{:keys [date source status user-name id imported extant suppressed] :as r} (:data data)]
|
||||||
^{:key id}
|
^{:key id}
|
||||||
[grid/row {:class (:class r) :id id}
|
[grid/row {:class (:class r) :id id}
|
||||||
[grid/cell {} (date->str date)]
|
[grid/cell {} (date->str date pretty-long)]
|
||||||
[grid/cell {} source]
|
[grid/cell {} source]
|
||||||
[grid/cell {} status]
|
[grid/cell {} status]
|
||||||
[grid/cell {} user-name]
|
[grid/cell {} user-name]
|
||||||
|
|||||||
Reference in New Issue
Block a user