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B,MAAM/C,EAAS,yBACf5E,KAAKQ,gBAAgBqE,aAAaD,GAElC,MAEMvB,EAAOrD,KAAKK,MACfiD,KAHS,GAAGtD,KAAKkB,cAAclB,KAAKW,yCAKnC,CAAEgH,WACF3H,KAAKyB,iBAENK,KACC9B,KAAK4B,eACLsD,KAAS,KACPlF,KAAKQ,gBAAgB2E,YAAYP,EAAM,IAI7C,SAAOrB,KAAcF,EACvB,4CAx3IWjD,EAAsB,iCAAtBA,EAAsB6Z,QAAtB7Z,EAAsB8Z,UAAAC,WAFrB,gBAED/Z,CAAsB,oDC5G5B,SAASmD,EAAc6W,EAAQC,GAClC,MAAMC,EAA8B,iBAAXD,EACzB,OAAO,IAAI/L,QAAQ,CAACC,EAAS+B,KACzB,IACIiK,EADAC,GAAY,EAEhBJ,EAAOK,UAAU,CACbC,KAAOC,IACHJ,EAASI,EACTH,GAAY,GAEhBlY,MAAOgO,EACPsK,SAAUA,KACFJ,EACAjM,EAAQgM,GAEHD,EACL/L,EAAQ8L,EAAOQ,cAGfvK,EAAO,IAAIwK,IAAY,GAGlC,EAET,+HCnBO,SAASC,EAAUC,EAAuBC,GAC7C,OAAIA,EACQb,MAAWc,KAAOD,EAAkBnZ,QAAKqZ,KAAK,GCLvD,SAASC,IACZ,SAAOC,KAAQ,CAACjB,EAAQkB,KACpBlB,EAAOK,aAAUc,KAAyBD,EAAYE,KAAK,EAEnE,CDCkEJ,IAAmBhB,EAAOtY,KAAKiZ,EAAUC,MAAuB,EAEvHS,KAAS,CAACd,EAAOe,OAAUC,MAAUX,EAAsBL,EAAOe,IAAQ5Z,QAAKqZ,KAAK,IAAC,EAAGS,KAAMjB,IACzG,eERO,SAAS7X,EAAM+Y,EAAKC,EAAYC,KACnC,MAAMC,KAAWC,KAAMJ,EAAKC,GAC5B,OAAOf,EAAU,IAAMiB,EAC3B","names":["BEError","Error","response","constructor","message","super","this","name","d","Message","CostaBackendApiService","_http","inject","HttpClient","_loadingService","LoadingService","BookingFlowServicesPath","UserServicesPath","GenericServicesPath","ContentServicesPath","ExcursionServicesPath","EpipoliServicesPath","WeCareServicesPath","HandlersPath","CCKBasePath","window","cckBasePath","OcpPro","JakalaLegacyHeaders","HttpHeaders","JakalaHeaders","WithCredentials","withCredentials","UPLOAD","handleKtApi","source$","pipe","tap","res","Success","map","Result","catchError","console","error","handleKtApiWithNoMessage","handleKtApiWithBlockingMessage","handleKtApiWithWarningMessage","mockApi","data","delayMilliseconds","of","delay","handleApi","prefetch","inFrom","inTo","inDestination","inFare","obs$","post","lastValueFrom","prefetchExtended","inPort","inShip","inDiscount","inOccupancy","filters","from","dayjs","format","to","destinationCode","join","fareCode","portCode","shipCode","discountCode","occupancyCode","debounceTime","uploadGroupLoadData","file","loader","startLoading","api","formData","FormData","append","finalize","stopLoading","getGroupLoadOperations","groupId","timeInterval","getGroupLoadOperationDetails","operationId","getGroupLoadOperationDetailsCsv","extendOptionDate","extendOptionDateForBooking","bookingNumber","cancelBooking","penaltyInfo","undefined","retrieveBookingCancellationPenalty","login","username","password","loginInfo","UserName","Password","getContactInfos","cruiseSearch","cruiseExtendedSearch","useLightSearch","getGroupRequest","GroupId","ShipName","DepartureDate","DeparturePort","NumberOfGuests","NumberOfCabins","CabinType","GroupType","NumberOfBeds","NumberOfSingleCabins","DepartureAirport","Notes","ContactName","ContactPhoneNumber","ContactEmail","request","initialiseBooking","firstCruiseCode","categoryCode","secondCruiseCode","getGroupInvoice","firstEmail","secondEmail","eventsFlag","transportationInfoFlag","allFlag","paxDetailsFlag","groupMasterChargesFlag","detailSummaryFlag","groupPaymentFlag","allocationSummaryFlag","printMode","FirstEmail","SecondEmail","Events","TransportationInfo","Print","Sections","All","PaxDetails","GroupMasterCharges","DetailSummary","GroupPayment","AllocationSummary","getAgeRange","sendConfirmationLetter","emailAddress","versionType","quickQuotation","GetItineraryDetails","cruiseCode","changeFare","isQuotation","costaClubInfo","quote","getCostaClubInfo","FirstName","LastName","CostaClubNumber","birthDate","BirthDate","GetAllowedOperationForBooking","GetAllowedOperationForGuest","guestId","GetBookingWarningsAndMessages","GetBookingTips","getFares","setFares","fare","getAirports","checkPromoFlightAvailability","flightClass","checkPromoBusAvailability","checkPromoGenericTransportationAvailability","getPromoAirports","getPromoFlightSolutions","parameters","GetPromoGenericTransportationSolutions","GetPromoBusSolutions","getBusStations","direction","getHotels","cabinIndex","getAvailableCategories","getAvailableCabins_Legacy","categoryCodes","getAvailableCabins","getQuotation","Booking","headers","CustomHeaders","TRANSFORM_REQUEST","TransformerRequestCodes","REMOVE_AUTO_SSV","ADD_FISCOD_FOREIGN_GUEST","TRANSFORM_RESPONSE","TransformerResponseCodes","REMOVE_FISCOD_ON_FOREIGN_GUEST","GUEST_TBA","createBooking","modifyBooking","Payment","REMOVE_EMPTY_WEB_CHECKIN","GetErpIdListUrl","confirmBooking","checkVoucher","voucherId","getRichiestaAbilitazioneConfig","getRichiestaAbilitazione","richiestaAbilitazione","getUserProfile","userName","preventCache","JSON","parse","sessionStorage","getItem","SessionStorageKey","USER_DATA","Object","keys","length","Promise","resolve","setItem","stringify","getAgencyProfile","agencyCode","AGENCY_DATA_FULL","getAgencyProfileExtended","AGENCY_DATA_EXT","GetCorrelatedAgencies","align","AlignCorrelatedAgencies","ImpersonateAgency","StopImpersonatingAgency","IsImpersonatingAgency","getAgencyBalance","From","Date","To","ShipCode","getInsuranceTypes","guestSequenceNumber","setCurrentBookingToSession","SourcePage","DestinationPage","consolidateBooking","getCurrentBookingFromSession","callingPage","getMasterBookingFromSession","sendBookingDetails","html","getAvailableCabinLists","reject","getAvailableSpecialServices","getAvailableVoucher","getNationalities","getLanguages","getCountries","getRegions","countryCode","getShips","getDocumentInfo","getDocumentsList","itineraryCode","getTickets","getWebCheckInUrl","getWorldPayUrl","GetWorldPayUrlByCurrencyCode","currencyCode","getRestaurants","restaurantCode","GetServiceCharges","displayBooking","BookingNumber","BookingNumberTravelAndFriends","displayBookingList","getLastBookings","n","setAgencyProfile","agency","setAgencyProfileExtended","setUserProfile","user","setPassword","forgotPasswordSetPassword","CreateNewToken","forceChangePassword","uploadAgencyLogo","getUserMenuData","createUserProfile","deleteUserProfile","getEmergencyPhoneNumber","setEmergencyPhoneNumber","number","uploadPaySlip","getPaySlipUrl","getDominoUrl","getDownloadFileList","downloadPath","getNews","getExcursionPDFAvailableLanguages","getExcursionPDFList","dateFrom","dateTo","pdfLanguages","getGroupToolData","AGENCY_DATA","GetExcursionReservationGuests","GeneratePDF","departureDate","cruiseDuration","GetExcursions","GetCountryISOCode","ISO_CODE","GetCities","country","city","params","HttpParams","fromObject","suggest","countryiso","get","GetCitiesLegacy","query","GetCityInfo","state","GetCityInfoLegacy","province","searchtext","GetBankTAInfoFetch","GetBankInfoFetch","CountryISOCode","BankTAInfo","BankInfo","BicSwift","SetBankTAInfo","UploadBankAccount","GetWeCareAgencyData","GetJumpData","GetWeCareData","GetWeCareData_NY","GetSeguiCData","GetActualData","GetMasterCardSession","GetMandatoryTransportationDirection","GetB2BLoyaltyProgram","GetCustomerVouchers","resp","ExportCustomerVouchers","responseType","Blob","GetGroups","GetGroup","Id","Group","GroupDefinition","CreateGroup","GetGroupTypes","GetGroupPaymentTerms","GetAvailableGroupSpecialServices","CruiseCode","GetGroupConditions","GroupPriceType","GetGroupOnBoardServices","GetGroupTransportations","Type","Direction","Class","Price","TransportationDetails","SetWebCheckInAgencyBlock","block","AddMortgageRequest","Data","UpdateMortgageRequest","GetMortgageRequestForUpdate","IsKPIOverrideEnabled","UploadKPIOverride","GetCruiseDiscountAutoItems","cruiseCodes","GetPreCalculationScore","GetCruisesPrices","ShorexInvoiceDownload","guid","split","GetAgentInvoiceDownloadList","BookingListByAgency","Status","key","BOOKING_LIST_BY_ADV_OPT","BOOKING_LIST_BY_ADV_BKD","BOOKING_LIST_BY_ADV","MaxBooking","OnlyCount","EpipoliConnect","EpipoliRegister","EpipoliGetRecharges","EpipoliGetWallet","SetPayment","formOfPayment","paymentDate","SetPaymentExtended","PaymentDetail","FormOfPayment","PaymentDate","ForgotPasswordSendMail","factory","ɵfac","providedIn","source","config","hasConfig","_value","_hasValue","subscribe","next","value","complete","defaultValue","EmptyError","delayWhen","delayDurationSelector","subscriptionDelay","concat","take","ignoreElements","operate","subscriber","createOperatorSubscriber","noop","mergeMap","index","innerFrom","mapTo","due","scheduler","asyncScheduler","duration","timer"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./src/app/classes/BEError.class.ts","./src/app/services/costa-backend-api.service.ts","./node_modules/rxjs/dist/esm/internal/lastValueFrom.js","./node_modules/rxjs/dist/esm/internal/operators/delayWhen.js","./node_modules/rxjs/dist/esm/internal/operators/ignoreElements.js","./node_modules/rxjs/dist/esm/internal/operators/delay.js"],"sourcesContent":["import { KTResponseCustom, KTResponseDNoResult } from '@interfaces/Generic/KTResponse.interface';\n\nexport class BEError> extends Error {\n public response: any;\n constructor(message: T) {\n super();\n this.name = 'BEError';\n this.message = message?.d?.Message || 'Unexpected Error';\n this.response = message;\n }\n}\n","import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { BEError } from '@classes/BEError.class';\nimport { CustomHeaders } from '@enums/CustomHeaders.enum';\nimport { SessionStorageKey } from '@enums/SessionStorageKey.enum';\nimport { TransformerRequestCodes } from '@enums/TransformerRequestCodes.enum';\nimport { TransformerResponseCodes } from '@enums/TransformerResponseCodes.enum';\nimport {\n KTResponse,\n KTResponseCustom,\n KTResponseD,\n KTResponseDNoResult,\n KTResponseNoMessage,\n} from '@interfaces/Generic/KTResponse.interface';\nimport { SetPaymentRequestParams } from '@interfaces/Groups/SetPaymentRequestParams.interface';\nimport { B2BLoyaltyProgramResponse } from '@interfaces/Jakala/B2BLoyaltyProgramResponse.interface';\nimport { CitySearchResponse } from '@interfaces/Jakala/CitySearch.interface';\nimport { CitySuggestionsData } from '@interfaces/Jakala/CitySuggestionsData.interface';\nimport { AbilitazioneConfig } from '@interfaces/KT/AbilitazioneConfig.interface';\nimport { AbilitazioneRequestDTO } from '@interfaces/KT/AbilitazioneRequest.interface';\nimport { AgeRangeDTO } from '@interfaces/KT/AgeRange.interface';\nimport { AgencyBalanceDataDTO } from '@interfaces/KT/AgencyBalanceData.interface';\nimport { AgencyProfileDTO } from '@interfaces/KT/AgencyProfile.interface';\nimport { AgencyProfileResponseDataDTO } from '@interfaces/KT/AgencyProfileResponseData.interface';\nimport { AgentInvoiceDownloadDTO } from '@interfaces/KT/AgentInvoiceDownload.interface';\nimport { AirportListDataDTO } from '@interfaces/KT/AirportListData.interface';\nimport { AutoItemsCruiseListDataDTO } from '@interfaces/KT/AutoItemsCruiseListData.interface';\nimport { BankInfoResponseDTO } from '@interfaces/KT/BankInfoResponse.interface';\nimport { BankTAInfoDTO } from '@interfaces/KT/BankTAInfo.interface';\nimport { BankTAInfoResponseDTO } from '@interfaces/KT/BankTAInfoData.interface';\nimport { BookingCancellationPenalty } from '@interfaces/KT/BookingCancellationPenalty.interface';\nimport { BookingDataDTO } from '@interfaces/KT/BookingData.interface';\nimport { BookingListByAgencyDTO } from '@interfaces/KT/BookingListByAgency.interface';\nimport { BookingListItemDTO } from '@interfaces/KT/BookingListItem.interface';\nimport { BusStationListDataDTO } from '@interfaces/KT/BusStationListData.interface';\nimport { CRMAgencyProfileDTO } from '@interfaces/KT/CRMAgencyProfile.interface';\nimport { CabinSelectionDataDTO } from '@interfaces/KT/CabinSelectionData.interface';\nimport { CategoryListDataDTO } from '@interfaces/KT/CategoryListData.interface';\nimport {\n CreateNewTokenDTO,\n ForceChangePasswordDTO,\n ForgotPasswordSendMailDTO,\n ForgotPasswordSetPasswordDTO,\n ForgotPasswordSetPasswordResponseDTO,\n SetPasswordDTO\n} from '@interfaces/KT/ChangePassword.interface';\nimport { CheckOutSessionDTO } from '@interfaces/KT/CkeckOutSession.interface';\nimport { ContactInfos } from '@interfaces/KT/ContactInfos.interface';\nimport { CorrelatedAgencyDTO } from '@interfaces/KT/CorrelatedAgency.interface';\nimport { CostaClubInfoDTO } from '@interfaces/KT/CostaClubInfo.interface';\nimport { CountryDTO } from '@interfaces/KT/Country.interface';\nimport { CountryISOCodeDTO } from '@interfaces/KT/CountryISOCode.interface';\nimport { CruiseFinderDataDTO } from '@interfaces/KT/CruiseFinderData.interface';\nimport { CruiseItineraryDTO } from '@interfaces/KT/CruiseItinerary.interface';\nimport { CruiseListDataDTO } from '@interfaces/KT/CruiseListData.interface';\nimport { CustomerVoucherListDTO } from '@interfaces/KT/CustomerVoucherList.interface';\nimport { CustomerVoucherSearchDTO } from '@interfaces/KT/CustomerVoucherSearch.interface';\nimport { SimpleDocumentDTO } from '@interfaces/KT/Document.interface';\nimport { DocumentInfoDTO } from '@interfaces/KT/DocumentInfo.interface';\nimport { RechargeDTO } from '@interfaces/KT/Epipoli/Recharge.interface';\nimport { WalletDTO } from '@interfaces/KT/Epipoli/Wallet.interface';\nimport { ExcursionListDataDTO } from '@interfaces/KT/ExcursionListData.interface';\nimport { ExcursionPDFItemDTO } from '@interfaces/KT/ExcursionPDFItem.interface';\nimport { ExcursionPDFLanguageDTO } from '@interfaces/KT/ExcursionPDFLanguage.interface';\nimport { ExcursionReservationGuestDTO } from '@interfaces/KT/ExcursionReservationGuest.interface';\nimport { FareDTO } from '@interfaces/KT/Fare.interface';\nimport { FarePricesCruiseListDataDTO } from '@interfaces/KT/FarePricesCruiseListData.interface';\nimport { GroupLoadOperationDataDTO } from '@interfaces/KT/GroupLoadOperationData.interface';\nimport { GroupRequestDTO } from '@interfaces/KT/GroupRequest.interface';\nimport { GroupResponseDataDTO } from '@interfaces/KT/GroupResponseData.interface';\nimport { GroupToolDataDTO } from '@interfaces/KT/GroupToolData.interface';\nimport { HotelListDataDTO } from '@interfaces/KT/HotelListData.interface';\nimport { InsuranceTypeDTO } from '@interfaces/KT/InsuranceType.interface';\nimport { LanguageDTO } from '@interfaces/KT/Language.interface';\nimport { MandatoryTransportationDirectionDTO } from '@interfaces/KT/MandatoryTransportationDirection.interface';\nimport { MenuItemDTO } from '@interfaces/KT/MenuItem.interface';\nimport { MessageDTO } from '@interfaces/KT/Message.interface';\nimport { MortgageDataDTO } from '@interfaces/KT/MortgageData.interface';\nimport { NationalityDTO } from '@interfaces/KT/Nationality.interface';\nimport { NewsListDataDTO } from '@interfaces/KT/NewsListData.interface';\nimport { PaymentDTO } from '@interfaces/KT/Payment.intereface';\nimport { PreCalculationScoreDTO } from '@interfaces/KT/PreCalculationScore.interface';\nimport { PreCalculationScoreRequestDTO } from '@interfaces/KT/PreCalculationScoreRequest.interface';\nimport { PromoGeolocationParams } from '@interfaces/KT/PromoGeolocationParams.interface';\nimport { PromoTransportationSolutionListDataDTO } from '@interfaces/KT/PromoTransportationSolutionListData.interface';\nimport { RegionDTO } from '@interfaces/KT/Region.interface';\nimport { RestaurantListsDTO } from '@interfaces/KT/RestaurantLists.interface';\nimport { SectionDTO } from '@interfaces/KT/Section.interface';\nimport { ServiceChargeDTO } from '@interfaces/KT/ServiceCharge.interface';\nimport { SetPaymentExtendedRequestParams, SetPaymentExtendedResponse } from '@interfaces/KT/SetPaymentExtended.interface';\nimport { ShipListItemDTO } from '@interfaces/KT/Ship.interface';\nimport { SpecialServiceListDataDTO } from '@interfaces/KT/SpecialServiceListData.interface';\nimport { TicketDTO } from '@interfaces/KT/Ticket.interface';\nimport { TipDTO } from '@interfaces/KT/Tip.interface';\nimport { UserProfileDTO } from '@interfaces/KT/UserProfile.interface';\nimport { VoucherDTO } from '@interfaces/KT/Voucher.interface';\nimport { ActualDetailData } from '@interfaces/KT/WeCare/ActualDetailData.interface';\nimport { JumpData } from '@interfaces/KT/WeCare/JumpData.interface';\nimport { SeguiCData } from '@interfaces/KT/WeCare/SeguiCData.interface';\nimport { WeCareAgencyData } from '@interfaces/KT/WeCare/WeCareAgencyData.interface';\nimport { WeCareDataDTO } from '@interfaces/KT/WeCare/WeCareData.interface';\nimport dayjs from 'dayjs';\nimport { Observable, catchError, debounceTime, delay, finalize, lastValueFrom, map, of, tap } from 'rxjs';\nimport { LoadingService } from './loading.service';\n//import {airResponseMock} from \"@services/mocks/AirRTMock2\";\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CostaBackendApiService {\n private readonly _http = inject(HttpClient);\n private readonly _loadingService = inject(LoadingService);\n\n private readonly BookingFlowServicesPath = '_vti_bin/CostaClickNew/UIServices/BookingFlowServices.svc/';\n private readonly UserServicesPath = '_vti_bin/CostaClickNew/UIServices/UserServices.svc/';\n private readonly GenericServicesPath = '_vti_bin/CostaClickNew/UIServices/GenericServices.svc/';\n private readonly ContentServicesPath = '_vti_bin/CostaClickNew/UIServices/ContentServices.svc/';\n private readonly ExcursionServicesPath = '_vti_bin/CostaClickNew/UIServices/ExcursionServices.svc/';\n private readonly EpipoliServicesPath = '_vti_bin/CostaClickNew/UIServices/EpipoliServices.svc/';\n private readonly WeCareServicesPath = '../Templates/AgencyBalance/WeCare.aspx/';\n private readonly HandlersPath = '/_layouts/15/CostaClickNew/HttpHandlers/';\n\n private get CCKBasePath() {\n return window?.cckBasePath;\n }\n\n private readonly OcpPro = '160e607816cf40cda7745d0e960852ec';\n private readonly JakalaLegacyHeaders = new HttpHeaders({ 'Ocp-Apim-Subscription-Key': this.OcpPro });\n private readonly JakalaHeaders = new HttpHeaders({ 'Jakala-Subscription-Key': this.OcpPro });\n private readonly WithCredentials = {\n withCredentials: true,\n };\n private readonly UPLOAD = {\n withCredentials: true,\n };\n\n private handleKtApi(source$: Observable>): Observable {\n return source$.pipe(\n tap((res) => {\n if (!res?.d?.Success) throw res;\n }),\n map((res) => res?.d.Result),\n catchError((res) => {\n console.error('Rejected async call.', res);\n throw new BEError(res);\n }),\n );\n }\n\n private handleKtApiWithNoMessage(source$: Observable>): Observable['d']> {\n return source$.pipe(\n tap((res) => {\n if (!res?.d) throw null;\n }),\n map((res) => res?.d),\n catchError((res) => {\n console.error('Rejected async call.', res);\n throw new BEError(res);\n }),\n );\n }\n\n private handleKtApiWithBlockingMessage(source$: Observable>): Observable {\n return source$.pipe(\n tap((res) => {\n if (!res?.d?.Success || res?.d?.Message) throw res;\n }),\n map((res) => res?.d?.Result),\n catchError((res) => {\n console.error('Rejected async call.', res);\n throw new BEError(res);\n }),\n );\n }\n\n private handleKtApiWithWarningMessage(\n source$: Observable>,\n ): Observable['d']> {\n return source$.pipe(\n tap((res) => {\n if (!res?.d?.Success) throw res;\n }),\n map((res) => res?.d),\n catchError((res) => {\n console.error('Rejected async call.', res);\n throw new BEError(res);\n }),\n );\n }\n\n private mockApi(data: T, delayMilliseconds = 1000): Observable {\n return of(data).pipe(delay(delayMilliseconds));\n }\n\n private handleApi(source$: Observable): Observable {\n return source$.pipe(\n tap((res) => {\n if (!res) throw 'Unexpected Error';\n }),\n map((res) => res),\n catchError((res) => {\n console.error('Rejected async call.', res);\n throw new Error(res);\n }),\n );\n }\n\n /**\n * Fornisce gli elenchi di destinazioni e tariffe con cui riempire le relative liste a partire dalle date selezionate.\n *\n * @param inFrom Search From\n * @param inTo Search To\n * @param inDestination Search in destinations selected\n * @param inFare Search in fares selected\n * @see prefetchExtended\n * @deprecated\n */\n public prefetch(inFrom: Date, inTo: Date, inDestination: string[] = [], inFare: string[] = []): Promise {\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetCruiseFinderData`;\n const obs$ = this._http\n .post>(\n api,\n {\n inFrom,\n inTo,\n inDestination,\n inFare,\n },\n this.WithCredentials,\n )\n .pipe(this.handleKtApi);\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce gli elenchi di destinazioni, navi, porti e tariffe con cui riempire\n * le relative liste a partire dalle date selezionate e da eventuali altri\n * criteri di ricerca.\n *\n * @param inFrom Search From\n * @param inTo Search To\n * @param inDestination Search in destinations selected\n * @param inFare Search in fares selected\n * @param inPort Search in ports selected\n * @param inShip Search in ships selected\n * @param inDiscount Search in discounts selected\n * @param inOccupancy Search in occupancies selected\n *\n * @returns {Promise}\n */\n public prefetchExtended(\n inFrom: Date,\n inTo: Date,\n inDestination: string[] = [],\n inFare: string[] = [],\n inPort: string[] = [],\n inShip: string[] = [],\n inDiscount: string[] = [],\n inOccupancy: string[] = [],\n ): Promise {\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetExtendedCruiseFinderData`;\n const obs$ = this._http\n .post>(\n api,\n {\n filters: {\n from: dayjs(inFrom).format('YYYY-MM-DD'),\n to: dayjs(inTo).format('YYYY-MM-DD'),\n destinationCode: inDestination.join(','),\n fareCode: inFare.join(','),\n portCode: inPort.join(','),\n shipCode: inShip.join(','),\n discountCode: inDiscount.join(','),\n occupancyCode: inOccupancy.join(','),\n },\n },\n this.WithCredentials,\n )\n .pipe(debounceTime(250), this.handleKtApi);\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di effettuare l'upload del file CSV per il group load.\n *\n * @param file File to upload\n * @returns {Promise>}\n */\n public uploadGroupLoadData(file: File): Promise> {\n const loader = 'uploadGroupLoadData';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}UploadGroupLoadData`;\n const formData = new FormData();\n formData.append('file', file);\n const obs$ = this._http.post>(api, formData, this.UPLOAD).pipe(\n this.handleKtApiWithWarningMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce le operazioni di Group Load salvate su database.\n *\n * @param groupId Id Grouppo da richiedere\n * @param timeInterval Intervallo di tempo\n * @returns {Promise}\n */\n public getGroupLoadOperations(groupId = '', timeInterval: 'Today' | 'ThisMonth' | '' = ''): Promise {\n const loader = 'getGroupLoadOperations';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetGroupLoadOperations`;\n const obs$ = this._http\n .post>(\n api,\n {\n groupId,\n timeInterval,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce i dettagli dell'operazione di Group Load specificata.\n *\n * @param operationId OperationId da richiedere\n * @returns {Promise}\n */\n public getGroupLoadOperationDetails(operationId: string): Promise {\n const loader = 'getGroupLoadOperationDetails';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetGroupLoadOperationDetails`;\n const obs$ = this._http\n .post>(\n api,\n {\n operationId,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'URL del file CSV contenente i dettagli dell'operazione di Group Load specificata.\n *\n * @param operationId OperationId da richiedere\n * @returns {Promise}\n */\n public getGroupLoadOperationDetailsCsv(operationId: string): Promise {\n const loader = 'getGroupLoadOperationDetailsCsv';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetGroupLoadOperationDetailsCsv`;\n const obs$ = this._http\n .post>(\n api,\n {\n operationId,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Richiede di posticipare la data di scadenza dell'opzione sulla pratica attualmente in sessione.\n * Il metodo può essere chiamato se la sezione OptionDate delle allowed operation del booking ha\n * l'operazione Modify abilitata.\n *\n * @returns {KTResponseD}\n */\n public extendOptionDate(): Promise> {\n const loader = 'extendOptionDate';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}ExtendOptionDate`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithWarningMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n\n /**\n * Richiede di posticipare la data di scadenza dell’opzione sulla pratica richiesta in input.\n *\n * @returns {KTResponseD}\n */\n public extendOptionDateForBooking(bookingNumber : string): Promise> {\n const loader = 'extendOptionDateForBooking';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}ExtendOptionDateForBooking`;\n const obs$ = this._http.post>(api, { bookingNumber }, this.WithCredentials).pipe(\n this.handleKtApiWithWarningMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di annullare il booking in sessione.\n *\n * @param penaltyInfo Risposta della chiamata GetBookingCancellationPenalty\n * @see retrieveBookingCancellationPenalty\n * @returns {Promise}\n */\n public cancelBooking(penaltyInfo: BookingCancellationPenalty = undefined): Promise {\n const loader = 'cancelBooking';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}CancelBooking`;\n const obs$ = this._http\n .post>(\n api,\n {\n penaltyInfo,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di conoscere la penale in caso di annullamento del booking in sessione.\n * Se il booking non è in stato BKD la penale è nulla.\n *\n * @returns {Promise}\n */\n public retrieveBookingCancellationPenalty(): Promise {\n const loader = 'retrieveBookingCancellationPenalty';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetBookingCancellationPenalty`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Effettua la login di un utente dati Username e Password.\n * Se la login ha esito positivo verranno rilasciati una serie di cookie che saranno poi usati dall'applicativo,\n * tutte le chiamate successive dovranno quindi provvedere ad inviare i suddetti cookie.\n * Il servizio può essere chiamato in anonimo.\n *\n * @param username Username utente\n * @param password Password utente\n * @returns {Promise}\n */\n public login(username: string, password: string): Promise {\n const loader = 'login';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}LoginUser`;\n const obs$ = this._http\n .post>(\n api,\n {\n loginInfo: {\n UserName: username,\n Password: password,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ritorna le informazioni di contatto.\n *\n * @returns {Promise}\n */\n public getContactInfos(): Promise {\n const loader = 'getContactInfos';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetContactInfos`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce gli elenchi di destinazioni e tariffe con cui riempire le relative liste a partire dalle date selezionate.\n *\n * @param inFrom Ricerca da\n * @param inTo Ricerca a\n * @param inDestination Destinazioni\n * @param inFare Tariffe\n * @param inOccupancy Occupancy\n * @returns {Promise}\n */\n public cruiseSearch(\n inFrom: Date,\n inTo: Date,\n inDestination: string[] = [],\n inFare: string[] = [],\n inOccupancy: string[] = [],\n ): Promise {\n const loader = 'cruiseSearch';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetCruiseListData`;\n const obs$ = this._http\n .post>(\n api,\n {\n from: dayjs(inFrom).format('YYYY-MM-DD'),\n to: dayjs(inTo).format('YYYY-MM-DD'),\n destinationCode: inDestination.join(','),\n fareCode: inFare.join(','),\n occupancyCode: inOccupancy.join(','),\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce la lista delle crociere in base ai parametri di ricerca specificati. \\\n * **NON** torna informazioni relative ai prezzi se useLightSearch è passato a *true*\n *\n * @param inFrom Ricerca da\n * @param inTo Ricerca a\n * @param inDestination Destinazioni\n * @param inFare Tariffe\n * @param inOccupancy Occupancies\n * @param inPort Porti\n * @param inShip Navi\n * @param inDiscount Sconti\n * @param useLightSearch Utilizza ricerca light?\n * @returns {Promise}\n */\n public cruiseExtendedSearch(\n inFrom: Date,\n inTo: Date,\n inDestination: string[] = [],\n inFare: string[] = [],\n inOccupancy: string[] = [],\n inPort: string[] = [],\n inShip: string[] = [],\n inDiscount: string[] = [],\n useLightSearch = false,\n ): Promise {\n const loader = 'cruiseExtendedSearch';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetExtendedCruiseListData`;\n const apiLight = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetCruiseList`;\n const obs$ = this._http\n .post>(\n useLightSearch ? apiLight : api,\n {\n filters: {\n from: dayjs(inFrom).format('YYYY-MM-DD'),\n to: dayjs(inTo).format('YYYY-MM-DD'),\n destinationCode: inDestination.join(','),\n fareCode: inFare.join(','),\n portCode: inPort.join(','),\n shipCode: inShip.join(','),\n discountCode: inDiscount.join(','),\n occupancyCode: inOccupancy.join(','),\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di effettuare una richiesta di gruppo.\n *\n * @param GroupId Id Gruppo\n * @param ShipName Nome nave\n * @param DepartureDate Data di partenza\n * @param DeparturePort Porto di partenza\n * @param NumberOfGuests Numero di passeggeri\n * @param NumberOfCabins Numero di cabine\n * @param CabinType Tipologia cabine\n * @param GroupType Tipologia gruppo\n * @param NumberOfBeds Numero di letti\n * @param NumberOfSingleCabins Numero di cabine singole\n * @param DepartureAirport Porto di partenza\n * @param Notes Note\n * @param ContactName Nome contatto\n * @param ContactPhoneNumber Telefono contatto\n * @param ContactEmail Email contatto\n * @returns {Promise}\n */\n public getGroupRequest(\n GroupId: string,\n ShipName: string,\n DepartureDate: string,\n DeparturePort: string,\n NumberOfGuests: string,\n NumberOfCabins: string,\n CabinType: string,\n GroupType: string,\n NumberOfBeds: string,\n NumberOfSingleCabins: string,\n DepartureAirport: string,\n Notes: string,\n ContactName: string,\n ContactPhoneNumber: string,\n ContactEmail: string,\n ): Promise {\n const loader = 'getGroupRequest';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GroupRequest`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n GroupId,\n ShipName,\n DepartureDate,\n DeparturePort,\n NumberOfGuests,\n NumberOfCabins,\n CabinType,\n GroupType,\n NumberOfBeds,\n NumberOfSingleCabins,\n DepartureAirport,\n Notes,\n ContactName,\n ContactPhoneNumber,\n ContactEmail,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di impostare i dati strettamente necessari per la creazione in memoria\n * di un oggetto Booking, che sarà restituito come output.\n *\n * @param firstCruiseCode Codice Crociera\n * @param fareCode Codice Tariffa\n * @param categoryCode Codice Categoria\n * @param occupancyCode Codice Occupazione\n * @param secondCruiseCode Codice Crociera 2\n * @returns {Promise}\n */\n public initialiseBooking(\n firstCruiseCode: string,\n fareCode: string,\n categoryCode: string,\n occupancyCode: string,\n secondCruiseCode = '',\n ): Promise {\n const loader = 'initialiseBooking';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}InitializeBooking`;\n const obs$ = this._http\n .post>(\n api,\n {\n firstCruiseCode,\n secondCruiseCode,\n fareCode,\n categoryCode,\n occupancyCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di richiedere la fattura per il gruppo specificato.\n *\n * @param groupId Id gruppo\n * @param firstEmail Email 1\n * @param secondEmail Email 2\n * @param eventsFlag Flag Eventi\n * @param transportationInfoFlag Flag Trasporti\n * @param allFlag Flag Tutti\n * @param paxDetailsFlag Flag Passeggeri\n * @param groupMasterChargesFlag Flag master charges\n * @param detailSummaryFlag Flag dettaglio\n * @param groupPaymentFlag Flag pagamento\n * @param allocationSummaryFlag Flag allocazione\n * @param printMode Flag stampa\n * @returns {Promise}\n */\n public getGroupInvoice(\n groupId: string,\n firstEmail: string,\n secondEmail: string,\n eventsFlag = false,\n transportationInfoFlag = false,\n allFlag = false,\n paxDetailsFlag = false,\n groupMasterChargesFlag = false,\n detailSummaryFlag = false,\n groupPaymentFlag = false,\n allocationSummaryFlag = false,\n printMode = 2,\n ): Promise {\n const loader = 'getGroupInvoice';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GroupInvoice`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n GroupId: groupId,\n FirstEmail: firstEmail,\n SecondEmail: secondEmail,\n Events: eventsFlag,\n TransportationInfo: transportationInfoFlag,\n Print: printMode,\n Sections: {\n All: allFlag,\n PaxDetails: paxDetailsFlag,\n GroupMasterCharges: groupMasterChargesFlag,\n DetailSummary: detailSummaryFlag,\n GroupPayment: groupPaymentFlag,\n AllocationSummary: allocationSummaryFlag,\n },\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce le soglie di età in base alla config del booking correte.\n *\n * @returns {Promise}\n */\n public getAgeRange(): Promise {\n const loader = 'getAgeRange';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAgeRange`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Gestisce l'invio della lettera di conferma per email o fax.\n * In caso di compilazione di entrambi i valori prevale l'email\n *\n * @param emailAddress Email\n * @param versionType AGENCY or GUEST\n * @returns {Promise}\n */\n public sendConfirmationLetter(emailAddress: string, versionType: string): Promise {\n const loader = 'sendConfirmationLetter';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}SendConfirmationLetter`;\n const obs$ = this._http\n .post>(\n api,\n {\n emailAddress,\n versionType,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Effettua una quotazione sulla base dei dati selezionati. Nel booking deve essere presente una sola cabina.\n * Non è previsto alcun parametro di input, ma occorre chiamare preventivamente setCurrentBookingToSession\n *\n * @see setCurrentBookingToSession.\n * @returns {Promise}\n */\n public quickQuotation(): Promise {\n const loader = 'quickQuotation';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}QuickQuotation`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ritorna le informazioni necessarie a compilare la modale di dettaglio itinerario\n *\n * @param cruiseCode Codice Crociera\n * @returns {Promise}\n */\n public GetItineraryDetails(cruiseCode: string): Promise {\n const loader = 'GetItineraryDetails';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetItineraryDetails`;\n\n const obs$ = this._http\n .post>(\n api,\n {\n cruiseCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di modificare la tariffa del booking in sessione, effettuando il preventivo se richiesto.\n * L'elenco delle possibili tariffe viene restituito dal metodo GetFares.\n * Il metodo può essere chiamato se la property CanChangeFare del booking è uguale a true.\n * Se la modifica della tariffa va a buon fine occorre chiamare DisplayBooking per avere i dati aggiornati.\n *\n * @param isQuotation Se si vuole ottenere un preventivo o se si vuole cambiare la tariffa\n * @param fareCode Codice Tariffa\n * @param costaClubInfo Dati C|Club\n * @see getFares;\n * @see displayBooking;\n * @returns\n */\n public changeFare(isQuotation: boolean, fareCode: string, costaClubInfo: CostaClubInfoDTO): Promise {\n const loader = 'changeFare';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}ChangeFare`;\n const obs$ = this._http\n .post>(\n api,\n {\n quote: isQuotation,\n fareCode,\n costaClubInfo,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce le informazioni CostaClub per il passeggero specificato. \\\n * E' indispensabile specificare LastName e CostaClubNumber, oppure FirstName, LastName e BirthDate. \\\n * Se tutti i campi sono compilati, la priorità è data a CostaClubNumber\n *\n * @param FirstName Nome\n * @param LastName Cognome\n * @param CostaClubNumber Codice carla C|Club\n * @param birthDate Data di nascita\n * @returns {Promise}\n */\n public getCostaClubInfo(FirstName: string, LastName: string, CostaClubNumber: string, birthDate: string = null): Promise {\n const loader = 'getCostaClubInfo';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetCostaClubInfo`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n FirstName,\n LastName,\n CostaClubNumber,\n BirthDate: birthDate ? dayjs(birthDate).format('YYYY-MM-DD') : '',\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce il dettaglio delle operazioni consentite e delle configurazioni in\n * base alle configurazioni di sistema ed al booking attualmente salvato in sessione\n *\n * @returns {Promise}\n */\n public GetAllowedOperationForBooking(): Promise {\n const loader = 'GetAllowedOperationForBooking';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAllowedOperationForBooking`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce il dettaglio delle operazioni consentite e delle configurazioni in\n * base alle configurazioni di sistema ed al booking attualmente salvato in sessione\n *\n * @returns {Promise}\n */\n public GetAllowedOperationForGuest(guestId: any): Promise {\n const loader = 'GetAllowedOperationForGuest';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAllowedOperationForGuest`;\n const obs$ = this._http\n .post>(\n api,\n {\n guestId,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce un elenco di Massage e Warining da in base all'attuale configurazione del booking in sessione\n *\n * @returns {Promise}\n */\n public GetBookingWarningsAndMessages(): Promise {\n const loader = 'GetBookingWarningsAndMessages';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetBookingWarningsAndMessages`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce un elenco di Tips (messaggi) da visualizzare in base all'attuale configurazione del booking in sessione.\n * A differenza dei message and warning questi possono richiedere la visualizzazione in modale/popup e\n * l'interazione dell'utente (checkbox) per permettere di chiudere la popup/modale e proseguire nella navigazione\n *\n * @returns {Promise}\n */\n public GetBookingTips(): Promise {\n const loader = 'GetBookingTips';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetBookingTips`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco delle tariffe disponibili per la crociera precedentemente selezionata.\n * Se in sessione c'è un numero di booking vengono restituiti i valori che si possono scegliere allo step 5 per il cambio tariffa.\n *\n * @returns {Promise}\n */\n public getFares(): Promise {\n const loader = 'getFares';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetFares`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Occorre chiamare questo metodo ogniqualvolta si selezioni una tariffa differente\n * dalla dropdown dello step CategorySelection, o si cambi il valore della checkbox\n * CostaClub oppure si specifichi un diverso group ID.\n *\n * @param fareObj Fare\n * @returns {Promise<{}>}\n */\n public setFares(fare: FareDTO): Promise> {\n const loader = 'setFares';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}SetFare`;\n const obs$ = this._http\n .post>>(\n api,\n {\n fare,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco dei voli di linea disponibili a catalogo, con le relative direzioni e classi di volo ammesse.\n *\n * @returns {Promise}\n */\n public getAirports(): Promise {\n const loader = 'getAirports';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAirports`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n\n\n // return lastValueFrom(this.mockApi(airResponseMock));\n }\n\n /**\n * Verifica se ci sono voli promo disponibili.\n *\n * @returns {Promise}\n */\n public checkPromoFlightAvailability(): Promise {\n const loader = 'checkPromoFlightAvailability';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}CheckPromoFlightAvailability`;\n const obs$ = this._http\n .post>(\n api,\n {\n flightClass: '',\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApiWithBlockingMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Verifica se ci sono bus promo disponibili.\n *\n * @returns {Promise}\n */\n public checkPromoBusAvailability(): Promise {\n const loader = 'checkPromoBusAvailability';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}CheckPromoBusAvailability`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithBlockingMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Verifica se ci sono trasporti generici promo disponibili.\n *\n * @returns {Promise}\n */\n public checkPromoGenericTransportationAvailability(): Promise {\n const loader = 'checkPromoGenericTransportationAvailability';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}CheckPromoGenericTransportationAvailability`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithBlockingMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco dei voli promo disponibili.\n *\n * @returns {Promise}\n */\n public getPromoAirports(): Promise {\n const loader = 'getPromoAirports';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetPromoAirports`;\n const obs$ = this._http\n .post>(\n api,\n {\n flightClass: '',\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApiWithBlockingMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco delle soluzioni di volo promozionali disponibili.\n *\n * @param parameters Geolocation params\n * @returns {Promise}\n */\n public getPromoFlightSolutions(parameters: PromoGeolocationParams): Promise {\n const loader = 'getPromoFlightSolutions';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetPromoFlightSolutions`;\n const obs$ = this._http\n .post>(\n api,\n {\n ...parameters,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco delle soluzioni di volo promozionali disponibili.\n *\n * @param parameters Geolocation params\n * @returns {Promise}\n */\n public GetPromoGenericTransportationSolutions(parameters: PromoGeolocationParams): Promise {\n const loader = 'GetPromoGenericTransportationSolutions';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetPromoGenericTransportationSolutions`;\n const obs$ = this._http\n .post>(\n api,\n {\n ...parameters,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco delle soluzioni di volo promozionali disponibili.\n *\n * @param parameters Geolocation params\n * @returns {Promise}\n */\n public GetPromoBusSolutions(parameters: any): Promise {\n const loader = 'GetPromoBusSolutions';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetPromoBusSolutions`;\n const obs$ = this._http\n .post>(\n api,\n {\n ...parameters,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco delle stazioni per cui sono disponibili collegamenti mediante autobus\n *\n * @param direction\n * @returns {Promise}\n */\n public getBusStations(direction: 'InBound' | 'OutBound' | 'Both' | 'Any'): Promise {\n const loader = 'getBusStations';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetBusStations`;\n const obs$ = this._http\n .post>(\n api,\n {\n direction,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco degli hotel disponibili.\n *\n * @param cabinIndex Indice della cabina da richiedere\n * @returns {Promise}\n */\n public getHotels(cabinIndex: number = undefined): Promise {\n const loader = 'getHotels';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetHotels`;\n const obs$ = this._http\n .post>(\n api,\n {\n cabinIndex,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco delle categorie disponibili per la cabina specificata.\n *\n * @param cabinIndex: Indice Cabina da richiedere\n * @returns {Promise}\n */\n public getAvailableCategories(cabinIndex: number): Promise {\n const loader = 'getAvailableCategories';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAvailableCategories`;\n const obs$ = this._http\n .post>(\n api,\n {\n cabinIndex,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce per ciascuna cabina del booking l'elenco delle cabine disponibili.\n *\n * @param cabinIndex\n * @param categoryCodes\n * @returns {Promise}\n */\n public getAvailableCabins_Legacy(cabinIndex: number, categoryCodes: [string?] = []): Promise {\n const loader = 'getAvailableCabins';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAvailableCabinsByCategoryCodes`;\n const obs$ = this._http\n .post>(\n api,\n {\n cabinIndex,\n categoryCodes\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n public getAvailableCabins(cabinIndex: number, categoryCodes : [string?] = []): Promise {\n const loader = 'GetAvailableCabinsByCategoryCodes';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAvailableCabinsByCategoryCodes`;\n const obs$ = this._http\n .post>(\n api,\n {\n cabinIndex,\n categoryCodes\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Richiede una quotazione completa sulla base dei dati selezionati.\n *\n * @param Booking Booking\n * @returns\n */\n public getQuotation(Booking: BookingDataDTO): Promise {\n const loader = 'getQuotation';\n this._loadingService.startLoading(loader);\n let headers = new HttpHeaders();\n headers = headers.append(\n CustomHeaders.TRANSFORM_REQUEST,\n [TransformerRequestCodes.REMOVE_AUTO_SSV, TransformerRequestCodes.ADD_FISCOD_FOREIGN_GUEST].join(','),\n );\n headers = headers.append(\n CustomHeaders.TRANSFORM_RESPONSE,\n [TransformerResponseCodes.REMOVE_FISCOD_ON_FOREIGN_GUEST, TransformerResponseCodes.GUEST_TBA].join(','),\n );\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetQuotation`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Booking,\n },\n },\n {\n ...this.WithCredentials,\n headers,\n },\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Richiede la creazione di una pratica sulla base dei dati selezionati\n *\n * @param Booking\n * @returns {Promise}\n */\n public createBooking(Booking: BookingDataDTO): Promise {\n const loader = 'createBooking';\n this._loadingService.startLoading(loader);\n let headers = new HttpHeaders();\n headers = headers.append(CustomHeaders.TRANSFORM_REQUEST, [TransformerRequestCodes.ADD_FISCOD_FOREIGN_GUEST].join(','));\n headers = headers.append(CustomHeaders.TRANSFORM_RESPONSE, [TransformerResponseCodes.REMOVE_FISCOD_ON_FOREIGN_GUEST].join(','));\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}CreateBooking`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Booking,\n },\n },\n {\n ...this.WithCredentials,\n headers,\n },\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Consente di modificare i dati di una pratica precedentemente creata. \\\n * Questo metodo va chiamato ad ogni modifica della pratica\n *\n * @example aggiunta o modifica di cabine, passeggeri, voli, servizi speciali etc...\n * @param Booking\n * @param Payment\n * @returns {Promise>}\n */\n public modifyBooking(Booking: BookingDataDTO, Payment: Partial = undefined): Promise> {\n const loader = 'modifyBooking';\n this._loadingService.startLoading(loader);\n let headers = new HttpHeaders();\n headers = headers.append(\n CustomHeaders.TRANSFORM_REQUEST,\n [\n TransformerRequestCodes.REMOVE_AUTO_SSV,\n TransformerRequestCodes.REMOVE_EMPTY_WEB_CHECKIN,\n TransformerRequestCodes.ADD_FISCOD_FOREIGN_GUEST,\n ].join(','),\n );\n headers = headers.append(\n CustomHeaders.TRANSFORM_RESPONSE,\n [TransformerResponseCodes.REMOVE_FISCOD_ON_FOREIGN_GUEST, TransformerResponseCodes.GUEST_TBA].join(','),\n );\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}ModifyBooking`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Booking,\n Payment,\n },\n },\n {\n ...this.WithCredentials,\n headers,\n },\n )\n .pipe(\n this.handleKtApiWithWarningMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di ottenere l'url della lista di document legati al viaggio.\n *\n * @returns {Promise}\n */\n public GetErpIdListUrl(): Promise {\n const loader = 'GetErpIdListUrl';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetErpIdListUrl`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Consente di confermare una pratica precedentemente creata.\n *\n * @param Booking\n * @returns {Promise>}\n */\n public confirmBooking(Booking: BookingDataDTO): Promise> {\n const loader = 'confirmBooking';\n this._loadingService.startLoading(loader);\n let headers = new HttpHeaders();\n headers = headers.append(CustomHeaders.TRANSFORM_REQUEST, [TransformerRequestCodes.ADD_FISCOD_FOREIGN_GUEST].join(','));\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}ConfirmBooking`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Booking,\n },\n },\n {\n ...this.WithCredentials,\n headers,\n },\n )\n .pipe(\n this.handleKtApiWithWarningMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Controlla se il voucher è disponibile per il passeggero specificato.\n *\n * @param guestId Id Guest\n * @param voucherId Id Voucher\n * @returns {Promise>}\n */\n public checkVoucher(guestId: string, voucherId: string): Promise {\n const loader = 'checkVoucher';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}CheckVoucher`;\n const obs$ = this._http\n .post>(\n api,\n {\n guestId,\n voucherId,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ritorna i parametri necessari per effettuare la chiamata di richiesta abilitazione. \\\n * Tale chiamata ha infatti funzionalità e specifiche diverse a seconda del mercato. \\\n * Il servizio può essere chiamato in anonimo\n *\n * @returns {Promise}\n */\n public getRichiestaAbilitazioneConfig(): Promise {\n const loader = 'getRichiestaAbilitazioneConfig';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetRichiestaAbilitazioneConfig`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Innesca il processo di richiesta abilitazione, restituendo, se necessario, l'URL al PDF da aprire. \\\n * La valorizzazione dei campi è dipendente dalla risposta alla chiamata al metodo getRichiestaAbilitazioneConfig.\n * I campi non richiesti potranno essere lasciati vuoti o null (non verranno comunque considerati se non necessari). \\\n * Il servizio può essere chiamato in anonimo. \\\n *\n * @see getRichiestaAbilitazioneConfig\n * @param richiestaAbilitazione\n * @returns {Promise}\n */\n public getRichiestaAbilitazione(richiestaAbilitazione: AbilitazioneRequestDTO): Promise {\n const loader = 'getRichiestaAbilitazione';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}RichiestaAbilitazione`;\n const obs$ = this._http\n .post>(\n api,\n {\n richiestaAbilitazione,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce le informazioni di anagrafica dell'utente specificato. \\\n * Se userName è null verrà considerato l'utente che ha effettuato la login. \\\n * L'utente specificato sarà mostrato solo se il richiedente è il country manager o un amministratore della stessa agenzia.\n *\n * @param userName Utente da richiedere\n * @param preventCache\n * @returns { Promise }\n */\n public getUserProfile(userName: string = null, preventCache = false): Promise {\n const loader = 'getUserProfile';\n this._loadingService.startLoading(loader);\n try {\n const data: UserProfileDTO = JSON.parse(sessionStorage.getItem(SessionStorageKey.USER_DATA));\n if (!data || !Object.keys(data)?.length || preventCache) throw null;\n\n this._loadingService.stopLoading(loader);\n return Promise.resolve(data);\n } catch {\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetUserProfile`;\n const obs$ = this._http\n .post>(\n api,\n {\n userName,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n tap((res) => {\n sessionStorage.setItem(SessionStorageKey.USER_DATA, JSON.stringify(res));\n }),\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n }\n\n /**\n * Fornisce le informazioni di anagrafica dell'agenzia specificata.\n * Se agencyCode è null sarà considerata l'agenzia che ha effettuato la login.\n * L'agenzia specificata sarà mostrata solo se il richiedente è il country manager o l'agenzia è ad esso correlata.\n *\n * @param agencyCode Codice Agenzia\n * @returns { Promise }\n */\n public getAgencyProfile(agencyCode: string = null, preventCache = false): Promise {\n const loader = 'getAgencyProfile';\n this._loadingService.startLoading(loader);\n try {\n const data: AgencyProfileResponseDataDTO = JSON.parse(sessionStorage.getItem(SessionStorageKey.AGENCY_DATA_FULL));\n if (!data || !Object.keys(data)?.length || preventCache) throw null;\n\n this._loadingService.stopLoading(loader);\n return Promise.resolve(data);\n } catch {\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetAgencyProfile`;\n const obs$ = this._http\n .post>(\n api,\n {\n agencyCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n tap((res) => {\n sessionStorage.setItem(SessionStorageKey.AGENCY_DATA_FULL, JSON.stringify(res));\n }),\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n }\n\n /**\n * Fornisce le informazioni di anagrafica dell'agenzia specificata che tornano dal CRM.\n * Se agencyCode è null sarà considerata l'agenzia che ha effettuato la login.\n * L'agenzia specificata sarà mostrata solo se il richiedente è il country manager o l'agenzia è ad esso correlata.\n *\n * @param agencyCode Codice Agenzia\n * @returns { Promise }\n */\n public getAgencyProfileExtended(agencyCode: string = null, preventCache = false): Promise {\n const loader = 'getAgencyProfileExtended';\n this._loadingService.startLoading(loader);\n try {\n const data: CRMAgencyProfileDTO = JSON.parse(sessionStorage.getItem(SessionStorageKey.AGENCY_DATA_EXT));\n if (!data || !Object.keys(data)?.length || preventCache) throw null;\n\n this._loadingService.stopLoading(loader);\n return Promise.resolve(data);\n } catch {\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetAgencyProfileFromCRM`;\n const obs$ = this._http\n .post>(\n api,\n {\n agencyCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n tap((res) => {\n sessionStorage.setItem(SessionStorageKey.AGENCY_DATA_EXT, JSON.stringify(res));\n }),\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n }\n\n /**\n * Permette di ottenere l'elenco delle agenzie correlate a quella che ha effettuato la login,\n * purché l'utente corrente sia amministratore di agenzia o di gruppo ed agenzia.\n *\n * @param align\n * @returns {Promise}\n */\n public GetCorrelatedAgencies(align = true): Promise {\n const loader = 'GetCorrelatedAgencies';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetCorrelatedAgencies`;\n const obs$ = this._http\n .post>(\n api,\n {\n align,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di ottenere l'elenco delle agenzie correlate a quella specificata,\n * purché l'utente corrente sia il country manager.\n *\n * @param agencyCode Codice Agenzia\n * @returns {Promise}\n */\n public AlignCorrelatedAgencies(agencyCode: string): Promise {\n const loader = 'AlignCorrelatedAgencies';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}AlignCorrelatedAgencies`;\n const obs$ = this._http\n .post>(\n api,\n {\n agencyCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di impersonare l'agenzia specificata, purché l'utente corrente\n * sia amministratore di agenzia o di gruppo ed agenzia.\n *\n * @param agencyCode Codice Agenzia da impersonare\n * @returns { Promise }\n */\n public ImpersonateAgency(agencyCode: string): Promise {\n const loader = 'ImpersonateAgency';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}ImpersonateAgency`;\n const obs$ = this._http\n .post>(\n api,\n {\n agencyCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di interrompere l'azione di impersonare un'agenzia, purché\n * l'utente corrente sia amministratore di agenzia o di gruppo ed agenzia.\n *\n * @returns { Promise }\n */\n public StopImpersonatingAgency(): Promise {\n const loader = 'StopImpersonatingAgency';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}StopImpersonatingAgency`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di verificare se si sta impersonando un'agenzia, purché\n * l'utente corrente sia amministratore di agenzia o di gruppo ed agenzia.\n *\n * @returns { Priomise }\n */\n public IsImpersonatingAgency(): Promise {\n const loader = 'IsImpersonatingAgency';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}IsImpersonatingAgency`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce le informazioni di fatturato dell'agenzia corrispondenti ai criteri di ricerca.\n *\n * @param From Ricerca da\n * @param To Ricerca a\n * @param ShipCode Codice Nave\n * @returns {Promise}\n */\n public getAgencyBalance(From: Date = new Date(), To: Date = new Date(), ShipCode = ''): Promise {\n const loader = 'getAgencyBalance';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetAgencyBalance`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n From: dayjs(From).format('YYYY-MM-DD'),\n To: dayjs(To).format('YYYY-MM-DD'),\n ShipCode,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce i tipi di assicurazione disponibili.\n * La ricerca viene fatta su TTG se il booking in sessione ha tariffa e passeggeri impostati,\n * altrimenti sarà restituita la lista configurata per mercato.\n * Un valore positivo di guestSequenceNumber serve per ottenere il costo dei tipi di\n * assicurazione relativi ad un singolo passeggero\n *\n * @param guestSequenceNumber\n * @returns {Promise}\n */\n public getInsuranceTypes(guestSequenceNumber = 0): Promise {\n const loader = 'getInsuranceTypes';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetInsuranceTypes`;\n const obs$ = this._http\n .post>(\n api,\n {\n guestSequenceNumber,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Da chiamare per salvare in sessione il contenuto attuale della pagina.\n *\n * @param Booking Booking da salvare\n * @param SourcePage Pagina corrente\n * @param DestinationPage Pagina di destinazione\n * @returns {Promsie}\n */\n public setCurrentBookingToSession(Booking: BookingDataDTO, SourcePage: string, DestinationPage: string): Promise {\n const loader = 'setCurrentBookingToSession';\n this._loadingService.startLoading(loader);\n let headers = new HttpHeaders();\n headers = headers.append(CustomHeaders.TRANSFORM_REQUEST, [TransformerRequestCodes.ADD_FISCOD_FOREIGN_GUEST].join(','));\n headers = headers.append(CustomHeaders.TRANSFORM_RESPONSE, [TransformerResponseCodes.REMOVE_FISCOD_ON_FOREIGN_GUEST].join(','));\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}SetCurrentBookingToSession`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Booking,\n SourcePage,\n DestinationPage,\n },\n },\n {\n ...this.WithCredentials,\n headers,\n },\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Copia il current booking nel master booking. \\\n * Va chiamato per confermare in sessione le\n * modifiche fatte nella pagina (ad esempio quando si conferma la modifica di un preventivo). \\\n * E' chiamato in automatico quando si chiama SetCurrentBookingToSession prima di passare ad\n * una nuova pagina (quando cioè SourcePage e DestinationPage sono diversi), oppure quando si\n * effettua una QuickQuotation o si crea o modifica una pratica verso TTG\n *\n * @see setCurrentBookingToSession\n * @returns {Promise}\n */\n public consolidateBooking(): Promise {\n const loader = 'consolidateBooking';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}ConsolidateBooking`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce il booking corrente contenuto in sessione. \\\n * Se lo stato del booking in sessione non è compatibile con lo stato richiesto per la pagina passata come\n * parametro il metodo restituisce un errore (\"Success\": false) e il campo \"Message\" ne contiene i dettagli.\n *\n * @param callingPage Pagina del flusso di booking da richiedere\n * @returns {Promise}\n */\n public getCurrentBookingFromSession(callingPage: string): Promise {\n const loader = 'getCurrentBookingFromSession';\n this._loadingService.startLoading(loader);\n let headers = new HttpHeaders();\n headers = headers.append(\n CustomHeaders.TRANSFORM_RESPONSE,\n [TransformerResponseCodes.GUEST_TBA, TransformerResponseCodes.REMOVE_FISCOD_ON_FOREIGN_GUEST].join(','),\n );\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetCurrentBookingFromSession`;\n const obs$ = this._http\n .post>(\n api,\n {\n callingPage,\n },\n {\n ...this.WithCredentials,\n headers,\n },\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce il booking con cui inizializzare la nuova pagina. \\\n * Contestualmente il current booking viene allineato con il contenuto del master. \\\n * Se lo stato del booking in sessione non è compatibile con lo stato richiesto per la pagina passata come\n * parametro il metodo restituisce un errore (\"Success\": false) e il campo \"Message\" ne contiene i dettagli.\n *\n * @param callingPage Pagina del flusso di booking da richiedere\n * @returns {Promise}\n */\n public getMasterBookingFromSession(callingPage: string): Promise {\n const loader = 'getMasterBookingFromSession';\n this._loadingService.startLoading(loader);\n let headers = new HttpHeaders();\n headers = headers.append(\n CustomHeaders.TRANSFORM_RESPONSE,\n [TransformerResponseCodes.GUEST_TBA, TransformerResponseCodes.REMOVE_FISCOD_ON_FOREIGN_GUEST].join(','),\n );\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetMasterBookingFromSession`;\n const obs$ = this._http\n .post>(\n api,\n {\n callingPage,\n },\n {\n ...this.WithCredentials,\n headers,\n },\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Gestisce l'invio dei dettagli della pratica in formato PDF per email. \\\n * Il parametro html contiene il markup da convertire in PDF (viene usato il processo wkHtmlToPdf).\n *\n * @param emailAddress Indirizzo email a cui inviare i dettagli della pratica\n * @param html Html del dettaglio pratica\n * @returns {Promise}\n */\n public sendBookingDetails(emailAddress: string, html: string): Promise {\n const loader = 'sendBookingDetails';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}SendBookingDetails`;\n const obs$ = this._http\n .post>(\n api,\n {\n emailAddress,\n html,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Endpoint non più presente\n *\n * @deprecated\n */\n public getAvailableCabinLists(): Promise {\n // const loader = 'getAvailableCabinLists';\n // this._loadingService.startLoading(loader);\n // const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAvailableCabinLists`;\n // const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(this.handleKtApi, finalize(() => {\n // this._loadingService.stopLoading(loader);\n // }));\n // return lastValueFrom(obs$);\n return Promise.reject(\"Endpoint doesn't exist\");\n }\n\n /**\n * Fornisce l'elenco dei servizi speciali disponibili per il passeggero e la crociera specificati,\n * oltre alle possibili delivery location relative alla nave.\n *\n * @param guestId Id Utente\n * @param cruiseCode Codice Crociera\n * @returns { Promise }\n */\n public getAvailableSpecialServices(guestId: string, cruiseCode: string): Promise {\n const loader = 'getAvailableSpecialServices';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAvailableSpecialServices`;\n const obs$ = this._http\n .post>(\n api,\n {\n guestId,\n cruiseCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco dei voucher disponibili per il passeggero specificato.\n *\n * @param guestId\n * @returns {Promise}\n */\n public getAvailableVoucher(guestId: string): Promise {\n const loader = 'getAvailableVoucher';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAvailableVouchers`;\n const obs$ = this._http\n .post>(\n api,\n {\n guestId,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'elenco delle nazionalità gestite (codice, descrizione già localizzata ed indicazione OFAC)\n *\n * @returns {Promise}\n */\n public getNationalities(): Promise {\n const loader = 'getNationalities';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetNationalities`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'elenco dei languages gestiti (codice e descrizione già localizzata).\n *\n * @returns {Promise}\n */\n public getLanguages(): Promise {\n const loader = 'getLanguages';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetLanguages`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'elenco dei Country gestiti (codice e descrizione già localizzata)\n *\n * @returns {Promise}\n */\n public getCountries(): Promise {\n const loader = 'getCountries';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetCountries`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'elenco delle Regions gestite dato un Country code (codice e descrizione già localizzata)\n * o un array vuoto se il country non prevede regions.\n *\n * @param countryCode Codice Country\n * @returns {Promise}\n */\n public getRegions(countryCode: CountryDTO['Code']): Promise {\n const loader = 'getRegions';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetRegions`;\n const obs$ = this._http\n .post>(\n api,\n {\n countryCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'elenco delle Navi a catalogo.\n *\n * @returns {Promise}\n */\n public getShips(): Promise {\n const loader = 'getShips';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetShips`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ottiene la lista dei documenti per un dato passeggero con le relative informazioni per\n * la costruzione dei form di raccolta dati in BookingQuote e BookingEdit. \\\n * Necessita di un booking inizializzato ed il risultato tiene conto della nazionalità del passeggero se già salvata\n * nel booking in sessione (quindi i risultati potrebbero variare se si effettua la chiamata con un passeggero con\n * nazionalità valorizzata o meno). \\\n * Al cambio di nazionalità il servizio deve essere chiamato di nuovo.\n *\n * @param guestId Id Passeggero\n * @returns { Promise }\n */\n public getDocumentInfo(guestId: string): Promise {\n const loader = 'getDocumentInfo';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetDocumentsInfo`;\n const obs$ = this._http\n .post>(\n api,\n {\n guestId,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ottiene la lista dei documenti per un dato itinerario (solo lista semplice).\n *\n * @param itineraryCode\n * @returns {Promise}\n */\n public getDocumentsList(itineraryCode: string): Promise {\n const loader = 'getDocumentsList';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetDocumentsList`;\n const obs$ = this._http\n .post>(\n api,\n {\n itineraryCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce i biglietti associati al numero di booking corrente.\n *\n * @returns {Promise}\n */\n public getTickets(): Promise {\n const loader = 'getTickets';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetTickets`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'indirizzo della pagina da mostrare per il check-in online.\n *\n * @returns {Promise}\n */\n public getWebCheckInUrl(): Promise {\n const loader = 'getWebCheckInUrl';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetWebCheckInUrl`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'indirizzo della pagina da mostrare per gestire il pagamento con WorldPay.\n *\n * *NOTE*: **RICHIEDE** un booking initialization\n *\n * @returns {Promise}\n */\n public getWorldPayUrl(): Promise {\n const loader = 'getWorldPayUrl';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetWorldPayUrl`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'indirizzo della pagina da mostrare per gestire il pagamento con WorldPay.\n *\n * *NOTE*: Questa chiamata non necessita di un booking initialization.\n *\n * @returns {Promise}\n */\n public GetWorldPayUrlByCurrencyCode(currencyCode = 'EUR'): Promise {\n const loader = 'GetWorldPayUrlByCurrencyCode';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetWorldPayUrlByCurrencyCode`;\n const obs$ = this._http.post>(api, { currencyCode }, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce per ciascuna cabina del booking l'elenco dei ristoranti disponibili.\n *\n * @param {number} cabinIndex Indice cabina\n * @param {string} restaurantCode Codice ristorante\n * @returns {Promise}\n */\n public getRestaurants(cabinIndex = 0, restaurantCode: string = null): Promise {\n const loader = 'getRestaurants';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetRestaurants`;\n const obs$ = this._http\n .post>(\n api,\n {\n cabinIndex,\n restaurantCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce le quote di servizio per adulti e bambini, nelle valute previste dal booking in sessione.\n *\n * @returns {Promise}\n */\n public GetServiceCharges(): Promise {\n const loader = 'GetServiceCharges';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetServiceCharges`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce il booking corrispondente ai criteri di ricerca impostati, salvandolo già in sessione.\n *\n * @param BookingNumber Numero Booking\n * @param BookingNumberTravelAndFriends Numero Booking Travel&Friends\n * @returns {Promise}\n */\n public displayBooking(BookingNumber: string, BookingNumberTravelAndFriends: string = undefined): Promise {\n const loader = 'displayBooking';\n this._loadingService.startLoading(loader);\n let headers = new HttpHeaders();\n headers = headers.append(\n CustomHeaders.TRANSFORM_RESPONSE,\n [TransformerResponseCodes.GUEST_TBA, TransformerResponseCodes.REMOVE_FISCOD_ON_FOREIGN_GUEST].join(','),\n );\n\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}DisplayBooking`;\n const obs$ = this._http\n .post>(\n api,\n {\n filters: {\n BookingNumber,\n BookingNumberTravelAndFriends,\n },\n },\n {\n ...this.WithCredentials,\n headers,\n },\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce un elenco di booking sulla base dei criteri di ricerca impostati.\n *\n * @param LastName Cognome\n * @param BookingNumber Numero Booking\n * @param BookingNumberTravelAndFriends Numero Booking Travel&Friends\n * @param GroupId Id Gruppo\n * @returns {Promise}\n */\n public displayBookingList(\n LastName = '',\n BookingNumber = '',\n BookingNumberTravelAndFriends = '',\n GroupId = '',\n ): Promise {\n const loader = 'displayBookingList';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}DisplayBookingList`;\n const obs$ = this._http\n .post>(\n api,\n {\n filters: {\n LastName,\n BookingNumber,\n BookingNumberTravelAndFriends,\n GroupId,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco delle ultime n pratiche create da Costaclick\n *\n * @param n Numero di ultimi booking da mostrare\n * @returns {Promise}\n */\n public getLastBookings(n = 30): Promise {\n const loader = 'getLastBookings';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetLastBookings`;\n const obs$ = this._http\n .post>(\n api,\n {\n n,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di modificare le informazioni di anagrafica dell'agenzia specificata (se non è indicato il code verrà\n * aggiornata l'agenzia che ha effettuato la login). \\\n * A seconda che si modifichi l'agenzia corrente o meno saranno\n * salvati solo alcuni campi, come accadeva sul vecchio CostaClick (l'anagrafica si modifica solo per l'agenzia\n * corrente). \\\n * Al termine del salvataggio viene inviata una email all'indirizzo configurato. \\\n * L'agenzia specificata sarà modificata solo se il richiedente è il country manager o l'agenzia è ad esso correlata.\n *\n * @param agency Agenzia\n * @returns {Promise}\n */\n public setAgencyProfile(agency: AgencyProfileDTO): Promise {\n const loader = 'setAgencyProfile';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}SetAgencyProfile`;\n const obs$ = this._http\n .post>(\n api,\n {\n agency,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * *FIXME*: Missing description for api\n * @param agency\n * @returns {Promise}\n */\n public setAgencyProfileExtended(agency: CRMAgencyProfileDTO): Promise {\n const loader = 'setAgencyProfileExtended';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}SetAgencyProfileToCRM`;\n const obs$ = this._http\n .post>(\n api,\n {\n agency,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di modificare le informazioni di anagrafica dell'utente specificato (se non è indicato\n * lo username verrà aggiornato l'utente che ha effettuato la login). \\\n * Al termine del salvataggio viene inviata una email all'indirizzo specificato (solo per modifiche al\n * current user, mentre per il cambio password viene comunque inviata). \\\n * L'utente specificato sarà modificato solo se il richiedente è il country manager o un amministratore della stessa agenzia.\n *\n * @param user\n * @returns {Promise}\n */\n public setUserProfile(user: UserProfileDTO): Promise {\n const loader = 'setUserProfile';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}SetUserProfile`;\n const obs$ = this._http\n .post>(\n api,\n {\n user,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette all'utente che ha effettuato la login di modificare la propria password\n * e specificare domanda e risposta di sicurezza. \\\n * Passando l'agency code si può utilizzare la funzionalità per l'amministratore nel\n * caso di abilitazione agenzia (occorre quindi valorizzare a true uno dei booleani\n * EnablingAgency e ResettingPassword).\n *\n * @param request\n * @returns {Promise<''>}\n */\n public setPassword(request: SetPasswordDTO): Promise<''> {\n const loader = 'changePassword';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}SetPassword`;\n const obs$ = this._http\n .post>(\n api,\n {\n request,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette all'utente che non ha effettuato la login di modificare la propria password\n * specificando token e username ricevuti via email\n *\n * @param request\n * @returns {Promise<''>}\n */\n public forgotPasswordSetPassword(request: ForgotPasswordSetPasswordDTO): Promise {\n const loader = 'changePassword';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}ForgotPasswordSetPassword`;\n const obs$ = this._http\n .post>(\n api,\n {\n request,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette all'utente che non ha effettuato la login di modificare la propria password\n * specificando token e username ricevuti via email\n *\n * @param request\n * @returns {Promise<''>}\n */\n public CreateNewToken(request: CreateNewTokenDTO): Promise {\n const loader = 'changePassword';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}CreateNewToken`;\n const obs$ = this._http\n .post>(\n api,\n {\n request,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n\n /**\n * Permette all'utente admin o country manager di forzare il reset password per un utente specifico\n *\n * @param request\n * @returns {Promise<''>}\n */\n public forceChangePassword(request: ForceChangePasswordDTO): Promise<''> {\n const loader = 'changePassword';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}ForceChangePassword`;\n const obs$ = this._http\n .post>(\n api,\n {\n request,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di effettuare l'upload del logo dell'agenzia correntemente loggata.\n *\n * @param file\n * @returns {Promise}\n */\n public uploadAgencyLogo(file: File): Promise {\n const loader = 'uploadAgencyLogo';\n this._loadingService.startLoading(loader);\n const formData = new FormData();\n formData.append('file', file);\n const api = `${this.CCKBasePath}${this.UserServicesPath}UploadAgencyLogo`;\n const obs$ = this._http.post>(api, formData, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'elenco delle voci per il menù utente (Header di pagina) in forma di array.\n *\n * @returns {Promise}\n */\n public getUserMenuData(): Promise {\n const loader = 'getUserMenuData';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetUserMenuData`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di creare un nuovo profilo utente specificato \\\n * Per il campo sex:\n * * 0 => Maschio\n * * 1 => Femmina\n *\n * @param user\n * @returns {Promise}\n */\n public createUserProfile(user: UserProfileDTO): Promise {\n const loader = 'createUserProfile';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}CreateUserProfile`;\n const obs$ = this._http\n .post>(\n api,\n {\n user,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di eliminare il profilo utente specificato. \\\n * L'utente specificato sarà eliminato solo se il richiedente è il\n * country manager o un amministratore della stessa agenzia.\n *\n * @param userName\n * @returns { Promise }\n */\n public deleteUserProfile(userName: string): Promise {\n const loader = 'deleteUserProfile';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}DeleteUserProfile`;\n const obs$ = this._http\n .post>(\n api,\n {\n userName,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce il numero di telefono di emergenza dell'agenzia che ha effettuato la login.\n *\n * @returns {Promise}\n */\n public getEmergencyPhoneNumber(): Promise {\n const loader = 'getEmergencyPhoneNumber';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetEmergencyPhoneNumber`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di impostare il numero di telefono di emergenza dell'agenzia che ha effettuato la login\n * @param number\n * @returns {Promise}\n */\n public setEmergencyPhoneNumber(number: string): Promise {\n const loader = 'setEmergencyPhoneNumber';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}SetEmergencyPhoneNumber`;\n const obs$ = this._http\n .post>(\n api,\n {\n number,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di effettuare l'upload della busta paga se richiesto. \\\n * **NOTE** \\\n * Se la chiamata andrà a buon fine (\"Success\": true) il nome file presente\n * in Result andrà poi salvato nella proprietà \"PaySlipTempFileName\" dell'\n * oggetto \"BookingDataDTO\" prima di effettuate una nuova \"SetCurrentBookingToSession\".\n *\n * @see setCurrentBookingToSession\n * @param file\n * @returns {Promise}\n */\n public uploadPaySlip(file: File): Promise {\n const loader = 'uploadPaySlip';\n this._loadingService.startLoading(loader);\n const formData = new FormData();\n formData.append('file', file);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}UploadPaySlip`;\n const obs$ = this._http.post>(api, formData, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di ottenere l'url della busta paga caricata.\n *\n * @returns {Promise}\n */\n public getPaySlipUrl(): Promise {\n const loader = 'getPaySlipUrl';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetPaySlipUrl`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'indirizzo della pagina da mostrare per il preventivo emozionale.\n * Il metodo lavora sul booking in sessione.\n *\n * @returns {Promise}\n */\n public getDominoUrl(): Promise {\n const loader = 'getDominoUrl';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetDominoUrl`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'elenco dei file scaricabili per la sezione (WEB) di contesto. \\\n * Il servizio ritorna i file presenti nella folder \"Downloads\" della lista\n * \"Documents\" presente nel web di contesto\n *\n * @see DownloadMainCtrl.js:32\n * @param downloadPath\n * @returns\n */\n public getDownloadFileList(downloadPath: string): Promise {\n const loader = 'getDownloadFileList';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${downloadPath}${this.ContentServicesPath}GetDownloadFileList`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco delle ultime n pratiche create da Costaclick\n * @returns {Promise}\n */\n public getNews(): Promise {\n const loader = 'getNews';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetNews`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'elenco degli Available languages per la ricerca/generazione dei PDF escursioni\n * se configurati su quel mercato, in caso contrario la lista sarà vuota. \\\n * \\\n * Se la chiamata torna dati tra questi parametri andrà selezionato il valore per il parametro\n * \"pdfLanguages\" alla chiamata \"GetExcursionPDFList\"\n *\n * @see getExcursionPDFList\n * @returns {Promise}\n */\n public getExcursionPDFAvailableLanguages(): Promise {\n const loader = 'getExcursionPDFAvailableLanguages';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.ExcursionServicesPath}GetExcursionPDFAvailableLanguages`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'elenco delle cruise che soddisfano i parametri di ricerca e che hanno\n * un PDF escursioni già generato e disponibile al download.\n *\n * @param dateFrom\n * @param dateTo\n * @param shipCode\n * @param pdfLanguages\n * @returns {Promise}\n */\n public getExcursionPDFList(dateFrom: Date, dateTo: Date, shipCode: string, pdfLanguages = ''): Promise {\n const loader = 'getExcursionPDFList';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.ExcursionServicesPath}GetExcursionPDFList`;\n const obs$ = this._http\n .post>(\n api,\n {\n dateFrom: dayjs(dateFrom).format('YYYY-MM-DD'),\n dateTo: dayjs(dateTo).format('YYYY-MM-DD'),\n shipCode,\n pdfLanguages,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce i dati necessari al Group Tool.\n *\n * @returns {Promise}\n */\n public getGroupToolData(preventCache = false): Promise {\n const loader = 'getGroupToolData';\n this._loadingService.startLoading(loader);\n try {\n const data: GroupToolDataDTO = JSON.parse(sessionStorage.getItem(SessionStorageKey.AGENCY_DATA));\n if (!data || !Object.keys(data)?.length || preventCache) throw null;\n\n this._loadingService.stopLoading(loader);\n return Promise.resolve(data);\n } catch {\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetGroupToolData`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n tap((res) => {\n sessionStorage.setItem(SessionStorageKey.AGENCY_DATA, JSON.stringify(res));\n }),\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n }\n\n /**\n * Restituisce l'elenco dei passeggeri che possono prenotare escursioni, relativo al\n * numero di booking specificato, ed il link a cui mandare l'utenete per effettuare per prenotazioni.\n *\n * @param bookingNumber\n * @returns {Promise}\n */\n public GetExcursionReservationGuests(bookingNumber: string): Promise {\n const loader = 'GetExcursionReservationGuests';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.ExcursionServicesPath}GetExcursionReservationGuests`;\n const obs$ = this._http\n .post>(\n api,\n {\n bookingNumber,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di effettuare la generazione di un PDF excusioni per una data cruise on demand. \\\n * Restituisce l'url al PDF o un messaggio di errore se non è stato possibile generare il PDF\n *\n * @param departureDate\n * @param cruiseDuration\n * @param shipCode\n * @returns {Promise}\n * @deprecated\n */\n public GeneratePDF(departureDate: Date, cruiseDuration: string, shipCode: string): Promise {\n const loader = 'GeneratePDF';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.ExcursionServicesPath}GeneratePDF`;\n const obs$ = this._http\n .post>(\n api,\n {\n departureDate: dayjs(departureDate).format('YYYY-MM-DD'),\n cruiseDuration,\n shipCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l'elenco delle escursioni associate al codice crociera specificato, raggruppate per porto.\n *\n * @param cruiseCode\n * @returns {Promise}\n */\n public GetExcursions(cruiseCode: string): Promise {\n const loader = 'GetExcursions';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.ExcursionServicesPath}GetExcursions`;\n const obs$ = this._http\n .post>(\n api,\n {\n cruiseCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ritorna la lista dei codici ISO dei country\n *\n * @returns { Promise }\n */\n public GetCountryISOCode(preventCache = false): Promise {\n const loader = 'GetCountryISOCode';\n this._loadingService.startLoading(loader);\n try {\n const data: CountryISOCodeDTO[] = JSON.parse(sessionStorage.getItem(SessionStorageKey.ISO_CODE));\n if (!data || !Object.keys(data)?.length || preventCache) throw null;\n\n this._loadingService.stopLoading(loader);\n return Promise.resolve(data);\n } catch {\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetCountryISOCode`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n tap((res) => {\n sessionStorage.setItem(SessionStorageKey.ISO_CODE, JSON.stringify(res));\n }),\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n }\n\n /**\n * Ritorna una lista di città in base alla ricerca effettuata\n *\n * @param country\n * @param city\n * @returns\n * @see GetCities\n */\n public GetCities(country: string, city: string): Promise {\n const loader = 'GetCities';\n this._loadingService.startLoading(loader);\n const api = `https://valuelab.azure-api.net/premiumv2/searchcity`;\n const params = new HttpParams({\n fromObject: {\n suggest: city,\n countryiso: country,\n },\n });\n const obs$ = this._http\n .get(api, {\n params,\n headers: this.JakalaLegacyHeaders,\n })\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ritorna una lista di città in base alla ricerca effettuata\n *\n * @param country\n * @param city\n * @returns {Promise}\n */\n public GetCitiesLegacy(country: string, city: string): Promise {\n const loader = 'GetCitiesLegacy';\n // this._loadingService.startLoading(loader);\n const api = `https://valuelab.azure-api.net/suggestcity`;\n const params = new HttpParams({\n fromObject: {\n country,\n query: city,\n },\n });\n const obs$ = this._http\n .get(api, {\n params,\n headers: this.JakalaHeaders,\n })\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n *\n * @param country\n * @param city\n * @param province\n * @returns\n */\n public GetCityInfo(city: string, countryCode?: string, state?: string): Promise {\n const loader = 'GetCityInfo';\n // this._loadingService.startLoading(loader);\n const api = `https://valuelab.azure-api.net/premiumv2/geocodemunsplit`;\n const params = new HttpParams({\n fromObject: {\n city,\n countryCode,\n state\n },\n });\n const obs$ = this._http\n .get(api, {\n params,\n headers: this.JakalaLegacyHeaders,\n })\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n *\n * @param country\n * @param city\n * @param province\n * @returns\n */\n public GetCityInfoLegacy(country: string, city: string, province: string): Promise {\n const loader = 'GetCityInfoLegacy';\n // this._loadingService.startLoading(loader);\n const api = `https://valuelab.azure-api.net/searchcity`;\n const params = new HttpParams({\n fromObject: {\n searchtext: city,\n country,\n province,\n },\n });\n const obs$ = this._http\n .get(api, {\n params,\n headers: this.JakalaHeaders,\n })\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ritorna le informazioni bancarie del Travel Agent\n *\n * @returns {Promise}\n */\n public GetBankTAInfoFetch(): Promise {\n const loader = 'GetBankTAInfoFetch';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetBankTAInfoFetch`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithWarningMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ritorna la lista di banche della country data in input\n *\n * @param CountryISOCode\n * @returns {Promise}\n */\n public GetBankInfoFetch(CountryISOCode = ''): Promise {\n const loader = 'GetBankInfoFetch';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetBankInfoFetch`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n BankTAInfo: {\n BankInfo: {\n CountryISOCode,\n BicSwift: '',\n },\n },\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApiWithWarningMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Inserisce i dati della banca del Travel Agent specificato\n *\n * @param BankTAInfo\n * @returns {Promise}\n */\n public SetBankTAInfo(BankTAInfo: BankTAInfoDTO): Promise {\n const loader = 'SetBankTAInfo';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}SetBankTAInfo`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n BankTAInfo,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di effettuare l'upload del documento della banca dell'agenzia correntemente loggata\n *\n * @param file\n * @returns {Promise}\n */\n public UploadBankAccount(file: File): Promise {\n const loader = 'UploadBankAccount';\n this._loadingService.startLoading(loader);\n const formData = new FormData();\n formData.append('file', file);\n const api = `${this.CCKBasePath}${this.UserServicesPath}UploadBankAccount`;\n const obs$ = this._http.post>(api, formData, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce un oggetto con I dati generali dell'agenzia con cui si sta operando che\n * vengono visualizzati nella tabella a inizio pagina. \\\n * In tale oggetto vengono anche restituiti gli url per il pulsanti \"Scarica Piano Commerciale\"\n * e \"Scarica Lettera di credito\" presenti in alto a destra nella pagina. \\\n *\n * @returns {Promise}\n */\n public GetWeCareAgencyData(): Promise {\n const loader = 'GetWeCareAgencyData';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.WeCareServicesPath}GetWeCareAgencyData`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithNoMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Rappresentano i dati per le agenzie che partecipano alla commissione JUMP.\n *\n * @returns {Promise}\n */\n public GetJumpData(): Promise {\n const loader = 'GetJumpData';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.WeCareServicesPath}GetJumpData`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithNoMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce i dati visualizzati nel box centrale intitolato \"I tuoi obiettivi annuali\". \\\n * \\\n * I dati vengono restituiti in un array diviso per anni, i quali a loro volta sono divisi\n * in array rappresentativi dei semestri (la suddivisione in semestri è stata mantenuta fino\n * all'anno 2015, per gli anni successivi si troverà un unico elemento dell'array\n * rappresentativo di tutto l'anno).\n * \\\n * Questa API Torna i dati sul fatturato fino all'anno corrente\n *\n * @returns {Promise}\n */\n public GetWeCareData(): Promise {\n const loader = 'GetWeCareData';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.WeCareServicesPath}GetWeCareData`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithNoMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce i dati visualizzati nel box centrale intitolato \"I tuoi obiettivi annuali\". \\\n * \\\n * I dati vengono restituiti in un array diviso per anni, i quali a loro volta sono divisi\n * in array rappresentativi dei semestri (la suddivisione in semestri è stata mantenuta fino\n * all'anno 2015, per gli anni successivi si troverà un unico elemento dell'array\n * rappresentativo di tutto l'anno).\n * \\\n * Questa API Torna i dati sul fatturato anche per gli anni successivi\n *\n * @returns {Promise}\n */\n public GetWeCareData_NY(): Promise {\n const loader = 'GetWeCareData_NY';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.WeCareServicesPath}GetWeCareData_NY`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithNoMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce i dati riguardante all'incentivazione. \\\n * I dati vengono restituiti in un array diviso per anni, i quali a loro volta sono\n * divisi in array rappresentativi dei periodi di cui si compone una \"Run\" seguiC. \\\n * I periodi vanno da \"P1\" a \"P6\" e sono indicati nel campo \"Period\"\n *\n * @returns {Promise}\n */\n public GetSeguiCData(): Promise {\n const loader = 'GetSeguiCData';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.WeCareServicesPath}GetSeguiCData`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithNoMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * I dati presenti in questo oggetto vengono visualizzati nel popup che si apre cliccando\n * sul pulsante \"Dettaglio Pratiche\" presente nei grafici dei vari periodi. \\\n * Rappresentano il dettaglio delle pratiche che compongono il totale fatturato\n * dall'agenzia nel periodo selezionato.\n *\n * @returns {Promise}\n */\n public GetActualData(): Promise {\n const loader = 'GetActualData';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.WeCareServicesPath}GetActualData`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithNoMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ritorna una lista chiave / valore delle navi\n * @param req\n * @returns\n * @see getShips\n * @deprecated\n */\n // public GetShipList(req: any): Promise {\n // return Promise.reject('DEPRECATED API');\n // const loader = 'GetShipList';\n // this._loadingService.startLoading(loader);\n // const api = `${this.CCKBasePath}${this.WeCareServicesPath}GetShipList`;\n // const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(this.handleKtApiWithNoMessage, finalize(() => {\n // this._loadingService.stopLoading(loader);\n // }));\n // return lastValueFrom(obs$);\n // }\n\n /**\n * Restituisce i dati di sessione necessari per gestire il pagamento con MasterCard.\n *\n * @returns {Promise}\n */\n public GetMasterCardSession(): Promise {\n const loader = 'GetMasterCardSession';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetMasterCardSession`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di ottenere la direzione obbligatoria dei trasporti relativi alla\n * crociera e tariffa precedentemente selezionate.\n *\n * @returns\n */\n public GetMandatoryTransportationDirection(): Promise {\n const loader = 'GetMandatoryTransportationDirection';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetMandatoryTransportationDirection`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Aggiunge un nuovo utente alla loyalty\n *\n * @param req\n * @returns\n * @deprecated Loyalty no more used\n */\n // public InsertB2BLoyaltyUsers(req: any): Promise {\n // return Promise.reject('DEPRECATED API');\n // const loader = 'InsertB2BLoyaltyUsers';\n // this._loadingService.startLoading(loader);\n // const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}InsertB2BLoyaltyUsers`;\n // const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(this.handleKtApiWithWarningMessage, finalize(() => {\n // this._loadingService.stopLoading(loader);\n // }));\n // return lastValueFrom(obs$);\n // }\n\n /**\n * Torna il programma loyalty\n *\n * @returns { Promise }\n */\n public GetB2BLoyaltyProgram(): Promise {\n const loader = 'GetB2BLoyaltyProgram';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetB2BLoyaltyProgram`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithWarningMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Ritorna l'elenco dei Voucher dei clienti paginato e filtrato secondo i parametri di import\n *\n * @param filters\n * @returns {Promise}\n */\n public GetCustomerVouchers(filters: CustomerVoucherSearchDTO): Promise {\n const loader = 'GetCustomerVouchers';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetCustomerVouchers`;\n const obs$ = this._http\n .post>(\n api,\n {\n filters,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApiWithWarningMessage,\n map((resp) => resp.Result),\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Effettua l'export in CSV dll'elenco dei Voucher dei clienti paginato e filtrato secondo i parametri di import.\n *\n * @param filters\n * @returns {Promise}\n */\n public ExportCustomerVouchers(filters: CustomerVoucherSearchDTO): Promise {\n const loader = 'ExportCustomerVouchers';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}ExportCustomerVouchers`;\n const obs$ = this._http\n .post(\n api,\n {\n filters,\n },\n {\n ...this.WithCredentials,\n responseType: 'arraybuffer' as 'json',\n },\n )\n .pipe(\n this.handleApi,\n map((res) => new Blob([res])),\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco di gruppi relativi all'agenzia che ha effettuato la login.\n *\n * @returns {Promise>}\n */\n public GetGroups(): Promise> {\n const loader = 'GetGroups';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetGroups`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce le informazioni relative al gruppo richiesto.\n *\n * @param Id\n * @returns {Promise>}\n */\n public GetGroup(Id: string): Promise> {\n const loader = 'GetGroup';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetGroup`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Group: {\n GroupDefinition: {\n Id,\n },\n },\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di richiedere la creazione di un nuovo gruppo con le caratteristiche indicate.\n *\n * @param request\n * @returns {Promise>}\n */\n public CreateGroup(request: GroupRequestDTO): Promise> {\n const loader = 'CreateGroup';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}CreateGroup`;\n const obs$ = this._http\n .post>(\n api,\n {\n request,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco dei tipi di gruppo disponibili.\n *\n * @returns {Promise>}\n */\n public GetGroupTypes(): Promise> {\n const loader = 'GetGroupTypes';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetGroupTypes`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco dei termini di pagamento relativi all'agenzia che ha effettuato la login.\n *\n * @returns {Promise>}\n */\n public GetGroupPaymentTerms(): Promise> {\n const loader = 'GetGroupPaymentTerms';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetGroupPaymentTerms`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco dei servizi speciali di gruppo associati al codice crociera specificato.\n *\n * @param CruiseCode\n * @returns {Promise>}\n */\n public GetAvailableGroupSpecialServices(CruiseCode: string): Promise> {\n const loader = 'GetAvailableGroupSpecialServices';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetAvailableGroupSpecialServices`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Group: {\n GroupDefinition: {\n CruiseCode,\n },\n },\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco delle condizioni di gruppo relative ai parametri specificati.\n *\n * @param CruiseCode\n * @param GroupPriceType\n * @returns {Promise>}\n */\n public GetGroupConditions(CruiseCode: string, GroupPriceType = 'INC'): Promise> {\n const loader = 'GetGroupConditions';\n\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetGroupConditions`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Group: {\n GroupDefinition: {\n CruiseCode,\n },\n },\n GroupPriceType,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco dei servizi di bordo disponibili per i gruppi.\n *\n * @param CruiseCode\n * @param GroupPriceType\n * @returns {Promise>}\n */\n public GetGroupOnBoardServices(CruiseCode: string, GroupPriceType = 'INC'): Promise> {\n const loader = 'GetGroupOnBoardServices';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetGroupOnBoardServices`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Group: {\n GroupDefinition: {\n CruiseCode,\n },\n },\n GroupPriceType,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco dei trasporti di gruppo relativi ai parametri specificati.\n *\n * @param CruiseCode\n * @param Type\n * @param Direction\n * @param Class\n * @param Price\n * @returns {Promise>}\n */\n public GetGroupTransportations(\n CruiseCode: string,\n Type: string,\n Direction: string,\n Class = 'Y',\n Price = true,\n ): Promise> {\n const loader = 'GetGroupTransportations';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetGroupTransportations`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Group: {\n GroupDefinition: {\n CruiseCode,\n },\n TransportationDetails: {\n Type,\n Direction,\n Class,\n },\n },\n Price,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di salvare su TTG l'informazione relativa al blocco del check-in per la pratica presente in sessione.\n *\n * @param block\n * @returns {Promise}\n */\n public SetWebCheckInAgencyBlock(block: boolean): Promise> {\n const loader = 'SetWebCheckInAgencyBlock';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}SetWebCheckInAgencyBlock`;\n const obs$ = this._http\n .post>(\n api,\n {\n block,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di creare una richiesta di finanziamento.\n *\n * @param Data\n * @returns {Promise}\n */\n public AddMortgageRequest(Data: MortgageDataDTO): Promise {\n const loader = 'AddMortgageRequest';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}AddMortgageRequest`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Data,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApiWithBlockingMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di modificare la richiesta di finanziamento individuata da uno specifico RequestID.\n *\n * @param Data\n * @returns {Promise}\n */\n public UpdateMortgageRequest(Data: MortgageDataDTO): Promise {\n const loader = 'UpdateMortgageRequest';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}UpdateMortgageRequest`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Data,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApiWithBlockingMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di reperire i dati della richiesta di finanziamento individuata da uno specifico\n * RequestID per fare una modifica. \\\n * E' possibile modificare la richiesta solo una volta: dopo aver chiamato il metodo\n * UpdateMortgateRequest, il presente metodo non restituirà più i valori corrispondenti.\n *\n * @param Data\n * @returns {Promise}\n */\n public GetMortgageRequestForUpdate(Data: MortgageDataDTO): Promise {\n const loader = 'GetMortgageRequestForUpdate';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.GenericServicesPath}GetMortgageRequestForUpdate`;\n const obs$ = this._http\n .post>(\n api,\n {\n request: {\n Data,\n },\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApiWithBlockingMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di conoscere lo stato di abilitazione della funzionalità di\n * override dei valori di KPI, in base ad una configurazione di backend comune\n * a tutti i mercati. \\\n * \\\n * **SOLO** il Country Manager può invocare questo metodo.\n *\n * @returns {Promise}\n */\n public IsKPIOverrideEnabled(): Promise {\n const loader = 'IsKPIOverrideEnabled';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}IsKPIOverrideEnabled`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApiWithBlockingMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Permette di effettuare l'upload del file con l'override dei valori di KPI. \\\n * \\\n * **Solo** il Country Manager può invocare questo metodo.\n *\n * @param file\n * @returns {Promise}\n */\n public UploadKPIOverride(file: File): Promise {\n const loader = 'UploadKPIOverride';\n this._loadingService.startLoading(loader);\n const formData = new FormData();\n formData.append('file', file, 'KPIFile.csv');\n const api = `${this.CCKBasePath}${this.UserServicesPath}UploadKPIOverride`;\n const obs$ = this._http.post>(api, formData, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce gli AutoItem associati agli sconti relativi ai codici crociera\n * specificati, in base ad una data occupancy.\n *\n * @param cruiseCodes\n * @param occupancyCode\n * @returns {Promise}\n */\n public GetCruiseDiscountAutoItems(cruiseCodes: string[], occupancyCode: string): Promise {\n const loader = 'GetCruiseDiscountAutoItems';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetCruiseDiscountAutoItems`;\n const obs$ = this._http\n .post>(\n api,\n {\n cruiseCodes,\n occupancyCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce il precalcolo della variazione punti CostaClub corrispondente ai valori di input.\n *\n * @param {PreCalculationScoreRequestDTO} request\n * @returns {Promise}\n */\n public GetPreCalculationScore(request: PreCalculationScoreRequestDTO): Promise> {\n const loader = 'GetPreCalculationScore';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetPreCalculationScore`;\n const obs$ = this._http\n .post>(\n api,\n {\n request,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce i prezzi del set di crociere passate in input\n *\n * @param cruiseCodes\n * @param occupancyCode\n * @returns {Promise>}\n */\n public GetCruisesPrices(cruiseCodes: string[], occupancyCode: string): Promise> {\n const loader = 'GetCruisesPrices';\n this._loadingService.startLoading(loader);\n //!NO RESPONSE\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}GetCruisesPrices`;\n const obs$ = this._http\n .post>(\n api,\n {\n cruiseCodes,\n occupancyCode,\n },\n this.WithCredentials,\n )\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Handler http da chiamare in modalità **GET** per scaricare il file\n * corrispondente al GUID passato in query string.\n *\n * @param guid\n * @returns {Promise}\n * @deprecated Questa api non funziona come dovrebbe **NON** utilizzare!\n */\n public ShorexInvoiceDownload(guid: string): Promise {\n const loader = 'ShorexInvoiceDownload';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath.split('/CostaClick')[0]}${this.HandlersPath}InvoiceDownload.ashx`;\n const obs$ = this._http\n .post(\n api,\n {},\n {\n ...this.WithCredentials,\n params: new HttpParams({\n fromObject: {\n guid,\n },\n }),\n },\n )\n .pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Fornisce l'elenco dei file di fatturazione scaricati per l'agenzia che ha effettuato la login\n *\n * @returns {Promise}\n */\n public GetAgentInvoiceDownloadList(): Promise {\n const loader = 'GetAgentInvoiceDownloadList';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.UserServicesPath}GetAgentInvoiceDownloadList`;\n const obs$ = this._http.post>(api, {}, this.WithCredentials).pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n\n /**\n * Usato per fornire l’elenco (o anche solo il numero) dei FollowUpBooking.\n * Fornisce un elenco di booking filtrati per range di date e per stato:\n * * BKD (booked)\n * * OPT (in scadenza)\n * * CXL (cancellato)\n *\n * Se non si passa il parametro Status, vengono considerati tutti gli stati\n *\n * @param { 'BKD' | 'OPT' | 'CXL' | ''} Status;\n * @param preventCache\n * @returns { KTResponse }\n */\n public BookingListByAgency(Status: 'BKD' | 'OPT' | 'CXL' | '' = '', preventCache = false): Promise {\n const loader = 'BookingListByAgency';\n this._loadingService.startLoading(loader);\n\n let data: BookingListByAgencyDTO = null;\n let key = '';\n switch (Status) {\n case 'OPT':\n key = SessionStorageKey.BOOKING_LIST_BY_ADV_OPT;\n break;\n case 'BKD':\n key = SessionStorageKey.BOOKING_LIST_BY_ADV_BKD;\n break;\n default:\n key = SessionStorageKey.BOOKING_LIST_BY_ADV;\n }\n\n try {\n data = JSON.parse(sessionStorage.getItem(key));\n if (!data || !Object.keys(data)?.length || preventCache) throw null;\n this._loadingService.stopLoading(loader);\n return Promise.resolve(data);\n } catch {\n const req = {\n request: {\n Booking: {\n Status,\n },\n MaxBooking: '',\n OnlyCount: 'false',\n },\n };\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}BookingListByAgency`;\n const obs$ = this._http.post>(api, req, this.WithCredentials).pipe(\n this.handleKtApi,\n tap((res) => {\n sessionStorage.setItem(key, JSON.stringify(res));\n }),\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n return lastValueFrom(obs$);\n }\n }\n\n /**\n * Permette di autenticare l'utente alle promozioni Square definite nel token JWT. \\\n * Restituisce il link alla piattaforma Square, verso cui il FrontEnd farà redirect. \\\n * In caso l’utente non è ancora registrato, verrà restituito “Success”: false, senza l’url di redirect.\n *\n * @returns { Promise> }\n */\n public EpipoliConnect() {\n const loader = 'EpipoliConnect';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.EpipoliServicesPath}Connect`;\n const req = {};\n const obs$ = this._http.post>(api, req, this.WithCredentials).pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Registra l’utente attualmente loggato in CostaClick per l’abilitazione ad Epipoli. \\\n * In caso l’utente è già registrato verrà restituito nel json di risposta il parametro Success con valore false\n *\n * @returns { Promise> }\n */\n public EpipoliRegister() {\n const loader = 'EpipoliRegister';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.EpipoliServicesPath}Register`;\n const req = {};\n const obs$ = this._http.post>(api, req, this.WithCredentials).pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce l’elenco sia di ricariche già effettuate (crociere già partite),\n * sia di ricariche previste (crociere che ancora devono partire). \\\n * La distinzione tra i due casi viene fatta dal campo booleano Recharged.\n *\n * @returns { Promise> }\n */\n public EpipoliGetRecharges() {\n const loader = 'EpipoliGetRecharges';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.EpipoliServicesPath}GetRecharges`;\n const req = {};\n const obs$ = this._http.post>(api, req, this.WithCredentials).pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Restituisce il valore del wallet direttamente da epipoli (non dalle tabelle del database di CostaClick). \\\n * In caso l’utente non è già registrato su epipoli, verrà restituito nel json di risposta “Success”: false\n *\n * @returns { Promise> }\n */\n public EpipoliGetWallet() {\n const loader = 'EpipoliGetWallet';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.EpipoliServicesPath}GetWallet`;\n const req = {};\n const obs$ = this._http.post>(api, req, this.WithCredentials).pipe(\n this.handleApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Inserisce un pagamento (parziale o totale) su un booking di gruppo\n *\n * @returns { Promise }\n */\n public SetPayment(params: SetPaymentRequestParams) {\n const loader = 'SetPayment';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}/SetPayment`;\n const obs$ = this._http.post>(api, {\n ...params,\n formOfPayment: 'CreditCard',\n paymentDate: dayjs().format('YYYY-MM-DD'),\n }, this.WithCredentials).pipe(\n this.handleKtApiWithBlockingMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n /**\n * Inserisce un pagamento sul booking dlla cifra specificata\n *\n * @returns { Promise }\n */\n public SetPaymentExtended(params: SetPaymentExtendedRequestParams) {\n const loader = 'SetPaymentExtended';\n this._loadingService.startLoading(loader);\n const api = `${this.CCKBasePath}${this.BookingFlowServicesPath}/SetPaymentExtended`;\n const obs$ = this._http.post>(api, {\n request: {\n ...params,\n PaymentDetail: {\n ...params.PaymentDetail,\n FormOfPayment: 'CreditCard',\n PaymentDate: dayjs().format('YYYY-MM-DD'),\n },\n }\n }, this.WithCredentials).pipe(\n this.handleKtApiWithBlockingMessage,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n }),\n );\n\n return lastValueFrom(obs$);\n }\n\n /**\n * Invia una richiesta di reset password via mail\n *\n * @returns { Promise }\n */\n public ForgotPasswordSendMail(request: ForgotPasswordSendMailDTO): Promise {\n const loader = 'ForgotPasswordSendMail';\n this._loadingService.startLoading(loader);\n\n const api = `${this.CCKBasePath}${this.UserServicesPath}ForgotPasswordSendMail`;\n\n const obs$ = this._http\n .post>(\n api,\n { request },\n this.WithCredentials\n )\n .pipe(\n this.handleKtApi,\n finalize(() => {\n this._loadingService.stopLoading(loader);\n })\n );\n\n return lastValueFrom(obs$);\n }\n}\n","import { EmptyError } from './util/EmptyError';\nexport function lastValueFrom(source, config) {\n const hasConfig = typeof config === 'object';\n return new Promise((resolve, reject) => {\n let _hasValue = false;\n let _value;\n source.subscribe({\n next: (value) => {\n _value = value;\n _hasValue = true;\n },\n error: reject,\n complete: () => {\n if (_hasValue) {\n resolve(_value);\n }\n else if (hasConfig) {\n resolve(config.defaultValue);\n }\n else {\n reject(new EmptyError());\n }\n },\n });\n });\n}\n","import { concat } from '../observable/concat';\nimport { take } from './take';\nimport { ignoreElements } from './ignoreElements';\nimport { mapTo } from './mapTo';\nimport { mergeMap } from './mergeMap';\nimport { innerFrom } from '../observable/innerFrom';\nexport function delayWhen(delayDurationSelector, subscriptionDelay) {\n if (subscriptionDelay) {\n return (source) => concat(subscriptionDelay.pipe(take(1), ignoreElements()), source.pipe(delayWhen(delayDurationSelector)));\n }\n return mergeMap((value, index) => innerFrom(delayDurationSelector(value, index)).pipe(take(1), mapTo(value)));\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { noop } from '../util/noop';\nexport function ignoreElements() {\n return operate((source, subscriber) => {\n source.subscribe(createOperatorSubscriber(subscriber, noop));\n });\n}\n","import { asyncScheduler } from '../scheduler/async';\nimport { delayWhen } from './delayWhen';\nimport { timer } from '../observable/timer';\nexport function delay(due, scheduler = asyncScheduler) {\n const duration = timer(due, scheduler);\n return delayWhen(() => duration);\n}\n"],"x_google_ignoreList":[2,3,4,5]}