removed old database stuff, just left what's needed for importing

This commit is contained in:
BC
2019-01-10 20:28:17 -08:00
parent 13620fe57f
commit 7151adbfdf
8 changed files with 0 additions and 463 deletions

View File

@@ -26,32 +26,3 @@
(defn get-all []
(map data->fields (query base-query)))
(defn get-by-id [id]
(first (map data->fields
(query (-> base-query
(helpers/merge-where [:= :id id]))))))
(defn upsert [id data]
(-> (sql/build
:update :companies
:set (clj->db (select-keys (fields->data data) all-fields))
:where [:= :id (if (int? id)
id
(Integer/parseInt id))])
execute!)
(get-by-id (if (int? id)
id
(Integer/parseInt id))))
(defn add-bank-account [id bank-account]
(let [company (get-by-id id)
company (update company :bank-accounts
(fn [ba]
(let [next-id (inc (apply max (conj (map :id ba) 0)))]
(conj (vec ba) (assoc bank-account :id next-id)))))]
(upsert id company)))