code-reviews

escherize 2019-09-24T21:57:25.019500Z

I'm late to the party, but I think this library really helps with those sorts of nested maps

escherize 2019-09-24T21:57:28.019700Z

(deftrack good-trip?
  {:id trip-id
   :tripData {:startLocation start
              :endLocation end
              :segments segs}
   :tenantId tid
   :device {:id device-id}
   :accuracy accuracy}
  (and trip-id start end segs tid device-id accuracy
       (not (#{"BAD" "UNUSABLE"} accuracy))))

escherize 2019-09-24T21:58:13.020100Z

This approach helps you see what a trip looks like without rebuilding it in your head

escherize 2019-09-24T21:59:37.020500Z

this makes a function called good-trip? that you can call like so:

(good-trip?
 {:id 123
  :tripData {:startLocation 2323
             :endLocation 4545
             :segments [1 2 3]}
  :tenantId 99
  :device {:id 22}
  :accuracy "GOOD"})
;; => true