added start date.

This commit is contained in:
Bryce Covert
2020-08-26 06:31:49 -07:00
parent 4ac3e31e91
commit 1832aad335
8 changed files with 293 additions and 242 deletions

View File

@@ -44,7 +44,7 @@
:graphql {:token token
:query-obj {:venia/queries [[:client
[:id :name :code :email :matches :week-a-debits :week-a-credits :week-b-debits :week-b-credits :locations [:location-matches [:id :location :match]] [:bank-accounts [:id :code :number :bank-name :bank-code :check-number :name :routing :type :sort-order :visible :yodlee-account-id :locations :include-in-reports] ]
[:id :name :code :email :matches :week-a-debits :week-a-credits :week-b-debits :week-b-credits :locations [:location-matches [:id :location :match]] [:bank-accounts [:id :start-date :code :number :bank-name :bank-code :check-number :name :routing :type :sort-order :visible :yodlee-account-id :locations :include-in-reports] ]
[:address [:street1 :street2 :city :state :zip]]
[:forecasted-transactions [:id :amount :identifier :day-of-month]]]]
[:vendor
@@ -77,7 +77,7 @@
:query-obj {:venia/queries [[:client
[:id :name :code :matches :locations :week-a-debits :week-a-credits :week-b-debits :week-b-credits [:location-matches [:id :location :match]]
[:address [:street1 :street2 :city :state :zip]]
[:bank-accounts [:id :code :number :bank-name :bank-code :check-number :name :routing :type :sort-order :visible :yodlee-account-id :locations :include-in-reports] ]
[:bank-accounts [:id :start-date :code :number :bank-name :bank-code :check-number :name :routing :type :sort-order :visible :yodlee-account-id :locations :include-in-reports] ]
[:forecasted-transactions [:id :amount :identifier :day-of-month]]]]
[:vendor
vendor-query]

View File

@@ -4,7 +4,7 @@
[auto-ap.subs :as subs]
[auto-ap.views.components.address :refer [address-field]]
[auto-ap.views.components.layouts :refer [side-bar]]
[auto-ap.views.utils :refer [dispatch-event horizontal-field nf multi-field]]
[auto-ap.views.utils :refer [dispatch-event horizontal-field nf multi-field date-picker standard date->str]]
[cljs-time.coerce :as coerce]
[cljs-time.core :as t]
[clojure.spec.alpha :as s]
@@ -44,11 +44,20 @@
:identifier identifier
:amount amount})
(:forecasted-transactions new-client-data))
:bank-accounts (map (fn [{:keys [number name check-number include-in-reports type id code bank-name routing bank-code new? sort-order visible yodlee-account-id locations]}]
:bank-accounts (map (fn [{:keys [number name check-number include-in-reports type id code start-date bank-name routing bank-code new? sort-order visible yodlee-account-id locations]}]
{:number number
:name name
:check-number check-number
:include-in-reports include-in-reports
:start-date (cond (not start-date)
nil
(instance? goog.date.Date start-date)
(date->str start-date standard)
:else
start-date
)
:type type
:id id
:sort-order sort-order
@@ -101,7 +110,7 @@
[:location-matches [:location :match :id]]
[:address [:street1 :street2 :city :state :zip]]
[:forecasted-transactions [:id :amount :identifier :day-of-month]]
[:bank-accounts [:id :number :check-number :name :code :bank-code :bank-name :routing :type :visible :yodlee-account-id :sort-order :locations]]]]}]}
[:bank-accounts [:id :number :start-date :check-number :name :code :bank-code :bank-name :routing :type :visible :yodlee-account-id :sort-order :locations]]]]}]}
:on-success [::save-complete]
:on-error [::forms/save-error ::form]}})))
(re-frame/reg-event-db
@@ -231,7 +240,17 @@
[field "Nickname"
[:input.input {:placeholder "BOA Checking #1"
:type "text"
:field [:bank-accounts sort-order :name]}]]]
:field [:bank-accounts sort-order :name]}]]
[field "Start date"
[date-picker {:class-name "input"
:class "input"
:format-week-number (fn [] "")
:previous-month-button-label ""
:placeholder "mm/dd/yyyy"
:next-month-button-label ""
:next-month-label ""
:type "date"
:field [:bank-accounts sort-order :start-date]}]]]
(when (#{:check ":check"} type )
[:div