Lots of fixes for cloud.
This commit is contained in:
@@ -796,7 +796,7 @@
|
|||||||
:account-for-vendor gq-accounts/default-for-vendor
|
:account-for-vendor gq-accounts/default-for-vendor
|
||||||
:get-user get-user
|
:get-user get-user
|
||||||
:mutation/delete-transaction-rule gq-transaction-rules/delete-transaction-rule
|
:mutation/delete-transaction-rule gq-transaction-rules/delete-transaction-rule
|
||||||
:mutation/edit-user gq-users/edit-user
|
:mutation/edit-user gq-users/edit-user
|
||||||
:mutation/upsert-transaction-rule gq-transaction-rules/upsert-transaction-rule
|
:mutation/upsert-transaction-rule gq-transaction-rules/upsert-transaction-rule
|
||||||
:test-transaction-rule gq-transaction-rules/test-transaction-rule
|
:test-transaction-rule gq-transaction-rules/test-transaction-rule
|
||||||
:run-transaction-rule gq-transaction-rules/run-transaction-rule
|
:run-transaction-rule gq-transaction-rules/run-transaction-rule
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
(:require
|
(:require
|
||||||
[auto-ap.datomic :refer [audit-transact conn]]
|
[auto-ap.datomic :refer [audit-transact conn]]
|
||||||
[auto-ap.datomic.accounts :as d-accounts]
|
[auto-ap.datomic.accounts :as d-accounts]
|
||||||
[iol-ion.tx :refer [upsert-entity]]
|
|
||||||
[auto-ap.graphql.utils
|
[auto-ap.graphql.utils
|
||||||
:refer [->graphql
|
:refer [->graphql
|
||||||
<-graphql
|
<-graphql
|
||||||
@@ -15,6 +14,7 @@
|
|||||||
[auto-ap.search :as search]
|
[auto-ap.search :as search]
|
||||||
[auto-ap.utils :refer [heartbeat]]
|
[auto-ap.utils :refer [heartbeat]]
|
||||||
[datomic.client.api :as dc]
|
[datomic.client.api :as dc]
|
||||||
|
[iol-ion.tx :refer [random-tempid upsert-entity]]
|
||||||
[mount.core :as mount]
|
[mount.core :as mount]
|
||||||
[yang.scheduler :as scheduler]))
|
[yang.scheduler :as scheduler]))
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
:account/code (str numeric-code)
|
:account/code (str numeric-code)
|
||||||
:account/client-overrides (mapv
|
:account/client-overrides (mapv
|
||||||
(fn [client-override]
|
(fn [client-override]
|
||||||
{:db/id (:id client-override)
|
{:db/id (or (:id client-override) (random-tempid))
|
||||||
:account-client-override/client (:client-id client-override)
|
:account-client-override/client (:client-id client-override)
|
||||||
:account-client-override/name (:name client-override)
|
:account-client-override/name (:name client-override)
|
||||||
:account-client-override/search-terms (:name client-override)})
|
:account-client-override/search-terms (:name client-override)})
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
(ns auto-ap.graphql.ezcater
|
(ns auto-ap.graphql.ezcater
|
||||||
(:require
|
(:require
|
||||||
[auto-ap.datomic :refer [conn]]
|
[auto-ap.datomic :refer [conn]]
|
||||||
[auto-ap.graphql.utils :refer [assert-admin cleanse-query]]
|
[auto-ap.graphql.utils
|
||||||
|
:refer [assert-admin attach-tracing-resolvers cleanse-query]]
|
||||||
[auto-ap.search :as search]
|
[auto-ap.search :as search]
|
||||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
[auto-ap.utils :refer [heartbeat]]
|
||||||
[datomic.client.api :as dc]
|
[datomic.client.api :as dc]
|
||||||
[auto-ap.graphql.utils :refer [attach-tracing-resolvers]]))
|
[mount.core :as mount]
|
||||||
|
[yang.scheduler :as scheduler]))
|
||||||
|
|
||||||
(defn search [context args _]
|
(defn search [context args _]
|
||||||
(assert-admin (:id context))
|
(assert-admin (:id context))
|
||||||
@@ -26,6 +28,10 @@
|
|||||||
:text (:ezcater-caterer/search-terms result)})
|
:text (:ezcater-caterer/search-terms result)})
|
||||||
"ezcater-caterer"))
|
"ezcater-caterer"))
|
||||||
|
|
||||||
|
(mount/defstate indexer
|
||||||
|
:start (scheduler/every (* 5 60 1000) (heartbeat rebuild-search-index "rebuild-search-index"))
|
||||||
|
:stop (scheduler/stop indexer))
|
||||||
|
|
||||||
(def objects
|
(def objects
|
||||||
{:ezcater_caterer {:fields {:name {:type 'String}
|
{:ezcater_caterer {:fields {:name {:type 'String}
|
||||||
:id {:type :id}}}})
|
:id {:type :id}}}})
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
rule-id (if id
|
rule-id (if id
|
||||||
id
|
id
|
||||||
"transaction-rule")
|
"transaction-rule")
|
||||||
transaction [`(upsert-entity ~#:transaction-rule {:db/id rule-id
|
transaction [`(upsert-entity ~#:transaction-rule {:db/id (or rule-id (random-tempid))
|
||||||
:description description
|
:description description
|
||||||
:note note
|
:note note
|
||||||
:client client_id
|
:client client_id
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
(ns auto-ap.routes.queries
|
(ns auto-ap.routes.queries
|
||||||
(:require
|
(:require
|
||||||
[amazonica.aws.s3 :as s3]
|
[amazonica.aws.s3 :as s3]
|
||||||
[auto-ap.datomic :refer [conn pull-attr]]
|
[auto-ap.datomic :refer [conn pull-attr pull-id]]
|
||||||
[iol-ion.tx :refer [upsert-entity]]
|
|
||||||
[auto-ap.graphql.utils :refer [assert-admin]]
|
[auto-ap.graphql.utils :refer [assert-admin]]
|
||||||
[clojure.data.csv :as csv]
|
[clojure.data.csv :as csv]
|
||||||
[clojure.edn :as edn]
|
[clojure.edn :as edn]
|
||||||
@@ -12,7 +11,7 @@
|
|||||||
[com.unbounce.dogstatsd.core :as statsd]
|
[com.unbounce.dogstatsd.core :as statsd]
|
||||||
[config.core :refer [env]]
|
[config.core :refer [env]]
|
||||||
[datomic.client.api :as dc]
|
[datomic.client.api :as dc]
|
||||||
|
[iol-ion.tx :refer [random-tempid upsert-entity]]
|
||||||
[ring.middleware.json :refer [wrap-json-response]]
|
[ring.middleware.json :refer [wrap-json-response]]
|
||||||
[ring.util.request :refer [body-string]]
|
[ring.util.request :refer [body-string]]
|
||||||
[unilog.context :as lc])
|
[unilog.context :as lc])
|
||||||
@@ -41,11 +40,13 @@
|
|||||||
|
|
||||||
|
|
||||||
(defn put-query [guid body note & [lookup-key client]]
|
(defn put-query [guid body note & [lookup-key client]]
|
||||||
(let [guid (if lookup-key
|
(let [id (pull-id (dc/db conn) [:saved-query/lookup-key lookup-key])
|
||||||
|
guid (if lookup-key
|
||||||
(or (pull-attr (dc/db conn) :saved-query/guid [:saved-query/lookup-key lookup-key])
|
(or (pull-attr (dc/db conn) :saved-query/guid [:saved-query/lookup-key lookup-key])
|
||||||
guid)
|
guid)
|
||||||
guid)]
|
guid)]
|
||||||
(dc/transact conn [`(upsert-entity ~{:saved-query/guid guid
|
(dc/transact conn [`(upsert-entity ~{:db/id (or id (random-tempid))
|
||||||
|
:saved-query/guid guid
|
||||||
:saved-query/description note
|
:saved-query/description note
|
||||||
:saved-query/key (str "queries/" guid)
|
:saved-query/key (str "queries/" guid)
|
||||||
:saved-query/client client
|
:saved-query/client client
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
or-join syntax changed?
|
|
||||||
(probably fixed) regex no longer supported as argument for query. Check vendor datomic for how to do it right.
|
|
||||||
it looks like there are a bbunch of orrphaned customizations for accounts, breaking indexes
|
it looks like there are a bbunch of orrphaned customizations for accounts, breaking indexes
|
||||||
ezcater graphql needs search index too
|
|
||||||
make sure that temporary ids are set on all new things when using upsert-entity
|
|
||||||
Wrap tests around every api call
|
|
||||||
upsertentity Look at how address works on client save. There's agood chance that we should make saving a rel with only a temp id just resolve it to null
|
|
||||||
upsertledger - matching transaction rule might not assign an account. Other things might not assign accounts. This is an assertion that is commented out. Determine consequence of disabling
|
upsertledger - matching transaction rule might not assign an account. Other things might not assign accounts. This is an assertion that is commented out. Determine consequence of disabling
|
||||||
Search for all usages of :reset or :pay or dollars=
|
|
||||||
|
|
||||||
Fix searching
|
Fix searching
|
||||||
* indexing should happen more regularly, and just look for changes since last time it was run
|
* indexing should happen more regularly, and just look for changes since last time it was run
|
||||||
@@ -39,3 +32,4 @@ Future improvements:
|
|||||||
Make reports just be based on running-balances
|
Make reports just be based on running-balances
|
||||||
get rid of account-groups
|
get rid of account-groups
|
||||||
move to solr
|
move to solr
|
||||||
|
upsertentity Look at how address works on client save. There's agood chance that we should make saving a rel with only a temp id just resolve it to null
|
||||||
|
|||||||
Reference in New Issue
Block a user