All data on checks are now set up.

This commit is contained in:
Bryce Covert
2018-05-17 20:06:46 -07:00
parent e055a1e120
commit 03dd882da4
8 changed files with 79 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
(ns auto-ap.entities.vendors
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]))
[clojure.string :as str]
[auto-ap.entities.address :as address]))
(def email-regex #"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$")
(s/def ::id int)
@@ -14,7 +15,6 @@
:is-empty #(= % "")))))
(s/def ::phone (s/nilable string?))
(s/def ::data (s/nilable string?))
(s/def ::invoice-reminder-schedule (s/nilable #{"Weekly" "Never" nil}))
(s/def ::primary-contact ::identifier)
(s/def ::primary-email ::email)
@@ -23,13 +23,9 @@
(s/def ::secondary-contact ::identifier)
(s/def ::secondary-email ::email)
(s/def ::secondary-phone ::phone)
(s/def ::address ::address/address)
(s/def ::code (s/nilable string?))
(s/def ::address1 (s/nilable string?))
(s/def ::address2 (s/nilable string?))
(s/def ::city (s/nilable string?))
(s/def ::state (s/nilable string?))
(s/def ::zip (s/nilable string?))
(s/def ::vendor (s/keys :req-un [::name]
:opt-un [::code
@@ -41,11 +37,8 @@
::secondary-contact
::secondary-email
::secondary-phone
::address1
::address2
::city
::state
::zip]))
::address
]))
(def vendor-spec (apply hash-map (drop 1 (s/form ::vendor))))