added basics of ccp processor visibility.
This commit is contained in:
@@ -341,10 +341,7 @@
|
||||
ledger/norms-map
|
||||
yodlee2/norms-map
|
||||
audit/norms-map
|
||||
|
||||
vendors/norms-map
|
||||
)
|
||||
]
|
||||
vendors/norms-map)]
|
||||
(println "Conforming database...")
|
||||
(c/ensure-conforms conn norms-map)
|
||||
#_(when (not (seq args))
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
:db/cardinality :db.cardinality/one}
|
||||
|
||||
]]}
|
||||
|
||||
:add-expected-deposits {:txes [[{:db/ident :expected-deposit/external-id
|
||||
:db/doc "The external id for the deposit"
|
||||
:db/valueType :db.type/string
|
||||
@@ -123,6 +124,7 @@
|
||||
:db/valueType :db.type/double
|
||||
:db/cardinality :db.cardinality/one}]]}
|
||||
|
||||
|
||||
:add-discounts {:txes [[{:db/ident :sales-order/discount
|
||||
:db/doc "The total amount on the sale"
|
||||
:db/valueType :db.type/double
|
||||
@@ -145,7 +147,21 @@
|
||||
{:db/ident :sales-order/service-charge
|
||||
:db/doc "The total cost on the item"
|
||||
:db/valueType :db.type/double
|
||||
:db/cardinality :db.cardinality/one}]]}})
|
||||
:db/cardinality :db.cardinality/one}]]}
|
||||
|
||||
:add-food-apps {:txes [[{:db/ident :ccp-processor/doordash
|
||||
:db/doc "Doordash identifier"}
|
||||
{:db/ident :ccp-processor/grubhub
|
||||
:db/doc "Grubhub identifier"}
|
||||
{:db/ident :ccp-processor/uber-eats
|
||||
:db/doc "Uber eats processor"}
|
||||
{:db/ident :ccp-processor/na
|
||||
:db/doc "No specific ccp processor"}
|
||||
|
||||
{:db/ident :charge/processor
|
||||
:db/doc "Which food app processed this order"
|
||||
:db/valueType :db.type/ref
|
||||
:db/cardinality :db.cardinality/one}]]}})
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,10 +8,15 @@
|
||||
|
||||
(defn <-datomic [result]
|
||||
(-> result
|
||||
(update :sales-order/date c/from-date)))
|
||||
(update :sales-order/date c/from-date)
|
||||
(update :sales-order/charges (fn [cs]
|
||||
(map (fn [c]
|
||||
(update c :charge/processor :db/ident))
|
||||
cs)))))
|
||||
|
||||
(def default-read '[*
|
||||
{:sales-order/client [:client/name :db/id :client/code]}])
|
||||
{:sales-order/client [:client/name :db/id :client/code]
|
||||
:sales-order/charges [* {:charge/processor [:db/ident]}]}])
|
||||
|
||||
(defn raw-graphql-ids [db args]
|
||||
(let [query (cond-> {:query {:find []
|
||||
|
||||
@@ -262,6 +262,7 @@
|
||||
:discount {:type :money}}}
|
||||
:charge
|
||||
{:fields {:id {:type :id}
|
||||
:processor {:type :processor}
|
||||
:type_name {:type 'String}
|
||||
:total {:type :money}
|
||||
:tip {:type :money}}}
|
||||
@@ -908,6 +909,11 @@
|
||||
:enums {:payment_type {:values [{:enum-value :check}
|
||||
{:enum-value :cash}
|
||||
{:enum-value :debit}]}
|
||||
|
||||
:processor {:values [{:enum-value :na}
|
||||
{:enum-value :doordash}
|
||||
{:enum-value :uber_eats}
|
||||
{:enum-value :grubhub}]}
|
||||
:tin_type {:values [{:enum-value :ein}
|
||||
{:enum-value :ssn}]}
|
||||
:type_1099 {:values [{:enum-value :none}
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
(defn location_id->client-location [location]
|
||||
({"2RVBYER6QSV7W" ["NGAK" "MH"]
|
||||
"8JT71V8XGYAT3" ["NGKG" "NB"]
|
||||
#_#_#_#_#_#_#_#_#_#_#_#_"8JT71V8XGYAT3" ["NGKG" "NB"]
|
||||
"SCX0Y8CTGM1S0" ["NGE1" "UC"]
|
||||
"FNH5VRT890WK8" ["NGMJ" "SC"]
|
||||
"AMQ0NPA8FGDEF" ["NGPG" "SZ"]
|
||||
@@ -175,6 +175,11 @@
|
||||
(remove-nils
|
||||
#:charge
|
||||
{:type-name (:type t)
|
||||
:processor (condp = (:note t)
|
||||
"DOORDASH" :ccp-processor/doordash
|
||||
"UBEREATS" :ccp-processor/uber-eats
|
||||
"GRUBHUB" :ccp-processor/grubhub
|
||||
:ccp-processor/na)
|
||||
:total (amount->money (:amount_money t))
|
||||
:tip (amount->money (:tip_money t))}))))
|
||||
:line-items (->> (:line_items order)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
:date-range (:date-range params)
|
||||
:client-id (:id @(re-frame/subscribe [::subs/client]))}
|
||||
[[:sales-orders [:id :total :tax :tip :discount :service-charge :returns :date
|
||||
[:charges [:type-name :total]]
|
||||
[:charges [:type-name :total :processor]]
|
||||
[:line-items [:item-name :total :category]]
|
||||
[:client [:name :id]]]]
|
||||
:total
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
[grid/cell {:class "has-text-right"} (nf total )]
|
||||
[grid/cell {:class "has-text-right"} (nf tax )]
|
||||
[grid/cell {:class "has-text-right"} (nf tip )]
|
||||
[grid/cell {} (str/join ", " (map :type-name charges))]
|
||||
[grid/cell {} (str/join ", " (map (fn [c]
|
||||
(str (:type-name c) " (" (name (:processor c)) ")")) charges))]
|
||||
[grid/cell {} (str/join ", " (map :item-name line-items))]
|
||||
[grid/button-cell {}
|
||||
[:div.buttons
|
||||
|
||||
Reference in New Issue
Block a user