apidae 1.4.3 → 1.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aabfe9be4d2de7c87baa00f3234faf20fe31ab8125f6163acf65e0aa772e1dbc
4
- data.tar.gz: fb0e940576b5b979ed5ae0dd5fba63c24578c8293152372e8f0dfa67d195588b
3
+ metadata.gz: 5993f5c75ce5af62a6bfb8ac53a4f4ae0e07536fa9ac532686a88966461edfc5
4
+ data.tar.gz: 0e015ab1ffaf6af58f709e3dc1662f50200422ae5551b9dcf2a790b67050d249
5
5
  SHA512:
6
- metadata.gz: fc81a47d8e6165241e0449217e116e1d9f22e39c4e403ba377950bc8d527631abe593ab2be49ef589d1f8dbca41430606c890722020bb525a364dcaa3642f9a3
7
- data.tar.gz: fbd8e4c42aec95838f8a65c6d88a73f07f82082910d42fbbf71068678adb51cccc1d6caf61e9e1bded5424d965ade31c46ec49bbe6eb1d649fc0227bd12fe06f
6
+ metadata.gz: a4f0e9122f14fc19c07145963b11d4ed1a2edbae80ef8045d6277e3613fa2be478c6e36c89f794dd60a97f4e6eff049eaf59657da8219e454d14a7795a39d57c
7
+ data.tar.gz: ae9c7c1697a424a83e151bbbee9e47e918473c951e16f53c4780d8b9b83085aa7623af3e596f722866e790f16018e751600c71c89f4b8964b059a665176b5b38
@@ -12,6 +12,7 @@ module Apidae
12
12
  FAX = 202
13
13
  MOBILE_WEBSITE = 3769
14
14
  SHORTY_URL = 4923
15
+ INSTAGRAM = 7221
15
16
 
16
17
  CONTACTS_MAP = {
17
18
  'telephone' => PHONE,
@@ -24,7 +25,8 @@ module Apidae
24
25
  'yelp' => YELP,
25
26
  'fax' => FAX,
26
27
  'mobile_website' => MOBILE_WEBSITE,
27
- 'shorty_url' => SHORTY_URL
28
+ 'shorty_url' => SHORTY_URL,
29
+ 'instagram' => INSTAGRAM
28
30
  }
29
31
 
30
32
  MODE_AUTO = 'auto'
@@ -177,37 +179,13 @@ module Apidae
177
179
  when PHONE, ALT_PHONE
178
180
  contact_details[:telephone] ||= {}
179
181
  contact_details[:telephone][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
180
- when EMAIL
181
- contact_details[:email] ||= {}
182
- contact_details[:email][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
183
- when WEBSITE
184
- contact_details[:website] ||= {}
185
- contact_details[:website][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
186
- when GOOGLE
187
- contact_details[:google] ||= {}
188
- contact_details[:google][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
189
- when FACEBOOK
190
- contact_details[:facebook] ||= {}
191
- contact_details[:facebook][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
192
- when TWITTER
193
- contact_details[:twitter] ||= {}
194
- contact_details[:twitter][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
195
- when YELP
196
- contact_details[:yelp] ||= {}
197
- contact_details[:yelp][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
198
- when TRIP_ADVISOR
199
- contact_details[:trip_advisor] ||= {}
200
- contact_details[:trip_advisor][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
201
- when FAX
202
- contact_details[:fax] ||= {}
203
- contact_details[:fax][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
204
- when MOBILE_WEBSITE
205
- contact_details[:mobile_website] ||= {}
206
- contact_details[:mobile_website][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
207
- when SHORTY_URL
208
- contact_details[:shorty_url] ||= {}
209
- contact_details[:shorty_url][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
210
182
  else
183
+ contacts_refs_by_code = CONTACTS_MAP.invert
184
+ if contacts_refs_by_code.keys.include?(c[:type][:id])
185
+ contact_ref = contacts_refs_by_code[c[:type][:id]].to_sym
186
+ contact_details[contact_ref] ||= {}
187
+ contact_details[contact_ref][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
188
+ end
211
189
  end
212
190
  end
213
191
  end
@@ -262,7 +240,7 @@ module Apidae
262
240
  values = rates_hash[:periodes].blank? ? [] : rates_hash[:periodes].map {|p| build_rate(p, *locales)}
263
241
  methods = rates_hash[:modesPaiement].blank? ? [] : rates_hash[:modesPaiement].map {|p| p[:id]}
264
242
  {
265
- rates_desc: desc, rates: values, payment_methods: methods,
243
+ rates_desc: desc, rates: values, rates_category: rates_hash[:indicationTarif], payment_methods: methods,
266
244
  tax_included: rates_hash[:taxeDeSejourIncluse].blank? ? nil : (rates_hash[:taxeDeSejourIncluse] == 'OUI'),
267
245
  rates_desc_mode: rates_hash[:tarifsEnClairGenerationMode] == 'AUTOMATIQUE' ? MODE_AUTO : MODE_MANUAL,
268
246
  includes: node_value(rates_hash, :leTarifComprend, *locales),
@@ -282,7 +260,7 @@ module Apidae
282
260
  categories: lists_ids(data_hash[:categories], data_hash[:typesDetailles], data_hash[:activiteCategories], data_hash[:typesHabitation]),
283
261
  themes: lists_ids(data_hash[:themes]),
284
262
  capacity: (data_hash[:capacite] || {})
285
- .merge(presta_hash ? {group_min: presta_hash[:tailleGroupeMin], group_max: presta_hash[:tailleGroupeMax],
263
+ .merge(presta_hash ? {group_min: (presta_hash[:nombrePersonnesMinimum] || presta_hash[:tailleGroupeMin]), group_max: presta_hash[:tailleGroupeMax],
286
264
  age_min: presta_hash[:ageMin], age_max: presta_hash[:ageMax],
287
265
  wheelchair_max: presta_hash[:nombrePersonnesEnFauteuilRoulantAccueilliesSimultanement]} : {}),
288
266
  classification: nodes_ids(data_hash[:classement], data_hash[:classementPrefectoral], data_hash[:classification]) +
@@ -23,7 +23,8 @@ module Apidae
23
23
  :mobile_website, :shorty_url, :contacts
24
24
  store_accessor :location_data, :address, :place, :latitude, :longitude, :access, :territories, :environments, :altitude, :map_reference
25
25
  store_accessor :openings_data, :openings_desc, :openings_desc_mode, :openings, :time_periods, :openings_extra, :opening_days
26
- store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :payment_methods, :includes, :excludes, :rates_extra, :tax_included
26
+ store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :rates_category, :payment_methods, :includes, :excludes,
27
+ :rates_extra, :tax_included
27
28
  store_accessor :service_data, :services, :equipments, :comfort, :activities, :challenged, :languages, :documentation_languages
28
29
  store_accessor :booking_data, :booking_desc, :booking_entities, :visits_allowed, :visits_desc, :visits_duration, :visits_services
29
30
  store_accessor :tags_data, :promo, :internal, :linked
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.4.3"
2
+ VERSION = "1.4.5"
3
3
  end