Skip to content

Commit

Permalink
Merge pull request #96 from sygic-travel/hotel-ratings
Browse files Browse the repository at this point in the history
Hotel ratings
  • Loading branch information
NeosinneR authored Sep 18, 2017
2 parents f1982e9 + ddd423e commit 368c678
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ export namespace Places {
thumbnailUrl: string | null;
marker: string;
parents: string[];
starRating: number | null;
starRatingUnofficial: number | null;
customerRating: number | null;
detail: PlaceDetail | null;
}

Expand Down
3 changes: 3 additions & 0 deletions src/Places/Mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export const mapPlace = (place, detail: PlaceDetail | null) => {
marker: place.marker,
categories: place.categories,
parents: place.parent_ids,
starRating: place.star_rating,
starRatingUnofficial: place.star_rating_unofficial,
customerRating: place.customer_rating,
detail
} as Place;
};
Expand Down
3 changes: 3 additions & 0 deletions src/Places/Place.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export interface Place {
thumbnailUrl: string | null;
marker: string;
parents: string[];
starRating: number | null;
starRatingUnofficial: number | null;
customerRating: number | null;
detail: PlaceDetail | null;
}

Expand Down
3 changes: 3 additions & 0 deletions src/Spread/Spreader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const place: Place = {
categories: [],
parents: [],
perex: '',
starRatingUnofficial: null,
starRating: null,
customerRating: null,
thumbnailUrl: 'http://example.com',
detail: null
};
Expand Down
3 changes: 3 additions & 0 deletions src/SpreadV2/Spreader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const place: Place = {
parents: [],
perex: '',
thumbnailUrl: 'http://example.com',
starRating: null,
starRatingUnofficial: null,
customerRating: null,
detail: null
};
const sizeConfigs: SpreadSizeConfig[] = [
Expand Down
3 changes: 3 additions & 0 deletions src/TestData/HotelsApiReponses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export const hotels = {
"name_suffix": "Prague, Czech Republic",
"url": "https://alpha.travel.sygic.com/go/poi:345430",
"marker": "sightseeing:art:artwork",
"star_rating": 4,
"star_rating_unofficial": null,
"customer_rating": 8.6,
"categories": [
"sightseeing"
],
Expand Down
3 changes: 3 additions & 0 deletions src/TestData/HotelsExpectedResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export const hotels = [{
quadkey: '120212302033311321',
name: 'Charles Bridge',
nameSuffix: 'Prague, Czech Republic',
starRating: 4,
starRatingUnofficial: null,
customerRating: 8.6,
boundingBox: null,
perex: 'This 14-century bridge connects the Old Town with Lesser Town and the Prague Castle.' +
' With its length of 621 meters, solid Gothic stone…',
Expand Down
7 changes: 7 additions & 0 deletions src/TestData/PlacesApiResponses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export const placeDetailedEiffelTowerWithoutMedia = {
"price": null,
"owner_id": "12345",
"marker": "sightseeing:tower:lookout:observation",
"star_rating": 4,
"star_rating_unofficial": null,
"customer_rating": 8.6,
"categories": [
"sightseeing"
],
Expand Down Expand Up @@ -218,6 +221,9 @@ export const places = {
"name_suffix": "Prague, Czech Republic",
"url": "https://alpha.travel.sygic.com/go/poi:345430",
"marker": "sightseeing:art:artwork",
"star_rating" : 4,
"star_rating_unofficial": null,
"customer_rating": 8.6,
"categories": [
"sightseeing"
],
Expand Down Expand Up @@ -328,6 +334,7 @@ export const customPlaceData = {
"categories": [],
"customer_rating": null,
"star_rating": null,
"star_rating_unofficial": null,
"tags": [],
"address": null,
"admission": null,
Expand Down
9 changes: 9 additions & 0 deletions src/TestData/PlacesExpectedResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export const placeDetailedEiffelTowerWithoutMedia: Place = {
id: 'poi:530',
level: 'poi',
marker: 'sightseeing:tower:lookout:observation',
starRating: 4,
starRatingUnofficial: null,
customerRating: 8.6,
rating: 7.9110977331847,
location: {
lat: 48.858262,
Expand Down Expand Up @@ -106,6 +109,9 @@ export const places = [{
url: 'https://alpha.travel.sygic.com/go/poi:345430',
thumbnailUrl: 'https://alpha-media-cdn.sygictraveldata.com/media/poi:345430',
marker: 'sightseeing:art:artwork',
starRating: 4,
starRatingUnofficial: null,
customerRating: 8.6,
categories: ['sightseeing'],
parents: ['city:5', 'region:26009', 'region:26011', 'country:5', 'continent:1'],
detail: null
Expand Down Expand Up @@ -301,6 +307,9 @@ export const customPlace = {
url: null,
categories: [],
marker: 'default',
starRating: null,
starRatingUnofficial: null,
customerRating: null,
parents: [],
perex: '',
thumbnailUrl: null,
Expand Down
3 changes: 3 additions & 0 deletions src/TestData/SearchLocationExpectedResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export const searchLocations = [{
url: 'https://travel.sygic.com/go/poi:203997',
thumbnailUrl: null,
marker: 'shopping:optician',
starRating: null,
starRatingUnofficial: null,
customerRating: null,
parents: [],
detail: {
tags: [{
Expand Down
1 change: 1 addition & 0 deletions src/TestData/SearchLocationsApiResponses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const searchLocations = {
perex: null,
customer_rating: null,
star_rating: null,
star_rating_unofficial: null,
thumbnail_url: null,
meta: {
tier: 3,
Expand Down

0 comments on commit 368c678

Please sign in to comment.