LCOV - code coverage report
Current view: top level - matchscore/db/postgres - outbox.clj Coverage Total Hit
Test: lcov.info Lines: 100.0 % 10 10
Test Date: 2026-11-23 18:11:10 Functions: - 0 0

            Line data    Source code
       1            4 : (ns matchscore.db.postgres.outbox
       2              :   (:require
       3              :    [cheshire.core :as json]
       4              :    [honey.sql :as sql]
       5              :    [next.jdbc :as jdbc]))
       6              : 
       7              : 
       8            4 : (defn insert-outbox-event!
       9              :  "Insert an outbox event within the given transaction/connection."
      10              :  [tx {:keys [aggregate-type aggregate-id event-type payload metadata]}]
      11            4 :  (let [query
      12           16 :        {:insert-into :outbox_events
      13           32 :         :values      [{:aggregate_type aggregate-type
      14           24 :                        :aggregate_id   [:cast (str aggregate-id) :uuid]
      15            4 :                        :event_type     event-type
      16           24 :                        :payload        [:cast (json/generate-string payload) :jsonb]
      17           40 :                        :metadata       [:cast (json/generate-string (or metadata {})) :jsonb]}]}]
      18           24 :    (jdbc/execute! tx (sql/format query))))
        

Generated by: LCOV version 2.0-1