[agent]
id.column = 'import_id'
id.type = 'string'

_deleted.column = 'deleted'
_deleted.type = 'int'
_deleted.value = '0'

jmeno_cele.column = 'full_name'
jmeno_cele.type = 'string'

telefon.column = 'phone_work'
telefon.type = 'string'

email.column = 'email_work'
email.type = 'string'

[object]
id.column = 'import_id'
id.type = 'string'

nemovitost_uir_stat.column = 'state_id'
nemovitost_uir_stat.type = 'int'
; převod v PHP

nemovitost_uir_kraj_kod.column = 'county_id'
nemovitost_uir_kraj_kod.type = 'int'

nemovitost_uir_okres_kod.column = 'district_id'
nemovitost_uir_okres_kod.type = 'int'

nemovitost_uir_obec_kod.column = 'region_id'
nemovitost_uir_obec_kod.type = 'int'

citypart_id.column = 'citypart_id'
citypart_id.type = 'int'

street_id.column = 'street_id'
street_id.type = 'int'

nemovitost_uir_ulice_text.column = 'street'
nemovitost_uir_ulice_text.type = 'string'

street_show.column = 'street_show'
street_show.type = 'int'

nemovitost_uir_cp.column = 'street_number'
nemovitost_uir_cp.type = 'string'

nabidka_gps_x.column = 'gps_x'
nabidka_gps_x.type = 'float'
nabidka_gps_x.value = 'degToFloat<@this>'

nabidka_gps_y.column = 'gps_y'
nabidka_gps_y.type = 'float'
nabidka_gps_y.value = 'degToFloat<@this>'

zakazka_typ.column = 'action'
zakazka_typ.type = 'int'
zakazka_typ.convert.1 = 1
zakazka_typ.convert.2 = 3

nemovitost_typ.column = 'category'
nemovitost_typ.type = 'int'
; stejný číselník

nemovitost_ucel_budovy.column = 'subcategory'
nemovitost_ucel_budovy.type = 'int'
nemovitost_ucel_budovy.convert.1 = '201'
nemovitost_ucel_budovy.convert.2 = '202'
nemovitost_ucel_budovy.convert.3 = '203'
nemovitost_ucel_budovy.convert.4 = '203'
nemovitost_ucel_budovy.convert.5 = '205'
nemovitost_ucel_budovy.convert.6 = '206'
nemovitost_ucel_budovy.convert.7 = '207'
nemovitost_ucel_budovy.unset = '@nemovitost_typ==2 ? @null : @this'

nemovitost_druh_pozemku.column = 'subcategory'
nemovitost_druh_pozemku.type = 'int'
nemovitost_druh_pozemku.convert.1 = '301'
nemovitost_druh_pozemku.convert.2 = '302'
nemovitost_druh_pozemku.convert.3 = '303'
nemovitost_druh_pozemku.convert.4 = '304'
nemovitost_druh_pozemku.convert.5 = '305'
nemovitost_druh_pozemku.convert.6 = '306'
nemovitost_druh_pozemku.convert.7 = '315'
; ostatní prozatím převadíme na průmyslový
nemovitost_druh_pozemku.unset = '@nemovitost_typ==3 ? @null : @this'

nemovitost_dispozice.column = 'subcategory'
nemovitost_dispozice.type = 'int'
nemovitost_dispozice.convert.1  = '401' ; Garsonka
nemovitost_dispozice.convert.2  = '402' ; 1+kk
nemovitost_dispozice.convert.9  = '402' ; 1+1
nemovitost_dispozice.convert.3  = '403' ; 2+kk
nemovitost_dispozice.convert.10 = '403' ; 2+1
nemovitost_dispozice.convert.4  = '404' ; 3+kk
nemovitost_dispozice.convert.11 = '404' ; 3+1
nemovitost_dispozice.convert.5  = '405' ; 4+kk
nemovitost_dispozice.convert.12 = '405' ; 4+1
nemovitost_dispozice.convert.6  = '406' ; 5+kk
nemovitost_dispozice.convert.13 = '406' ; 5+1
nemovitost_dispozice.convert.7  = '406' ; 6+kk
nemovitost_dispozice.convert.14 = '406' ; 6+1
nemovitost_dispozice.convert.8  = '406' ; 7+kk
nemovitost_dispozice.convert.15 = '406' ; 7+1
nemovitost_dispozice.convert.16 = '407' ; Atypický
nemovitost_dispozice.convert.17 = '407' ; Jiný
nemovitost_dispozice.unset = '@nemovitost_typ==4 ? @null : @this'

_nemovitost_druh_domu.column = 'subcategory'
_nemovitost_druh_domu.type = 'int'
_nemovitost_druh_domu.value = '603'
; POZOR HACK: u položky, kde je value nadrátováno, nefunguje v unsetu @this
_nemovitost_druh_domu.unset = '@nemovitost_typ==6 ? @null : 603'

nemovitost_typ_zarizeni.column = 'subcategory'
nemovitost_typ_zarizeni.type = 'int'
nemovitost_typ_zarizeni.convert.1 = '701'
nemovitost_typ_zarizeni.convert.2 = '701'
nemovitost_typ_zarizeni.convert.3 = '703'
nemovitost_typ_zarizeni.unset = '@nemovitost_typ==7 ? @null : @this'

nemovitost_druh_prostor.column = 'subcategory'
nemovitost_druh_prostor.type = 'int'
nemovitost_druh_prostor.convert.1 = '901'
nemovitost_druh_prostor.convert.2 = '902'
nemovitost_druh_prostor.convert.3 = '903'
nemovitost_druh_prostor.convert.4 = '904'
nemovitost_druh_prostor.convert.5 = '905'
nemovitost_druh_prostor.unset = '@nemovitost_typ==9 ? @null : @this'

_nemovitost_druh_chaty.column = 'subcategory'
_nemovitost_druh_chaty.type = 'int'
_nemovitost_druh_chaty.value = '1001'
_nemovitost_druh_chaty.unset = '@nemovitost_typ==10 ? @null : 1001'

_nemovitost_druh_garaze.column = 'subcategory'
_nemovitost_druh_garaze.type = 'int'
_nemovitost_druh_garaze.value = '1101'
_nemovitost_druh_garaze.unset = '@nemovitost_typ==11 ? @null : 1101'

nemovitost_vlastnictvi.column = 'ownership'
nemovitost_vlastnictvi.type = 'int'
; číselník máme stejný
; a vlastnictví je výchozím stavu osobní
nemovitost_vlastnictvi.value = '@this ? @this : 1'

zakazka_stav.column = 'status'
zakazka_stav.type = 'int'
zakazka_stav.convert.10 = '1' ; příprava
zakazka_stav.convert.20 = '1' ; aktivní
zakazka_stav.convert.30 = '3' ; rezervace
; 4 = predaná, 8=prenajatá
zakazka_stav.convert.40 = '@zakazka_typ==2 ?  8 : 4' ; realizováno
zakazka_stav.convert.41 = '@zakazka_typ==2 ?  8 : 4' ; realizováno jinou RK
zakazka_stav.convert.50 = '5' ; zrušeno

zakazka_typ_smlouvy.column = 'exclusive'
zakazka_typ_smlouvy.type = 'int'
zakazka_typ_smlouvy.convert.10 = 1
zakazka_typ_smlouvy.convert.20 = 0
zakazka_typ_smlouvy.convert.30 = 1
zakazka_typ_smlouvy.value = '@this ? @this : 1'

_export.column = 'export'
_export.type = 'int'

_show_web.column = 'show_web'
_show_web.type = 'int'

_watermark_add.column = 'watermark_add'
_watermark_add.type = 'int'
_watermark_add.value = '0'

;logo_if_no_photo
;contact_date

automatic_detail_url.column = 'url'
automatic_detail_url.type = 'string'

nemovitost_energeticky_stitek.column = 'energy_cert'
nemovitost_energeticky_stitek.type = 'int'
nemovitost_energeticky_stitek.convert.1 = '1'
nemovitost_energeticky_stitek.convert.2 = '2'
nemovitost_energeticky_stitek.convert.3 = '3'
nemovitost_energeticky_stitek.convert.4 = '4'
nemovitost_energeticky_stitek.convert.5 = '5'
nemovitost_energeticky_stitek.convert.6 = '6'
nemovitost_energeticky_stitek.convert.7 = '7'
nemovitost_energeticky_stitek.convert.20 = '1'
nemovitost_energeticky_stitek.convert.21 = '1'
nemovitost_energeticky_stitek.convert.0 = '99'

; dražbu nevedene
;first_inspection_date a second_inspection_date též ne

nemovitost_cena_prodej.column = 'price'
nemovitost_cena_prodej.type = 'float'
nemovitost_cena_prodej.value = '@zakazka_typ == 1 ? @this : @nemovitost_cena_pronajem'

nemovitost_cena_prodej_jednotka.column = 'price_unit'
nemovitost_cena_prodej_jednotka.type = 'int'
nemovitost_cena_prodej_jednotka.convert.1 = '1' ; za nemovitost
nemovitost_cena_prodej_jednotka.convert.3 = '2' ; za m2
nemovitost_cena_prodej_jednotka.unset = '@zakazka_typ==1 ? @null : @this'

nemovitost_cena_pronajem_jednotka.column = 'price_unit'
nemovitost_cena_pronajem_jednotka.type = 'int'
nemovitost_cena_pronajem_jednotka.convert.2 = '3' ; za mesic
nemovitost_cena_pronajem_jednotka.convert.4 = '4' ; m2/mesic
nemovitost_cena_pronajem_jednotka.convert.5 = '6' ; m2/rok
nemovitost_cena_pronajem_jednotka.convert.6 = '5' ; za rok
nemovitost_cena_pronajem_jednotka.convert.7 = '7' ; za den
nemovitost_cena_pronajem_jednotka.unset = '@zakazka_typ==2 ? @null : @this'

nemovitost_mena.column = 'price_currency'
nemovitost_mena.type = 'int'
nemovitost_mena.convert.1 = '3'
nemovitost_mena.convert.2 = '5'
nemovitost_mena.convert.3 = '1'

; energy a price_energy nevedem
; price_down taky nevedem

unit_price.column = 'unit_price'
unit_price.type = 'float'
unit_price.value = '@nemovitost_cena_prodej'
unit_price.unset = '@zakazka_typ == 1 && @nemovitost_cena_prodej_jednotka == 3 ? @nemovitost_cena_prodej : @null'

nemovitost_cena_poznamka.column = 'price_note'
nemovitost_cena_poznamka.type = 'string'

; video_id
; groundplan_id
; virtualtour_id
; streetview

nemovitost_url_foto360.column = 'momento'
nemovitost_url_foto360.type = 'string'

_nemovitost_dispozice.column = 'rooms_count'
_nemovitost_dispozice.type = 'int'
_nemovitost_dispozice.convert.1 = '1'
_nemovitost_dispozice.convert.9 = '1'
_nemovitost_dispozice.convert.10 = '2'
_nemovitost_dispozice.convert.11 = '3'
_nemovitost_dispozice.convert.12 = '4'
_nemovitost_dispozice.convert.13 = '5'
; iný byt
_nemovitost_dispozice.convert.17 = '3'
_nemovitost_dispozice.value='@nemovitost_dispozice'
_nemovitost_dispozice.unset = '@nemovitost_typ==4 ? @null : @this'

nemovitost_pocet_obytnych_mistnosti.column = 'rooms_count'
nemovitost_pocet_obytnych_mistnosti.type = 'int'
nemovitost_pocet_obytnych_mistnosti.unset = 'inList<@nemovitost_typ, 6, 11> ? @null : @this'

;bathrooms_count
;kitchens_count
;toilets_count

nemovitost_balkon.column = 'balconies_count'
nemovitost_balkon.type = 'int'

nemovitost_lodzie.column = 'loggies_count'
nemovitost_lodzie.type = 'int'

;balcony_or_loggie

nemovitost_terasa.column = 'terraces_count'
nemovitost_terasa.type = 'int'

nemovitost_garaz.column = 'garages_count'
nemovitost_garaz.type = 'int'

;pantries_count
;wardrobes_count

; logika převodu - uvádíme "hlavní plochu" jako usable_area, jen u pozemků jako plot_area
nemovitost_plocha_celkova.column = '@nemovitost_typ==3 ? plot_area : usable_area'
nemovitost_plocha_celkova.type = 'int'
nemovitost_plocha_celkova.unset = 'inList<@nemovitost_typ, 2, 3, 4> ? @null : @this'

nemovitost_plocha_uzitna.column = 'usable_area'
nemovitost_plocha_uzitna.type = 'int'
nemovitost_plocha_uzitna.unset = 'inList<@nemovitost_typ, 1, 5, 6, 7, 8, 9, 10> ? @null : @this'

; ^ ^ ^
; * exportujeme celkovou plochu jako "Úžitková plocha" (u komerčních objektů, bytů)
; * exportujeme celkovou plochu jako "Plocha pozemku" (u pozemků)
; * exportujeme užitnou plochu jako "Úžitková plocha" (u zemědělských, historických, domů a vil, hotelů, najemnícj, komerčních prostor, chat)
; * exportujeme zastavěnou plochu jako "Úžitková plocha" (u malých objektů)


nemovitost_plocha_zastavena.column = 'usable_area'
nemovitost_plocha_zastavena.type = 'int'
nemovitost_plocha_zastavena.unset = '@nemovitost_typ==11 ? @null : @this'

; zastavěná plocha pro všechno kromě chat
_nemovitost_plocha_zastavena.column = 'building_area'
_nemovitost_plocha_zastavena.type = 'int'
_nemovitost_plocha_zastavena.value = '@nemovitost_plocha_zastavena'
_nemovitost_plocha_zastavena.unset = '@nemovitost_typ==11 ? @_convertedValue : @null'

; plocha pozemku pro všechno kromě pozemků
nemovitost_plocha_parcely.column = 'plot_area'
nemovitost_plocha_parcely.type = 'int'
nemovitost_plocha_parcely.unset = '@nemovitost_typ==3 ? @_convertedValue : @null'

; plocha pozemku pouze pro byty
nemovitost_vlastni_pozemek.column = 'plot_area'
nemovitost_vlastni_pozemek.type = 'int'
nemovitost_vlastni_pozemek.unset = '@nemovitost_typ==4 ? @null : @_convertedValue'

nemovitost_sklep_plocha.column = 'cellar_area'
nemovitost_sklep_plocha.type = 'int'
nemovitost_sklep_plocha.unset = '@nemovitost_sklep ? @null : @this'

; store_area
; office_area
; total_area

nemovitost_sirka.column = 'dimension_width'
nemovitost_sirka.type = 'int'

nemovitost_vyska.column = 'dimension_height'
nemovitost_vyska.type = 'int'

nemovitost_delka.column = 'dimension_length'
nemovitost_delka.type = 'int'

nemovitost_podlazi_cislo.column = 'floor'
nemovitost_podlazi_cislo.type = 'int'

nemovitost_pocet_podlazi.column = 'floors'
nemovitost_pocet_podlazi.type = 'int'

; ground_floor + last_floor

nemovitost_vytah.column = 'lift'
nemovitost_vytah.type = 'int'

; floor_parquet
; floor_paving
; floor_coverings
; floor_pvc
; floor_concrete

; wall_spatula
; wall_plaster
; wall_wallpapers
; window_plastic
; window_wood
; window_euro
; window_al

; bath_clasic
; bath_corner
; bath_shower
; bath_separe_toilet

; kitchen_sideboard
; kitchen_cooker
; kitchen_dishwasher
; kitchen_fridge
; kitchen_microwave
; kitchenette

; adv_luxury + adv_sunny + adv_nice_view

adv_school.column = 'adv_school'
adv_school.type = 'int'

adv_hospital.column = 'adv_hospital'
adv_hospital.type = 'int'

adv_bus.column = 'adv_bus'
adv_bus.type = 'int'

adv_shopping.column = 'adv_shopping'
adv_shopping.type = 'int'

adv_silence.column = 'adv_silence'
adv_silence.type = 'int'

; adv_workshop
; adv_outfire
; adv_pool
; adv_fishing
; adv_tourism
; adv_cycling
; adv_fire
; adv_muscle
; adv_winter_garden
; adv_sauna
; adv_alcove
; adv_insulated_house

; heating_central
; heating_floor
; heating_local
; heating_fire
; access_klima

nemovitost_topeni.column = 'heating_heat'
nemovitost_topeni.type = 'int'
nemovitost_topeni.value = 'max<@this, 0>!=0 ? 1 : 0'

; heating_emitters
; heating_cold_to

nemovitost_stav_objektu.column = 'condition'
nemovitost_stav_objektu.type = 'int'
nemovitost_stav_objektu.convert.1 = '1'
nemovitost_stav_objektu.convert.2 = '2'
nemovitost_stav_objektu.convert.3 = '3'
nemovitost_stav_objektu.convert.4 = '4'
nemovitost_stav_objektu.convert.5 = '5'
nemovitost_stav_objektu.convert.6 = '6'
nemovitost_stav_objektu.convert.7 = '7'
nemovitost_stav_objektu.convert.8 = '8'
nemovitost_stav_objektu.convert.9 = '9'
nemovitost_stav_objektu.convert.10 = '10'

nemovitost_rok_vystavby.column = 'age'
nemovitost_rok_vystavby.type = 'int'
nemovitost_rok_vystavby.unset = 0

nemovitost_druh_objektu.column = 'building_type'
nemovitost_druh_objektu.type = 'int'
; číselník máme stejný

; parking

; equip_*

access_tv.column = 'access_tv'
access_tv.type = 'int'
access_tv.value = 'substr<@nemovitost_ostatni_rozvody, 0, 1>=="1"'
; exportujeme televizi pokud máme satelit nebo kabelovou televizi
_access_tv.column = 'access_tv'
_access_tv.type = 'int'
_access_tv.value = 'substr<@nemovitost_ostatni_rozvody, 1, 1>=="1"'
_access_tv.unset = '0'

access_phone.column = 'access_phone'
access_phone.type = 'int'
access_phone.value = 'substr<@nemovitost_telekomunikace, 1, 1>=="1"'

; access_skt

access_internet.column = 'access_internet'
access_internet.type = 'int'
access_internet.value = 'substr<@nemovitost_telekomunikace, 0, 1>=="1"'

; security_* nevedeme

; roof + roof_loft

; roofing
; terrain
; plot_exploitation + plot_location
; cellar
nemovitost_komunikace.column = 'road'
nemovitost_komunikace.type = 'int'
; číselník máme stejný
nemovitost_komunikace.unset = 0

nemovitost_voda.column = 'water'
nemovitost_voda.type = 'int'
nemovitost_voda.value = 'max<@this, 0>!=0 ? 1 : 0'

; water_well

electricity_230.column = 'electricity_230'
electricity_230.type = 'int'
electricity_230.value = 'substr<@nemovitost_elektrina, 1, 1>=="1"'

electricity_400.column = 'electricity_400'
electricity_400.type = 'int'
electricity_400.value = 'substr<@nemovitost_elektrina, 3, 1>=="1"'

nemovitost_plyn.column = 'gas'
nemovitost_plyn.type = 'int'
nemovitost_plyn.value = 'max<@this, 0>!=0 ? 1 : 0'

canalization.column = 'canalization'
canalization.type = 'int'
canalization.value = 'substr<@nemovitost_odpad, 0, 1>=="1"'

canalization_sink.column = 'canalization_sink'
canalization_sink.type = 'int'
canalization_sink.value = 'substr<@nemovitost_odpad, 2, 1>=="1"'

canalization_cov.column = 'canalization_cov'
canalization_cov.type = 'int'
canalization_cov.value = 'substr<@nemovitost_odpad, 1, 1>=="1"'

; data_connection

; disposal_* nevedeme

; availability_highway
; availability_railway
; availability_way
; availability_airport
; availability_port

notexport_portals.column = 'notexport_portals'
notexport_portals.type = 'string'
