apidae 1.4.2 → 1.4.3
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 +11 -5
- data/app/models/apidae/obj.rb +4 -4
- data/config/initializers/constants.rb +3 -3
- data/lib/apidae/version.rb +1 -1
- 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: aabfe9be4d2de7c87baa00f3234faf20fe31ab8125f6163acf65e0aa772e1dbc
|
4
|
+
data.tar.gz: fb0e940576b5b979ed5ae0dd5fba63c24578c8293152372e8f0dfa67d195588b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc81a47d8e6165241e0449217e116e1d9f22e39c4e403ba377950bc8d527631abe593ab2be49ef589d1f8dbca41430606c890722020bb525a364dcaa3642f9a3
|
7
|
+
data.tar.gz: fbd8e4c42aec95838f8a65c6d88a73f07f82082910d42fbbf71068678adb51cccc1d6caf61e9e1bded5424d965ade31c46ec49bbe6eb1d649fc0227bd12fe06f
|
@@ -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
|
@@ -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,19 @@ 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
26
|
store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :payment_methods, :includes, :excludes, :rates_extra, :tax_included
|
27
|
-
store_accessor :service_data, :services, :equipments, :comfort, :activities, :challenged, :languages
|
27
|
+
store_accessor :service_data, :services, :equipments, :comfort, :activities, :challenged, :languages, :documentation_languages
|
28
28
|
store_accessor :booking_data, :booking_desc, :booking_entities, :visits_allowed, :visits_desc, :visits_duration, :visits_services
|
29
29
|
store_accessor :tags_data, :promo, :internal, :linked
|
30
30
|
store_accessor :version_data, :versioned_fields
|
@@ -235,7 +235,7 @@ module Apidae
|
|
235
235
|
apidae_obj.apidae_type = object_data[:type]
|
236
236
|
apidae_obj.apidae_subtype = ApidaeDataParser.node_id(object_data[type_fields[:node]], type_fields[:subtype])
|
237
237
|
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)
|
238
|
+
apidae_obj.description_data = ApidaeDataParser.parse_desc_data(object_data[:presentation], object_data[:donneesPrivees], object_data[:prestations], *locales)
|
239
239
|
apidae_obj.contact_data = ApidaeDataParser.parse_contact_data(object_data[:informations], object_data[:contacts])
|
240
240
|
apidae_obj.location_data = ApidaeDataParser.parse_location_data(object_data[:localisation], object_data[type_fields[:node]],
|
241
241
|
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