minor bugfix.

This commit is contained in:
Bryce Covert
2022-05-08 16:16:38 -07:00
parent 4b4246fafa
commit 8f47b4bb2b
2 changed files with 8 additions and 10 deletions

View File

@@ -1,20 +1,20 @@
(ns auto-ap.square.core (ns auto-ap.square.core
(:require [auto-ap.datomic :refer [conn remove-nils]] (:require [auto-ap.datomic :refer [conn remove-nils]]
[auto-ap.time :as atime] [auto-ap.time :as atime]
[auto-ap.utils :refer [allow-once]]
[clj-http.client :as client] [clj-http.client :as client]
[clj-time.coerce :as coerce] [clj-time.coerce :as coerce]
[clj-time.core :as time] [clj-time.core :as time]
[clj-time.periodic :as periodic]
[clj-time.format :as f] [clj-time.format :as f]
[clojure.string :as str] [clj-time.periodic :as periodic]
[clojure.core.async :as async]
[clojure.data.json :as json] [clojure.data.json :as json]
[clojure.string :as str]
[clojure.tools.logging :as log] [clojure.tools.logging :as log]
[datomic.api :as d] [datomic.api :as d]
[mount.core :as mount] [mount.core :as mount]
[unilog.context :as lc] [unilog.context :as lc]
#_{:clj-kondo/ignore [:unused-namespace]} [yang.scheduler :as scheduler]))
[yang.scheduler :as scheduler]
[clojure.core.async :as async]))
(defn client-base-headers [client] (defn client-base-headers [client]
{"Square-Version" "2021-08-18" {"Square-Version" "2021-08-18"
@@ -481,12 +481,9 @@
(log/info "Loading refunds") (log/info "Loading refunds")
(upsert-refunds client)))) (upsert-refunds client))))
(def upsert-all (allow-once upsert-all))
(mount/defstate square-loader (mount/defstate square-loader
:start (scheduler/every (* 4 59 60 1000) upsert-all) :start (scheduler/every (* 4 59 60 1000) upsert-all)
:stop (scheduler/stop square-loader)) :stop (scheduler/stop square-loader))

View File

@@ -432,6 +432,7 @@
:field [:accounts] :field [:accounts]
:max (Math/abs (js/parseFloat (:amount data))) :max (Math/abs (js/parseFloat (:amount data)))
:descriptor "credit account" :descriptor "credit account"
:client (:client data)
:disabled (or (boolean (:payment data)) :disabled (or (boolean (:payment data))
should-disable-for-client?) should-disable-for-client?)
:locations locations}]) :locations locations}])