From 27703e575b25edda657e899949d9371e55ff1d45 Mon Sep 17 00:00:00 2001 From: Tim Arendsen Date: Sat, 11 Nov 2023 01:12:09 +0100 Subject: [PATCH] v0.4.8: Added Mirabilandia, moved Bobbejaanland, improved Movie Park (Halloween) --- package-lock.json | 2 +- package.json | 2 +- src/_services/parks/parks.service.ts | 5 +- src/_services/themepark/theme-park.service.ts | 2 +- .../bobbejaanland/bobbejaanland.module.ts | 19 ---- .../bobbejaanland/bobbejaanland.service.ts | 105 ------------------ .../bobbejaanland-api-response.interface.ts | 68 ------------ src/parks/parks.module.ts | 5 +- .../bobbejaanland.service.spec.ts | 12 +- .../bobbejaanland/bobbejaanland.service.ts | 42 +++++++ .../atracciones-response.interface.ts | 2 +- .../mirabilandia/mirabilandia.service.spec.ts | 22 ++++ .../mirabilandia/mirabilandia.service.ts | 34 ++++++ .../movie-park/movie-park.service.ts | 4 + .../parques-reunidos-park.service.ts | 32 +++++- .../parques-reunidos.transfer.ts | 13 ++- .../parques-reunidos.module.ts | 6 +- 17 files changed, 156 insertions(+), 219 deletions(-) delete mode 100644 src/parks/bobbejaanland/bobbejaanland.module.ts delete mode 100644 src/parks/bobbejaanland/bobbejaanland.service.ts delete mode 100644 src/parks/bobbejaanland/interfaces/bobbejaanland-api-response.interface.ts rename src/parks/{ => parques-reunidos}/bobbejaanland/bobbejaanland.service.spec.ts (69%) create mode 100644 src/parks/parques-reunidos/bobbejaanland/bobbejaanland.service.ts create mode 100644 src/parks/parques-reunidos/mirabilandia/mirabilandia.service.spec.ts create mode 100644 src/parks/parques-reunidos/mirabilandia/mirabilandia.service.ts diff --git a/package-lock.json b/package-lock.json index 0cf308a..559e18b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "themeparks-node-api", - "version": "0.4.7", + "version": "0.4.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ed995ce..b396877 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "themeparks-node-api", - "version": "0.4.7", + "version": "0.4.8", "description": "An API which can retrieve theme park wait times.", "author": "Tim Arendsen", "private": false, diff --git a/src/_services/parks/parks.service.ts b/src/_services/parks/parks.service.ts index 74cc861..c96a90e 100644 --- a/src/_services/parks/parks.service.ts +++ b/src/_services/parks/parks.service.ts @@ -17,7 +17,7 @@ import { HellendoornService } from '../../parks/hellendoorn/hellendoorn.service' import { LegolandDeutschlandService } from '../../parks/legoland/legoland-deutschland/legoland-deutschland.service'; import { CompanyService } from '../company/company.service'; import { SixflagsService } from '../../parks/sixflags/sixflags.service'; -import { BobbejaanlandService } from '../../parks/bobbejaanland/bobbejaanland.service'; +import { BobbejaanlandService } from '../../parks/parques-reunidos/bobbejaanland/bobbejaanland.service'; import { PlopsalandDePanneService } from '../../parks/plopsaland/plopsaland-de-panne/plopsaland-de-panne.service'; import { HansaParkService } from '../../parks/hansa-park/hansa-park.service'; import { OuwehandsDierenparkService } from '../../parks/ouwehands-dierenpark/ouwehands-dierenpark.service'; @@ -57,6 +57,7 @@ import { HersheyparkService } from '../../parks/hersheypark/hersheypark.service' import { SeaworldService } from '../../parks/seaworld/seaworld.service'; import { UniversalService } from '../../parks/universal/universal.service'; import { GardalandService } from '../../parks/gardaland/gardaland.service'; +import { MirabilandiaService } from '../../parks/parques-reunidos/mirabilandia/mirabilandia.service'; @Injectable() export class ParksService { @@ -115,6 +116,7 @@ export class ParksService { private readonly _seaworldCompanyService: SeaworldService, private readonly _universalService: UniversalService, private readonly _gardaland: GardalandService, + private readonly _mirabilandia: MirabilandiaService, ) { this._parks = []; this._parks.push(_eftelingService); @@ -161,6 +163,7 @@ export class ParksService { this._parks.push(_futuroscope); this._parks.push(_hersheypark); this._parks.push(_gardaland) + this._parks.push(_mirabilandia) this._companies = []; this._companies.push(_sixflagsService); diff --git a/src/_services/themepark/theme-park.service.ts b/src/_services/themepark/theme-park.service.ts index 87e6236..9fb588a 100644 --- a/src/_services/themepark/theme-park.service.ts +++ b/src/_services/themepark/theme-park.service.ts @@ -80,7 +80,7 @@ export class ThemeParkService { } async getHalloweenEvents(): Promise { - throw new NotImplementedException("Could not get animals"); + throw new NotImplementedException("Could not get halloween events"); } async getHalloweenEvent(id: string): Promise { diff --git a/src/parks/bobbejaanland/bobbejaanland.module.ts b/src/parks/bobbejaanland/bobbejaanland.module.ts deleted file mode 100644 index af194b2..0000000 --- a/src/parks/bobbejaanland/bobbejaanland.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Module } from '@nestjs/common'; -import { BobbejaanlandService } from './bobbejaanland.service'; -import { ConfigModule } from '@nestjs/config'; -import { HttpModule } from '@nestjs/axios'; - -@Module({ - providers: [BobbejaanlandService], - exports: [BobbejaanlandService], - imports: [ - HttpModule, - ConfigModule.forRoot({ - envFilePath: '.env', - cache: false, - ignoreEnvFile: false, - }) - ], -}) -export class BobbejaanlandModule { -} diff --git a/src/parks/bobbejaanland/bobbejaanland.service.ts b/src/parks/bobbejaanland/bobbejaanland.service.ts deleted file mode 100644 index dd181bd..0000000 --- a/src/parks/bobbejaanland/bobbejaanland.service.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { Injectable } from '@nestjs/common'; -import { ParkType, ThemePark } from '../../_interfaces/park.interface'; -import { ThemeParkSupports } from '../../_interfaces/park-supports.interface'; -import { ThroughPoisThemeParkService } from '../../_services/themepark/through-pois-theme-park.service'; -import { Poi } from '../../_interfaces/poi.interface'; -import { BobbejaanlandApiResponseInterface } from './interfaces/bobbejaanland-api-response.interface'; -import { PoiCategory } from '../../_interfaces/poi-categories.enum'; -import { RideCategory } from '../../_interfaces/ride-category.interface'; -import { HttpService } from '@nestjs/axios'; - -@Injectable() -export class BobbejaanlandService extends ThroughPoisThemeParkService { - constructor(private readonly httpService: HttpService) { - super(); - } - - getInfo(): ThemePark { - return { - timezone: 'Europe/Amsterdam', - name: 'Bobbejaanland', - parkType: ParkType.THEMEPARK, - image: 'https://www.bobbejaanland.be/content/dam/bjl/images/generals/KVDS-20190616-171430-NIKON%20D5-2.jpg', - countryCode: 'be', - description: 'Bobbejaanland is een pretpark in Lichtaart, gelegen tussen Herentals en Kasterlee in België, en is genoemd naar zijn oprichter Bobbejaan Schoepen. Het pretpark is gelegen in een moerassig gebied in de vallei van de Kleine Nete.', - id: 'bobbejaanland', - location: { - lat: 51.2009421, - lng: 4.9040014 - } - }; - } - - getSupports(): ThemeParkSupports { - return { - supportsRideWaitTimesHistory: false, - supportsOpeningTimes: false, - supportsAnimals: false, - supportsOpeningTimesHistory: false, - supportsRideWaitTimes: false, - supportsRestaurants: true, - supportsShows: false, - supportsRides: true, - supportsShops: true, - supportsShopOpeningTimes: false, - supportsPoiLocations: true, - supportsPois: true, - supportsRestaurantOpeningTimes: false, - supportsShowTimes: false, - supportsTranslations: false, -supportsHalloween: false, - }; - } - - async getPois(): Promise { - const url = 'https://www.bobbejaanland.be/content/bjl/be/het-park/ontdek/parkactiviteiten/attracties.searchservlet.json?type_primary=parques-reunidos%3Aattractions&type_secondary=&type=filters&lang=nl;'; - return this.httpService.get(url).toPromise().then(value => { - return value.data.docs.map(poi => { - const ride: Poi = { - id: poi.id, - title: poi.attractionName_s, - category: PoiCategory.ATTRACTION, - original: poi, - description: poi.description_s, - image_url: 'https://bobbejaanland.be' + poi.mainImage_s, - }; - - if (poi.intensity_level_s) { - switch (poi.intensity_level_s) { - case 'intense': - ride.rideCategory = RideCategory.THRILL; - break; - case 'moderate': - ride.rideCategory = RideCategory.FAMILY; - break; - default: - case 'soft': - ride.rideCategory = RideCategory.KIDS; - break; - } - } - - if (parseFloat(poi.latitude_s) !== 4) { - ride.location = { - lat: parseFloat(poi.latitude_s), - lng: parseFloat(poi.longitude_s), - }; - } - - if (poi['theme-areas_ss'] && poi['theme-areas_ss'].length > 0) { - ride.area = poi['theme-areas_ss'][0]; - } - - if (poi.minHeight_ss && poi.minHeight_ss.length > 0) { - ride.minSizeWithoutEscort = parseInt(poi.minHeight_ss[0].split(' ')[0]); - } - - if (poi.maxHeight_ss && poi.maxHeight_ss.length > 0) { - ride.maxSize = parseInt(poi.maxHeight_ss[0].split(' ')[0]); - } - - return ride; - }); - }); - } -} diff --git a/src/parks/bobbejaanland/interfaces/bobbejaanland-api-response.interface.ts b/src/parks/bobbejaanland/interfaces/bobbejaanland-api-response.interface.ts deleted file mode 100644 index a88c4f3..0000000 --- a/src/parks/bobbejaanland/interfaces/bobbejaanland-api-response.interface.ts +++ /dev/null @@ -1,68 +0,0 @@ -export interface BobbejaanlandApiResponseInterface { - 'matches': number, - 'docs': BobbejaanlandApiResponseItemInterface[] -} - -export interface BobbejaanlandApiResponseItemInterface { - 'id': string, - 'template_s': string, - 'type_s': string, - 'attractionName_s': string, - 'briefDescription_s': string, - 'descriptionTitle_s': string, - 'description_s': string, - 'mainImage_s': string, - 'altImage_s': string, - 'intensity_ss': string[], - 'intensity_level_s': 'soft' | 'moderate' | 'intense', - 'checkIntensity_b': boolean, - 'typeAttracction_ss': string[], - 'checkTypeAttracction_b': boolean, - 'age-recomendation_ss': string[], - 'checkAgeRecomendation_b': boolean, - 'checkThemeArea_b': boolean, - 'checkfastPass_b': boolean, - 'openingSeason_ss': string[], - 'checkOpeningSeason_b': boolean, - 'checkMinAge_b': boolean, - 'checkMaxSpeed_b': boolean, - 'checkMaxHeight_b': boolean, - 'minHeight_ss': string[], - 'checkMinHeight_b': boolean, - 'checkMaxWeight_b': boolean, - 'checkMinWeight_b': boolean, - 'adultCompaninon_b': boolean, - 'howToRide_ss': string[], - 'waterShoes_b': boolean, - 'accesibility_b': boolean, - 'longitude_s': string, - 'latitude_s': string, - 'waitTime_b': boolean, - 'galleryPhoto_ss': string[], - 'tags_ss': string[], - 'h1_txt_nl': string, - 'hl_title_txt_nl_mv': string[], - 'autosuggest_lang': string[], - 'h1_txt_sort_nl': string, - 'h2_txt_nl': string, - 'hl_body_txt_nl_mv': string[], - 'p_richtext_txt_nl': string, - 'tipology_name_s': string, - 'tipology_title_s': string, - 'tipology_value_f': 40.0, - 'tipology_search_s': string, - 'collection': string[], - 'path': string, - 'realpath': string[], - 'index_date': string, - 'lang': string[], - 'button_label_txt_nl': string, - 'button_link_txt_nl': string, - 'alt_image_txt_nl': string, - 'jcr_title': string[], - '_version_': number, - 'final_hl_title': '', - 'final_hl_summary': '', - 'theme-areas_ss': string[] - 'maxHeight_ss': string[] -} diff --git a/src/parks/parks.module.ts b/src/parks/parks.module.ts index 3425f21..0868b49 100644 --- a/src/parks/parks.module.ts +++ b/src/parks/parks.module.ts @@ -12,7 +12,6 @@ import { SixflagsModule } from './sixflags/sixflags.module'; import { BellewaerdeModule } from './bellewaerde/bellewaerde.module'; import { HellendoornModule } from './hellendoorn/hellendoorn.module'; import { LegolandModule } from './legoland/legoland.module'; -import { BobbejaanlandModule } from './bobbejaanland/bobbejaanland.module'; import { PlopsalandDePanneModule } from './plopsaland/plopsaland-de-panne/plopsaland-de-panne.module'; import { EuropaParkModule } from './europa-park/europa-park.module'; import { HansaParkModule } from './hansa-park/hansa-park.module'; @@ -42,7 +41,7 @@ import { UniversalModule } from './universal/universal.module'; import { GardalandModule } from './gardaland/gardaland.module'; @Module({ - exports: [EftelingModule, ToverlandModule, PhantasialandModule, ParcAsterixModule, HolidayParkModule, DippiedoeModule, DisneyModule, WalibiModule, PortaventuraModule, SixflagsModule, BellewaerdeModule, HellendoornModule, LegolandModule, BobbejaanlandModule, PlopsalandDePanneModule, EuropaParkModule, HansaParkModule, OuwehandsDierenparkModule, WildlandsModule, LisebergModule, HerschendModule, CedarfairModule, ParqueWarnerModule, GronaLundModule, TivoliModule, ThorpeParkModule, AltonTowersModule, PaultonsParkModule, SanDiegoZooModule, ChessingtonResortModule, BlijdorpModule, ApenheulModule, EnergylandiaModule, FamilyparkModule, BeekseBergenModule, ParquesReunidosModule, FuturoscopeModule, HersheyparkModule, SeaworldModule, UniversalModule, GardalandModule], - imports: [EftelingModule, ToverlandModule, PhantasialandModule, ParcAsterixModule, HolidayParkModule, DippiedoeModule, DisneyModule, WalibiModule, PortaventuraModule, SixflagsModule, BellewaerdeModule, HellendoornModule, LegolandModule, BobbejaanlandModule, PlopsalandDePanneModule, EuropaParkModule, HansaParkModule, OuwehandsDierenparkModule, WildlandsModule, LisebergModule, HerschendModule, CedarfairModule, ParqueWarnerModule, GronaLundModule, TivoliModule, ThorpeParkModule, AltonTowersModule, PaultonsParkModule, SanDiegoZooModule, ChessingtonResortModule, BlijdorpModule, ApenheulModule, EnergylandiaModule, FamilyparkModule, BeekseBergenModule, ParquesReunidosModule, FuturoscopeModule, HersheyparkModule, SeaworldModule, UniversalModule, GardalandModule], + exports: [EftelingModule, ToverlandModule, PhantasialandModule, ParcAsterixModule, HolidayParkModule, DippiedoeModule, DisneyModule, WalibiModule, PortaventuraModule, SixflagsModule, BellewaerdeModule, HellendoornModule, LegolandModule, PlopsalandDePanneModule, EuropaParkModule, HansaParkModule, OuwehandsDierenparkModule, WildlandsModule, LisebergModule, HerschendModule, CedarfairModule, ParqueWarnerModule, GronaLundModule, TivoliModule, ThorpeParkModule, AltonTowersModule, PaultonsParkModule, SanDiegoZooModule, ChessingtonResortModule, BlijdorpModule, ApenheulModule, EnergylandiaModule, FamilyparkModule, BeekseBergenModule, ParquesReunidosModule, FuturoscopeModule, HersheyparkModule, SeaworldModule, UniversalModule, GardalandModule], + imports: [EftelingModule, ToverlandModule, PhantasialandModule, ParcAsterixModule, HolidayParkModule, DippiedoeModule, DisneyModule, WalibiModule, PortaventuraModule, SixflagsModule, BellewaerdeModule, HellendoornModule, LegolandModule, PlopsalandDePanneModule, EuropaParkModule, HansaParkModule, OuwehandsDierenparkModule, WildlandsModule, LisebergModule, HerschendModule, CedarfairModule, ParqueWarnerModule, GronaLundModule, TivoliModule, ThorpeParkModule, AltonTowersModule, PaultonsParkModule, SanDiegoZooModule, ChessingtonResortModule, BlijdorpModule, ApenheulModule, EnergylandiaModule, FamilyparkModule, BeekseBergenModule, ParquesReunidosModule, FuturoscopeModule, HersheyparkModule, SeaworldModule, UniversalModule, GardalandModule], }) export class ParksModule {} diff --git a/src/parks/bobbejaanland/bobbejaanland.service.spec.ts b/src/parks/parques-reunidos/bobbejaanland/bobbejaanland.service.spec.ts similarity index 69% rename from src/parks/bobbejaanland/bobbejaanland.service.spec.ts rename to src/parks/parques-reunidos/bobbejaanland/bobbejaanland.service.spec.ts index 8250cf0..c465def 100644 --- a/src/parks/bobbejaanland/bobbejaanland.service.spec.ts +++ b/src/parks/parques-reunidos/bobbejaanland/bobbejaanland.service.spec.ts @@ -1,5 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { BobbejaanlandService } from './bobbejaanland.service'; +import { ParquesReunidosTransfer } from '../parques-reunidos-transfer/parques-reunidos.transfer'; import { HttpModule } from '@nestjs/axios'; import { ConfigModule } from '@nestjs/config'; @@ -8,7 +9,7 @@ describe('BobbejaanlandService', () => { beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ - providers: [BobbejaanlandService], + providers: [BobbejaanlandService, ParquesReunidosTransfer], imports: [HttpModule, ConfigModule.forRoot()] }).compile(); @@ -18,13 +19,4 @@ describe('BobbejaanlandService', () => { it('should be defined', () => { expect(service).toBeDefined(); }); - - it('should return info', () => { - expect(service.getInfo().id).toBeDefined(); - }); - - it('should return a list of POIs', async () => { - const data = await service.getPois(); - expect(data).toBeInstanceOf(Array); - }); }); diff --git a/src/parks/parques-reunidos/bobbejaanland/bobbejaanland.service.ts b/src/parks/parques-reunidos/bobbejaanland/bobbejaanland.service.ts new file mode 100644 index 0000000..ac94013 --- /dev/null +++ b/src/parks/parques-reunidos/bobbejaanland/bobbejaanland.service.ts @@ -0,0 +1,42 @@ +import { Injectable } from '@nestjs/common'; +import { ParquesReunidosParkService } from '../parques-reunidos-park.service'; +import { ParkType, ThemePark } from '../../../_interfaces/park.interface'; + +@Injectable() +export class BobbejaanlandService extends ParquesReunidosParkService { + getInfo(): ThemePark { + return { + timezone: 'Europe/Amsterdam', + name: 'Bobbejaanland', + parkType: ParkType.THEMEPARK, + image: 'https://www.bobbejaanland.be/content/dam/bjl/images/generals/KVDS-20190616-171430-NIKON%20D5-2.jpg', + countryCode: 'be', + description: 'Bobbejaanland is een pretpark in Lichtaart, gelegen tussen Herentals en Kasterlee in België, en is genoemd naar zijn oprichter Bobbejaan Schoepen. Het pretpark is gelegen in een moerassig gebied in de vallei van de Kleine Nete.', + id: 'bobbejaanland', + location: { + lat: 51.2009421, + lng: 4.9040014, + }, + }; + } + + getStayEstablishment(): string { + return 'mGvE' + } + + supportsRestaurants(): boolean { + return true; + } + + getShowCategoryID(): string { + return ''; + } + + halloweenCategories(): (string | number)[] { + return [] + } + + getShowType(): 'new' | 'old' | 'unsupported' { + return 'unsupported'; + } +} diff --git a/src/parks/parques-reunidos/interfaces/atracciones-response.interface.ts b/src/parks/parques-reunidos/interfaces/atracciones-response.interface.ts index 18816b4..ad87aef 100644 --- a/src/parks/parques-reunidos/interfaces/atracciones-response.interface.ts +++ b/src/parks/parques-reunidos/interfaces/atracciones-response.interface.ts @@ -1,5 +1,5 @@ export interface AtraccionesResponseInterface { - 'data': AtraccionesResponseInterface[] + 'data': AtraccionesResponseAtraccioneInterface[] } export interface AtraccionesResponseAtraccioneInterface { diff --git a/src/parks/parques-reunidos/mirabilandia/mirabilandia.service.spec.ts b/src/parks/parques-reunidos/mirabilandia/mirabilandia.service.spec.ts new file mode 100644 index 0000000..e290195 --- /dev/null +++ b/src/parks/parques-reunidos/mirabilandia/mirabilandia.service.spec.ts @@ -0,0 +1,22 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { MirabilandiaService } from './mirabilandia.service'; +import { ParquesReunidosTransfer } from '../parques-reunidos-transfer/parques-reunidos.transfer'; +import { HttpModule } from '@nestjs/axios'; +import { ConfigModule } from '@nestjs/config'; + +describe('MirabilandiaService', () => { + let service: MirabilandiaService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [MirabilandiaService, ParquesReunidosTransfer], + imports: [HttpModule, ConfigModule.forRoot()] + }).compile(); + + service = module.get(MirabilandiaService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/src/parks/parques-reunidos/mirabilandia/mirabilandia.service.ts b/src/parks/parques-reunidos/mirabilandia/mirabilandia.service.ts new file mode 100644 index 0000000..4e66514 --- /dev/null +++ b/src/parks/parques-reunidos/mirabilandia/mirabilandia.service.ts @@ -0,0 +1,34 @@ +import { Injectable } from '@nestjs/common'; +import { ParqueDeAtraccionesService } from '../parque-de-atracciones/parque-de-atracciones.service'; +import { ParkType, ThemePark } from '../../../_interfaces/park.interface'; + +@Injectable() +export class MirabilandiaService extends ParqueDeAtraccionesService { + getInfo(): ThemePark { + return { + countryCode: 'it', + description: 'Mirabilandia is een Italiaans pretpark, gelegen in Savio nabij Ravenna, Emilia-Romagna. Het park ontvangt jaarlijks ongeveer 1,8 miljoen bezoekers en is daarmee het op een na grootste pretpark van Italië. Het heeft een oppervlakte van 30 hectare met een extra 10 hectare voor het waterwereld gedeelte', + id: 'mirabilandia', + image: 'https://www.mirabilandia.it/content/mir/en/scopri-il-parco/organizza-la-tua-visita/aree-tematiche/ducati-world/_jcr_content/responsiveGrid/cc18_columns_copy/col_1/ca03_image.coreimg.jpeg/1622553207215/ducati-world-thematic-areas-mirabilandia-2.jpeg', + name: 'Mirabilandia', + parkType: ParkType.THEMEPARK, + location: { + lat: 44.337796958387614, + lng: 12.26365557672404, + }, + }; + } + + // TODO: This probably isn't unsupported in the summer + getShowType(): 'new' | 'old' | 'unsupported' { + return 'unsupported'; + } + + supportsRestaurants(): boolean { + return true; + } + + getStayEstablishment(): string { + return 'm5Oo'; + } +} diff --git a/src/parks/parques-reunidos/movie-park/movie-park.service.ts b/src/parks/parques-reunidos/movie-park/movie-park.service.ts index 07706da..cc968b5 100644 --- a/src/parks/parques-reunidos/movie-park/movie-park.service.ts +++ b/src/parks/parques-reunidos/movie-park/movie-park.service.ts @@ -37,4 +37,8 @@ export class MovieParkService extends ParquesReunidosParkService { supportsRestaurants(): boolean { return true; } + + halloweenCategories(): (string | number)[] { + return [48231] + } } diff --git a/src/parks/parques-reunidos/parques-reunidos-park.service.ts b/src/parks/parques-reunidos/parques-reunidos-park.service.ts index 6fc14ca..76d736e 100644 --- a/src/parks/parques-reunidos/parques-reunidos-park.service.ts +++ b/src/parks/parques-reunidos/parques-reunidos-park.service.ts @@ -37,6 +37,10 @@ export class ParquesReunidosParkService extends ThemeParkService { return false; } + public halloweenCategories(): (string | number)[] { + return []; + } + public getShowCategoryID(): string { throw new NotImplementedException('Show Category ID not set'); } @@ -44,12 +48,13 @@ export class ParquesReunidosParkService extends ThemeParkService { getSupports(): ThemeParkSupports { const supportsShows = this.getShowType() !== 'unsupported'; const supportsRestaurants = this.supportsRestaurants(); + const supportsHalloween = this.halloweenCategories().length > 0; return { supportsAnimals: false, supportsOpeningTimes: false, supportsOpeningTimesHistory: false, - supportsPoiLocations: false, + supportsPoiLocations: true, supportsPois: true, supportsRestaurantOpeningTimes: false, supportsRestaurants: supportsRestaurants, @@ -61,7 +66,7 @@ export class ParquesReunidosParkService extends ThemeParkService { supportsShowTimes: supportsShows, supportsShows: supportsShows, supportsTranslations: true, - supportsHalloween: false, + supportsHalloween: supportsHalloween, }; } @@ -80,6 +85,10 @@ export class ParquesReunidosParkService extends ThemeParkService { promises.push(this.getRestaurants()); } + if (this.getSupports().supportsHalloween) { + promises.push(this.getHalloweenEvents()); + } + return [] .concat .apply([], await Promise.all(promises)); @@ -93,7 +102,13 @@ export class ParquesReunidosParkService extends ThemeParkService { }, }) .toPromise() - .then((response) => this.transfer.transferRidesToPois(response.data.data)); + .then((response) => { + if (this.halloweenCategories().length > 0) { + return this.transfer.transferRidesToPois(response.data.data.filter((e) => !this.halloweenCategories().includes(e.category))) + } + + return this.transfer.transferRidesToPois(response.data.data) + }); } async getRestaurants(): Promise { @@ -139,4 +154,15 @@ export class ParquesReunidosParkService extends ThemeParkService { .toPromise() .then((response) => this.transfer.transferShowsToPois(response.data.data)); } + + async getHalloweenEvents(): Promise { + return this.http.get(this.apiUrl + '/api/v1/service/attraction', { + headers: { + Authorization: 'Bearer ' + this.apiToken, + 'Stay-Establishment': this.getStayEstablishment(), + }, + }) + .toPromise() + .then((response) => this.transfer.transferRidesToPois(response.data.data.filter((e) => this.halloweenCategories().includes(e.category)))); + } } diff --git a/src/parks/parques-reunidos/parques-reunidos-transfer/parques-reunidos.transfer.ts b/src/parks/parques-reunidos/parques-reunidos-transfer/parques-reunidos.transfer.ts index d643a69..9b4ddbb 100644 --- a/src/parks/parques-reunidos/parques-reunidos-transfer/parques-reunidos.transfer.ts +++ b/src/parks/parques-reunidos/parques-reunidos-transfer/parques-reunidos.transfer.ts @@ -45,6 +45,7 @@ export class ParquesReunidosTransfer extends TransferService { if (ride.photographs && ride.photographs.length > 0) { r.previewImage = `https://s3-eu-west-1.amazonaws.com/stayapp.cms/${ride.photographs[0]}/${ride.photographs[0]}_appthumb`; + r.image_url = `https://s3-eu-west-1.amazonaws.com/stayapp.cms/${ride.photographs[0]}/${ride.photographs[0]}_appthumb`; r.images = []; ride.photographs.forEach((photo) => { @@ -68,15 +69,19 @@ export class ParquesReunidosTransfer extends TransferService { // Nickelodeon Land case 7881: break; + // Casa del Terror + case 36921: + r.category = PoiCategory.HALLOWEEN_EVENT; + break; + // Movie park: Scare maze + case 48231: + r.category = PoiCategory.HALLOWEEN_WALKTROUGH; + break; // No disponibles case 29844: default: r.rideCategory = RideCategory.UNDEFINED; break; - // Casa del Terror - case 36921: - r.category = PoiCategory.HALLOWEEN_EVENT; - break; } if (ride.textList) { diff --git a/src/parks/parques-reunidos/parques-reunidos.module.ts b/src/parks/parques-reunidos/parques-reunidos.module.ts index 90c5e8c..3f0d5e3 100644 --- a/src/parks/parques-reunidos/parques-reunidos.module.ts +++ b/src/parks/parques-reunidos/parques-reunidos.module.ts @@ -6,6 +6,8 @@ import { ParquesReunidosTransfer } from './parques-reunidos-transfer/parques-reu import { MovieParkService } from './movie-park/movie-park.service'; import { ParquesReunidosParkService } from './parques-reunidos-park.service'; import { ParqueWarnerMadridBeachService } from './parque-warner-madrid-beach/parque-warner-madrid-beach.service'; +import { BobbejaanlandService } from './bobbejaanland/bobbejaanland.service'; +import { MirabilandiaService } from './mirabilandia/mirabilandia.service'; @Module({ imports: [ @@ -16,8 +18,8 @@ import { ParqueWarnerMadridBeachService } from './parque-warner-madrid-beach/par ignoreEnvFile: false, }), ], - providers: [ParquesReunidosParkService, ParqueDeAtraccionesService, ParquesReunidosTransfer, MovieParkService, ParqueWarnerMadridBeachService], - exports: [ParqueDeAtraccionesService, MovieParkService, ParqueWarnerMadridBeachService], + providers: [ParquesReunidosParkService, ParqueDeAtraccionesService, ParquesReunidosTransfer, MovieParkService, ParqueWarnerMadridBeachService, BobbejaanlandService, MirabilandiaService], + exports: [ParqueDeAtraccionesService, MovieParkService, ParqueWarnerMadridBeachService, BobbejaanlandService, MirabilandiaService], }) export class ParquesReunidosModule {}