apidae 1.2.7 → 1.2.12

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
  SHA1:
3
- metadata.gz: f7f870ce44d951a04a1b73afa9c3b16a5a8ebdb9
4
- data.tar.gz: e95f2475a72a05c59cbcab56863d77d316b4ffbc
3
+ metadata.gz: 14c1e6c1ecb7759e122f8b6598d38df5a3c6c65e
4
+ data.tar.gz: b053447b481455f07d200ea6c3c2ddaa306ce451
5
5
  SHA512:
6
- metadata.gz: 9cf4871c99377ff9e1dbb875099a5b75279177fb1964a18f57363083c38af1f0b5bce1e8f880103486652b5bb417da7dbebf6b2d2602b537c2432d1bf801bc62
7
- data.tar.gz: 2896159f983e04f3710a82a465c75a5a2080336bfa6f4266c0ec10b6a7e46f6a2929a87ff410db44fb700ecfa8ccdfbd09e664e15ce8ae628c58b19c4cb43369
6
+ metadata.gz: 75533fc47e84a10f7fe1409103bb4aa027a7f807581565f690fb575c45beb9f05a21e3741702ec47dd85a77ca9534b82a8087af911e0f32df81e1142881e7a36
7
+ data.tar.gz: 4ce2cc2ebd34a81f1029d258a36fe522a9900f33adfcd029cfb01c29a22034ff3b0edb84a8d40cd3542ec0df95ce33741047e07607edacaffd82426084bc0c69
@@ -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
@@ -151,6 +151,7 @@ module Apidae
151
151
  name: localized_value(att, :nom, locale),
152
152
  url: att[:traductionFichiers][0][:url].gsub('http:', 'https:'),
153
153
  type: att[:type],
154
+ link: att[:link],
154
155
  description: localized_value(att, :legende, locale)
155
156
  }
156
157
  end
@@ -219,6 +220,7 @@ module Apidae
219
220
  loc_data.merge!({place: type_data_hash[:nomLieu]}) if type_data_hash
220
221
  geoloc_details = location_hash[:geolocalisation]
221
222
  if geoloc_details && geoloc_details[:valide] && geoloc_details[:geoJson]
223
+ loc_data[:altitude] = geoloc_details[:altitude]
222
224
  loc_data[:latitude] = geoloc_details[:geoJson][:coordinates][1]
223
225
  loc_data[:longitude] = geoloc_details[:geoJson][:coordinates][0]
224
226
  end
@@ -318,13 +320,17 @@ module Apidae
318
320
  tags
319
321
  end
320
322
 
321
- def self.parse_booking(reservation_hash, *locales)
323
+ def self.parse_booking(reservation_hash, visits_hash, *locales)
324
+ booking_hash = {}
322
325
  if reservation_hash
323
- {
324
- booking_desc: node_value(reservation_hash, :complement, *locales),
325
- booking_entities: reservation_hash[:organismes]
326
- }
326
+ booking_hash[:booking_desc] = node_value(reservation_hash, :complement, *locales),
327
+ booking_hash[:booking_entities] = reservation_hash[:organismes]
327
328
  end
329
+ if visits_hash
330
+ booking_hash[:visits_allowed] = visits_hash[:visitable] == true
331
+ booking_hash[:visits_desc] = node_value(visits_hash, :complementVisite, *locales)
332
+ end
333
+ booking_hash
328
334
  end
329
335
 
330
336
  def self.parse_town(location_hash)
@@ -336,10 +342,15 @@ module Apidae
336
342
  end
337
343
  end
338
344
 
339
- def self.parse_entity_fields(information_hash, type_data_hash)
345
+ def self.parse_entity_fields(information_hash, type_data_hash, sp_hash)
346
+ entity_hash = {}
340
347
  if information_hash && information_hash[:structureGestion]
341
- {entity_id: information_hash[:structureGestion][:id], service_provider_id: node_id(type_data_hash, :prestataireActivites)}
348
+ entity_hash.merge!({entity_id: information_hash[:structureGestion][:id], service_provider_id: node_id(type_data_hash, :prestataireActivites)})
349
+ end
350
+ if sp_hash && sp_hash[:prestataireActivites]
351
+ entity_hash[:is_service_provider] = true
342
352
  end
353
+ entity_hash
343
354
  end
344
355
 
345
356
  def self.node_id(node, key)
@@ -16,14 +16,14 @@ module Apidae
16
16
  store_accessor :attachments_data, :attachments
17
17
  store_accessor :type_data, :categories, :themes, :capacity, :classification, :labels, :chains, :area, :track,
18
18
  :products, :audience, :animals, :animals_desc, :extra, :duration, :certifications, :business
19
- store_accessor :entity_data, :entity_id, :entity_name, :service_provider_id
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
 
@@ -84,7 +84,7 @@ module Apidae
84
84
  COS => {node: :informationsCommerceEtService, subtype: :commerceEtServiceType},
85
85
  DEG => {node: :informationsDegustation, subtype: :degustationType},
86
86
  DOS => {node: :informationsDomaineSkiable, subtype: :domaineSkiableType},
87
- EQU => {node: :informationsEquipement, subtype: :equipementType},
87
+ EQU => {node: :informationsEquipement, subtype: :rubrique},
88
88
  FEM => {node: :informationsFeteEtManifestation, subtype: :feteEtManifestationType},
89
89
  HCO => {node: :informationsHebergementCollectif, subtype: :hebergementCollectifType},
90
90
  HLO => {node: :informationsHebergementLocatif, subtype: :hebergementLocatifType},
@@ -185,12 +185,12 @@ 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)
192
192
  apidae_obj.attachments_data = ApidaeDataParser.parse_attachments_data(object_data[:multimedias], *locales)
193
- apidae_obj.entity_data = ApidaeDataParser.parse_entity_fields(object_data[:informations], object_data[type_fields[:node]])
193
+ apidae_obj.entity_data = ApidaeDataParser.parse_entity_fields(object_data[:informations], object_data[type_fields[:node]], object_data[:informationsPrestataireActivites])
194
194
  apidae_obj.service_data = ApidaeDataParser.parse_service_data(object_data[:prestations], object_data[type_fields[:node]])
195
195
  apidae_obj.tags_data = ApidaeDataParser.parse_tags_data(object_data[:presentation], object_data[:criteresInternes], object_data[:liens])
196
196
  apidae_obj.meta_data = object_data[:metadonnees]
@@ -8,9 +8,10 @@ module Apidae
8
8
  LOCALE_ZH = 'zh'
9
9
  LOCALE_ES = 'es'
10
10
  LOCALE_PT_BR = 'pt-BR'
11
+ LOCALE_JP = 'jp'
11
12
 
12
13
  DEFAULT_LOCALE = LOCALE_FR
13
- ALL_LOCALES = [LOCALE_FR, LOCALE_EN, LOCALE_IT, LOCALE_DE, LOCALE_NL, LOCALE_RU, LOCALE_ZH, LOCALE_ES, LOCALE_PT_BR]
14
+ ALL_LOCALES = [LOCALE_FR, LOCALE_EN, LOCALE_IT, LOCALE_DE, LOCALE_NL, LOCALE_RU, LOCALE_ZH, LOCALE_ES, LOCALE_PT_BR, LOCALE_JP]
14
15
 
15
16
  STANDARD_VERSION = 'STANDARD'
16
17
  WINTER_VERSION = 'HIVER'
@@ -28,7 +29,7 @@ module Apidae
28
29
  :openings_desc, :rates_desc, :includes, :excludes, :extra, :booking_desc]
29
30
  ALL_FIELDS = LOCALIZED_FIELDS + [:theme_desc, :private_desc, :capacity, :telephone, :email, :website,
30
31
  :google, :facebook, :twitter, :yelp, :trip_advisor, :fax, :mobile_website, :shorty_url,
31
- :openings, :rates, :services, :payment_methods, :categories, :themes, :labels, :chains,
32
- :classification, :challenged, :environments, :languages, :products, :animals,
33
- :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]
34
35
  end
@@ -41,6 +41,7 @@ fr:
41
41
  ru: Russe
42
42
  zh: Chinois
43
43
  'pt-BR': Brésilien
44
+ jp: Japonais
44
45
  versions:
45
46
  STANDARD: Standard
46
47
  HIVER: Hiver
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.2.7"
2
+ VERSION = "1.2.12"
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.7
4
+ version: 1.2.12
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-11-06 00:00:00.000000000 Z
11
+ date: 2021-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails