(ns auto-ap.entities.invoice
  (:require [clojure.spec.alpha :as s]
            [auto-ap.entities.shared :as shared]))

(s/def ::vendor-id string?)
(s/def ::vendor-name string?)
(s/def ::client-id string?)
(s/def ::invoice-number ::shared/required-identifier)
(s/def ::date ::shared/date)
(s/def ::total ::shared/money)

(s/def ::invoice (s/keys :req-un [::client-id
                                  ::invoice-number
                                  ::date
                                  ::vendor-id
                                  ::total]
                         :opt-un [
                                  ::vendor-name]))
