apidae 1.3.6 → 1.3.9
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 -3
- data/app/models/apidae/obj.rb +6 -4
- data/config/initializers/cache.rb +1 -1
- data/lib/apidae/version.rb +1 -1
- data/test/dummy/log/development.log +168 -351
- data/test/dummy/log/test.log +495 -9201
- data/test/models/apidae/obj_test.rb +10 -3
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66681e7a228d04a5be420fea1d27f363dab5f3abd1431cfcfc9ddc00e1931bc1
|
4
|
+
data.tar.gz: 6872e5a2de4d23d368b00c7bb01639113afc5b1133952ce793a12e7f372885f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45e6cf33a4d259a15576d28936fa7f8fc917cf4538d00c8bfec03b45b0bdde200c6cd6d536884030d2fa9d86a2313ec9e63b2bd190ff65ec6e395a19c6310acc
|
7
|
+
data.tar.gz: 40040d7672373c353358d5cba94c10f296eb6d810868d698ad11f0090456c3897c33b2838a8aeeac974bb4465f7420f37a5c5eca09cf91d40572ef4c589735b1
|
@@ -113,7 +113,7 @@ module Apidae
|
|
113
113
|
short_desc: node_value(data_hash, :descriptifCourt, *locales),
|
114
114
|
long_desc: node_value(data_hash, :descriptifDetaille, *locales),
|
115
115
|
theme_desc: data_hash[:descriptifsThematises].blank? ? {} : Hash[data_hash[:descriptifsThematises].map {|th| [node_id(th, :theme), node_value(th, :description, *locales)]}],
|
116
|
-
private_desc: private_data.blank? ? {} : Hash[private_data.map {|d| [d[:nomTechnique], node_value(d, :descriptif, *locales)]}]
|
116
|
+
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))]}]
|
117
117
|
}
|
118
118
|
end
|
119
119
|
end
|
@@ -253,6 +253,7 @@ module Apidae
|
|
253
253
|
methods = rates_hash[:modesPaiement].blank? ? [] : rates_hash[:modesPaiement].map {|p| p[:id]}
|
254
254
|
{
|
255
255
|
rates_desc: desc, rates: values, payment_methods: methods,
|
256
|
+
tax_included: rates_hash[:taxeDeSejourIncluse].blank? ? nil : (rates_hash[:taxeDeSejourIncluse] == 'OUI'),
|
256
257
|
rates_desc_mode: rates_hash[:tarifsEnClairGenerationMode] == 'AUTOMATIQUE' ? MODE_AUTO : MODE_MANUAL,
|
257
258
|
includes: node_value(rates_hash, :leTarifComprend, *locales),
|
258
259
|
excludes: node_value(rates_hash, :leTarifNeComprendPas, *locales),
|
@@ -275,6 +276,8 @@ module Apidae
|
|
275
276
|
age_min: presta_hash[:ageMin], age_max: presta_hash[:ageMax]} : {}),
|
276
277
|
classification: nodes_ids(data_hash[:classement], data_hash[:classementPrefectoral], data_hash[:classification]) +
|
277
278
|
lists_ids(data_hash[:classementsGuides]) + lists_ids(data_hash[:classements]),
|
279
|
+
classification_date: data_hash[:dateClassement],
|
280
|
+
classification_ref: data_hash[:numeroClassement],
|
278
281
|
labels: lists_ids(data_hash[:labels], data_hash[:labelsChartesQualite], prestations_hash[:labelsTourismeHandicap]) +
|
279
282
|
(node_id(data_hash, :typeLabel) ? [node_id(data_hash, :typeLabel)] : []),
|
280
283
|
chains: lists_ids(data_hash[:chaines]) + nodes_ids(data_hash[:chaineEtLabel]),
|
@@ -288,7 +291,10 @@ module Apidae
|
|
288
291
|
extra: apidae_obj.apidae_type == Obj::SPA ? node_value(data_hash, :formuleHebergement, *locales) : node_value(prestations_hash, :complementAccueil, *locales),
|
289
292
|
duration: apidae_obj.apidae_type == Obj::SPA ? {days: data_hash[:nombreJours], nights: data_hash[:nombreNuits]} : data_hash[:dureeSeance],
|
290
293
|
certifications: data_hash[:agrements].blank? ? [] : data_hash[:agrements].map {|a| {id: a[:type][:id], identifier: a[:numero]}},
|
291
|
-
business: business_hash
|
294
|
+
business: (business_hash || {}).except(:sallesEquipeesPour, :sallesEquipement, :sallesRestauration, :sallesReunion, :sallesHebergement),
|
295
|
+
business_equipments: lists_ids((business_hash || {})[:sallesEquipeesPour], (business_hash || {})[:sallesEquipement],
|
296
|
+
(business_hash || {})[:sallesRestauration], (business_hash || {})[:sallesHebergement]),
|
297
|
+
business_rooms: (business_hash || {})[:sallesReunion]
|
292
298
|
}
|
293
299
|
end
|
294
300
|
|
@@ -325,12 +331,14 @@ module Apidae
|
|
325
331
|
def self.parse_booking(reservation_hash, visits_hash, *locales)
|
326
332
|
booking_hash = {}
|
327
333
|
if reservation_hash
|
328
|
-
booking_hash[:booking_desc] = node_value(reservation_hash, :complement, *locales)
|
334
|
+
booking_hash[:booking_desc] = node_value(reservation_hash, :complement, *locales)
|
329
335
|
booking_hash[:booking_entities] = reservation_hash[:organismes]
|
330
336
|
end
|
331
337
|
if visits_hash
|
332
338
|
booking_hash[:visits_allowed] = visits_hash[:visitable] == true
|
333
339
|
booking_hash[:visits_desc] = node_value(visits_hash, :complementVisite, *locales)
|
340
|
+
booking_hash[:visits_duration] = visits_hash[:dureeMoyenneVisiteIndividuelle]
|
341
|
+
booking_hash[:visits_services] = lists_ids(visits_hash[:prestationsVisitesGroupees]) + lists_ids(visits_hash[:prestationsVisitesIndividuelles])
|
334
342
|
end
|
335
343
|
booking_hash
|
336
344
|
end
|
data/app/models/apidae/obj.rb
CHANGED
@@ -14,16 +14,17 @@ module Apidae
|
|
14
14
|
store_accessor :description_data, :short_desc, :long_desc, :theme_desc, :private_desc
|
15
15
|
store_accessor :pictures_data, :pictures
|
16
16
|
store_accessor :attachments_data, :attachments
|
17
|
-
store_accessor :type_data, :categories, :themes, :capacity, :classification, :
|
18
|
-
:
|
17
|
+
store_accessor :type_data, :categories, :themes, :capacity, :classification, :classification_date,
|
18
|
+
:classification_ref, :labels, :chains, :area, :track, :tricky_sections, :products, :audience, :animals,
|
19
|
+
:animals_desc, :extra, :duration, :certifications, :business, :business_equipments, :business_rooms
|
19
20
|
store_accessor :entity_data, :entity_id, :entity_name, :service_provider_id, :is_service_provider, :legal
|
20
21
|
store_accessor :contact_data, :telephone, :email, :website, :google, :facebook, :twitter, :yelp, :trip_advisor, :fax,
|
21
22
|
:mobile_website, :shorty_url, :contacts
|
22
23
|
store_accessor :location_data, :address, :place, :latitude, :longitude, :access, :territories, :environments, :altitude, :map_reference
|
23
24
|
store_accessor :openings_data, :openings_desc, :openings_desc_mode, :openings, :time_periods, :openings_extra
|
24
|
-
store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :payment_methods, :includes, :excludes, :rates_extra
|
25
|
+
store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :payment_methods, :includes, :excludes, :rates_extra, :tax_included
|
25
26
|
store_accessor :service_data, :services, :equipments, :comfort, :activities, :challenged, :languages
|
26
|
-
store_accessor :booking_data, :booking_desc, :booking_entities, :visits_allowed, :visits_desc
|
27
|
+
store_accessor :booking_data, :booking_desc, :booking_entities, :visits_allowed, :visits_desc, :visits_duration, :visits_services
|
27
28
|
store_accessor :tags_data, :promo, :internal, :linked
|
28
29
|
store_accessor :version_data, :versioned_fields
|
29
30
|
|
@@ -79,6 +80,7 @@ module Apidae
|
|
79
80
|
STR = 'STRUCTURE'
|
80
81
|
TER = 'TERRITOIRE'
|
81
82
|
|
83
|
+
# Todo : subtype for DEG shoud be :statutsExploitant (double check and fix in 1.2 and master)
|
82
84
|
TYPES_DATA = {
|
83
85
|
ACT => {node: :informationsActivite, subtype: :activiteType},
|
84
86
|
COS => {node: :informationsCommerceEtService, subtype: :commerceEtServiceType},
|
@@ -1 +1 @@
|
|
1
|
-
$apidae_cache = ActiveSupport::Cache::FileStore.new('cache/apidae', expires_in: 24.hours)
|
1
|
+
$apidae_cache = ActiveSupport::Cache::FileStore.new('cache/apidae', expires_in: ENV['APIDAE_CACHE_DURATION'] || 24.hours)
|
data/lib/apidae/version.rb
CHANGED