Makes integreat run on datomic cloud
This commit is contained in:
@@ -35,13 +35,13 @@
|
||||
:subscriptions))
|
||||
|
||||
(defn get-integrations []
|
||||
(d/q '[:find [(pull ?i [:ezcater-integration/api-key
|
||||
:ezcater-integration/subscriber-uuid
|
||||
:db/id
|
||||
:ezcater-integration/integration-status [:db/id]]) ...]
|
||||
:in $
|
||||
:where [?i :ezcater-integration/api-key]]
|
||||
(d/db conn)))
|
||||
(map first (d/q '[:find (pull ?i [:ezcater-integration/api-key
|
||||
:ezcater-integration/subscriber-uuid
|
||||
:db/id
|
||||
:ezcater-integration/integration-status [:db/id]])
|
||||
:in $
|
||||
:where [?i :ezcater-integration/api-key]]
|
||||
(d/db conn))))
|
||||
|
||||
(defn mark-integration-status [integration integration-status]
|
||||
@(d/transact conn
|
||||
@@ -63,12 +63,12 @@
|
||||
(defn upsert-used-subscriptions
|
||||
([integration]
|
||||
(let [extant (get-subscriptions integration)
|
||||
to-ensure (set (d/q '[:find [?cu ...]
|
||||
:in $
|
||||
:where [_ :client/ezcater-locations ?el]
|
||||
[?el :ezcater-location/caterer ?c]
|
||||
[?c :ezcater-caterer/uuid ?cu]]
|
||||
(d/db conn)))
|
||||
to-ensure (set (map first (d/q '[:find ?cu
|
||||
:in $
|
||||
:where [_ :client/ezcater-locations ?el]
|
||||
[?el :ezcater-location/caterer ?c]
|
||||
[?c :ezcater-caterer/uuid ?cu]]
|
||||
(d/db conn))))
|
||||
to-create (set/difference
|
||||
to-ensure
|
||||
(set (map :parentId extant)))]
|
||||
|
||||
Reference in New Issue
Block a user