(ns servisne-info.tasks.daily-report
  (:require [servisne-info.logging :as l]
            [servisne-info.notifications :refer [send-daily-report-email]]
            [servisne-info.repository :as repo]
            [servisne-info.tasks.task-definition :refer [deftask]]))

(defn- format-event-data [event]
  (l/format-data (dissoc event :_id)))

(defn send-daily-report []
  (let [events (repo/find-events-for-yesterday)]
    (send-daily-report-email (map format-event-data events))))

(def send-daily-report-task
  (deftask "send daily report"
    (send-daily-report)))

(ns servisne-info.tasks.daily-report
  (:require [servisne-info.logging :as l]
            [servisne-info.notifications :refer [send-daily-report-email]]
            [servisne-info.repository :as repo]
            [servisne-info.tasks.task-definition :refer [deftask]]))

(defn- format-event-data [event]
  (l/format-data (dissoc event :_id :created-at)))

(defn send-daily-report []
  (let [events (repo/find-events-for-yesterday)]
    (send-daily-report-email (map format-event-data events))))

(def send-daily-report-task
  (deftask "send daily report"
    (send-daily-report)))

Remove created-at from daily report
Remove created-at from daily report

strika/servisne.info,darkofabijan/servisne.info,darkofabijan/servisne.info,strika/servisne.info