Skip to content

Commit

Permalink
Merge pull request #514 from roomorama/hotfix/update_cancellation_policy
Browse files Browse the repository at this point in the history
Update cancellation policy naming
  • Loading branch information
keang authored Nov 8, 2016
2 parents 0976663 + 9a70c3a commit 7bfae15
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This file summarises the most important changes that went live on each release
of Concierge. Please check the Wiki entry on the release process to understand
how this file is formatted and how the process works.
## [0.13.1] - 2016-11-08
## Changed
- Cancellation policies naming

## [0.13.0] - 2016-11-02
### Added
- Avantio integrations: quote, book, cancel and synchronisation
Expand Down
9 changes: 9 additions & 0 deletions lib/concierge/roomorama/cancellation_policy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Roomorama
module CancellationPolicy
FLEXIBLE = 'flexible'.freeze
MODERATE = 'moderate'.freeze
FIRM = 'firm'.freeze
STRICT = 'strict'.freeze
SUPER_STRICT = 'super_strict'.freeze
end
end
2 changes: 1 addition & 1 deletion lib/concierge/suppliers/atleisure/mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module AtLeisure
# * +meta_data+ - hash based AtLeisure payload
#
class Mapper
CANCELLATION_POLICY = 'super_elite'
CANCELLATION_POLICY = Roomorama::CancellationPolicy::SUPER_STRICT

CODES = {
property_type: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Mappers
# This class is responsible for building a +Roomorama::Property+ object
# from data getting from Avantio.
class RoomoramaProperty
CANCELLATION_POLICY = 'super_elite'
CANCELLATION_POLICY = Roomorama::CancellationPolicy::SUPER_STRICT

PROPERTY_TYPES = Concierge::SafeAccessHash.new({
1 => {type: 'apartment'}, # Apartment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Mappers
# This class is responsible for building a +Roomorama::Property+ object
# from data getting from Ciirus API.
class RoomoramaProperty
CANCELLATION_POLICY = 'super_elite'
CANCELLATION_POLICY = Roomorama::CancellationPolicy::SUPER_STRICT
# Until we hear from ciirus on how to determine this field, it will be.. unknown
SECURITY_DEPOSIT_TYPE = 'unknown'

Expand Down
2 changes: 1 addition & 1 deletion lib/concierge/suppliers/kigo/mappers/property.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Kigo::Mappers
#
class Property

CANCELLATION_POLICY = 'super_elite'
CANCELLATION_POLICY = Roomorama::CancellationPolicy::SUPER_STRICT

attr_reader :property, :payload, :references, :pricing, :resolver

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Mappers
# from data getting from Poplidays API.
class RoomoramaProperty
# NOTE: actually Poplidays API doesn't support cancellation
CANCELLATION_POLICY = 'super_elite'
CANCELLATION_POLICY = Roomorama::CancellationPolicy::SUPER_STRICT

# Apparently Poplidays does not have the "security deposit method",
# and they ask the guest to figure out directly with the host.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class RoomoramaProperty
attr_reader :ru_property, :location, :owner, :seasons

EN_DESCRIPTION_LANG_CODE = "1"
CANCELLATION_POLICY = "super_elite"
CANCELLATION_POLICY = Roomorama::CancellationPolicy::SUPER_STRICT
DEFAULT_PROPERTY_RATE = "9999"
MINIMUM_STAY = 1
SURFACE_UNIT = "metric"
Expand Down
2 changes: 1 addition & 1 deletion lib/concierge/suppliers/saw/mappers/roomorama_property.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Mappers
# Object initialization includes mapping of property attributes, rates,
# amenitites, images, units.
class RoomoramaProperty
CANCELLATION_POLICY = 'moderate'
CANCELLATION_POLICY = Roomorama::CancellationPolicy::MODERATE

# Bulds Roomorama::Property object
#
Expand Down
2 changes: 1 addition & 1 deletion lib/concierge/suppliers/waytostay/properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def property_attributes_from(response)
attr.merge!({
surface_unit: "metric",
default_to_available: true,
cancellation_policy: "strict",
cancellation_policy: Roomorama::CancellationPolicy::FIRM,
instant_booking: true
})
attr.merge! parse_floors(response)
Expand Down
2 changes: 1 addition & 1 deletion lib/concierge/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Concierge
VERSION = "0.13.0"
VERSION = "0.13.1"
end
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"check_out_time": "11:00:00",
"currency": "EUR",
"default_to_available": true,
"cancellation_policy": "strict",
"cancellation_policy": "firm",
"services_cleaning": true,
"services_cleaning_rate": 75,
"services_cleaning_required": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"check_out_time": "11:00:00",
"currency": "EUR",
"default_to_available": true,
"cancellation_policy": "strict",
"cancellation_policy": "firm",
"services_cleaning": true,
"services_cleaning_rate": 75,
"services_cleaning_required": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"security_deposit_currency": "EUR",
"security_deposit_type": "cash",
"default_to_available": true,
"cancellation_policy": "strict",
"cancellation_policy": "firm",
"instant_booking": true,
"description_append": "License number: HUTB-012425 68",
"translations": {
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/concierge/roomorama/diff_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

it "is able to set and retrieve property attributes" do
subject.title = "Beautiful Apartment in Paris"
subject.cancellation_policy = "elite"
subject.cancellation_policy = Roomorama::CancellationPolicy::STRICT

expect(subject.title).to eq "Beautiful Apartment in Paris"
expect(subject.cancellation_policy).to eq "elite"
expect(subject.cancellation_policy).to eq Roomorama::CancellationPolicy::STRICT
end

it "is nil for attributes not set" do
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/concierge/roomorama/property_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

it "is able to set and retrieve property attributes" do
subject.title = "Beautiful Apartment in Paris"
subject.cancellation_policy = "elite"
subject.cancellation_policy = Roomorama::CancellationPolicy::STRICT

expect(subject.title).to eq "Beautiful Apartment in Paris"
expect(subject.cancellation_policy).to eq "elite"
expect(subject.cancellation_policy).to eq Roomorama::CancellationPolicy::STRICT
end

it "is nil for attributes not set" do
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/concierge/suppliers/atleisure/mapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
expect(property.max_guests).to eq 8
expect(property.pets_allowed).to eq true
expect(property.currency).to eq 'EUR'
expect(property.cancellation_policy).to eq 'super_elite'
expect(property.cancellation_policy).to eq 'super_strict'
expect(property.default_to_available).to eq false
expect(property.country_code).to eq 'BE'
expect(property.city).to eq 'Malmedy'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
expect(property.surface_unit).to be_nil
expect(property.pets_allowed).to be true
expect(property.currency).to eq('EUR')
expect(property.cancellation_policy).to eq('super_elite')
expect(property.cancellation_policy).to eq('super_strict')
expect(property.security_deposit_amount).to eq(1000.0)
expect(property.security_deposit_type).to eq('cash')
expect(property.security_deposit_currency_code).to eq('EUR')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
expect(roomorama_property.amenities).to eq(amenities)
expect(roomorama_property.pets_allowed).to be(true)
expect(roomorama_property.currency).to eq('USD')
expect(roomorama_property.cancellation_policy).to eq('super_elite')
expect(roomorama_property.cancellation_policy).to eq('super_strict')

expect(roomorama_property.images.length).to eq(1)
image = roomorama_property.images.first
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/concierge/suppliers/kigo/mappers/property_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
expect(property.floor).to eq 3
expect(property.pets_allowed).to eq true
expect(property.smoking_allowed).to eq false
expect(property.cancellation_policy).to eq 'super_elite'
expect(property.cancellation_policy).to eq 'super_strict'
expect(property.default_to_available).to eq true
expect(property.check_in_time).to eq '15:00'
expect(property.check_out_time).to eq '10:00'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
expect(roomorama_property.currency).to eq('EUR')
expect(roomorama_property.surface).to eq(45)
expect(roomorama_property.surface_unit).to eq('metric')
expect(roomorama_property.cancellation_policy).to eq('super_elite')
expect(roomorama_property.cancellation_policy).to eq('super_strict')
expect(roomorama_property.security_deposit_amount).to eq(500.0)
expect(roomorama_property.security_deposit_currency_code).to eq('EUR')
expect(roomorama_property.security_deposit_type).to eq('unknown')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
end

it "sets cancellation_policy to the property" do
expect(property.cancellation_policy).to eq("super_elite")
expect(property.cancellation_policy).to eq("super_strict")
end

it "sets default_to_available flag to false" do
Expand Down

0 comments on commit 7bfae15

Please sign in to comment.