    (enum :transaction.source/unmark-sent-email)
    (enum :transaction.source/mark-sent-email)
    (enum :transaction.source/migration)
+
+   (attribute :transaction/document
+              :db.type/ref
+              :db/doc "Annotates transaction with document it belongs to")
 
    (attribute :migration
               :db.type/ref

   (attribute :chat/color
              :db.type/string
              :metadata/unescaped true)

   (attribute :server/timestamp
              :db.type/instant)

              :db.type/long
              :db/doc "db/id of this layer's parent. Could be called \"parent\", but want to avoid confusion with \"child\", which is taken.")

   (attribute :layer/document
              :db.type/ref
              :db/doc "Document that the layer belongs to")

   ;; No logins at the moment, so we'll use this to identify users
   ;; chats rely on this, is it a good idea? Nice to have something stable across tabs
   (attribute :session/uuid
