<commit_before>(ns chat.client.schema
  (:require [cljs-uuid-utils.core :as uuid]))


(defn make-message [data]
  {:id (or (data :id) (uuid/make-random-squuid))
   :content (data :content)
   :thread-id (or (data :thread-id) (uuid/make-random-squuid))
   :group-id (data :group-id)
   :user-id (data :user-id)
   :created-at (or (data :created-at) (js/Date.))
   :mentioned-user-ids (or (data :mentioned-user-ids) [])
   :mentioned-tag-ids (or (data :mentioned-tag-ids) [])})

(defn make-tag [data]
  {:id (or (data :id) (uuid/make-random-squuid))
   :name (data :name)
   :group-id (data :group-id)
   :group-name (get data :group-name "")
   :description nil
   :threads-count 0
   :subscribers-count 0})

(defn make-group [data]
  {:id (or (data :id) (uuid/make-random-squuid))
   :name (data :name)
   :admins #{}
   :intro nil
   :avatar nil})

(defn make-invitation [data]
  {:id (or (data :id) (uuid/make-random-squuid))
   :invitee-email (data :invitee-email)
   :group-id (data :group-id)})<commit_msg>fix creating groups client side error<commit_after>(ns chat.client.schema
  (:require [cljs-uuid-utils.core :as uuid]))


(defn make-message [data]
  {:id (or (data :id) (uuid/make-random-squuid))
   :content (data :content)
   :thread-id (or (data :thread-id) (uuid/make-random-squuid))
   :group-id (data :group-id)
   :user-id (data :user-id)
   :created-at (or (data :created-at) (js/Date.))
   :mentioned-user-ids (or (data :mentioned-user-ids) [])
   :mentioned-tag-ids (or (data :mentioned-tag-ids) [])})

(defn make-tag [data]
  {:id (or (data :id) (uuid/make-random-squuid))
   :name (data :name)
   :group-id (data :group-id)
   :group-name (get data :group-name "")
   :description nil
   :threads-count 0
   :subscribers-count 0})

(defn make-group [data]
  {:id (or (data :id) (uuid/make-random-squuid))
   :name (data :name)
   :admins #{}
   :intro nil
   :avatar nil
   :public? false})

(defn make-invitation [data]
  {:id (or (data :id) (uuid/make-random-squuid))
   :invitee-email (data :invitee-email)
   :group-id (data :group-id)})
{'fraction_non_alphanumeric': 0.1928294573643411, 'fraction_numerical': 0.001937984496124031, 'mean_word_length': 3.5384615384615383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2616462', 'n_tokens_mistral': 852, 'n_tokens_neox': 821, 'n_words': 196}