Makes cloud functions installable remotely
This commit is contained in:
@@ -34,3 +34,19 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(defn regenerate-literals []
|
||||
(require 'com.github.ivarref.gen-fn)
|
||||
(spit
|
||||
"resources/functions.edn"
|
||||
(let [datomic-fn @(resolve 'com.github.ivarref.gen-fn/datomic-fn)]
|
||||
[(datomic-fn :pay #'iol-ion.tx.pay/pay)
|
||||
(datomic-fn :plus #'iol-ion.tx.plus/plus)
|
||||
(datomic-fn :propose-invoice #'iol-ion.tx.propose-invoice/propose-invoice)
|
||||
(datomic-fn :reset-rels #'iol-ion.tx.reset-rels/reset-rels)
|
||||
(datomic-fn :reset-scalars #'iol-ion.tx.reset-scalars/reset-scalars)
|
||||
(datomic-fn :upsert-entity #'iol-ion.tx.upsert-entity/upsert-entity)
|
||||
(datomic-fn :upsert-invoice #'iol-ion.tx.upsert-invoice/upsert-invoice)
|
||||
(datomic-fn :upsert-ledger #'iol-ion.tx.upsert-ledger/upsert-ledger)
|
||||
(datomic-fn :upsert-transaction #'iol-ion.tx.upsert-transaction/upsert-transaction)])))
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
(datomic.api/cancel {:cognitect.anomalies/category :cognitect.anomalies/incorrect
|
||||
:cognitect.anomalies/message
|
||||
(str "Cannot upsert without :db/id or :db/ident, " entity)}))
|
||||
[]
|
||||
(let [e (or (:db/id entity) (:db/ident entity))
|
||||
is-new? (string? e)
|
||||
extant-entity (when-not is-new?
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
)
|
||||
|
||||
(defn upsert-invoice [db invoice]
|
||||
(println invoice)
|
||||
(let [upserted-entity [[:upsert-entity invoice]]
|
||||
with-invoice (dc/with db upserted-entity)
|
||||
invoice-id (or (-> with-invoice :tempids (get (:db/id invoice)))
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
(:journal-entry-line/client+account+location+date jel)
|
||||
(:db/id jel)]
|
||||
})
|
||||
(filter (fn line-must-match-client-account-location [result]
|
||||
(take-while (fn line-must-match-client-account-location [result]
|
||||
(and
|
||||
(= (take 3 (:journal-entry-line/client+account+location+date result))
|
||||
(take 3 (:journal-entry-line/client+account+location+date jel)))
|
||||
|
||||
Reference in New Issue
Block a user