Merge branch 'master' into datomic

This commit is contained in:
BC
2018-10-25 21:13:18 -07:00
6 changed files with 90 additions and 27 deletions

View File

@@ -3,7 +3,7 @@
[clojure.string :as str]))
(def date-regex #"[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}")
(def money-regex #"[0-9]+(\.[0-9]{1,2})?$")
(def money-regex #"\-?[0-9]+(\.[0-9]{1,2})?$")
(s/def ::identifier (s/nilable string?))
(s/def ::date (s/and string? #(re-matches date-regex %)))

View File

@@ -5,8 +5,7 @@
(def email-regex #"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$")
(s/def ::id int)
(s/def ::identifier (s/nilable string?))
(s/def ::required-identifier (s/and string?
(s/def ::identifier (s/nilable string?)) (s/def ::required-identifier (s/and string?
#(not (str/blank? %))))
(s/def ::name ::required-identifier)
@@ -17,14 +16,14 @@
(s/def ::phone (s/nilable string?))
(s/def ::invoice-reminder-schedule (s/nilable #{"Weekly" "Never" nil}))
(s/def ::primary-contact ::identifier)
(s/def ::primary-email ::email)
(s/def ::primary-phone ::phone)
(s/def ::primary-contact (s/nilable ::identifier))
(s/def ::primary-email (s/nilable ::email))
(s/def ::primary-phone (s/nilable ::phone))
(s/def ::secondary-contact ::identifier)
(s/def ::secondary-email ::email)
(s/def ::secondary-phone ::phone)
(s/def ::address ::address/address)
(s/def ::secondary-contact (s/nilable ::identifier))
(s/def ::secondary-email (s/nilable ::email))
(s/def ::secondary-phone (s/nilable ::phone))
(s/def ::address (s/nilable ::address/address))
(s/def ::default-expense-account int?)
(s/def ::code (s/nilable string?))