hopefully makes the insights page show correct
This commit is contained in:
137
scratch-sessions/setting-up-admin-assignments.repl
Normal file
137
scratch-sessions/setting-up-admin-assignments.repl
Normal file
@@ -0,0 +1,137 @@
|
||||
;; This buffer is for Clojure experiments and evaluation.
|
||||
|
||||
;; Press C-j to evaluate the last expression.
|
||||
|
||||
;; You can also press C-u C-j to evaluate the expression and pretty-print its result.
|
||||
|
||||
(def in
|
||||
"Sushi Con - CB Quarterly/ Prepayments Ashlee
|
||||
Sushi Con - SJ Quarterly/ Prepayments Ashlee
|
||||
SC Morgan Hill LP Quarterly/ Prepayments Ashlee
|
||||
Lous Coffee Monthly Return Ashlee
|
||||
Breakfast Club - MORGAN HILL Quarterly/Prepayments Ashlee
|
||||
Bills Fremont LLC Quarterly/ Prepayments Ashlee
|
||||
MT Boxes 2 LLC - Bill's Café PA Quarterly/ Prepayments Ashlee
|
||||
MT Boxes LLC - Philz Coffee Quarterly/ Prepayments Ashlee
|
||||
NTG - Fountains/Roseville Quarterly/ Prepayments Ashlee
|
||||
NTG - Fremont Quarterly/ Prepayments Ashlee
|
||||
NTG - ELk Grove Quarterly/ Prepayments Ashlee
|
||||
NTG Roseville Quarterly/ Prepayments Ashlee
|
||||
NTG - San Carlos Gyro House Quarterly/ Prepayments Ashlee
|
||||
NTG - Wellborne TX Due on 20th Quarterly/ Prepayments Ashlee
|
||||
NTG - Visalia Quarterly/ Prepayments Ashlee
|
||||
NTG - University TX Due on 20th Quarterly/ Prepayments Ashlee
|
||||
NTG - St George Quarterly/ Prepayments (do restuarant tax quarterly) Ashlee
|
||||
NTG - Danville Quarterly/ Prepayments Ashlee
|
||||
NTG - Dublin - Dublin Greek Eats Quarterly/ Prepayments Ashlee
|
||||
NTG - Vacaville Greek Eats Quarterly/ Prepayments Ashlee
|
||||
NTG - Pacific Greek Eats Quarterly/ Prepayments Ashlee
|
||||
NTG Concord Quarterly/ Prepayments Ashlee
|
||||
NTG Davis Quarterly/ Prepayments Ashlee
|
||||
NTG Walnut Creek Quarterly/ Prepayments Ashlee
|
||||
NTG Oyster Point Quarterly/ Prepayments Ashlee
|
||||
NTG - Clayton Quarterly/Prepayments Ashlee
|
||||
NTG - Fort Apache Nevada: Monthly file and pay Ashlee
|
||||
NTG - Henderson Nevada: Monthly file and pay Ashlee
|
||||
Monstera Plant Lounge Quarterly Only Ben for now
|
||||
NTG State Line Monthly Return Gina
|
||||
NTG Olathe (Kansas State Sales Tax) Monthly Return Gina
|
||||
NTG - Union City - ENTG1 LLC Quarterly/ Prepayments Gina
|
||||
NTG Santa Rosa Quarterly/ Prepayments Gina
|
||||
Elia Quarterly/ Prepayments Gina
|
||||
Sultan's Kebab - A&F Quarterly/ Prepayments Gina
|
||||
Sultan's Kebab - Ulas Inc Quarterly/ Prepayments Gina
|
||||
Bagel Box (New, Ben did July's prepayment) Quarterly/ Prepayments Gina
|
||||
NTG - San Mateo - Lakonia Ltd LLC Quarterly/ Prepayments Gina
|
||||
NTG Fullerton Quarterly/ Prepayments Gina
|
||||
NTG - Bridgepoint Harvester Quarterly/ Prepayments Gina
|
||||
NTG Daly City - Harvester Quarterly/ Prepayments Gina
|
||||
NTG Gellert - Harvester Quarterly/ Prepayments Gina
|
||||
NTG San Francisco Quarterly/ Prepayments Gina
|
||||
Akiko LLC - NTG Quarterly/ Prepayments Gina
|
||||
NTG - Gilroy Quarterly/ Prepayments Gina
|
||||
NTG - Monterey Quarterly/ Prepayments Gina
|
||||
NTG - Fresno - Gyros in Motion Quarterly/ Prepayments Gina
|
||||
NTG - VGZ Burgers Quarterly/ Prepayments Gina
|
||||
NTG Vallejo Quarterly/ Prepayments Gina
|
||||
NTG - Newport - KSHRIG LLC Quarterly/ Prepayments Gina
|
||||
NTG Brentwood KTMM Quarterly/ Prepayments Gina
|
||||
NTG Brentwood LLC Quarterly/ Prepayments Gina
|
||||
NTG SLO Quarterly/ Prepayments Gina
|
||||
NTG San Diego - Enzo Quarterly/ Prepayments Gina
|
||||
Odeum Quarterly/ Prepayments Gina
|
||||
Penolope's CT Quarterly/ Prepayments Gina
|
||||
Penelope's Spear Quarterly/ Prepayments Gina
|
||||
Sandwich Monkey Quarterly/ Prepayments Gina
|
||||
NTG - UCLA/westwood - Aphrodite One LLC Quarterly/ Prepayments Ashlee
|
||||
NTG - Zero To Sixty Quarterly/ Prepayments Ashlee
|
||||
NTG Santa Monica Quarterly/ Prepayments Ashlee
|
||||
NTG Westlake Quarterly/ Prepayments Ashlee
|
||||
NTG Woodland Hills Quarterly/ Prepayments Ashlee
|
||||
NTG Phoenix Monthly Return Kyle
|
||||
NTG Hayward Quarterly/ Prepayments Kyle
|
||||
NTG Hollywood Quarterly/ Prepayments Kyle
|
||||
NTG Novato SamZee LLC Quarterly/ Prepayments Kyle
|
||||
NTG San Leandro Quarterly/ Prepayments Kyle
|
||||
NTG Castro Valley Quarterly/ Prepayments Kyle
|
||||
NTG Livermore Giannos Gyros Quarterly/ Prepayments Kyle
|
||||
NTG River Bank Giannos Gyros Quarterly/ Prepayments Kyle
|
||||
MDB21 Inc dba Naschmarkt Quarterly/ Prepayments Kyle
|
||||
MDBPA Quarterly/ Prepayments Kyle
|
||||
Anatolian Kitchen Quarterly/ Prepayments Kyle
|
||||
Campbell Creamery - Shree Sairam LLC Annual 6/30 Kyle
|
||||
Lean Feast Humble Hustler Annual Kyle
|
||||
Bella Saratoga Quarterly/ Prepayments Kyle
|
||||
Brown Chicken Brown Cow Quarterly/ Prepayments Kyle
|
||||
Frost Cupcake Factory Quarterly Only Kyle
|
||||
Hiro Mura Quarterly/ Prepayments Kyle
|
||||
Mio Vicino - SC Quarterly/ Prepayments Kyle
|
||||
Orale Mex Grill Quarterly/ Prepayments Kyle
|
||||
Piatto Piccolo LLC (Vin Santo) Quarterly/ Prepayments Kyle
|
||||
Poke Poke Fish Bar LLC Quarterly/ Prepayments Kyle
|
||||
Roberto's Cantina Quarterly/ Prepayments Kyle
|
||||
Savory Kitchen Quarterly/ Prepayments Kyle
|
||||
Sorelle Italian Bistro Quarterly/ Prepayments Kyle
|
||||
Warm Elements Quarterly/ Prepayments Kyle
|
||||
Willow Glen Creamery Quarterly Only Kyle"
|
||||
)
|
||||
|
||||
(def parsed
|
||||
(->> (clojure.data.csv/read-csv in :separator \tab)
|
||||
(map (fn [[client-stuff _ person]]
|
||||
{:search client-stuff
|
||||
:client-id (some->> {"query" (format "_text_:\"%s \"" (->> (-> client-stuff
|
||||
(str/replace "NTG" "Nick the Greek")
|
||||
(str/replace "Sushi Con" "Sushi Confidential")
|
||||
(str/split #" "))
|
||||
(str/join " ")))
|
||||
"fields" "id"}
|
||||
(solr/query solr/impl "clients")
|
||||
(map :id)
|
||||
first
|
||||
Long/parseLong)
|
||||
:person person
|
||||
:user-id ({"Gina" 17592278867066
|
||||
"Kyle" 17592196388717
|
||||
"Ashlee" 17592255266681
|
||||
"Ben" 17592186109010} person)}
|
||||
))))
|
||||
|
||||
@(dc/transact conn
|
||||
(->> parsed
|
||||
(filter :client-id)
|
||||
(filter :user-id)
|
||||
(map (fn [x]
|
||||
[:db/add (:user-id x) :user/clients (:client-id x)]))))
|
||||
|
||||
(->> parsed
|
||||
(filter (fn [x]
|
||||
(or (not (:client-id x))
|
||||
(not (:user-id x)))))
|
||||
(group-by :person)
|
||||
(map (fn [[p v]]
|
||||
[p (map :search v)]))
|
||||
(into {}))
|
||||
|
||||
(user/init-repl)
|
||||
|
||||
Reference in New Issue
Block a user