parent
f7460f320e
commit
78a340a1d0
@ -0,0 +1,8 @@
|
||||
(ns beherbergung.db.import.offer.ngo.warhelp
|
||||
(:require [clojure.edn]
|
||||
[beherbergung.model.offer-mapping.core :refer [unify]]
|
||||
[beherbergung.model.offer-mapping.warhelp]))
|
||||
|
||||
(defn importfile->table [file]
|
||||
(take 5 (unify (clojure.edn/read-string (slurp file)) ;; TODO all
|
||||
beherbergung.model.offer-mapping.warhelp/mapping)))
|
@ -0,0 +1,32 @@
|
||||
(ns beherbergung.model.offer-mapping.warhelp
|
||||
(:require [clojure.spec.alpha :as s]
|
||||
[beherbergung.model.offer :refer [int_string]]
|
||||
[clojure.string :refer [split]]))
|
||||
|
||||
(defn split_user_string
|
||||
"TODO handle common separators entered by users like `,` or `and`"
|
||||
[s]
|
||||
(split s #" "))
|
||||
|
||||
(def mapping {:id_tmp #(or (not-empty (get % "E-Mail ")) (get % "Phone"))
|
||||
|
||||
:time_from_str (constantly nil)
|
||||
:time_duration_str "Available from- , to / Verfügbar von- bis"
|
||||
|
||||
:beds "How many people can you host? / Wievielen Menschen können sie Unterkunft bieten?"
|
||||
:languages ["The language you speak / Gesprochene Sprachen" split_user_string]
|
||||
|
||||
:place_country "Country / Land"
|
||||
:place_city (constantly nil)
|
||||
:place_zip (constantly nil)
|
||||
:place_street (constantly nil)
|
||||
:place_street_number (constantly nil)
|
||||
|
||||
:accessible (constantly nil)
|
||||
:animals_allowed (constantly nil)
|
||||
:animals_present (constantly nil)
|
||||
|
||||
:contact_name_full "Name "
|
||||
:contact_phone "Phone"
|
||||
:contact_email "E-Mail "
|
||||
:note "Anything else to keep in mind? Animals? Allergies? / Gibt es sonst noch etwas zu bedenken? Tiere? Allergien?"})
|
Loading…
Reference in new issue