Skip to content

Commit

Permalink
Merge pull request #361 from roomorama/release/0.9.2
Browse files Browse the repository at this point in the history
Release/0.9.2
  • Loading branch information
keang authored Sep 19, 2016
2 parents a2cda3e + f081c84 commit 861c272
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 31 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ 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.9.2] - 2016-09-19
### Fixed
- Improper type/subtype combinations
- Ciirus:: skip properties with monthly rates

## [0.9.1] - 2016-09-15
### Added
- Ciirus (0, 0) coordinates validation
Expand Down
3 changes: 2 additions & 1 deletion apps/workers/suppliers/ciirus/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ class Metadata
attr_reader :synchronisation, :host
IGNORABLE_RATES_ERROR_MESSAGES = [
"(soap:Server) Server was unable to process request. ---> GetPropertyRates: Error - No Rate Assigned by user. Please contact the user and request they populate this data.",
"(soap:Server) Server was unable to process request. ---> GetPropertyRates: Error - No Rate Rows Returned"
"(soap:Server) Server was unable to process request. ---> GetPropertyRates: Error - No Rate Rows Returned",
"(soap:Server) Server was unable to process request. ---> GetPropertyRates: Monthly Rates Not Supported via API. Monthly Rates Set By User. Please contact the Unit Supplier to configure a supported rate type for your channel."
]

IGNORABLE_IMAGES_ERROR_MESSAGE = '(soap:Server) Server was unable to process request. ---> GetImageList: This property contains demo images.'
Expand Down
6 changes: 6 additions & 0 deletions lib/concierge/roomorama/property.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ module Roomorama
# table in Roomorama. It includes attribute accessors for all parameters accepted
# by Roomorama's API, as well as convenience methods to set property images.
#
# The current valid type/subtypes are:
# "room" => [],
# "house" => ["villa", "cottage", "cabin", "chateau", "bungalow"],
# "apartment" => ["loft", "serviced_apartment", "condo", "luxury_apartment", "studio_bachelor"],
# "bnb" => [],
# "hostel" => []
# Usage
#
# property = Roomorama::Property.new("ID123")
Expand Down
4 changes: 0 additions & 4 deletions lib/concierge/suppliers/atleisure/mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,11 @@ def set_property_type
property.subtype = 'cottage'
when 40 # Mansion
property.type = 'house'
property.subtype = 'townhouse'
when 50 # Villa
property.type = 'house'
property.subtype = 'villa'
when 60 # Chalet
property.type = 'house'
property.subtype = 'ski_chalet'
when 80 # Bungalow
property.type = 'house'
property.subtype = 'bungalow'
Expand All @@ -209,10 +207,8 @@ def set_property_type
property.subtype = 'cabin'
when 160 # Apartment
property.type = 'apartment'
property.subtype = 'apartment'
when 70, 90, 95, 100, 145, 150, 170 # Farmhouse, Boat, House Boat, Holiday Home, Riad, Mobile Home, Cave house
property.type = 'house'
property.subtype = 'house'
end
end

Expand Down
28 changes: 14 additions & 14 deletions lib/concierge/suppliers/kigo/mappers/property_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ def map(id)
# Skipped property types (hostel, hotel, resort)
def type_mapping
{
'House' => ['house', 'house'],
'Beach house' => ['house', 'beach_house'],
'Lake house' => ['house', 'lake_house'],
'Mountain house' => ['house', 'house'],
'House' => ['house', nil],
'Beach house' => ['house', nil],
'Lake house' => ['house', nil],
'Mountain house' => ['house', nil],
'Country house / villa' => ['house', 'villa'],
'Cottage / chalet / cabin' => ['house', 'chalet'],
'Cottage / chalet / cabin' => ['house', nil],
'Bungalow' => ['house', 'bungalow'],
'Town house' => ['house', 'townhouse'],
'Mobile home' => ['room', 'cabin'],
'Bed and breakfast' => ['bnb', 'room'],
'Share house' => ['house', 'house'],
'Apartment' => ['apartment', 'apartment'],
'Condo' => ['apartment', 'luxury_apartment'],
'Town house' => ['house', nil],
'Mobile home' => ['house', 'cabin'],
'Bed and breakfast' => ['bnb', nil],
'Share house' => ['room', nil],
'Apartment' => ['apartment', nil],
'Condo' => ['apartment', 'condo'],
'Penthouse' => ['apartment', 'luxury_apartment'],
'Camping' => ['room', 'cabin'],
'Camping' => ['house', 'cabin'],
'Other' => ['room', nil],
'Houseboat' => ['house', 'house']
'Houseboat' => ['house', nil]
}
end

end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class RoomoramaProperty

# Maps Poplidays lodging type to Roomorama property type/subtype.
PROPERTY_TYPES = Concierge::SafeAccessHash.new({
'APARTMENT' => {type: 'apartment', subtype: 'apartment'},
'HOUSE' => {type: 'house', subtype: 'house'},
'APARTMENT' => {type: 'apartment'},
'HOUSE' => {type: 'house'},
})


Expand Down Expand Up @@ -236,4 +236,4 @@ def to_stay(availability, mandatory_services)
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/concierge/suppliers/waytostay/properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Properties
identifier: "reference",
title: "general.name",
description: "descriptions.description",
type: "general.type",
type: "general.type", # Currently all are "Apartment"
lat: "location.coord.lat",
lng: "location.coord.lng",
number_of_bedrooms: "general.bedrooms",
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.9.1"
VERSION = "0.9.2"
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
property.description = "Bonjour!"
property.nightly_rate = 100
property.currency = "EUR"
property.type = "bnb"

image = Roomorama::Image.new("IMG1")
image.url = "https://www.example.org/image1.png"
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/concierge/roomorama/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
property.description = "Bonjour!"
property.nightly_rate = 100
property.currency = "EUR"
property.type = "bnb"

image = Roomorama::Image.new("IMG1")
image.url = "https://www.example.org/image1.png"
Expand Down Expand Up @@ -73,6 +74,7 @@
it "sends the request with the correct parameters" do
serialized_property = {
identifier: "JPN123",
type: "bnb",
title: "Studio Apartment in Paris",
description: "Bonjour!",
multi_unit: false,
Expand Down
3 changes: 3 additions & 0 deletions spec/lib/concierge/roomorama/property_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
nightly_rate: 100,
pets_allowed: false,
default_to_available: false,
type: "bnb",

images: [
{
Expand Down Expand Up @@ -228,6 +229,8 @@
unit.add_image(image)

subject.add_unit(unit)

subject.type = "bnb"
end

it "is invalid if the identifier is not given" 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 @@ -141,7 +141,7 @@
expect(property.services_cleaning_rate).to eq 150
expect(property.smoking_allowed).to eq false
expect(property.type).to eq 'house'
expect(property.subtype).to eq 'house'
expect(property.subtype).to eq nil
expect(property.minimum_stay).to eq 3
expect(property.nightly_rate.to_i).to eq 57
expect(property.weekly_rate.to_i).to eq 402
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

it { expect(subject.map(123)).to eq nil }
it { expect(subject.map(nil)).to eq nil }
it { expect(subject.map(property_type_id)).to eq %w(house lake_house) }
it { expect(subject.map(property_type_id)).to eq ['house', nil] }

end

end
end
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
expect(roomorama_property).to be_a(Roomorama::Property)
expect(roomorama_property.identifier).to eq('8927439190')
expect(roomorama_property.type).to eq('apartment')
expect(roomorama_property.subtype).to eq('apartment')
expect(roomorama_property.subtype).to eq(nil)
expect(roomorama_property.title).to eq('Rental Apartment RIVIERA GARDEN - Antibes, 1 bedroom, 4 persons')
expect(roomorama_property.address).to eq('87-91 Avenue Francisque PERRAUD')
expect(roomorama_property.postal_code).to eq('06600')
Expand Down Expand Up @@ -148,4 +148,4 @@
def to_safe_hash(hash)
Concierge::SafeAccessHash.new(hash)
end
end
end
4 changes: 3 additions & 1 deletion spec/lib/tasks/properties.rake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
before do
refs.each do |ref|
create_property(identifier: ref,
data: {amenities: "wifi,laundry",
data: {
amenities: "wifi,laundry",
type: "bnb",
images: [
{ identifier: "PROP1IMAGE", url: "https://www.example.org/image.png" }
]})
Expand Down
1 change: 1 addition & 0 deletions spec/support/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def create_property(overrides = {})
identifier: "PROP1",
data: {
title: "Studio Apartment in Madrid",
type: "bnb",
nightly_rate: 10,
images: [
{ identifier: "PROP1IMAGE", url: "https://www.example.org/image.png" }
Expand Down
1 change: 1 addition & 0 deletions spec/workers/operation_runner/publish_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
property.nightly_rate = 100
property.weekly_rate = 200
property.monthly_rate = 300
property.type = "bnb"

image = Roomorama::Image.new("img1")
image.identifier = "img1"
Expand Down
3 changes: 3 additions & 0 deletions spec/workers/property_synchronisation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
property.nightly_rate = 100
property.weekly_rate = 200
property.monthly_rate = 300
property.type = "bnb"

image = Roomorama::Image.new("img1")
image.identifier = "img1"
Expand Down Expand Up @@ -186,6 +187,7 @@
it "enqueues a disable operation with non-processed identifiers" do
data = {
identifier: "prop1",
type: "bnb",
images: [
{
identifier: "img1",
Expand Down Expand Up @@ -224,6 +226,7 @@

data = {
identifier: "prop1",
type: "bnb",
images: [
{
identifier: "img1",
Expand Down
1 change: 1 addition & 0 deletions spec/workers/router_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
property.nightly_rate = 100
property.weekly_rate = 200
property.monthly_rate = 300
property.type = "bnb"

image = Roomorama::Image.new("img1")
image.identifier = "img1"
Expand Down
3 changes: 2 additions & 1 deletion spec/workers/suppliers/waytostay_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@
end

data = {
title: "Studio Apartment in Madrid",
title: "Studio Apartment in Madrid",
nightly_rate: 10,
type: "bnb",
images: [
{ identifier: "PROP1IMAGE", url: "https://www.example.org/image.png" }
]
Expand Down

0 comments on commit 861c272

Please sign in to comment.