BWN72T44GRRZ6K2OPN56FTLNEB7J7AGC7T2U5HSMLEKUPGJP2NUAC
parseLogEvent :: Object -> Parser LogEvent
parseLogEvent x =
(StartWork <$> x .: "start") <|> (StopWork <$> x .: "stop")
parseLogEntry :: Value -> Parser (C.UTCTime -> LogEntry)
parseLogEntry = unversion parseLogEntry' where
parseLogEntry' (Version 2 0) (Object x) = do
creditTo' <- x .: "creditTo" >>= parseCreditTo
eventCtr <- x .: "eventType" >>= nameEvent
eventMeta' <- x .: "eventMeta"
pure $ \t -> LogEntry creditTo' (eventCtr t) eventMeta'