supports starting from scratch.

This commit is contained in:
Bryce Covert
2019-04-12 22:07:19 -07:00
parent 53c80e13ee
commit e02cb2f646
3 changed files with 26 additions and 10 deletions

View File

@@ -23,11 +23,16 @@
:db/doc "The location of the location match"}
]])
(def add-starter
[[{:db/id [:client/code "CBC"]
:client/matches ["campbell brewing company"]
:client/location-matches [{:location-match/location "CB"
:location-match/matches ["campbell brewing company"]}]}]])
(defn add-starter [conn]
(if (seq (d/query {:query {:find '[?e]
:in ['$]
:where ['[?e :client/code "CBC"]]}
:args [(d/db conn)]}))
[[{:db/id [:client/code "CBC"]
:client/matches ["campbell brewing company"]
:client/location-matches [{:location-match/location "CB"
:location-match/matches ["campbell brewing company"]}]}]]
[[]]))
(defn add-default-location [conn]
[[{:db/ident :client/default-location
@@ -36,8 +41,13 @@
:db/doc "The default location if one can't be found"}]])
(defn add-default-location-2 [conn]
[[{:db/id [:client/code "CBC"]
:client/default-location "CB"}]])
(if (seq (d/query {:query {:find '[?e]
:in ['$]
:where ['[?e :client/code "CBC"]]}
:args [(d/db conn)]}))
[[{:db/id [:client/code "CBC"]
:client/default-location "CB"}]]
[[]]))
(def add-import-status
[[{:db/ident :invoice/import-status