Allows users to self set up square

This commit is contained in:
2022-04-06 08:22:52 -07:00
parent 982a0f3bed
commit 3a49ba971c
9 changed files with 303 additions and 239 deletions

View File

@@ -23,6 +23,10 @@
(defn get-all []
(->> (d/q '[:find (pull ?e [*
{:client/address [*]}
{:client/square-locations [:square-location/square-id
:square-location/name
:square-location/client-location
:db/id]}
{:client/bank-accounts [* {:bank-account/type [*]
:bank-account/yodlee-account [:yodlee-account/name :yodlee-account/id :yodlee-account/number]
:bank-account/plaid-account [:plaid-account/name :db/id :plaid-account/number :plaid-account/balance]

View File

@@ -250,5 +250,26 @@
:db/doc "The type of refund"
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}]]
:requires [:add-refunds]}})
:requires [:add-refunds]}
:add-square-locations-3 {:txes [[{:db/ident :client/square-auth-token
:db/doc "A token that can be used to authenticate with square"
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}
{:db/ident :client/square-locations
:db/doc "Locations in square"
:db/valueType :db.type/ref
:db/isComponent true
:db/cardinality :db.cardinality/many}
{:db/ident :square-location/square-id
:db/doc "An id for a location in square"
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}
{:db/ident :square-location/name
:db/doc "Name of the location in square e.g. Woodland Hills"
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}
{:db/ident :square-location/client-location
:db/doc "The client location that this location should match to. e.g. WH"
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}]]}})