Permalink
Browse files

wip

* Save filepath with document for easier inspection
* Small bugfix whereby all the clients and registrants were thought to
  be the same being.
  • Loading branch information...
1 parent 30e493c commit 21c7d56b890dcc0f24a067316abc7d4f35fe1eb0 Zack Maril committed Jul 22, 2014
Showing with 5 additions and 21 deletions.
  1. +1 −0 src/echelon/core.clj
  2. +4 −21 src/echelon/load.clj
View
@@ -60,6 +60,7 @@
(map second)
(filter #(< 1 (count %)))
(map (partial map first))
+ disjoint-lists
(mapcat (partial merges-for-beings dbc))
(d/with dbc)
:db-after)]
View
@@ -66,6 +66,7 @@
:lobbying.form/source :lobbying.form/sopr-html
:lobbying.form/document-id (:document_id m)
+ :lobbying.form/filepath f
:lobbying.form/amendment
(-> m :registration_type :amendment)
@@ -111,7 +112,7 @@
(let [r (:registrant m)]
{:record/type :lobbying.record/registrant
:record/represents
- (if (m :client :client_self)
+ (if (-> m :client :client_self)
client-being-id
registrant-being-id)
:lobbying.registrant/name (:registrant_name r)
@@ -233,7 +234,8 @@
(doseq [datoms
(map (comp
registration-datoms
- (juxt identity (comp #(json/read-str % :key-fn keyword) slurp)))
+ (juxt (memfn getPath)
+ (comp #(json/read-str % :key-fn keyword) slurp)))
(list-registration-forms))
:when (not (contains-nil? datoms))]
@(d/transact conn datoms)))
@@ -246,22 +248,3 @@
(load-schema! conn)
(println "Data loading...")
(load-data! conn))
-
-(comment
- (->> (list-registration-forms)
- (map (comp #(json/read-str % :key-fn keyword)
- slurp))
- (filter (comp not empty? :affiliated_organizations) )
- first
-; (vector "")
- ;registration-datoms
- ))
-
-(comment
- (doseq [form (list-registration-forms)
- :when (-> form
- slurp
- (json/read-str :key-fn keyword)
- (#(registration-datoms ["" %] ))
- contains-nil?)]
- (println form)))

0 comments on commit 21c7d56

Please sign in to comment.