apidae 1.2.9 → 1.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2be2cf907e5a637962c70ddfde7fb4c2fab3f898
4
- data.tar.gz: f71204e522ad70932deb15a8c2dd0330ddbdefa0
3
+ metadata.gz: eb14f5d801d035d8f53e81c4fd05c383a880a12f
4
+ data.tar.gz: e2bbf9c0cfb99b65c00913fdca94bd02a73ea794
5
5
  SHA512:
6
- metadata.gz: 4176569bfe745b9f7391435ccd898cb5b3cdd2560febbca15ecd8500cdf00a7d7a01642a2ff9aa36f12c405c3db6c8e451d4c3e4ac61aa7fb7dab2cde377f824
7
- data.tar.gz: e6f83af4e0b1d8688ebf5dae737ded92335d41196ec48ab7205875f8d54e11cf4971afd7ebd91bf5491a48e033ca0bcfef3c0a93ae4febb091cd32083350f4c4
6
+ metadata.gz: f8e3f3d162355c19e25756696e415b6dcbfb89f276ed6017ebad77d627fa834cf5cf8b68fe8682db55223f17dfb9f879843e422a3b34647aa1d78becd46c3780
7
+ data.tar.gz: 973a2f042b1f057b61ec9c31d6399323b1b7d1abe2a58b869725bb5de5a4a3e690bb010ed1f0be6b483a59af6ee9530bd031bf7f3d2b5c1a5ad4f489ef2eea54
@@ -44,7 +44,7 @@ module Apidae
44
44
  'LUNDI' => MONDAY,
45
45
  'MARDI' => TUESDAY,
46
46
  'MERCREDI' => WEDNESDAY,
47
- 'JEUD' => THURSDAY,
47
+ 'JEUDI' => THURSDAY,
48
48
  'VENDREDI' => FRIDAY,
49
49
  'SAMEDI' => SATURDAY,
50
50
  'DIMANCHE' => SUNDAY
@@ -223,6 +223,7 @@ module Apidae
223
223
  loc_data[:latitude] = geoloc_details[:geoJson][:coordinates][1]
224
224
  loc_data[:longitude] = geoloc_details[:geoJson][:coordinates][0]
225
225
  end
226
+ loc_data[:altitude] = geoloc_details[:altitude] if geoloc_details
226
227
  loc_data[:access] = node_value(geoloc_details, :complement) if geoloc_details
227
228
  loc_data[:environments] = location_hash[:environnements].map {|e| e[:id]} if location_hash[:environnements]
228
229
  end
@@ -277,7 +278,8 @@ module Apidae
277
278
  (node_id(data_hash, :typeLabel) ? [node_id(data_hash, :typeLabel)] : []),
278
279
  chains: lists_ids(data_hash[:chaines]) + nodes_ids(data_hash[:chaineEtLabel]),
279
280
  area: apidae_obj.apidae_type == Obj::DOS ? data_hash.except(:classification) : node_value(data_hash, :lieuDePratique),
280
- track: apidae_obj.apidae_type == Obj::EQU ? data_hash[:itineraire] : nil,
281
+ track: apidae_obj.apidae_type == Obj::EQU ? (data_hash[:itineraire] || {}).except(:passagesDelicats) : nil,
282
+ tricky_sections: apidae_obj.apidae_type == Obj::EQU ? node_value(data_hash[:itineraire], :passagesDelicats, *locales) : nil,
281
283
  products: lists_ids(data_hash[:typesProduit], data_hash[:aopAocIgps], data_hash[:specialites]),
282
284
  audience: lists_ids(prestations_hash[:typesClientele]),
283
285
  animals: {allowed: prestations_hash[:animauxAcceptes] == 'ACCEPTES', desc: node_value(prestations_hash, :descriptifAnimauxAcceptes, *locales),
@@ -319,13 +321,17 @@ module Apidae
319
321
  tags
320
322
  end
321
323
 
322
- def self.parse_booking(reservation_hash, *locales)
324
+ def self.parse_booking(reservation_hash, visits_hash, *locales)
325
+ booking_hash = {}
323
326
  if reservation_hash
324
- {
325
- booking_desc: node_value(reservation_hash, :complement, *locales),
326
- booking_entities: reservation_hash[:organismes]
327
- }
327
+ booking_hash[:booking_desc] = node_value(reservation_hash, :complement, *locales),
328
+ booking_hash[:booking_entities] = reservation_hash[:organismes]
329
+ end
330
+ if visits_hash
331
+ booking_hash[:visits_allowed] = visits_hash[:visitable] == true
332
+ booking_hash[:visits_desc] = node_value(visits_hash, :complementVisite, *locales)
328
333
  end
334
+ booking_hash
329
335
  end
330
336
 
331
337
  def self.parse_town(location_hash)
@@ -15,15 +15,15 @@ module Apidae
15
15
  store_accessor :pictures_data, :pictures
16
16
  store_accessor :attachments_data, :attachments
17
17
  store_accessor :type_data, :categories, :themes, :capacity, :classification, :labels, :chains, :area, :track,
18
- :products, :audience, :animals, :animals_desc, :extra, :duration, :certifications, :business
18
+ :tricky_sections, :products, :audience, :animals, :animals_desc, :extra, :duration, :certifications, :business
19
19
  store_accessor :entity_data, :entity_id, :entity_name, :service_provider_id, :is_service_provider
20
20
  store_accessor :contact_data, :telephone, :email, :website, :google, :facebook, :twitter, :yelp, :trip_advisor, :fax,
21
21
  :mobile_website, :shorty_url, :contacts
22
- store_accessor :location_data, :address, :place, :latitude, :longitude, :access, :territories, :environments
22
+ store_accessor :location_data, :address, :place, :latitude, :longitude, :access, :territories, :environments, :altitude
23
23
  store_accessor :openings_data, :openings_desc, :openings_desc_mode, :openings, :time_periods, :openings_extra
24
24
  store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :payment_methods, :includes, :excludes, :rates_extra
25
25
  store_accessor :service_data, :services, :equipments, :comfort, :activities, :challenged, :languages
26
- store_accessor :booking_data, :booking_desc, :booking_entities
26
+ store_accessor :booking_data, :booking_desc, :booking_entities, :visits_allowed, :visits_desc
27
27
  store_accessor :tags_data, :promo, :internal, :linked
28
28
  store_accessor :version_data, :versioned_fields
29
29
 
@@ -185,7 +185,7 @@ module Apidae
185
185
  apidae_obj.town = ApidaeDataParser.parse_town(object_data[:localisation])
186
186
  apidae_obj.openings_data = ApidaeDataParser.parse_openings(object_data[:ouverture], *locales)
187
187
  apidae_obj.rates_data = ApidaeDataParser.parse_rates(object_data[:descriptionTarif], *locales)
188
- apidae_obj.booking_data = ApidaeDataParser.parse_booking(object_data[:reservation], *locales)
188
+ apidae_obj.booking_data = ApidaeDataParser.parse_booking(object_data[:reservation], object_data[:visites], *locales)
189
189
  apidae_obj.type_data = ApidaeDataParser.parse_type_data(apidae_obj, object_data[type_fields[:node]], object_data[:prestations],
190
190
  object_data[:tourismeAffaires], *locales)
191
191
  apidae_obj.pictures_data = ApidaeDataParser.parse_pictures_data(object_data[:illustrations], *locales)
@@ -29,7 +29,7 @@ module Apidae
29
29
  :openings_desc, :rates_desc, :includes, :excludes, :extra, :booking_desc]
30
30
  ALL_FIELDS = LOCALIZED_FIELDS + [:theme_desc, :private_desc, :capacity, :telephone, :email, :website,
31
31
  :google, :facebook, :twitter, :yelp, :trip_advisor, :fax, :mobile_website, :shorty_url,
32
- :openings, :rates, :services, :payment_methods, :categories, :themes, :labels, :chains,
33
- :classification, :challenged, :environments, :languages, :products, :animals,
34
- :equipments, :comfort, :activities, :promo, :internal, :linked]
32
+ :openings, :openings_extra, :rates, :services, :payment_methods, :categories, :themes,
33
+ :labels, :chains, :classification, :challenged, :environments, :languages, :products,
34
+ :animals, :equipments, :comfort, :activities, :promo, :internal, :linked]
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.2.9"
2
+ VERSION = "1.2.14"
3
3
  end
@@ -65,3 +65,5 @@ Migrating to AddLocalesDataToApidaeProjects (20190123214635)
65
65
   (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
66
66
  Apidae::Obj Load (26.8ms) SELECT apidae_id, COUNT(id) FROM "apidae_objs" WHERE "apidae_objs"."root_obj_id" IS NULL GROUP BY "apidae_objs"."apidae_id" HAVING (COUNT(id) > 1)
67
67
  Apidae::Obj Load (2.4ms) SELECT apidae_id, COUNT(id) FROM "apidae_objs" WHERE "apidae_objs"."root_obj_id" IS NULL GROUP BY "apidae_objs"."apidae_id" HAVING (COUNT(id) > 1)
68
+ Apidae::Obj Load (0.8ms) SELECT "apidae_objs".* FROM "apidae_objs" ORDER BY "apidae_objs"."id" ASC LIMIT $1 [["LIMIT", 1]]
69
+  (3.4ms) SELECT COUNT(*) FROM "apidae_objs"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apidae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.9
4
+ version: 1.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-16 00:00:00.000000000 Z
11
+ date: 2021-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails