<commit_before>(ns salava.extra.application.schemas
  (:require [schema.core :as s
             :include-macros true]  ;; cljs only
            ))

(s/defschema Applications  {:iframe (s/maybe s/Str)
                            :language (s/maybe s/Str)})

(s/defschema BadgeAdvert {:id                    s/Int
                          :remote_url            s/Str
                          :remote_id             s/Str
                          :remote_issuer_id      s/Str
                          :info                  s/Str
                          :application_url       s/Str
                          :application_url_label (s/maybe s/Str)
                          :issuer_content_id     s/Str
                          :badge_content_id      s/Str
                          :criteria_content_id   s/Str
                          :criteria_url          s/Str
                          :kind                  (s/enum "application" "advert")
                          :country               s/Str
                          :not_before            s/Int
                          :not_after             s/Int
                          :ctime                 s/Int
                          :mtime                 s/Int
                          :deleted               s/Bool})

(s/defschema BadgeAdvertPublish (-> BadgeAdvert
                                    (dissoc :id :issuer_content_id :badge_content_id
                                            :criteria_content_id :ctime :mtime :deleted)
                                    (assoc :badge s/Str :client s/Str)))

(s/defschema BadgeAdvertUnpublish {:remote_url       s/Str
                                   :remote_id        s/Str
                                   :remote_issuer_id s/Str})



(s/defschema BadgeAdvertModal (-> BadgeAdvert
                                  (dissoc :issuer_content_id :badge_content_id
                                                       :criteria_content_id :ctime :deleted :remote_url :remote_id :remote_issuer_id)
                                    (assoc :followed s/Int
                                           :image_file (s/maybe s/Str)
                                           :description (s/maybe s/Str)
                                           :issuer_content_url  (s/maybe s/Str)
                                           :issuer_content_name (s/maybe s/Str)
                                           :name s/Str
                                           (s/optional-key :tags) (s/maybe s/Str)
                                           (s/optional-key :issuer_contact) (s/maybe s/Str)<commit_msg>Badge adverts, added remote issuer tier and banner to schema<commit_after>(ns salava.extra.application.schemas
  (:require [schema.core :as s
             :include-macros true]  ;; cljs only
            ))

(s/defschema Applications  {:iframe (s/maybe s/Str)
                            :language (s/maybe s/Str)})

(s/defschema BadgeAdvert {:id                    s/Int
                          :remote_url            s/Str
                          :remote_id             s/Str
                          :remote_issuer_id      s/Str
                          :info                  s/Str
                          :application_url       s/Str
                          :application_url_label (s/maybe s/Str)
                          :issuer_content_id     s/Str
                          :badge_content_id      s/Str
                          :criteria_content_id   s/Str
                          :criteria_url          s/Str
                          :kind                  (s/enum "application" "advert")
                          :country               s/Str
                          :not_before            s/Int
                          :not_after             s/Int
                          :ctime                 s/Int
                          :mtime                 s/Int
                          :deleted               s/Bool})

(s/defschema BadgeAdvertPublish (-> BadgeAdvert
                                    (dissoc :id :issuer_content_id :badge_content_id
                                            :criteria_content_id :ctime :mtime :deleted)
                                    (assoc :badge  s/Str
                                           :client s/Str
                                           :remote_issuer_tier   s/Str
                                           :remote_issuer_banner (s/maybe s/Str))))

(s/defschema BadgeAdvertUnpublish {:remote_url       s/Str
                                   :remote_id        s/Str
                                   :remote_issuer_id s/Str})



(s/defschema BadgeAdvertModal (-> BadgeAdvert
                                  (dissoc :issuer_content_id :badge_content_id
                                                       :criteria_content_id :ctime :deleted :remote_url :remote_id :remote_issuer_id)
                                    (assoc :followed s/Int
                                           :image_file (s/maybe s/Str)
                                           :description (s/maybe s/Str)
                                           :issuer_content_url  (s/maybe s/Str)
                                           :issuer_content_name (s/maybe s/Str)
                                           :name s/Str
                                           (s/optional-key :tags) (s/maybe s/Str)
                                           (s/optional-key :issuer_contact) (s/maybe s/Str)
{'fraction_non_alphanumeric': 0.0651501364877161, 'fraction_numerical': 0.0, 'mean_word_length': 0.7414448669201521, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 54, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4546842', 'n_tokens_mistral': 1294, 'n_tokens_neox': 1254, 'n_words': 253}