 (defrecord SocialGroup []
   Entity->Rest
   (create [this]
-    (post-entity :socialgroup this))
-  (fetch [this]
-    (fetch-entity :socialgroup this)))
+    (post-entity :socialGroup this))
+  (fetch [this]
+    (fetch-entity :socialGroup this)))
 
 (defrecord Residency []
   Entity->Rest
   (create [this]
-    (->> (nest-uuid :individual this)
-         (nest-uuid :location this)
-         (post-entity :residency this)))
+    (->> this
+         (nest-uuid :individual)
+         (nest-uuid :location)
+         (post-entity :residency)))
   (fetch [this]
     (fetch-entity :residency this)))
 
 (defrecord Membership []
   Entity->Rest
   (create [this]
-    (->> (nest-uuid :individual this)
-         (nest-uuid :socialGroup this)
-         (post-entity :membership this)))
+    (->> this
+         (nest-uuid :individual)
+         (nest-uuid :socialGroup)
+         (post-entity :membership)))
   (fetch [this]
     (fetch-entity :membership this)))
 
 (defrecord Relationship []
   Entity->Rest
   (create [this]
-    (->> (nest-uuid :individualA this)
-         (nest-uuid :individualB this)
-         (post-entity :relationship this)))
+    (->> this
+         (nest-uuid :individualA)
+         (nest-uuid :individualB)
+         (post-entity :relationship)))
   (fetch [this]
     (fetch-entity :relationship this)))
 

  (get-entity (bulk-url locations-url) :locations))


;;;;;;;;;;;;;;;;;;;;;;
;;;; Manual Tests ;;;;
(comment

  (create (map->Location {:name "test location"
                          :extId "test location"
                          :type "RURAL"
                          :collectionDateTime "2016-08-01T00:56:55.920Z"
                          :collectedByUuid "UNKNOWN_STATUS"}))



  (find-user {:username "user"
              :password "password"})

  (find-fieldworker {:username "fieldworker"
                     :password "password"})

  (create-location
   {:name "test location"
    :extId "test location"
    :type "RURAL"
    :collectionDateTime "2016-08-01T00:56:55.920Z"
    :collectedByUuid "UNKNOWN_STATUS"})
  )


(def urls {:location "/locations"
           :individual "/individuals"
           :socialGroup "/socialGroups"
           :residency "/residencies"
           :membership "/memberships"
           :relationship "/relationships"
