import { injectable } from "inversify"; import { IJsonApiResponse, IJsonApiResource, IJsonApiRelationship, priceRange, } from "../../interfaces"; import { IImage, } from "../image"; import { IPlace } from "../place"; import { IPoi, } from "../poi"; export const lodgingType = "lodging"; export const lodgingProviderType = "lodging_provider"; export type poiTypes = "sights" | "eating" | "shopping" | "drinking_nightlife" | "entertainment" | "transport" | "info" | "festivals_events" | "sleeping"; export type Address = { extras?: string, street?: string, }; export type Attribute = { category: string, name: string, }; export type Location = { coordinates: number[], type: "Point", }; export type Description = { text: string, title: string, }; export interface ILodgingProviderAttributes { address: Address; description: Description[]; facilities: string[]; location: Location; lodging_type: string; name: string; score: number; website: string; } export interface ILodgingProvider { address: Address; description: Description[]; facilities: string[]; id: string; location: Location; lodgingType: string; name: string; provider: string; score: number; website: string; } export interface ILodgingAttributes { address?: Address; attributes?: Attribute[]; bookable?: boolean; facilities?: string[]; location?: Location; name?: string; poi_type?: poiTypes; price_range?: priceRange; price_string?: string; review?: { essential?: string, extension?: string, }; searchable_name?: string; score?: number; star_rating?: 1 | 2 | 3 | 4 | 5; subtypes?: string[]; } export interface ILodgingResource extends IJsonApiResource {} export interface ILodgingResponse extends IJsonApiResponse {} export interface ILodging { id?: string; address?: Address; attributes?: Attribute[]; description?: Description[]; location?: Location; name?: string; poiType?: poiTypes; priceRange?: priceRange; price?: string; review?: { essential?: string, extension?: string, }; richHoursString?: string; lpInternalScore?: number; searchableName?: string; starRating?: 1 | 2 | 3 | 4 | 5; subtypes?: string[]; containingPlaces?: IPlace[]; containingPlaceId?: string; containingPlaceName?: string; containingCityId?: string; containingCityName?: string; containingContinentId?: string; containingContinentName?: string; containingCountryName?: string; containingNeighborhoodId?: string; containingNeighborhoodName?: string; containingRegionNames?: string[]; type?: string; images?: IImage[]; poi?: IPoi; providers?: ILodgingProvider[]; } @injectable() export default class Lodging implements ILodging { id?: string; address?: Address; description?: Description[]; location?: Location; name?: string; attributes?: Attribute[]; poiType?: poiTypes; price?: string; priceRange?: priceRange; publishedAt?: string; review?: { essential?: string, extension?: string, }; lpInternalScore?: number; searchableName?: string; subtypes?: string[]; starRating?: 1 | 2 | 3 | 4 | 5; containingPlaces?: IPlace[]; containingPlaceId?: string; containingPlaceName?: string; containingCityId?: string; containingCityName?: string; containingContinentId?: string; containingContinentName?: string; containingCountryName?: string; containingNeighborhoodId?: string; containingNeighborhoodName?: string; containingRegionNames?: string[]; type?: string = "poi"; images?: IImage[] = []; poi?: IPoi; providers?: ILodgingProvider[]; constructor(options?: ILodging) { Object.assign(this, options); } }