Supports editing expense accounts

This commit is contained in:
Bryce Covert
2019-04-12 12:00:42 -07:00
parent bdb06d802b
commit e64820d71a
6 changed files with 119 additions and 53 deletions

View File

@@ -0,0 +1,16 @@
(ns auto-ap.entities.account
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]
[auto-ap.entities.shared :as shared]))
(def numeric-regex #"^[0-9]+$")
(s/def ::account-set string?)
(s/def ::numeric-code (s/or :numericstring? (s/and string?
#(re-matches numeric-regex %))
:numeric? int?))
(s/def ::name string?)
(s/def ::type #{:dividend :expense :asset :liability :equities :revenue})
(s/def ::account (s/keys :req-un [::account-set ::numeric-code ::name ::type]))