apidae 1.4.2 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/apidae/apidae_data_parser.rb +12 -6
- data/app/models/apidae/obj.rb +6 -5
- data/config/initializers/constants.rb +3 -3
- data/lib/apidae/version.rb +1 -1
- data/test/dummy/log/development.log +2088 -0
- data/test/dummy/log/test.log +556 -0
- data/test/models/apidae/obj_test.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b92a9500f041a825be642e53f3bc1497e6f3448d40a31185485fc0cc313d34a8
|
4
|
+
data.tar.gz: 4fa5733460999f4c3a9558f35b3caf5ba94cbc5a0cf82fd4c83a953a25355001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ff90b90ff0153f945b54382af7792be8ae9096b9c6e7fb4e345d15f5c044f0cf695d00ce9ea6c6716d576a4c2485387cd65e43a6718431d068e29309506aea7
|
7
|
+
data.tar.gz: 84fac7d1042a47b33fe67a27eb19ad856b1896f03704b763f8da740f482cabb7a21413249361fe4908de36a1f5d3ff34c6751d31b91510f9dca8f762afa1983c
|
@@ -112,13 +112,14 @@ module Apidae
|
|
112
112
|
owner_data
|
113
113
|
end
|
114
114
|
|
115
|
-
def self.parse_desc_data(data_hash, private_data, *locales)
|
115
|
+
def self.parse_desc_data(data_hash, private_data, presta_data, *locales)
|
116
116
|
unless data_hash.blank?
|
117
117
|
{
|
118
118
|
short_desc: node_value(data_hash, :descriptifCourt, *locales),
|
119
119
|
long_desc: node_value(data_hash, :descriptifDetaille, *locales),
|
120
120
|
theme_desc: data_hash[:descriptifsThematises].blank? ? {} : Hash[data_hash[:descriptifsThematises].map {|th| [node_id(th, :theme), node_value(th, :description, *locales)]}],
|
121
|
-
private_desc: private_data.blank? ? {} : Hash[private_data.map {|d| [d[:nomTechnique], (node_value(d, :descriptif, *locales).blank? ? {LOCALE_FR => d[:libelleFr]} : node_value(d, :descriptif, *locales))]}]
|
121
|
+
private_desc: private_data.blank? ? {} : Hash[private_data.map {|d| [d[:nomTechnique], (node_value(d, :descriptif, *locales).blank? ? {LOCALE_FR => d[:libelleFr]} : node_value(d, :descriptif, *locales))]}],
|
122
|
+
accessibility_desc: presta_data.blank? ? {} : Hash[presta_data.select {|k, v| k.to_s.start_with?('descriptifHandicap')}.map {|k, v| [k, node_value(presta_data, k, *locales)]}]
|
122
123
|
}
|
123
124
|
end
|
124
125
|
end
|
@@ -261,7 +262,7 @@ module Apidae
|
|
261
262
|
values = rates_hash[:periodes].blank? ? [] : rates_hash[:periodes].map {|p| build_rate(p, *locales)}
|
262
263
|
methods = rates_hash[:modesPaiement].blank? ? [] : rates_hash[:modesPaiement].map {|p| p[:id]}
|
263
264
|
{
|
264
|
-
rates_desc: desc, rates: values, payment_methods: methods,
|
265
|
+
rates_desc: desc, rates: values, rates_category: rates_hash[:indicationTarif], payment_methods: methods,
|
265
266
|
tax_included: rates_hash[:taxeDeSejourIncluse].blank? ? nil : (rates_hash[:taxeDeSejourIncluse] == 'OUI'),
|
266
267
|
rates_desc_mode: rates_hash[:tarifsEnClairGenerationMode] == 'AUTOMATIQUE' ? MODE_AUTO : MODE_MANUAL,
|
267
268
|
includes: node_value(rates_hash, :leTarifComprend, *locales),
|
@@ -282,7 +283,8 @@ module Apidae
|
|
282
283
|
themes: lists_ids(data_hash[:themes]),
|
283
284
|
capacity: (data_hash[:capacite] || {})
|
284
285
|
.merge(presta_hash ? {group_min: presta_hash[:tailleGroupeMin], group_max: presta_hash[:tailleGroupeMax],
|
285
|
-
age_min: presta_hash[:ageMin], age_max: presta_hash[:ageMax]
|
286
|
+
age_min: presta_hash[:ageMin], age_max: presta_hash[:ageMax],
|
287
|
+
wheelchair_max: presta_hash[:nombrePersonnesEnFauteuilRoulantAccueilliesSimultanement]} : {}),
|
286
288
|
classification: nodes_ids(data_hash[:classement], data_hash[:classementPrefectoral], data_hash[:classification]) +
|
287
289
|
lists_ids(data_hash[:classementsGuides]) + lists_ids(data_hash[:classements]),
|
288
290
|
classification_date: data_hash[:dateClassement],
|
@@ -317,7 +319,8 @@ module Apidae
|
|
317
319
|
type_data_hash ? type_data_hash[:activitesSportives] : [],
|
318
320
|
type_data_hash ? type_data_hash[:activitesCulturelles] : []),
|
319
321
|
challenged: lists_ids(data_hash[:tourismesAdaptes]),
|
320
|
-
languages: lists_ids(data_hash[:languesParlees])
|
322
|
+
languages: lists_ids(data_hash[:languesParlees]),
|
323
|
+
documentation_languages: lists_ids(data_hash[:languesDocumentation])
|
321
324
|
}
|
322
325
|
end
|
323
326
|
end
|
@@ -365,7 +368,10 @@ module Apidae
|
|
365
368
|
entity_hash = {}
|
366
369
|
if information_hash
|
367
370
|
if information_hash[:structureGestion]
|
368
|
-
entity_hash.merge!({entity_id: information_hash[:structureGestion][:id],
|
371
|
+
entity_hash.merge!({entity_id: information_hash[:structureGestion][:id], entity_name: information_hash[:structureGestion].dig(:nom, :libelleFr),
|
372
|
+
info_entity_id: (information_hash[:structureInformation] || information_hash[:structureGestion])[:id],
|
373
|
+
info_entity_name: (information_hash[:structureInformation] || information_hash[:structureGestion]).dig(:nom, :libelleFr),
|
374
|
+
service_provider_id: node_id(type_data_hash, :prestataireActivites)})
|
369
375
|
end
|
370
376
|
|
371
377
|
if information_hash[:informationsLegales]
|
data/app/models/apidae/obj.rb
CHANGED
@@ -12,19 +12,20 @@ module Apidae
|
|
12
12
|
|
13
13
|
store_accessor :title_data, :title
|
14
14
|
store_accessor :owner_data, :owner_name, :owner_id, :polls
|
15
|
-
store_accessor :description_data, :short_desc, :long_desc, :theme_desc, :private_desc
|
15
|
+
store_accessor :description_data, :short_desc, :long_desc, :theme_desc, :private_desc, :accessibility_desc
|
16
16
|
store_accessor :pictures_data, :pictures
|
17
17
|
store_accessor :attachments_data, :attachments
|
18
18
|
store_accessor :type_data, :categories, :themes, :capacity, :classification, :classification_date,
|
19
19
|
:classification_ref, :labels, :chains, :area, :track, :tricky_sections, :products, :audience, :animals,
|
20
20
|
:animals_desc, :extra, :duration, :certifications, :business, :business_equipments, :business_rooms
|
21
|
-
store_accessor :entity_data, :entity_id, :entity_name, :service_provider_id, :is_service_provider, :legal
|
21
|
+
store_accessor :entity_data, :entity_id, :entity_name, :info_entity_id, :info_entity_name, :service_provider_id, :is_service_provider, :legal
|
22
22
|
store_accessor :contact_data, :telephone, :email, :website, :google, :facebook, :twitter, :yelp, :trip_advisor, :fax,
|
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,
|
27
|
-
|
26
|
+
store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :rates_category, :payment_methods, :includes, :excludes,
|
27
|
+
:rates_extra, :tax_included
|
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
|
30
31
|
store_accessor :version_data, :versioned_fields
|
@@ -235,7 +236,7 @@ module Apidae
|
|
235
236
|
apidae_obj.apidae_type = object_data[:type]
|
236
237
|
apidae_obj.apidae_subtype = ApidaeDataParser.node_id(object_data[type_fields[:node]], type_fields[:subtype])
|
237
238
|
apidae_obj.title_data = ApidaeDataParser.parse_title(object_data, *locales)
|
238
|
-
apidae_obj.description_data = ApidaeDataParser.parse_desc_data(object_data[:presentation], object_data[:donneesPrivees], *locales)
|
239
|
+
apidae_obj.description_data = ApidaeDataParser.parse_desc_data(object_data[:presentation], object_data[:donneesPrivees], object_data[:prestations], *locales)
|
239
240
|
apidae_obj.contact_data = ApidaeDataParser.parse_contact_data(object_data[:informations], object_data[:contacts])
|
240
241
|
apidae_obj.location_data = ApidaeDataParser.parse_location_data(object_data[:localisation], object_data[type_fields[:node]],
|
241
242
|
object_data[:territoires])
|
@@ -25,9 +25,9 @@ module Apidae
|
|
25
25
|
ALL_VERSIONS = [STANDARD_VERSION, WINTER_VERSION, SUMMER_VERSION, CHALLENGED_VERSION, BUSINESS_VERSION,
|
26
26
|
GROUPS_VERSION, ACTIVITIES_VERSION]
|
27
27
|
|
28
|
-
LOCALIZED_FIELDS = [:title, :short_desc, :long_desc, :pictures, :attachments,
|
29
|
-
:includes, :excludes, :extra, :booking_desc]
|
30
|
-
ALL_FIELDS = LOCALIZED_FIELDS + [:theme_desc, :private_desc, :capacity, :telephone, :email, :website,
|
28
|
+
LOCALIZED_FIELDS = [:title, :short_desc, :long_desc, :pictures, :attachments,
|
29
|
+
:openings_desc, :rates_desc, :includes, :excludes, :extra, :booking_desc]
|
30
|
+
ALL_FIELDS = LOCALIZED_FIELDS + [:theme_desc, :private_desc, :accessibility_desc, :capacity, :telephone, :email, :website,
|
31
31
|
:google, :facebook, :twitter, :yelp, :trip_advisor, :fax, :mobile_website, :shorty_url,
|
32
32
|
:openings, :openings_extra, :rates, :services, :payment_methods, :categories, :themes,
|
33
33
|
:labels, :chains, :classification, :challenged, :environments, :languages, :products,
|
data/lib/apidae/version.rb
CHANGED