I'm late to the party, but I think this library really helps with those sorts of nested maps
(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))))
This approach helps you see what a trip looks like without rebuilding it in your head
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