@sabstravtech/obtservices 0.0.26051001 → 0.1.6161600
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/angular/fetchers.d.ts +2 -0
- package/angular/lib/vendor/fetchers/get-office.fetcher.d.ts +7 -0
- package/angular/lib/vendor/fetchers/get-user-default-mi-value.fetcher.d.ts +7 -0
- package/angular/lib/vendor/services/enterprise-basket.service.d.ts +4 -4
- package/angular/lib/vendor/services/logon.service.d.ts +2 -2
- package/angular/lib/vendor/services/user.service.d.ts +5 -3
- package/angular/lib/vendor/types/graphql.angular.types.d.ts +389 -508
- package/angular/sabstravtech-obtservices-angular.metadata.json +1 -1
- package/base/fetchers.d.ts +2 -0
- package/base/lib/vendor/classes/base-enterprise.d.ts +3 -1
- package/base/lib/vendor/classes/cabhire-enterprise-search.d.ts +5 -1
- package/base/lib/vendor/classes/carhire-enterprise-search.d.ts +8 -1
- package/base/lib/vendor/classes/eurostar-enterprise-search.d.ts +11 -4
- package/base/lib/vendor/classes/fast-track-enterprise-search.d.ts +2 -1
- package/base/lib/vendor/classes/flight-enterprise-search.d.ts +11 -0
- package/base/lib/vendor/classes/hotel-enterprise-search.d.ts +4 -0
- package/base/lib/vendor/classes/irl-enterprise-search.d.ts +9 -4
- package/base/lib/vendor/classes/lounges-enterprise-search.d.ts +2 -1
- package/base/lib/vendor/classes/management-info-and-valid.d.ts +2 -2
- package/base/lib/vendor/classes/parking-enterprise-search.d.ts +2 -1
- package/base/lib/vendor/classes/rail-enterprise-search.d.ts +1 -1
- package/base/lib/vendor/classes/user-favourite.enum.d.ts +1 -0
- package/base/lib/vendor/fetchers/eurostar-quote.fetcher.d.ts +3 -1
- package/base/lib/vendor/fetchers/flight-quote.fetcher.d.ts +1 -0
- package/base/lib/vendor/fetchers/get-office.fetcher.d.ts +20 -0
- package/base/lib/vendor/fetchers/get-user-default-mi-value.fetcher.d.ts +21 -0
- package/base/lib/vendor/fetchers/search-users-can-book-for-fetcher.d.ts +2 -2
- package/base/lib/vendor/interfaces/Icabhire-enterprise-search.d.ts +1 -0
- package/base/lib/vendor/interfaces/Icarhire-enterprise-search.d.ts +2 -0
- package/base/lib/vendor/interfaces/Ienterprise-basket.service.d.ts +3 -2
- package/base/lib/vendor/interfaces/Iflight-enterprise-search.d.ts +6 -0
- package/base/lib/vendor/interfaces/Ihotel-enterprise-search.d.ts +3 -0
- package/base/lib/vendor/interfaces/Iirl-enterprise-search.d.ts +4 -4
- package/base/lib/vendor/interfaces/Imybookings.service.d.ts +3 -2
- package/base/lib/vendor/interfaces/Isearch.service.d.ts +1 -0
- package/base/lib/vendor/interfaces/Iuser.service.d.ts +10 -3
- package/base/lib/vendor/interfaces/rail-basket-item.interface.d.ts +2 -0
- package/base/lib/vendor/interfaces/summary-interface.d.ts +4 -0
- package/base/lib/vendor/models/traveller.object.d.ts +11 -1
- package/base/lib/vendor/services/enterprise-basket.service.d.ts +9 -7
- package/base/lib/vendor/services/logon.service.d.ts +3 -3
- package/base/lib/vendor/services/my-bookings.service.d.ts +3 -2
- package/base/lib/vendor/services/search.service.d.ts +3 -2
- package/base/lib/vendor/services/user.service.d.ts +18 -3
- package/base/lib/vendor/services/webtoken.service.d.ts +6 -4
- package/base/lib/vendor/types/graphql.types.d.ts +379 -508
- package/base/lib/vendor/types/types.d.ts +35 -7
- package/base/sabstravtech-obtservices-base.metadata.json +1 -1
- package/bundles/sabstravtech-obtservices-angular.umd.js +300 -201
- package/bundles/sabstravtech-obtservices-angular.umd.js.map +1 -1
- package/bundles/sabstravtech-obtservices-angular.umd.min.js +1 -1
- package/bundles/sabstravtech-obtservices-angular.umd.min.js.map +1 -1
- package/bundles/sabstravtech-obtservices-base.umd.js +2143 -597
- package/bundles/sabstravtech-obtservices-base.umd.js.map +1 -1
- package/bundles/sabstravtech-obtservices-base.umd.min.js +2 -2
- package/bundles/sabstravtech-obtservices-base.umd.min.js.map +1 -1
- package/esm2015/angular/fetchers.js +3 -1
- package/esm2015/angular/lib/vendor/fetchers/get-office.fetcher.js +25 -0
- package/esm2015/angular/lib/vendor/fetchers/get-user-default-mi-value.fetcher.js +25 -0
- package/esm2015/angular/lib/vendor/services/enterprise-basket.service.js +25 -25
- package/esm2015/angular/lib/vendor/services/logon.service.js +7 -7
- package/esm2015/angular/lib/vendor/services/ticket-queue.service.js +4 -1
- package/esm2015/angular/lib/vendor/services/user.service.js +13 -7
- package/esm2015/angular/lib/vendor/services/webtoken.service.js +2 -2
- package/esm2015/angular/lib/vendor/types/graphql.angular.types.js +808 -1231
- package/esm2015/base/fetchers.js +3 -1
- package/esm2015/base/lib/vendor/classes/base-enterprise.js +6 -3
- package/esm2015/base/lib/vendor/classes/bookable-basket.js +1 -3
- package/esm2015/base/lib/vendor/classes/cabhire-enterprise-search.js +155 -9
- package/esm2015/base/lib/vendor/classes/carhire-enterprise-search.js +129 -8
- package/esm2015/base/lib/vendor/classes/eurostar-enterprise-search.js +351 -20
- package/esm2015/base/lib/vendor/classes/fast-track-enterprise-search.js +8 -5
- package/esm2015/base/lib/vendor/classes/flight-enterprise-search.js +94 -14
- package/esm2015/base/lib/vendor/classes/helpers.js +15 -2
- package/esm2015/base/lib/vendor/classes/hotel-enterprise-search.js +86 -21
- package/esm2015/base/lib/vendor/classes/irl-enterprise-search.js +123 -18
- package/esm2015/base/lib/vendor/classes/lounges-enterprise-search.js +63 -8
- package/esm2015/base/lib/vendor/classes/management-info-and-valid.js +56 -33
- package/esm2015/base/lib/vendor/classes/parking-enterprise-search.js +109 -6
- package/esm2015/base/lib/vendor/classes/rail-enterprise-search.js +81 -7
- package/esm2015/base/lib/vendor/classes/supplementary-booking-info-impl.js +17 -1
- package/esm2015/base/lib/vendor/classes/user-favourite.enum.js +2 -1
- package/esm2015/base/lib/vendor/data/countries.json +484 -242
- package/esm2015/base/lib/vendor/fetchers/eurostar-quote.fetcher.js +3 -3
- package/esm2015/base/lib/vendor/fetchers/flight-quote.fetcher.js +3 -3
- package/esm2015/base/lib/vendor/fetchers/get-office.fetcher.js +11 -0
- package/esm2015/base/lib/vendor/fetchers/get-user-default-mi-value.fetcher.js +10 -0
- package/esm2015/base/lib/vendor/fetchers/search-users-can-book-for-fetcher.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Icabhire-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Icarhire-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Ienterprise-basket.service.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Iflight-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Ihotel-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Iirl-enterprise-search.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Imybookings.service.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Isearch.service.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/Iuser.service.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/rail-basket-item.interface.js +1 -1
- package/esm2015/base/lib/vendor/interfaces/summary-interface.js +1 -1
- package/esm2015/base/lib/vendor/models/traveller.object.js +21 -3
- package/esm2015/base/lib/vendor/services/enterprise-basket.service.js +42 -19
- package/esm2015/base/lib/vendor/services/logon.service.js +8 -5
- package/esm2015/base/lib/vendor/services/my-bookings.service.js +3 -2
- package/esm2015/base/lib/vendor/services/search.service.js +32 -24
- package/esm2015/base/lib/vendor/services/user.service.js +47 -3
- package/esm2015/base/lib/vendor/services/webtoken.service.js +12 -6
- package/esm2015/base/lib/vendor/types/graphql.types.js +15 -1
- package/esm2015/base/lib/vendor/types/types.js +4 -3
- package/fesm2015/sabstravtech-obtservices-angular.js +948 -1334
- package/fesm2015/sabstravtech-obtservices-angular.js.map +1 -1
- package/fesm2015/sabstravtech-obtservices-base.js +1984 -472
- package/fesm2015/sabstravtech-obtservices-base.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BehaviorSubject, of, Subject, combineLatest,
|
|
1
|
+
import { BehaviorSubject, of, Subject, combineLatest, forkJoin, Subscription } from 'rxjs';
|
|
2
2
|
import { take, map, catchError, debounceTime, distinctUntilChanged, switchMap, tap } from 'rxjs/operators';
|
|
3
3
|
import _, { cloneDeep } from 'lodash';
|
|
4
4
|
import { __awaiter, __decorate, __metadata, __rest } from 'tslib';
|
|
@@ -6,7 +6,7 @@ import moment from 'moment';
|
|
|
6
6
|
import Ajv from 'ajv';
|
|
7
7
|
|
|
8
8
|
class BaseEnterpriseSearch {
|
|
9
|
-
constructor(storageService, helpers, searchService) {
|
|
9
|
+
constructor(storageService, helpers, searchService, userService) {
|
|
10
10
|
this.storageService = storageService;
|
|
11
11
|
this.helpers = helpers;
|
|
12
12
|
this.searchService = searchService;
|
|
@@ -54,6 +54,8 @@ class BaseEnterpriseSearch {
|
|
|
54
54
|
try {
|
|
55
55
|
results.pipe(take(1)).subscribe((results1) => {
|
|
56
56
|
console.log('Got results', cloneDeep(results1));
|
|
57
|
+
this.rawResults = Object.freeze(results1);
|
|
58
|
+
this.storageService.setSessionItem(this.resultsSessionName + '_raw', this.rawResults);
|
|
57
59
|
this.fullResults = Object.freeze(this.processResults(results1));
|
|
58
60
|
this._cheapestResultPrice = this.updateLowestPrice(this.fullResults);
|
|
59
61
|
this.storageService.setSessionItem(this.resultsSessionName, this.makeSessionResults(this.fullResults));
|
|
@@ -63,8 +65,9 @@ class BaseEnterpriseSearch {
|
|
|
63
65
|
resolve(false);
|
|
64
66
|
this.isLoading.next(false);
|
|
65
67
|
}, () => {
|
|
68
|
+
var _a;
|
|
66
69
|
this.isLoading.next(false);
|
|
67
|
-
resolve(this.fullResults.length !== 0);
|
|
70
|
+
resolve(((_a = this.fullResults) === null || _a === void 0 ? void 0 : _a.length) !== 0);
|
|
68
71
|
});
|
|
69
72
|
}
|
|
70
73
|
catch (err) {
|
|
@@ -254,6 +257,7 @@ var CabHireVehicleType;
|
|
|
254
257
|
CabHireVehicleType["StandardCar"] = "StandardCar";
|
|
255
258
|
CabHireVehicleType["Suv"] = "SUV";
|
|
256
259
|
CabHireVehicleType["BlackCab"] = "BlackCab";
|
|
260
|
+
CabHireVehicleType["HackneyCarriage"] = "HackneyCarriage";
|
|
257
261
|
CabHireVehicleType["TaxiSuv"] = "TaxiSUV";
|
|
258
262
|
})(CabHireVehicleType || (CabHireVehicleType = {}));
|
|
259
263
|
var CarHireClass;
|
|
@@ -491,6 +495,12 @@ var CurrencyCode;
|
|
|
491
495
|
CurrencyCode["Zmw"] = "ZMW";
|
|
492
496
|
CurrencyCode["Zwl"] = "ZWL";
|
|
493
497
|
})(CurrencyCode || (CurrencyCode = {}));
|
|
498
|
+
var DepartTimeType;
|
|
499
|
+
(function (DepartTimeType) {
|
|
500
|
+
DepartTimeType["Anytime"] = "Anytime";
|
|
501
|
+
DepartTimeType["DepartAfter"] = "DepartAfter";
|
|
502
|
+
DepartTimeType["ArriveBefore"] = "ArriveBefore";
|
|
503
|
+
})(DepartTimeType || (DepartTimeType = {}));
|
|
494
504
|
var DistanceTypes;
|
|
495
505
|
(function (DistanceTypes) {
|
|
496
506
|
DistanceTypes["K"] = "K";
|
|
@@ -661,6 +671,7 @@ var ServiceType;
|
|
|
661
671
|
ServiceType["Flight"] = "FLIGHT";
|
|
662
672
|
ServiceType["Eurostar"] = "EUROSTAR";
|
|
663
673
|
ServiceType["InternationalRail"] = "INTERNATIONAL_RAIL";
|
|
674
|
+
ServiceType["Ferry"] = "FERRY";
|
|
664
675
|
ServiceType["Rail"] = "RAIL";
|
|
665
676
|
ServiceType["Hotel"] = "HOTEL";
|
|
666
677
|
ServiceType["Car"] = "CAR";
|
|
@@ -670,6 +681,12 @@ var ServiceType;
|
|
|
670
681
|
ServiceType["Cab"] = "CAB";
|
|
671
682
|
ServiceType["Coach"] = "COACH";
|
|
672
683
|
})(ServiceType || (ServiceType = {}));
|
|
684
|
+
var TicketType;
|
|
685
|
+
(function (TicketType) {
|
|
686
|
+
TicketType["None"] = "None";
|
|
687
|
+
TicketType["Fixed"] = "Fixed";
|
|
688
|
+
TicketType["Flexible"] = "Flexible";
|
|
689
|
+
})(TicketType || (TicketType = {}));
|
|
673
690
|
var UiConfigTarget;
|
|
674
691
|
(function (UiConfigTarget) {
|
|
675
692
|
UiConfigTarget["All"] = "ALL";
|
|
@@ -728,9 +745,13 @@ class FreeTextManagementInfo extends ManagementInfoAndIsValid {
|
|
|
728
745
|
this.tempValue = this.selectedValues
|
|
729
746
|
? ((_a = this.selectedValues[0]) === null || _a === void 0 ? void 0 : _a.freeValue) || ''
|
|
730
747
|
: '';
|
|
748
|
+
if (this.defaultValue && !this.selectedValues.length) {
|
|
749
|
+
this.value = this.defaultValue.value;
|
|
750
|
+
this.selectedValues[0].freeValue = this.defaultValue.value;
|
|
751
|
+
}
|
|
731
752
|
}
|
|
732
753
|
getValue() {
|
|
733
|
-
return this.
|
|
754
|
+
return this.selectedValues[0] ? this.selectedValues[0].freeValue : '';
|
|
734
755
|
}
|
|
735
756
|
setValue(val) {
|
|
736
757
|
if (this.tempValue === val) {
|
|
@@ -749,27 +770,32 @@ class FreeTextManagementInfo extends ManagementInfoAndIsValid {
|
|
|
749
770
|
this.basketService.setMiFreeValue(basketid, this, this.selectedValues[0] ? this.selectedValues[0].freeValue : '', userId, guest);
|
|
750
771
|
}
|
|
751
772
|
hasErrors(value) {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
+
const _super = Object.create(null, {
|
|
774
|
+
hasErrors: { get: () => super.hasErrors }
|
|
775
|
+
});
|
|
776
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
777
|
+
return new Promise((resolve, reject) => {
|
|
778
|
+
if (this.mandatory && (!value || value.length === 0)) {
|
|
779
|
+
resolve({ hasErrors: true });
|
|
780
|
+
}
|
|
781
|
+
if (this.valueMask && !!value) {
|
|
782
|
+
return this.basketService
|
|
783
|
+
.validateFreeValeMi(this, value)
|
|
784
|
+
.then((result) => {
|
|
785
|
+
resolve(result ? null : { hasErrors: true });
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
else if (this.values.length > 0) {
|
|
789
|
+
resolve(!!this.values.find((miv) => {
|
|
790
|
+
return miv.value === value;
|
|
791
|
+
})
|
|
792
|
+
? null
|
|
793
|
+
: { hasErrors: true });
|
|
794
|
+
}
|
|
795
|
+
else {
|
|
796
|
+
resolve(_super.hasErrors.call(this, value));
|
|
797
|
+
}
|
|
798
|
+
});
|
|
773
799
|
});
|
|
774
800
|
}
|
|
775
801
|
}
|
|
@@ -794,21 +820,28 @@ class AutoSugestManagementInfo extends ManagementInfoAndIsValid {
|
|
|
794
820
|
else {
|
|
795
821
|
console.error('No values for AutoSugest field');
|
|
796
822
|
}
|
|
823
|
+
if (this.defaultValue && !this.selectedValues.length) {
|
|
824
|
+
this.value = this.defaultValue.value;
|
|
825
|
+
this.selectedValues[0].value = {
|
|
826
|
+
id: this.defaultValue.valueId,
|
|
827
|
+
label: this.defaultValue.label,
|
|
828
|
+
value: this.defaultValue.value,
|
|
829
|
+
default: true,
|
|
830
|
+
fixed: false,
|
|
831
|
+
agentOnly: false
|
|
832
|
+
};
|
|
833
|
+
}
|
|
797
834
|
}
|
|
798
835
|
getValue() {
|
|
799
836
|
return this.selectedValues[0] ? this.selectedValues[0].value.id : '__NONE';
|
|
800
837
|
}
|
|
801
838
|
hasErrors(value) {
|
|
802
839
|
return __awaiter(this, void 0, void 0, function* () {
|
|
803
|
-
|
|
804
|
-
return
|
|
805
|
-
return value1.id === value.id;
|
|
806
|
-
})
|
|
807
|
-
? { hasErrors: true }
|
|
808
|
-
: null;
|
|
840
|
+
if (!value || value.length === 0) {
|
|
841
|
+
return ({ hasErrors: true });
|
|
809
842
|
}
|
|
810
|
-
|
|
811
|
-
return null;
|
|
843
|
+
if (this.value.length > 0) {
|
|
844
|
+
return (this.avaliableItems.find((value1) => { return value1.id === value.id; }) ? null : { hasErrors: true });
|
|
812
845
|
}
|
|
813
846
|
});
|
|
814
847
|
}
|
|
@@ -868,8 +901,15 @@ class DropdownManagementInfo extends ManagementInfoAndIsValid {
|
|
|
868
901
|
console.error('No values for Dropdown MI field ');
|
|
869
902
|
}
|
|
870
903
|
if (this.defaultValue && !this.selectedValues.length) {
|
|
871
|
-
this.value = this.defaultValue.
|
|
872
|
-
this.selectedValues[0].value =
|
|
904
|
+
this.value = this.defaultValue.valueId;
|
|
905
|
+
this.selectedValues[0].value = {
|
|
906
|
+
id: this.defaultValue.valueId,
|
|
907
|
+
label: this.defaultValue.label,
|
|
908
|
+
value: this.defaultValue.value,
|
|
909
|
+
default: true,
|
|
910
|
+
fixed: false,
|
|
911
|
+
agentOnly: false
|
|
912
|
+
};
|
|
873
913
|
}
|
|
874
914
|
}
|
|
875
915
|
getValue() {
|
|
@@ -1051,6 +1091,7 @@ var SchemaFormat;
|
|
|
1051
1091
|
SchemaFormat["apis"] = "apis";
|
|
1052
1092
|
SchemaFormat["mandatoryIfEticket"] = "mandatory-if-eticket";
|
|
1053
1093
|
SchemaFormat["mandatoryIfTod"] = "mandatory-if-tod";
|
|
1094
|
+
SchemaFormat["countryIsoCode"] = "countryIsoCode";
|
|
1054
1095
|
})(SchemaFormat || (SchemaFormat = {}));
|
|
1055
1096
|
var Widgets;
|
|
1056
1097
|
(function (Widgets) {
|
|
@@ -1126,8 +1167,8 @@ const BreakBastExcluded = [
|
|
|
1126
1167
|
const AccessibleIncluded = [
|
|
1127
1168
|
'Accessibility',
|
|
1128
1169
|
'Accessible and Disabled',
|
|
1129
|
-
'
|
|
1130
|
-
'
|
|
1170
|
+
'Disabled',
|
|
1171
|
+
'Mobility Access'
|
|
1131
1172
|
];
|
|
1132
1173
|
const excludedPattern = '(' + BreakBastExcluded.join(')|(') + ')';
|
|
1133
1174
|
const includedPattern = '(' + BreakFastIncluded.join(')|(') + ')';
|
|
@@ -3003,9 +3044,7 @@ class BookableBasket {
|
|
|
3003
3044
|
})) {
|
|
3004
3045
|
return this.workoutState(basket, BookingStatus.ApprovedPaymentOption);
|
|
3005
3046
|
}
|
|
3006
|
-
console.log(basket.suppInfo);
|
|
3007
3047
|
const haveSuppDetails = basket.suppInfo.find((supp) => supp.hasDetails);
|
|
3008
|
-
console.log(haveSuppDetails);
|
|
3009
3048
|
if (haveSuppDetails) {
|
|
3010
3049
|
status = BookingStatus.ApprovedSupplemtal;
|
|
3011
3050
|
}
|
|
@@ -3232,7 +3271,18 @@ const COACH_MAX_INFANT_AGE_YEARS = 0;
|
|
|
3232
3271
|
const LOUNGES_MAX_INFANT_AGE_YEARS = 0;
|
|
3233
3272
|
const METRES_TO_MILES_CONVERSION = 1609;
|
|
3234
3273
|
const TIME_BASE = 60;
|
|
3235
|
-
const GROUP_TICKET_CODES = [
|
|
3274
|
+
const GROUP_TICKET_CODES = [
|
|
3275
|
+
'GS',
|
|
3276
|
+
'AIG',
|
|
3277
|
+
'GRP',
|
|
3278
|
+
'GU3',
|
|
3279
|
+
'GU4',
|
|
3280
|
+
'GUC',
|
|
3281
|
+
'MPG',
|
|
3282
|
+
'2TR',
|
|
3283
|
+
'SGU',
|
|
3284
|
+
'GSU'
|
|
3285
|
+
];
|
|
3236
3286
|
class BaseHelperRoutines {
|
|
3237
3287
|
isGroupTicket(code) {
|
|
3238
3288
|
return GROUP_TICKET_CODES.includes(code.toUpperCase().trim());
|
|
@@ -3935,6 +3985,8 @@ class BaseHelperRoutines {
|
|
|
3935
3985
|
}
|
|
3936
3986
|
return value;
|
|
3937
3987
|
break;
|
|
3988
|
+
case 'passport':
|
|
3989
|
+
return value ? this.toStrings(value, schema) : isRequired ? {} : null;
|
|
3938
3990
|
default:
|
|
3939
3991
|
console.warn(`+++ unknown schema type ${schema.type} | returning value as is +++`);
|
|
3940
3992
|
return value;
|
|
@@ -4636,11 +4688,12 @@ var ActionType;
|
|
|
4636
4688
|
})(ActionType || (ActionType = {}));
|
|
4637
4689
|
|
|
4638
4690
|
class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
4639
|
-
constructor(cabfetcher, helpers, storageService, searchService, basketService) {
|
|
4640
|
-
super(storageService, helpers, searchService);
|
|
4691
|
+
constructor(cabfetcher, helpers, storageService, searchService, basketService, userService) {
|
|
4692
|
+
super(storageService, helpers, searchService, userService);
|
|
4641
4693
|
this.cabfetcher = cabfetcher;
|
|
4642
4694
|
this.basketService = basketService;
|
|
4643
4695
|
this.type = ServiceType.Cab;
|
|
4696
|
+
this.travellers = [];
|
|
4644
4697
|
this.airportChange = new Subject();
|
|
4645
4698
|
this.transTypes = [
|
|
4646
4699
|
{ key: CabHireVehicleType.Any, value: 'Any (1-8 Passengers)', id: 8 },
|
|
@@ -4718,6 +4771,10 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
4718
4771
|
* flightNumber
|
|
4719
4772
|
*/
|
|
4720
4773
|
this._flightNumber = '';
|
|
4774
|
+
/*
|
|
4775
|
+
* flightNumber
|
|
4776
|
+
*/
|
|
4777
|
+
this._returnFlightNumber = '';
|
|
4721
4778
|
/*
|
|
4722
4779
|
* terminal
|
|
4723
4780
|
*/
|
|
@@ -4850,6 +4907,12 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
4850
4907
|
set flightNumber(value) {
|
|
4851
4908
|
this._flightNumber = value;
|
|
4852
4909
|
}
|
|
4910
|
+
get returnFlightNumber() {
|
|
4911
|
+
return this._returnFlightNumber;
|
|
4912
|
+
}
|
|
4913
|
+
set returnFlightNumber(value) {
|
|
4914
|
+
this._returnFlightNumber = value;
|
|
4915
|
+
}
|
|
4853
4916
|
/*
|
|
4854
4917
|
* airport
|
|
4855
4918
|
*/
|
|
@@ -5044,6 +5107,13 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
5044
5107
|
this.returnDateTime.isSameOrBefore(this.departs)) {
|
|
5045
5108
|
this.validationMessages.push('Return Date/Time must be after outbound date/time');
|
|
5046
5109
|
}
|
|
5110
|
+
if (this.travellers.length > 4) {
|
|
5111
|
+
// use id from travel type to see if
|
|
5112
|
+
if (this.transTypes.find((type) => type.key === this.tempParams.vehicleType)
|
|
5113
|
+
.id < this.travellers.length) {
|
|
5114
|
+
this.validationMessages.push(`The number of passengers exceeds the available vehicle capacity for the ${this.tempParams.vehicleType} taxi`);
|
|
5115
|
+
}
|
|
5116
|
+
}
|
|
5047
5117
|
this.isValid.next(this.validationMessages.length === 0);
|
|
5048
5118
|
this.messages.next(this.validationMessages);
|
|
5049
5119
|
}
|
|
@@ -5186,7 +5256,7 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
5186
5256
|
results = results.sort((a, b) => b.price - a.price);
|
|
5187
5257
|
}
|
|
5188
5258
|
else {
|
|
5189
|
-
results = results.sort((a, b) => a.price - b.price);
|
|
5259
|
+
results = results === null || results === void 0 ? void 0 : results.sort((a, b) => a.price - b.price);
|
|
5190
5260
|
}
|
|
5191
5261
|
this.results.next(results);
|
|
5192
5262
|
}
|
|
@@ -5271,10 +5341,134 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
5271
5341
|
return this.inboundVisibility;
|
|
5272
5342
|
}
|
|
5273
5343
|
updateFromPreviousSearches(previousItems) {
|
|
5274
|
-
var _a;
|
|
5344
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5275
5345
|
const flightItem = (_a = previousItems[ServiceType.Flight]) === null || _a === void 0 ? void 0 : _a.searchQuery;
|
|
5346
|
+
const railItem = (_b = previousItems[ServiceType.Rail]) === null || _b === void 0 ? void 0 : _b.searchQuery;
|
|
5347
|
+
const irlItem = (_c = previousItems[ServiceType.InternationalRail]) === null || _c === void 0 ? void 0 : _c.searchQuery;
|
|
5348
|
+
const hotelItem = (_d = previousItems[ServiceType.Rail]) === null || _d === void 0 ? void 0 : _d.searchQuery;
|
|
5349
|
+
const carItem = (_e = previousItems[ServiceType.Car]) === null || _e === void 0 ? void 0 : _e.searchQuery;
|
|
5350
|
+
const loungeItem = (_f = previousItems[ServiceType.Lounge]) === null || _f === void 0 ? void 0 : _f.searchQuery;
|
|
5351
|
+
const parkingItem = (_g = previousItems[ServiceType.Parking]) === null || _g === void 0 ? void 0 : _g.searchQuery;
|
|
5352
|
+
const eurostarItem = (_h = previousItems[ServiceType.Eurostar]) === null || _h === void 0 ? void 0 : _h.searchQuery;
|
|
5276
5353
|
if (flightItem) {
|
|
5277
|
-
|
|
5354
|
+
try {
|
|
5355
|
+
if (previousItems.FLIGHT.inboundDate) {
|
|
5356
|
+
const dateArray = previousItems.FLIGHT.inboundDate.split("-");
|
|
5357
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5358
|
+
}
|
|
5359
|
+
else if (previousItems.FLIGHT.outboundDate) {
|
|
5360
|
+
const dateArray = previousItems.FLIGHT.outboundDate.split("-");
|
|
5361
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5362
|
+
}
|
|
5363
|
+
}
|
|
5364
|
+
catch (_j) {
|
|
5365
|
+
console.error('Error trying to prepopulate cabhire from flight item');
|
|
5366
|
+
}
|
|
5367
|
+
}
|
|
5368
|
+
else if (railItem) {
|
|
5369
|
+
try {
|
|
5370
|
+
if (previousItems.RAIL.inboundDate) {
|
|
5371
|
+
const dateArray = previousItems.RAIL.inboundDate.split("-");
|
|
5372
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5373
|
+
}
|
|
5374
|
+
else if (previousItems.RAIL.outboundDate) {
|
|
5375
|
+
const dateArray = previousItems.RAIL.outboundDate.split("-");
|
|
5376
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5377
|
+
}
|
|
5378
|
+
}
|
|
5379
|
+
catch (_k) {
|
|
5380
|
+
console.error('Error trying to prepopulate cabhire from rail item');
|
|
5381
|
+
}
|
|
5382
|
+
}
|
|
5383
|
+
else if (irlItem) {
|
|
5384
|
+
try {
|
|
5385
|
+
if (previousItems.INTERNATIONAL_RAIL.inboundDate) {
|
|
5386
|
+
const dateArray = previousItems.INTERNATIONAL_RAIL.inboundDate.split("-");
|
|
5387
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5388
|
+
}
|
|
5389
|
+
else if (previousItems.INTERNATIONAL_RAIL.outboundDate) {
|
|
5390
|
+
const dateArray = previousItems.INTERNATIONAL_RAIL.outboundDate.split("-");
|
|
5391
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5392
|
+
}
|
|
5393
|
+
}
|
|
5394
|
+
catch (_l) {
|
|
5395
|
+
console.error('Error trying to prepopulate cabhire from international rail item');
|
|
5396
|
+
}
|
|
5397
|
+
}
|
|
5398
|
+
else if (hotelItem) {
|
|
5399
|
+
try {
|
|
5400
|
+
if (previousItems.HOTEL.inboundDate) {
|
|
5401
|
+
const dateArray = previousItems.HOTEL.inboundDate.split("-");
|
|
5402
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5403
|
+
}
|
|
5404
|
+
else if (previousItems.HOTEL.outboundDate) {
|
|
5405
|
+
const dateArray = previousItems.HOTEL.outboundDate.split("-");
|
|
5406
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5407
|
+
}
|
|
5408
|
+
}
|
|
5409
|
+
catch (_m) {
|
|
5410
|
+
console.error('Error trying to prepopulate cabhire from hotel item');
|
|
5411
|
+
}
|
|
5412
|
+
}
|
|
5413
|
+
else if (carItem) {
|
|
5414
|
+
try {
|
|
5415
|
+
if (previousItems.CAR.inboundDate) {
|
|
5416
|
+
const dateArray = previousItems.CAR.inboundDate.split("-");
|
|
5417
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5418
|
+
}
|
|
5419
|
+
else if (previousItems.CAR.outboundDate) {
|
|
5420
|
+
const dateArray = previousItems.CAR.outboundDate.split("-");
|
|
5421
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5422
|
+
}
|
|
5423
|
+
}
|
|
5424
|
+
catch (_o) {
|
|
5425
|
+
console.error('Error trying to prepopulate cabhire from car item');
|
|
5426
|
+
}
|
|
5427
|
+
}
|
|
5428
|
+
else if (loungeItem) {
|
|
5429
|
+
try {
|
|
5430
|
+
if (previousItems.LOUNGE.inboundDate) {
|
|
5431
|
+
const dateArray = previousItems.LOUNGE.inboundDate.split("-");
|
|
5432
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5433
|
+
}
|
|
5434
|
+
else if (previousItems.LOUNGE.outboundDate) {
|
|
5435
|
+
const dateArray = previousItems.LOUNGE.outboundDate.split("-");
|
|
5436
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5437
|
+
}
|
|
5438
|
+
}
|
|
5439
|
+
catch (_p) {
|
|
5440
|
+
console.error('Error trying to prepopulate cabhire from lounge item');
|
|
5441
|
+
}
|
|
5442
|
+
}
|
|
5443
|
+
else if (parkingItem) {
|
|
5444
|
+
try {
|
|
5445
|
+
if (previousItems.PARKING.inboundDate) {
|
|
5446
|
+
const dateArray = previousItems.PARKING.inboundDate.split("-");
|
|
5447
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5448
|
+
}
|
|
5449
|
+
else if (previousItems.PARKING.outboundDate) {
|
|
5450
|
+
const dateArray = previousItems.PARKING.outboundDate.split("-");
|
|
5451
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5452
|
+
}
|
|
5453
|
+
}
|
|
5454
|
+
catch (_q) {
|
|
5455
|
+
console.error('Error trying to prepopulate cabhire from parking item');
|
|
5456
|
+
}
|
|
5457
|
+
}
|
|
5458
|
+
else if (eurostarItem) {
|
|
5459
|
+
try {
|
|
5460
|
+
if (previousItems.EUROSTAR.inboundDate) {
|
|
5461
|
+
const dateArray = previousItems.EUROSTAR.inboundDate.split("-");
|
|
5462
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5463
|
+
}
|
|
5464
|
+
else if (previousItems.EUROSTAR.outboundDate) {
|
|
5465
|
+
const dateArray = previousItems.EUROSTAR.outboundDate.split("-");
|
|
5466
|
+
this.date = this.helpers.yyyymmddTimeToNgDate(`${dateArray[0]}${dateArray[1]}${dateArray[2].substring(0, 2)}`, "");
|
|
5467
|
+
}
|
|
5468
|
+
}
|
|
5469
|
+
catch (_r) {
|
|
5470
|
+
console.error('Error trying to prepopulate cabhire from eurostar item');
|
|
5471
|
+
}
|
|
5278
5472
|
}
|
|
5279
5473
|
}
|
|
5280
5474
|
updateSearchFromExpiredBasketItem(basketItem) {
|
|
@@ -5324,6 +5518,7 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
5324
5518
|
return ((_a = this.transTypes.find((x) => x.key === transTypeIndex)) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
5325
5519
|
}
|
|
5326
5520
|
addCabHireToBasket(cabHireQuote, cabHireQuery) {
|
|
5521
|
+
var _a, _b, _c, _d, _e, _f;
|
|
5327
5522
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5328
5523
|
if (cabHireQuote.unavailable) {
|
|
5329
5524
|
return Promise.resolve(DifferentInvokdedUserReasons.cancel);
|
|
@@ -5353,7 +5548,7 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
5353
5548
|
latitude: cabHireQuote.toLocation.latitude,
|
|
5354
5549
|
longitude: cabHireQuote.toLocation.longitude
|
|
5355
5550
|
},
|
|
5356
|
-
vehicleType:
|
|
5551
|
+
vehicleType: cabHireQuote.vehicleType,
|
|
5357
5552
|
tripDistanceMetres: cabHireQuote.tripDistanceMetres,
|
|
5358
5553
|
tripDurationSeconds: cabHireQuote.tripDurationSeconds,
|
|
5359
5554
|
termsAndCond: termsAndConditions
|
|
@@ -5363,7 +5558,10 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
5363
5558
|
searchQuery: cabHireQuery,
|
|
5364
5559
|
co2PerItem: cabHireQuote.co2PerItem,
|
|
5365
5560
|
co2PerPassenger: cabHireQuote.co2PerPassenger,
|
|
5366
|
-
outboundDate: cabHireQuery.departs.format()
|
|
5561
|
+
outboundDate: cabHireQuery.departs.format(),
|
|
5562
|
+
lowestPrice: ((_a = this.cheapestPrice) === null || _a === void 0 ? void 0 : _a.amount) != cabHireQuote.price || ((_b = this.cheapestPrice) === null || _b === void 0 ? void 0 : _b.currencyCode) != cabHireQuote.currency ? (_c = this.cheapestPrice) === null || _c === void 0 ? void 0 : _c.amount : null,
|
|
5563
|
+
lowestPriceCurrency: ((_d = this.cheapestPrice) === null || _d === void 0 ? void 0 : _d.amount) != cabHireQuote.price || ((_e = this.cheapestPrice) === null || _e === void 0 ? void 0 : _e.currencyCode) != cabHireQuote.currency ?
|
|
5564
|
+
(_f = this.cheapestPrice) === null || _f === void 0 ? void 0 : _f.currencyCode : null
|
|
5367
5565
|
}, intBasket, this.searchService, this.travellers, cabHireQuote.requiresReason);
|
|
5368
5566
|
if (whatHappened === DifferentInvokdedUserReasons.research) {
|
|
5369
5567
|
this.performSearch();
|
|
@@ -5380,7 +5578,7 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
5380
5578
|
this.toAddress = newToAddress;
|
|
5381
5579
|
}
|
|
5382
5580
|
updateLowestPrice(results) {
|
|
5383
|
-
if (!results.length)
|
|
5581
|
+
if (!(results === null || results === void 0 ? void 0 : results.length))
|
|
5384
5582
|
return null;
|
|
5385
5583
|
const currency = results[0].currency;
|
|
5386
5584
|
return results.reduce((cheapestPrice, result) => {
|
|
@@ -5473,8 +5671,8 @@ var SortTypesCar;
|
|
|
5473
5671
|
})(SortTypesCar || (SortTypesCar = {}));
|
|
5474
5672
|
class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
5475
5673
|
// ! - End of getters and setters
|
|
5476
|
-
constructor(carhirefetcher, carHireAvailabilityDetailFetcher, helpers, basketService, storageService, searchService) {
|
|
5477
|
-
super(storageService, helpers, searchService);
|
|
5674
|
+
constructor(carhirefetcher, carHireAvailabilityDetailFetcher, helpers, basketService, storageService, searchService, userService) {
|
|
5675
|
+
super(storageService, helpers, searchService, userService);
|
|
5478
5676
|
this.carhirefetcher = carhirefetcher;
|
|
5479
5677
|
this.carHireAvailabilityDetailFetcher = carHireAvailabilityDetailFetcher;
|
|
5480
5678
|
this.basketService = basketService;
|
|
@@ -5684,6 +5882,20 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
5684
5882
|
tempParams: {}
|
|
5685
5883
|
};
|
|
5686
5884
|
this.updateTempParams(searchService.makeCarHireQuery(data.tempParams));
|
|
5885
|
+
// if (this.userConfig?.carhire_defaults) {
|
|
5886
|
+
// this.updateTempParams(searchService.makeCarHireQuery(this.userConfig.carhire_defaults));
|
|
5887
|
+
// }
|
|
5888
|
+
userService.fullUserDetails.userConfigs.subscribe(data => {
|
|
5889
|
+
var _a;
|
|
5890
|
+
// this.userConfig.next(data);
|
|
5891
|
+
console.log(data);
|
|
5892
|
+
if (data && (data === null || data === void 0 ? void 0 : data.carhire_defaults)) {
|
|
5893
|
+
this.updateTempParams(searchService.makeCarHireQuery((_a = data === null || data === void 0 ? void 0 : data.carhire_defaults) === null || _a === void 0 ? void 0 : _a.config));
|
|
5894
|
+
}
|
|
5895
|
+
});
|
|
5896
|
+
// userService.subscribe(data=>{
|
|
5897
|
+
// this.updateTempParams(searchService.makeCarHireQuery(data.carhire_defaults));
|
|
5898
|
+
// })
|
|
5687
5899
|
if (searchService.shouldAddTravellerSubscription()) {
|
|
5688
5900
|
searchService.travellerInformation.subscribe((travellers) => {
|
|
5689
5901
|
this.adults = 1;
|
|
@@ -6439,6 +6651,7 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
6439
6651
|
fullResults = fullResults.sort((a, b) => this.getPrice(b) - this.getPrice(a));
|
|
6440
6652
|
break;
|
|
6441
6653
|
case 2: // preferred TODO
|
|
6654
|
+
fullResults = this.sortByPreferred(fullResults);
|
|
6442
6655
|
break;
|
|
6443
6656
|
case 3: // brand
|
|
6444
6657
|
fullResults = this.sortByBrand(fullResults);
|
|
@@ -6529,6 +6742,28 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
6529
6742
|
this.results.next(sortedResults);
|
|
6530
6743
|
return sortedResults;
|
|
6531
6744
|
}
|
|
6745
|
+
/**
|
|
6746
|
+
* @description - sort the results
|
|
6747
|
+
* @param results - full results from sort results function
|
|
6748
|
+
*/
|
|
6749
|
+
sortByPreferred(results) {
|
|
6750
|
+
const fullResults = this.helpers.clone(results ? results : this.results.value);
|
|
6751
|
+
const sortedResults = fullResults.sort((a, b) => {
|
|
6752
|
+
const aPref = a.tmcPreferred || a.companyPreferred || a.officePreferred ? 1 : 0;
|
|
6753
|
+
const bPref = b.tmcPreferred || b.companyPreferred || b.officePreferred ? 1 : 0;
|
|
6754
|
+
if (aPref > bPref) {
|
|
6755
|
+
return -1;
|
|
6756
|
+
}
|
|
6757
|
+
else if (aPref < bPref) {
|
|
6758
|
+
return 1;
|
|
6759
|
+
}
|
|
6760
|
+
else {
|
|
6761
|
+
return 0;
|
|
6762
|
+
}
|
|
6763
|
+
});
|
|
6764
|
+
this.results.next(sortedResults);
|
|
6765
|
+
return sortedResults;
|
|
6766
|
+
}
|
|
6532
6767
|
/**
|
|
6533
6768
|
* @description - get the price of a individual car
|
|
6534
6769
|
*/
|
|
@@ -6598,9 +6833,12 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
6598
6833
|
};
|
|
6599
6834
|
}
|
|
6600
6835
|
updateFromPreviousSearches(previousItems) {
|
|
6601
|
-
var _a;
|
|
6836
|
+
var _a, _b, _c, _d;
|
|
6602
6837
|
console.log('PREPOPULATING CARHIRE FORM');
|
|
6603
6838
|
const flightItem = (_a = previousItems[ServiceType.Flight]) === null || _a === void 0 ? void 0 : _a.searchQuery;
|
|
6839
|
+
const railItem = (_b = previousItems[ServiceType.Rail]) === null || _b === void 0 ? void 0 : _b.searchQuery;
|
|
6840
|
+
const hotelItem = (_c = previousItems[ServiceType.Rail]) === null || _c === void 0 ? void 0 : _c.searchQuery;
|
|
6841
|
+
const irlItem = (_d = previousItems[ServiceType.InternationalRail]) === null || _d === void 0 ? void 0 : _d.searchQuery;
|
|
6604
6842
|
if (flightItem) {
|
|
6605
6843
|
try {
|
|
6606
6844
|
let startDate = this.searchService.searches[ServiceType.Flight].outBoundDate.toDate();
|
|
@@ -6629,10 +6867,80 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
6629
6867
|
this.dropoff_country = this.searchService.searches[ServiceType.Flight]
|
|
6630
6868
|
.arriveLocation.countryCode;
|
|
6631
6869
|
}
|
|
6632
|
-
catch (
|
|
6870
|
+
catch (_e) {
|
|
6633
6871
|
console.error('Error trying to prepopulate carhire from flight item');
|
|
6634
6872
|
}
|
|
6635
6873
|
}
|
|
6874
|
+
else if (railItem) {
|
|
6875
|
+
try {
|
|
6876
|
+
let startDate = this.searchService.searches[ServiceType.Rail].outBoundDateTime.toDate();
|
|
6877
|
+
let endDate = this.searchService.searches[ServiceType.Rail].inBoundDateTime.toDate();
|
|
6878
|
+
this.pickup_datetime =
|
|
6879
|
+
this.searchService.searches[ServiceType.Rail].outBoundDateTime;
|
|
6880
|
+
this.dropoff_datetime =
|
|
6881
|
+
this.searchService.searches[ServiceType.Rail].inBoundDateTime;
|
|
6882
|
+
this.pickup_date = {
|
|
6883
|
+
day: startDate.getUTCDate(),
|
|
6884
|
+
month: startDate.getUTCMonth() + 1,
|
|
6885
|
+
year: startDate.getUTCFullYear()
|
|
6886
|
+
};
|
|
6887
|
+
this.dropoff_date = {
|
|
6888
|
+
day: endDate.getUTCDate(),
|
|
6889
|
+
month: endDate.getUTCMonth() + 1,
|
|
6890
|
+
year: endDate.getUTCFullYear()
|
|
6891
|
+
};
|
|
6892
|
+
}
|
|
6893
|
+
catch (_f) {
|
|
6894
|
+
console.error('Error trying to prepopulate carhire from rail item');
|
|
6895
|
+
}
|
|
6896
|
+
}
|
|
6897
|
+
else if (irlItem) {
|
|
6898
|
+
try {
|
|
6899
|
+
let startDate = this.searchService.searches[ServiceType.InternationalRail].outBoundDateTime.toDate();
|
|
6900
|
+
let endDate = this.searchService.searches[ServiceType.InternationalRail].returnDepartureDateTime.toDate();
|
|
6901
|
+
this.pickup_datetime =
|
|
6902
|
+
this.searchService.searches[ServiceType.InternationalRail].outBoundDateTime;
|
|
6903
|
+
this.dropoff_datetime =
|
|
6904
|
+
this.searchService.searches[ServiceType.InternationalRail].returnDepartureDateTime;
|
|
6905
|
+
this.pickup_date = {
|
|
6906
|
+
day: startDate.getUTCDate(),
|
|
6907
|
+
month: startDate.getUTCMonth() + 1,
|
|
6908
|
+
year: startDate.getUTCFullYear()
|
|
6909
|
+
};
|
|
6910
|
+
this.dropoff_date = {
|
|
6911
|
+
day: endDate.getUTCDate(),
|
|
6912
|
+
month: endDate.getUTCMonth() + 1,
|
|
6913
|
+
year: endDate.getUTCFullYear()
|
|
6914
|
+
};
|
|
6915
|
+
}
|
|
6916
|
+
catch (_g) {
|
|
6917
|
+
console.error('Error trying to prepopulate carhire from international rail item');
|
|
6918
|
+
}
|
|
6919
|
+
}
|
|
6920
|
+
else if (hotelItem) {
|
|
6921
|
+
try {
|
|
6922
|
+
let startDate = this.searchService.searches[ServiceType.Hotel].checkin_date.toDate();
|
|
6923
|
+
let endDate = this.searchService.searches[ServiceType.Hotel].checkout_date.toDate();
|
|
6924
|
+
// this.locationType = LocationTypes.;
|
|
6925
|
+
this.pickup_datetime =
|
|
6926
|
+
this.searchService.searches[ServiceType.Hotel].checkin_date;
|
|
6927
|
+
this.dropoff_datetime =
|
|
6928
|
+
this.searchService.searches[ServiceType.Hotel].checkout_date;
|
|
6929
|
+
this.pickup_date = {
|
|
6930
|
+
day: startDate.getUTCDate(),
|
|
6931
|
+
month: startDate.getUTCMonth() + 1,
|
|
6932
|
+
year: startDate.getUTCFullYear()
|
|
6933
|
+
};
|
|
6934
|
+
this.dropoff_date = {
|
|
6935
|
+
day: endDate.getUTCDate(),
|
|
6936
|
+
month: endDate.getUTCMonth() + 1,
|
|
6937
|
+
year: endDate.getUTCFullYear()
|
|
6938
|
+
};
|
|
6939
|
+
}
|
|
6940
|
+
catch (_h) {
|
|
6941
|
+
console.error('Error trying to prepopulate carhire from hotel item');
|
|
6942
|
+
}
|
|
6943
|
+
}
|
|
6636
6944
|
}
|
|
6637
6945
|
// !date and time is handled differently for LU
|
|
6638
6946
|
_updatePickupDateTime() {
|
|
@@ -6702,7 +7010,7 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
6702
7010
|
* @description - add car hire to basket
|
|
6703
7011
|
*/
|
|
6704
7012
|
addCarHireToBasket(carHireVehicleAvailibility, carHireQuery) {
|
|
6705
|
-
var _a, _b;
|
|
7013
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
6706
7014
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6707
7015
|
if (carHireVehicleAvailibility.unavailable) {
|
|
6708
7016
|
return Promise.resolve(DifferentInvokdedUserReasons.cancel);
|
|
@@ -6740,6 +7048,12 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
6740
7048
|
type: displayRecord.vehicle.type,
|
|
6741
7049
|
manualTransmission: displayRecord.vehicle.transmission.includes(CarHireTransmission.Manual)
|
|
6742
7050
|
},
|
|
7051
|
+
fareInfo: {
|
|
7052
|
+
title: (_c = carHireVehicleAvailibility === null || carHireVehicleAvailibility === void 0 ? void 0 : carHireVehicleAvailibility.fareInfo) === null || _c === void 0 ? void 0 : _c.title,
|
|
7053
|
+
type: (_d = carHireVehicleAvailibility === null || carHireVehicleAvailibility === void 0 ? void 0 : carHireVehicleAvailibility.fareInfo) === null || _d === void 0 ? void 0 : _d.type,
|
|
7054
|
+
code: (_e = carHireVehicleAvailibility === null || carHireVehicleAvailibility === void 0 ? void 0 : carHireVehicleAvailibility.fareInfo) === null || _e === void 0 ? void 0 : _e.code,
|
|
7055
|
+
supplierCode: (_f = carHireVehicleAvailibility === null || carHireVehicleAvailibility === void 0 ? void 0 : carHireVehicleAvailibility.fareInfo) === null || _f === void 0 ? void 0 : _f.supplierCode
|
|
7056
|
+
},
|
|
6743
7057
|
vendorName: displayRecord.vendor.name,
|
|
6744
7058
|
identifiers: {
|
|
6745
7059
|
dropOffLocation: identifiers.dropOffLocation,
|
|
@@ -6751,11 +7065,13 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
6751
7065
|
termsAndCond: termsAndConditions
|
|
6752
7066
|
},
|
|
6753
7067
|
price,
|
|
6754
|
-
currency:
|
|
7068
|
+
currency: displayRecord.charges[0].currencyCode,
|
|
6755
7069
|
searchQuery: carHireQuery,
|
|
6756
7070
|
co2PerItem,
|
|
6757
7071
|
co2PerPassenger,
|
|
6758
|
-
outboundDate: new Date(displayRecord.pickup).toISOString()
|
|
7072
|
+
outboundDate: new Date(displayRecord.pickup).toISOString(),
|
|
7073
|
+
lowestPrice: ((_g = this.cheapestPrice) === null || _g === void 0 ? void 0 : _g.amount) != price ? (_h = this.cheapestPrice) === null || _h === void 0 ? void 0 : _h.amount : null,
|
|
7074
|
+
lowestPriceCurrency: ((_j = this.cheapestPrice) === null || _j === void 0 ? void 0 : _j.amount) != price ? (_k = this.cheapestPrice) === null || _k === void 0 ? void 0 : _k.currencyCode : null
|
|
6759
7075
|
}, intBasket, this.searchService, this.travellers, carHireVehicleAvailibility.requiresReason);
|
|
6760
7076
|
if (whatHappened === DifferentInvokdedUserReasons.research) {
|
|
6761
7077
|
this.performSearch();
|
|
@@ -6863,6 +7179,9 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
6863
7179
|
});
|
|
6864
7180
|
});
|
|
6865
7181
|
}
|
|
7182
|
+
checkForPreferred() {
|
|
7183
|
+
return !!this.results.value.find(result => result.officePreferred || result.tmcPreferred || result.companyPreferred);
|
|
7184
|
+
}
|
|
6866
7185
|
}
|
|
6867
7186
|
CarhireEnterpriseSearch.STORAGE_SESSION_PARAMS = 'carhire_params';
|
|
6868
7187
|
CarhireEnterpriseSearch.STORAGE_SESSION_RESULTS = 'carhire_results';
|
|
@@ -6963,6 +7282,7 @@ UserFavorurite.HideFlightCabinClasses = new UserFavorurite('hideFlightCabinClass
|
|
|
6963
7282
|
UserFavorurite.AlternativeRailItineraryEnabled = new UserFavorurite('alternativeRailItineraryEnabled');
|
|
6964
7283
|
UserFavorurite.riskMinimumLevel = new UserFavorurite('riskMinimumLevel');
|
|
6965
7284
|
UserFavorurite.ENABLE_CHATBOT = new UserFavorurite('enableChatbot');
|
|
7285
|
+
UserFavorurite.LocalCurrency = new UserFavorurite('local_currency');
|
|
6966
7286
|
class Suppliers {
|
|
6967
7287
|
constructor(value) {
|
|
6968
7288
|
this.value = value;
|
|
@@ -6992,7 +7312,7 @@ var FlightSortTypes;
|
|
|
6992
7312
|
})(FlightSortTypes || (FlightSortTypes = {}));
|
|
6993
7313
|
class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
6994
7314
|
constructor(flightfetcher, helpers, userService, basketService, storageService, searchService, applyFlightRules, modalService) {
|
|
6995
|
-
super(storageService, helpers, searchService);
|
|
7315
|
+
super(storageService, helpers, searchService, userService);
|
|
6996
7316
|
this.flightfetcher = flightfetcher;
|
|
6997
7317
|
this.userService = userService;
|
|
6998
7318
|
this.basketService = basketService;
|
|
@@ -7090,7 +7410,7 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
7090
7410
|
if (a.direction !== b.direction) {
|
|
7091
7411
|
return a.direction - b.direction;
|
|
7092
7412
|
}
|
|
7093
|
-
return (
|
|
7413
|
+
return (b.preferred ? 1 : 0) - (a.preferred ? 1 : 0);
|
|
7094
7414
|
},
|
|
7095
7415
|
[FlightSortTypes.LowestEmissions]: (a, b) => {
|
|
7096
7416
|
if (a.direction !== b.direction) {
|
|
@@ -7166,6 +7486,20 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
7166
7486
|
this.filters = new BehaviorSubject(DEFAULT_FLIGHT_FILTERS);
|
|
7167
7487
|
this.duralSingleFilter = new BehaviorSubject(DEFAULT_FLIGHT_FILTERS);
|
|
7168
7488
|
this.choosenDisplayType = new BehaviorSubject(FlightDisplayTypes.returns);
|
|
7489
|
+
this._cheapestPriceObject = {
|
|
7490
|
+
dualOutbound: {
|
|
7491
|
+
amount: Number.MAX_SAFE_INTEGER,
|
|
7492
|
+
currencyCode: 'GBP'
|
|
7493
|
+
},
|
|
7494
|
+
dualInbound: {
|
|
7495
|
+
amount: Number.MAX_SAFE_INTEGER,
|
|
7496
|
+
currencyCode: 'GBP'
|
|
7497
|
+
},
|
|
7498
|
+
returns: {
|
|
7499
|
+
amount: Number.MAX_SAFE_INTEGER,
|
|
7500
|
+
currencyCode: 'GBP'
|
|
7501
|
+
}
|
|
7502
|
+
};
|
|
7169
7503
|
this._multiDestination = [];
|
|
7170
7504
|
const data = storageService.getSessionItem(FlightEnterpriseSearch.STORAGE_SESSION_PARAMS) || {
|
|
7171
7505
|
tempParams: {},
|
|
@@ -7198,6 +7532,9 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
7198
7532
|
this.negotiated =
|
|
7199
7533
|
this.tempParams.fareType === FareType.Negotiated ? true : false;
|
|
7200
7534
|
}
|
|
7535
|
+
get cheapestPriceObject() {
|
|
7536
|
+
return this._cheapestPriceObject;
|
|
7537
|
+
}
|
|
7201
7538
|
get timeArray() {
|
|
7202
7539
|
this._timeArray =
|
|
7203
7540
|
this._timeArray ||
|
|
@@ -7477,13 +7814,13 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
7477
7814
|
journeyWhenSelected: {},
|
|
7478
7815
|
dualSingleWhenSelected: {},
|
|
7479
7816
|
whenSelectedAlone: {}
|
|
7480
|
-
}, results.ruleActionSummary);
|
|
7817
|
+
}, results.ruleActionSummary || {});
|
|
7481
7818
|
this.resultQuery = this.getSearchQuery();
|
|
7482
7819
|
this.multi = results.multi;
|
|
7483
7820
|
this.setFlightDisplayType(FlightDisplayTypes.returns);
|
|
7484
7821
|
this.currentFilters = this.helpers.createFlightFilters(results.journeys, DEFAULT_FLIGHT_FILTERS);
|
|
7485
7822
|
this.filters.next(this.currentFilters);
|
|
7486
|
-
delete this.resultQuery
|
|
7823
|
+
// delete this.resultQuery['withGrouped'];
|
|
7487
7824
|
const dualSingles = results.multi.reduce((previousItems, nextItem) => {
|
|
7488
7825
|
previousItems[nextItem.order === OUTBOUND ? 'outbound' : 'inbound'] =
|
|
7489
7826
|
nextItem.results.reduce((accum, flight) => {
|
|
@@ -7497,7 +7834,7 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
7497
7834
|
}, { outbound: {}, inbound: {} });
|
|
7498
7835
|
// console.log(dualSingles);
|
|
7499
7836
|
const dualInboundFilters = this.helpers.createFlightFilters(Object.values(dualSingles.inbound), DEFAULT_FLIGHT_FILTERS);
|
|
7500
|
-
this.duralSingleFilter.next(this.helpers.createFlightFilters(Object.values(dualSingles.outbound), Object.assign(Object.assign({}, DEFAULT_FLIGHT_FILTERS), { arrivalReturnAirport: dualInboundFilters.arrivalAirport, depatureReturnAirport: dualInboundFilters.depatureAirport, returnArrivalTime: dualInboundFilters.arrivalTime, returnDuration: dualInboundFilters.duration, returnDepartureTime: dualInboundFilters.departureTime })));
|
|
7837
|
+
this.duralSingleFilter.next(this.helpers.createFlightFilters(Object.values(dualSingles.outbound), Object.assign(Object.assign({}, DEFAULT_FLIGHT_FILTERS), { price: dualInboundFilters.price, arrivalReturnAirport: dualInboundFilters.arrivalAirport, depatureReturnAirport: dualInboundFilters.depatureAirport, returnArrivalTime: dualInboundFilters.arrivalTime, returnDuration: dualInboundFilters.duration, returnDepartureTime: dualInboundFilters.departureTime })));
|
|
7501
7838
|
if (results && this.searchService.isFlightsGrouped()) {
|
|
7502
7839
|
const returns = (results.journeys || []).reduce((accum, flight) => {
|
|
7503
7840
|
accum[flight.uid] = Object.assign({
|
|
@@ -7519,6 +7856,28 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
7519
7856
|
result1.direction = FlightDirectionEnum.DualSingleInbound;
|
|
7520
7857
|
return result1;
|
|
7521
7858
|
});
|
|
7859
|
+
// gonna grab cheapest flights here
|
|
7860
|
+
this._cheapestPriceObject.returns = returnData.reduce((cheapestPrice, result) => {
|
|
7861
|
+
const price = result.minPrice;
|
|
7862
|
+
if (cheapestPrice.amount > price) {
|
|
7863
|
+
cheapestPrice.amount = price;
|
|
7864
|
+
}
|
|
7865
|
+
return cheapestPrice;
|
|
7866
|
+
}, { amount: Number.MAX_SAFE_INTEGER, currencyCode: 'GBP' });
|
|
7867
|
+
this._cheapestPriceObject.dualOutbound = dualDataOutbound.reduce((cheapestPrice, result) => {
|
|
7868
|
+
const price = result.minPrice;
|
|
7869
|
+
if (cheapestPrice.amount > price) {
|
|
7870
|
+
cheapestPrice.amount = price;
|
|
7871
|
+
}
|
|
7872
|
+
return cheapestPrice;
|
|
7873
|
+
}, { amount: Number.MAX_SAFE_INTEGER, currencyCode: 'GBP' });
|
|
7874
|
+
this._cheapestPriceObject.dualInbound = dualDataInbound.reduce((cheapestPrice, result) => {
|
|
7875
|
+
const price = result.minPrice;
|
|
7876
|
+
if (cheapestPrice.amount > price) {
|
|
7877
|
+
cheapestPrice.amount = price;
|
|
7878
|
+
}
|
|
7879
|
+
return cheapestPrice;
|
|
7880
|
+
}, { amount: Number.MAX_SAFE_INTEGER, currencyCode: 'GBP' });
|
|
7522
7881
|
const data2 = [...returnData, ...dualDataOutbound, ...dualDataInbound];
|
|
7523
7882
|
console.log('Processed Grouped data', data2);
|
|
7524
7883
|
return data2;
|
|
@@ -7561,7 +7920,12 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
7561
7920
|
inlegsCount: 0,
|
|
7562
7921
|
dataSource: '',
|
|
7563
7922
|
preferred: false,
|
|
7564
|
-
|
|
7923
|
+
companyPreferred: false,
|
|
7924
|
+
companyPreferredMessage: '',
|
|
7925
|
+
officePreferred: false,
|
|
7926
|
+
officePreferredMessage: '',
|
|
7927
|
+
tmcPreferred: false,
|
|
7928
|
+
tmcPreferredMessage: '',
|
|
7565
7929
|
outboundFlightNumber: '',
|
|
7566
7930
|
operator: '',
|
|
7567
7931
|
operatorFull: '',
|
|
@@ -7582,7 +7946,7 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
7582
7946
|
}
|
|
7583
7947
|
// ! using a reduce because not all flights actually exist and we were seeing undefined in the flight list
|
|
7584
7948
|
brands[brand].forEach((flightNum) => {
|
|
7585
|
-
var _a, _b, _c, _d, _e, _f;
|
|
7949
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
7586
7950
|
const flight = groupedObject[flightNum];
|
|
7587
7951
|
if (flight) {
|
|
7588
7952
|
if (isOutBound || treatOutboundsAsOutbounds) {
|
|
@@ -7602,13 +7966,28 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
7602
7966
|
returnObject.maxPrice > maxprice
|
|
7603
7967
|
? returnObject.maxPrice
|
|
7604
7968
|
: maxprice;
|
|
7605
|
-
returnObject.
|
|
7969
|
+
returnObject.companyPreferred =
|
|
7606
7970
|
((_a = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _a === void 0 ? void 0 : _a.companyPreferred) || ((_b = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _b === void 0 ? void 0 : _b.companyPreferred) ||
|
|
7607
7971
|
false;
|
|
7608
|
-
returnObject.
|
|
7972
|
+
returnObject.companyPreferredMessage =
|
|
7609
7973
|
((_c = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _c === void 0 ? void 0 : _c.companyPreferredMessage) || ((_d = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _d === void 0 ? void 0 : _d.companyPreferredMessage) ||
|
|
7610
7974
|
'';
|
|
7611
|
-
|
|
7975
|
+
returnObject.officePreferred =
|
|
7976
|
+
((_e = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _e === void 0 ? void 0 : _e.officePreferred) || ((_f = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _f === void 0 ? void 0 : _f.officePreferred) ||
|
|
7977
|
+
false;
|
|
7978
|
+
returnObject.officePreferredMessage =
|
|
7979
|
+
((_g = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _g === void 0 ? void 0 : _g.officePreferredMessage) || ((_h = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _h === void 0 ? void 0 : _h.officePreferredMessage) ||
|
|
7980
|
+
'';
|
|
7981
|
+
returnObject.tmcPreferred =
|
|
7982
|
+
((_j = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _j === void 0 ? void 0 : _j.tmcPreferred) || ((_k = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _k === void 0 ? void 0 : _k.tmcPreferred) ||
|
|
7983
|
+
false;
|
|
7984
|
+
returnObject.tmcPreferredMessage =
|
|
7985
|
+
((_l = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _l === void 0 ? void 0 : _l.tmcPreferredMessage) || ((_m = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _m === void 0 ? void 0 : _m.tmcPreferredMessage) ||
|
|
7986
|
+
'';
|
|
7987
|
+
returnObject.preferred =
|
|
7988
|
+
((_o = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _o === void 0 ? void 0 : _o.companyPreferred) || ((_p = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _p === void 0 ? void 0 : _p.companyPreferred) || ((_q = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _q === void 0 ? void 0 : _q.officePreferred) || ((_r = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _r === void 0 ? void 0 : _r.officePreferred) || ((_s = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _s === void 0 ? void 0 : _s.tmcPreferred) || ((_t = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _t === void 0 ? void 0 : _t.tmcPreferred);
|
|
7989
|
+
false;
|
|
7990
|
+
if ((_v = (_u = returnObject.classes[correctBrand]) === null || _u === void 0 ? void 0 : _u.flights) === null || _v === void 0 ? void 0 : _v.length) {
|
|
7612
7991
|
returnObject.classes[correctBrand].flights.push(flight);
|
|
7613
7992
|
returnObject.classes[correctBrand].minprice = Math.min(returnObject.classes[correctBrand].minprice, minprice);
|
|
7614
7993
|
returnObject.classes[correctBrand].maxprice = Math.max(returnObject.classes[correctBrand].maxprice, maxprice);
|
|
@@ -7938,7 +8317,6 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
7938
8317
|
includeNearbyAirports: this.tempParams.includeNearbyAirports,
|
|
7939
8318
|
preferredCarriers: this.tempParams.preferredCarriers.map((carrier) => (carrier === null || carrier === void 0 ? void 0 : carrier.code) ? carrier.code : null),
|
|
7940
8319
|
fareType: this.tempParams.fareType,
|
|
7941
|
-
withGrouped: isFlightsGrouped
|
|
7942
8320
|
}, this.isReturn
|
|
7943
8321
|
? {
|
|
7944
8322
|
returnDate: this.helpers.formatIsoDate(this.tempParams.inboundDate),
|
|
@@ -8531,10 +8909,15 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
8531
8909
|
return acc;
|
|
8532
8910
|
}, []);
|
|
8533
8911
|
if (multiInbounds.length > 0) {
|
|
8912
|
+
if (!this.rawResults) {
|
|
8913
|
+
this.rawResults = this.storageService.getSessionItem(this.resultsSessionName + '_raw');
|
|
8914
|
+
}
|
|
8915
|
+
console.log(this.rawResults);
|
|
8534
8916
|
this.applyFlightRules
|
|
8535
8917
|
.fetchOne({
|
|
8536
8918
|
selectedOutboundFlight: this.selectedGroupFlight,
|
|
8537
|
-
availableInboundFlights: multiInbounds
|
|
8919
|
+
availableInboundFlights: multiInbounds,
|
|
8920
|
+
searchId: this.rawResults.searchId
|
|
8538
8921
|
})
|
|
8539
8922
|
.pipe(take(1))
|
|
8540
8923
|
.subscribe((rules) => {
|
|
@@ -8568,7 +8951,11 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
8568
8951
|
price: total.price,
|
|
8569
8952
|
searchQuery: this.resultQuery,
|
|
8570
8953
|
service: sourceId.toString(),
|
|
8571
|
-
outboundDate
|
|
8954
|
+
outboundDate,
|
|
8955
|
+
lowestPrice: (this.absoluteCheapestPrice.amount != Math.floor(total.price) || this.absoluteCheapestPrice.currencyCode != total.currency) ?
|
|
8956
|
+
this.absoluteCheapestPrice.amount : null,
|
|
8957
|
+
lowestPriceCurrency: (this.absoluteCheapestPrice.amount != Math.floor(total.price) || this.absoluteCheapestPrice.currencyCode != total.currency) ?
|
|
8958
|
+
this.absoluteCheapestPrice.currencyCode : null
|
|
8572
8959
|
};
|
|
8573
8960
|
if (inboundDate) {
|
|
8574
8961
|
booking.inboundDate = inboundDate;
|
|
@@ -8580,6 +8967,19 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
8580
8967
|
return whatHappened;
|
|
8581
8968
|
});
|
|
8582
8969
|
}
|
|
8970
|
+
get absoluteCheapestPrice() {
|
|
8971
|
+
if (this.cheapestPrice)
|
|
8972
|
+
return this.cheapestPrice;
|
|
8973
|
+
let price = { amount: null, currencyCode: null };
|
|
8974
|
+
if (this.cheapestPriceObject.dualInbound.amount + this.cheapestPriceObject.dualOutbound.amount <
|
|
8975
|
+
this.cheapestPriceObject.returns.amount && this.cheapestPriceObject.dualInbound.currencyCode == this.cheapestPriceObject.dualOutbound.currencyCode) {
|
|
8976
|
+
price.amount = this.cheapestPriceObject.dualInbound.amount + this.cheapestPriceObject.dualOutbound.amount;
|
|
8977
|
+
price.currencyCode = this.cheapestPriceObject.dualInbound.currencyCode;
|
|
8978
|
+
}
|
|
8979
|
+
else
|
|
8980
|
+
price = this.cheapestPriceObject.returns;
|
|
8981
|
+
return price;
|
|
8982
|
+
}
|
|
8583
8983
|
makeSchemaFlights(selectedFlight, flightGroup, groupIndex, segmentIndex) {
|
|
8584
8984
|
return Object.assign(Object.assign({}, selectedFlight), { journeyInfo: {
|
|
8585
8985
|
flightGroup,
|
|
@@ -8927,11 +9327,11 @@ var SortTypesHotel;
|
|
|
8927
9327
|
SortTypesHotel["name"] = "name";
|
|
8928
9328
|
SortTypesHotel["price"] = "price";
|
|
8929
9329
|
})(SortTypesHotel || (SortTypesHotel = {}));
|
|
8930
|
-
const CLIENT_PREFERRED_VALUE =
|
|
8931
|
-
const AGENT_PREFERRED_VALUE =
|
|
9330
|
+
const CLIENT_PREFERRED_VALUE = 2;
|
|
9331
|
+
const AGENT_PREFERRED_VALUE = 1;
|
|
8932
9332
|
class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
8933
9333
|
constructor(hotelFetcher, helpers, userService, environment, avaliabilityService, basketService, storageService, searchService, httpCallService, quickListFetcher, getRailStationFetcher, applyHotelRulesFetcher) {
|
|
8934
|
-
super(storageService, helpers, searchService);
|
|
9334
|
+
super(storageService, helpers, searchService, userService);
|
|
8935
9335
|
this.hotelFetcher = hotelFetcher;
|
|
8936
9336
|
this.userService = userService;
|
|
8937
9337
|
this.environment = environment;
|
|
@@ -8946,6 +9346,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
8946
9346
|
this.offices = new BehaviorSubject([]);
|
|
8947
9347
|
this.lastActivePage = new BehaviorSubject(null);
|
|
8948
9348
|
this.jitRulesReceived = new BehaviorSubject(false);
|
|
9349
|
+
this.reapplySorting = new BehaviorSubject(false);
|
|
8949
9350
|
this.galleries = {};
|
|
8950
9351
|
this.occupied = 0;
|
|
8951
9352
|
this.results_details = {
|
|
@@ -8997,6 +9398,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
8997
9398
|
this.hasChain(hotel) &&
|
|
8998
9399
|
this.breakfastTypeFilter(hotel));
|
|
8999
9400
|
});
|
|
9401
|
+
console.log('nortmal sort results');
|
|
9000
9402
|
this.results.next(this.resultsFilterMethod(this.fullResults));
|
|
9001
9403
|
};
|
|
9002
9404
|
// Lightening Filters
|
|
@@ -9011,7 +9413,9 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9011
9413
|
this.getAmenitiesFilter(hotel) &&
|
|
9012
9414
|
this.accessibleRoomTypeFilter(hotel));
|
|
9013
9415
|
});
|
|
9416
|
+
console.log('lightning sort results');
|
|
9014
9417
|
this.results.next(this.resultsFilterMethod(this.fullResults));
|
|
9418
|
+
this.reapplySorting.next(true);
|
|
9015
9419
|
};
|
|
9016
9420
|
this.results_details.chains = new Set();
|
|
9017
9421
|
const data = storageService.getSessionItem(HotelEnterpriseSearch.STORAGE_SESSION_PARAMS) || {
|
|
@@ -9021,6 +9425,14 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9021
9425
|
? this.tempParams.currency
|
|
9022
9426
|
: this._default_currency;
|
|
9023
9427
|
this.updateTempParams(searchService.makeHotelQuery(data.tempParams));
|
|
9428
|
+
userService.fullUserDetails.userConfigs.subscribe(data => {
|
|
9429
|
+
var _a;
|
|
9430
|
+
// this.userConfig.next(data);
|
|
9431
|
+
console.log(data);
|
|
9432
|
+
if (data && (data === null || data === void 0 ? void 0 : data.hotel_defaults)) {
|
|
9433
|
+
this.updateTempParams(searchService.makeHotelQuery((_a = data === null || data === void 0 ? void 0 : data.hotel_defaults) === null || _a === void 0 ? void 0 : _a.config));
|
|
9434
|
+
}
|
|
9435
|
+
});
|
|
9024
9436
|
if (searchService.shouldAddTravellerSubscription()) {
|
|
9025
9437
|
searchService.travellerInformation.subscribe((travellers) => {
|
|
9026
9438
|
this.travellers = travellers;
|
|
@@ -9071,6 +9483,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9071
9483
|
if (this.searchService.canBook(ServiceType.Hotel)) {
|
|
9072
9484
|
// need this check because on refresh we are getting errors - theory that user hasn't fully loaded in yet
|
|
9073
9485
|
this._applyTravelRules();
|
|
9486
|
+
this.reapplySorting.next(true);
|
|
9074
9487
|
}
|
|
9075
9488
|
}
|
|
9076
9489
|
});
|
|
@@ -9296,7 +9709,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9296
9709
|
})
|
|
9297
9710
|
.pipe(take(1))
|
|
9298
9711
|
.subscribe((data1) => {
|
|
9299
|
-
const filterResults = this.resultsFilterMethod(this.fullResults);
|
|
9712
|
+
const filterResults = this.resultsFilterMethod ? this.resultsFilterMethod(this.fullResults) : [];
|
|
9300
9713
|
const travleResults = filterResults.map((hotel) => {
|
|
9301
9714
|
if (data1[hotel.id]) {
|
|
9302
9715
|
return this.avaliabilityService.setHotelAvalability(data1[hotel.id]);
|
|
@@ -9306,13 +9719,14 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9306
9719
|
travleResults.forEach((hotel) => {
|
|
9307
9720
|
if (hotel.availableRates) {
|
|
9308
9721
|
hotel.jitRemoveResultRule = false;
|
|
9309
|
-
this.jitRulesReceived.next(true);
|
|
9310
9722
|
}
|
|
9311
9723
|
else {
|
|
9312
9724
|
hotel.jitRemoveResultRule = true;
|
|
9313
9725
|
}
|
|
9314
9726
|
});
|
|
9727
|
+
this.jitRulesReceived.next(true);
|
|
9315
9728
|
this.results.next(travleResults);
|
|
9729
|
+
this.reapplySorting.next(true);
|
|
9316
9730
|
});
|
|
9317
9731
|
}
|
|
9318
9732
|
makeLocations(location) {
|
|
@@ -9563,14 +9977,16 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9563
9977
|
return this.helpers.removeNulls(this.query);
|
|
9564
9978
|
}
|
|
9565
9979
|
buildQuery(ogSearch = false) {
|
|
9566
|
-
var _a, _b, _c, _d, _e, _f;
|
|
9980
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
9567
9981
|
const tempParams = ogSearch ? this.originalUserSearch : this.tempParams;
|
|
9982
|
+
if (!this.userCurrency)
|
|
9983
|
+
this.userCurrency = (_a = this.userService.getUserFavoriteObject(UserFavorurite.LocalCurrency)) === null || _a === void 0 ? void 0 : _a.currency;
|
|
9568
9984
|
const query = {
|
|
9569
9985
|
startDate: tempParams.checkin_date.format('YYYY-MM-DD'),
|
|
9570
9986
|
endDate: tempParams.checkout_date.format('YYYY-MM-DD'),
|
|
9571
9987
|
rooms: tempParams.no_of_rooms,
|
|
9572
9988
|
adults: tempParams.no_of_occupants,
|
|
9573
|
-
currency:
|
|
9989
|
+
currency: this.userCurrency || tempParams.currency || null,
|
|
9574
9990
|
distance: tempParams.distance,
|
|
9575
9991
|
distanceType: DistanceTypes.M,
|
|
9576
9992
|
maxResults: 100
|
|
@@ -9592,18 +10008,18 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9592
10008
|
}
|
|
9593
10009
|
break;
|
|
9594
10010
|
case LocationTypes.TrainStation:
|
|
9595
|
-
if ((
|
|
10011
|
+
if ((_c = (_b = tempParams.location) === null || _b === void 0 ? void 0 : _b.railstation) === null || _c === void 0 ? void 0 : _c.stationCode) {
|
|
9596
10012
|
query.trainStationCode = tempParams.location.railstation.stationCode;
|
|
9597
10013
|
}
|
|
9598
|
-
else if ((
|
|
10014
|
+
else if ((_d = tempParams.trainsStation) === null || _d === void 0 ? void 0 : _d.stationCode) {
|
|
9599
10015
|
query.trainStationCode = tempParams.trainsStation.stationCode;
|
|
9600
10016
|
}
|
|
9601
10017
|
break;
|
|
9602
10018
|
case LocationTypes.Office: // Needs to fix in next PR
|
|
9603
|
-
if ((
|
|
10019
|
+
if ((_e = tempParams.location) === null || _e === void 0 ? void 0 : _e.id) {
|
|
9604
10020
|
query.officeId = +tempParams.location.id;
|
|
9605
10021
|
}
|
|
9606
|
-
else if ((
|
|
10022
|
+
else if ((_f = tempParams.office) === null || _f === void 0 ? void 0 : _f.id) {
|
|
9607
10023
|
query.officeId = +tempParams.office.id;
|
|
9608
10024
|
}
|
|
9609
10025
|
break;
|
|
@@ -9621,18 +10037,21 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9621
10037
|
}
|
|
9622
10038
|
// add chain or group name int he query
|
|
9623
10039
|
if (tempParams.hotel_chain) {
|
|
9624
|
-
query.groupName = (
|
|
10040
|
+
query.groupName = (_g = tempParams.hotel_chain) === null || _g === void 0 ? void 0 : _g.name;
|
|
9625
10041
|
}
|
|
9626
10042
|
this.query = query;
|
|
9627
10043
|
}
|
|
9628
10044
|
makeHotelAvalilityObject(hotel) {
|
|
10045
|
+
var _a;
|
|
10046
|
+
if (!this.userCurrency)
|
|
10047
|
+
this.userCurrency = (_a = this.userService.getUserFavoriteObject(UserFavorurite.LocalCurrency)) === null || _a === void 0 ? void 0 : _a.currency;
|
|
9629
10048
|
return {
|
|
9630
10049
|
hotel: hotel.id,
|
|
9631
10050
|
startDate: this.helpers.formatIsoDate(this.checkin_date),
|
|
9632
10051
|
endDate: this.helpers.formatIsoDate(this.checkout_date),
|
|
9633
10052
|
rooms: this.no_of_rooms,
|
|
9634
10053
|
occupants: this.no_of_occupants,
|
|
9635
|
-
currency: 'GBP'
|
|
10054
|
+
currency: this.userCurrency || 'GBP'
|
|
9636
10055
|
};
|
|
9637
10056
|
}
|
|
9638
10057
|
resultsHaveTag(searchTag) {
|
|
@@ -9798,9 +10217,16 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9798
10217
|
}));
|
|
9799
10218
|
}
|
|
9800
10219
|
sortByDistance() {
|
|
9801
|
-
this.results.
|
|
9802
|
-
|
|
9803
|
-
|
|
10220
|
+
let results = this.results.value || [];
|
|
10221
|
+
try {
|
|
10222
|
+
results = results.sort((a, b) => {
|
|
10223
|
+
return Number(a.location.distance) - Number(b.location.distance);
|
|
10224
|
+
});
|
|
10225
|
+
}
|
|
10226
|
+
catch (error) {
|
|
10227
|
+
console.error('+++ Error sorting by preferred: ', error, ' +++');
|
|
10228
|
+
}
|
|
10229
|
+
this.results.next(results);
|
|
9804
10230
|
}
|
|
9805
10231
|
byPreferred() {
|
|
9806
10232
|
let results = this.results.value || [];
|
|
@@ -9921,10 +10347,11 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9921
10347
|
}
|
|
9922
10348
|
}
|
|
9923
10349
|
updateFromPreviousSearches(previousItems) {
|
|
9924
|
-
var _a, _b;
|
|
10350
|
+
var _a, _b, _c;
|
|
9925
10351
|
console.log('PREPOPULATING HOTEL FORM');
|
|
9926
10352
|
const flightItem = (_a = previousItems[ServiceType.Flight]) === null || _a === void 0 ? void 0 : _a.searchQuery;
|
|
9927
10353
|
const railItem = (_b = previousItems[ServiceType.Rail]) === null || _b === void 0 ? void 0 : _b.searchQuery;
|
|
10354
|
+
const irlItem = (_c = previousItems[ServiceType.InternationalRail]) === null || _c === void 0 ? void 0 : _c.searchQuery;
|
|
9928
10355
|
if (flightItem) {
|
|
9929
10356
|
try {
|
|
9930
10357
|
this.location_type_select = LocationTypes.Airport;
|
|
@@ -9939,7 +10366,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9939
10366
|
airport: this.searchService.searches[ServiceType.Flight].arriveLocation
|
|
9940
10367
|
};
|
|
9941
10368
|
}
|
|
9942
|
-
catch (
|
|
10369
|
+
catch (_d) {
|
|
9943
10370
|
console.error('Error trying to prepopulate hotel from flight item');
|
|
9944
10371
|
}
|
|
9945
10372
|
}
|
|
@@ -9955,10 +10382,25 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9955
10382
|
this.location = this.searchService.searches[ServiceType.Rail]
|
|
9956
10383
|
.travellingTo;
|
|
9957
10384
|
}
|
|
9958
|
-
catch (
|
|
10385
|
+
catch (_e) {
|
|
9959
10386
|
console.error('Error trying to prepopulate hotel from rail item');
|
|
9960
10387
|
}
|
|
9961
10388
|
}
|
|
10389
|
+
else if (irlItem) {
|
|
10390
|
+
try {
|
|
10391
|
+
this.location_type_select = LocationTypes.TrainStation;
|
|
10392
|
+
this.checkin_date = this.searchService.searches[ServiceType.InternationalRail].outBoundDateTime;
|
|
10393
|
+
this.checkout_date =
|
|
10394
|
+
this.searchService.searches[ServiceType.InternationalRail].returnDepartureDateTime;
|
|
10395
|
+
this.trainsStation = this.searchService.searches[ServiceType.InternationalRail]
|
|
10396
|
+
.travellingTo;
|
|
10397
|
+
this.location = this.searchService.searches[ServiceType.InternationalRail]
|
|
10398
|
+
.travellingTo;
|
|
10399
|
+
}
|
|
10400
|
+
catch (_f) {
|
|
10401
|
+
console.error('Error trying to prepopulate hotel from international rail item');
|
|
10402
|
+
}
|
|
10403
|
+
}
|
|
9962
10404
|
}
|
|
9963
10405
|
hasPreferred(hotel) {
|
|
9964
10406
|
const preferredFilters = this.filters.preferred;
|
|
@@ -9981,6 +10423,24 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
9981
10423
|
return hotel.preferred.client === true;
|
|
9982
10424
|
}
|
|
9983
10425
|
}
|
|
10426
|
+
atLeastOnePreferredAgentHotel() {
|
|
10427
|
+
let atLeastOne = false;
|
|
10428
|
+
for (let i = 0; i < this.results.value.length; i++) {
|
|
10429
|
+
if (this.results.value[i].preferred.consumer) {
|
|
10430
|
+
return true;
|
|
10431
|
+
}
|
|
10432
|
+
}
|
|
10433
|
+
return false;
|
|
10434
|
+
}
|
|
10435
|
+
atLeastOnePreferredClientHotel() {
|
|
10436
|
+
let atLeastOne = false;
|
|
10437
|
+
for (let i = 0; i < this.results.value.length; i++) {
|
|
10438
|
+
if (this.results.value[i].preferred.client) {
|
|
10439
|
+
return true;
|
|
10440
|
+
}
|
|
10441
|
+
}
|
|
10442
|
+
return false;
|
|
10443
|
+
}
|
|
9984
10444
|
getmaxPriceForCurrency(currency) {
|
|
9985
10445
|
return this.avaliabilityService.maxPriceForCurrency(currency);
|
|
9986
10446
|
}
|
|
@@ -10159,6 +10619,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
10159
10619
|
const termsAndConditions = this.getTermsAndCond(hotelRoom, hotelQuery);
|
|
10160
10620
|
// bookedTravellersChunks.forEach((chunk: Traveller[], index: number) => {
|
|
10161
10621
|
return roomArray.reduce((current, chunk, index) => __awaiter(this, void 0, void 0, function* () {
|
|
10622
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10162
10623
|
switch (yield current) {
|
|
10163
10624
|
case DifferentInvokdedUserReasons.cancel:
|
|
10164
10625
|
return DifferentInvokdedUserReasons.cancel;
|
|
@@ -10192,7 +10653,10 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
10192
10653
|
price: hotelRoom.total,
|
|
10193
10654
|
currency: hotelRoom.currencyCode,
|
|
10194
10655
|
searchQuery,
|
|
10195
|
-
outboundDate: hotelQuery.startDate
|
|
10656
|
+
outboundDate: hotelQuery.startDate,
|
|
10657
|
+
lowestPrice: ((_a = this.cheapestPrice) === null || _a === void 0 ? void 0 : _a.amount) != hotelRoom.total || ((_b = this.cheapestPrice) === null || _b === void 0 ? void 0 : _b.currencyCode) != hotelRoom.currencyCode ? (_c = this.cheapestPrice) === null || _c === void 0 ? void 0 : _c.amount : null,
|
|
10658
|
+
lowestPriceCurrency: ((_d = this.cheapestPrice) === null || _d === void 0 ? void 0 : _d.amount) != hotelRoom.total || ((_e = this.cheapestPrice) === null || _e === void 0 ? void 0 : _e.currencyCode) != hotelRoom.currencyCode ?
|
|
10659
|
+
(_f = this.cheapestPrice) === null || _f === void 0 ? void 0 : _f.currencyCode : null
|
|
10196
10660
|
}, intBasket, this.searchService,
|
|
10197
10661
|
// this is an array of 1 or 2 travellers which go in 1 room
|
|
10198
10662
|
// chunk
|
|
@@ -10279,8 +10743,8 @@ HotelEnterpriseSearch.STORAGE_SESSION_PARAMS = 'search_hotel';
|
|
|
10279
10743
|
HotelEnterpriseSearch.STORAGE_SESSION_RESULTS = 'results_hotel';
|
|
10280
10744
|
|
|
10281
10745
|
class LoungesEnterpriseSearch extends BaseEnterpriseSearch {
|
|
10282
|
-
constructor(loungefetcher, helpers, basketService, storageService, searchService) {
|
|
10283
|
-
super(storageService, helpers, searchService);
|
|
10746
|
+
constructor(loungefetcher, helpers, basketService, storageService, searchService, userService) {
|
|
10747
|
+
super(storageService, helpers, searchService, userService);
|
|
10284
10748
|
this.loungefetcher = loungefetcher;
|
|
10285
10749
|
this.basketService = basketService;
|
|
10286
10750
|
this.type = ServiceType.Lounge;
|
|
@@ -10548,9 +11012,13 @@ class LoungesEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
10548
11012
|
this.results.next(results.sort(terminalSorter));
|
|
10549
11013
|
}
|
|
10550
11014
|
updateFromPreviousSearches(previousItems) {
|
|
10551
|
-
var _a;
|
|
11015
|
+
var _a, _b, _c, _d, _e;
|
|
10552
11016
|
console.log('PREPOPULATING LOUNGE FORM');
|
|
10553
11017
|
const flightItem = (_a = previousItems[ServiceType.Flight]) === null || _a === void 0 ? void 0 : _a.searchQuery;
|
|
11018
|
+
const irlItem = (_b = previousItems[ServiceType.InternationalRail]) === null || _b === void 0 ? void 0 : _b.searchQuery;
|
|
11019
|
+
const railItem = (_c = previousItems[ServiceType.Rail]) === null || _c === void 0 ? void 0 : _c.searchQuery;
|
|
11020
|
+
const hotelItem = (_d = previousItems[ServiceType.Rail]) === null || _d === void 0 ? void 0 : _d.searchQuery;
|
|
11021
|
+
const carItem = (_e = previousItems[ServiceType.Car]) === null || _e === void 0 ? void 0 : _e.searchQuery;
|
|
10554
11022
|
if (flightItem) {
|
|
10555
11023
|
try {
|
|
10556
11024
|
let date = this.searchService.searches[ServiceType.Flight].outBoundDate.toDate();
|
|
@@ -10562,41 +11030,89 @@ class LoungesEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
10562
11030
|
this.locationCode = this.searchService.searches[ServiceType.Flight]
|
|
10563
11031
|
.arriveLocation;
|
|
10564
11032
|
}
|
|
10565
|
-
catch (
|
|
10566
|
-
console.error('Error trying to prepopulate
|
|
11033
|
+
catch (_f) {
|
|
11034
|
+
console.error('Error trying to prepopulate lounge from flight item');
|
|
10567
11035
|
}
|
|
10568
11036
|
}
|
|
10569
|
-
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10588
|
-
|
|
10589
|
-
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10594
|
-
|
|
11037
|
+
else if (railItem) {
|
|
11038
|
+
try {
|
|
11039
|
+
let date = this.searchService.searches[ServiceType.Rail].outBoundDateTime.toDate();
|
|
11040
|
+
this.date = {
|
|
11041
|
+
day: date.getUTCDate(),
|
|
11042
|
+
month: date.getUTCMonth() + 1,
|
|
11043
|
+
year: date.getUTCFullYear()
|
|
11044
|
+
};
|
|
11045
|
+
}
|
|
11046
|
+
catch (_g) {
|
|
11047
|
+
console.error('Error trying to prepopulate lounge from rail item');
|
|
11048
|
+
}
|
|
11049
|
+
}
|
|
11050
|
+
else if (irlItem) {
|
|
11051
|
+
try {
|
|
11052
|
+
let date = this.searchService.searches[ServiceType.InternationalRail].outBoundDateTime.toDate();
|
|
11053
|
+
this.date = {
|
|
11054
|
+
day: date.getUTCDate(),
|
|
11055
|
+
month: date.getUTCMonth() + 1,
|
|
11056
|
+
year: date.getUTCFullYear()
|
|
11057
|
+
};
|
|
11058
|
+
}
|
|
11059
|
+
catch (_h) {
|
|
11060
|
+
console.error('Error trying to prepopulate lounge from international rail item');
|
|
11061
|
+
}
|
|
11062
|
+
}
|
|
11063
|
+
else if (hotelItem) {
|
|
11064
|
+
try {
|
|
11065
|
+
let date = this.searchService.searches[ServiceType.Hotel].checkin_date.toDate();
|
|
11066
|
+
this.date = {
|
|
11067
|
+
day: date.getUTCDate(),
|
|
11068
|
+
month: date.getUTCMonth() + 1,
|
|
11069
|
+
year: date.getUTCFullYear()
|
|
11070
|
+
};
|
|
11071
|
+
}
|
|
11072
|
+
catch (_j) {
|
|
11073
|
+
console.error('Error trying to prepopulate lounge from hotel item');
|
|
11074
|
+
}
|
|
11075
|
+
}
|
|
11076
|
+
else if (carItem) {
|
|
11077
|
+
try {
|
|
11078
|
+
let date = this.searchService.searches[ServiceType.Car].pickup_date;
|
|
11079
|
+
this.date = date;
|
|
11080
|
+
}
|
|
11081
|
+
catch (_k) {
|
|
11082
|
+
console.error('Error trying to prepopulate lounge from car item');
|
|
11083
|
+
}
|
|
11084
|
+
}
|
|
11085
|
+
}
|
|
11086
|
+
updateSearchFromExpiredBasketItem(basketItem) {
|
|
11087
|
+
const searchLoungesQuery = basketItem.searchQuery;
|
|
11088
|
+
if (searchLoungesQuery) {
|
|
11089
|
+
this.arrivalDatetime = moment(searchLoungesQuery.arrivalDatetime);
|
|
11090
|
+
this.terminal = searchLoungesQuery.terminal;
|
|
11091
|
+
this.searchService
|
|
11092
|
+
.getAirportByCode(searchLoungesQuery.locationCode)
|
|
11093
|
+
.subscribe((airport) => {
|
|
11094
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11095
|
+
if (airport) {
|
|
11096
|
+
this.locationCode = {
|
|
11097
|
+
country: (_b = (_a = airport.iataMatch) === null || _a === void 0 ? void 0 : _a.locationDetails) === null || _b === void 0 ? void 0 : _b.country,
|
|
11098
|
+
countryCode: (_d = (_c = airport.iataMatch) === null || _c === void 0 ? void 0 : _c.locationDetails) === null || _d === void 0 ? void 0 : _d.countryCode,
|
|
11099
|
+
destination: airport.iataMatch.name,
|
|
11100
|
+
gateway: airport.iataMatch.iata,
|
|
11101
|
+
postcode: (_f = (_e = airport.iataMatch) === null || _e === void 0 ? void 0 : _e.locationDetails) === null || _f === void 0 ? void 0 : _f.postcode,
|
|
11102
|
+
terminals: this.searchService.processTerminals(airport.iataMatch.terminals)
|
|
11103
|
+
};
|
|
11104
|
+
}
|
|
11105
|
+
});
|
|
11106
|
+
}
|
|
11107
|
+
// add Travellers
|
|
11108
|
+
if (basketItem.users) {
|
|
11109
|
+
basketItem.users.forEach((user) => {
|
|
11110
|
+
this.searchService.addTraveller(user);
|
|
10595
11111
|
});
|
|
10596
11112
|
}
|
|
10597
11113
|
}
|
|
10598
11114
|
addLoungeToBasket(loungeQuote, loungeQuery) {
|
|
10599
|
-
var _a;
|
|
11115
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
10600
11116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10601
11117
|
if (loungeQuote.unavailable) {
|
|
10602
11118
|
return Promise.resolve(DifferentInvokdedUserReasons.cancel);
|
|
@@ -10634,7 +11150,10 @@ class LoungesEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
10634
11150
|
price: loungeQuote.price,
|
|
10635
11151
|
currency: loungeQuote.currency,
|
|
10636
11152
|
searchQuery: loungeQuery,
|
|
10637
|
-
outboundDate: loungeQuery.arrivalDatetime.format()
|
|
11153
|
+
outboundDate: loungeQuery.arrivalDatetime.format(),
|
|
11154
|
+
lowestPrice: ((_b = this.cheapestPrice) === null || _b === void 0 ? void 0 : _b.amount) != loungeQuote.price || ((_c = this.cheapestPrice) === null || _c === void 0 ? void 0 : _c.currencyCode) != loungeQuote.currency ? (_d = this.cheapestPrice) === null || _d === void 0 ? void 0 : _d.amount : null,
|
|
11155
|
+
lowestPriceCurrency: ((_e = this.cheapestPrice) === null || _e === void 0 ? void 0 : _e.amount) != loungeQuote.price || ((_f = this.cheapestPrice) === null || _f === void 0 ? void 0 : _f.currencyCode) != loungeQuote.currency ?
|
|
11156
|
+
(_g = this.cheapestPrice) === null || _g === void 0 ? void 0 : _g.currencyCode : null
|
|
10638
11157
|
}, intBasket, this.searchService, this.travellers, loungeQuote.requiresReason);
|
|
10639
11158
|
if (whatHappened === DifferentInvokdedUserReasons.research) {
|
|
10640
11159
|
this.performSearch();
|
|
@@ -10752,8 +11271,8 @@ const defaultValidations = {
|
|
|
10752
11271
|
DateOverlapped: `Inward Journey can not be before outward journey`
|
|
10753
11272
|
};
|
|
10754
11273
|
class ParkingEnterpriseSearch extends BaseEnterpriseSearch {
|
|
10755
|
-
constructor(parkingfetcher, helpers, basketService, storageService, searchService) {
|
|
10756
|
-
super(storageService, helpers, searchService);
|
|
11274
|
+
constructor(parkingfetcher, helpers, basketService, storageService, searchService, userService) {
|
|
11275
|
+
super(storageService, helpers, searchService, userService);
|
|
10757
11276
|
this.parkingfetcher = parkingfetcher;
|
|
10758
11277
|
this.basketService = basketService;
|
|
10759
11278
|
this.type = ServiceType.Parking;
|
|
@@ -11118,9 +11637,14 @@ class ParkingEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11118
11637
|
}
|
|
11119
11638
|
}
|
|
11120
11639
|
updateFromPreviousSearches(previousItems) {
|
|
11121
|
-
var _a;
|
|
11640
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11122
11641
|
console.log('PREPOPULATING PARKING FORM');
|
|
11123
11642
|
const flightItem = (_a = previousItems[ServiceType.Flight]) === null || _a === void 0 ? void 0 : _a.searchQuery;
|
|
11643
|
+
const railItem = (_b = previousItems[ServiceType.Rail]) === null || _b === void 0 ? void 0 : _b.searchQuery;
|
|
11644
|
+
const irlItem = (_c = previousItems[ServiceType.InternationalRail]) === null || _c === void 0 ? void 0 : _c.searchQuery;
|
|
11645
|
+
const hotelItem = (_d = previousItems[ServiceType.Rail]) === null || _d === void 0 ? void 0 : _d.searchQuery;
|
|
11646
|
+
const carItem = (_e = previousItems[ServiceType.Car]) === null || _e === void 0 ? void 0 : _e.searchQuery;
|
|
11647
|
+
const loungeItem = (_f = previousItems[ServiceType.Lounge]) === null || _f === void 0 ? void 0 : _f.searchQuery;
|
|
11124
11648
|
if (flightItem) {
|
|
11125
11649
|
try {
|
|
11126
11650
|
let startDate = this.searchService.searches[ServiceType.Flight].outBoundDate.toDate();
|
|
@@ -11138,12 +11662,106 @@ class ParkingEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11138
11662
|
this.locationCode = this.searchService.searches[ServiceType.Flight]
|
|
11139
11663
|
.arriveLocation;
|
|
11140
11664
|
}
|
|
11141
|
-
catch (
|
|
11665
|
+
catch (_g) {
|
|
11142
11666
|
console.error('Error trying to prepopulate parking from flight item');
|
|
11143
11667
|
}
|
|
11144
11668
|
}
|
|
11669
|
+
else if (railItem) {
|
|
11670
|
+
try {
|
|
11671
|
+
let startDate = this.searchService.searches[ServiceType.Rail].outBoundDateTime.toDate();
|
|
11672
|
+
let endDate = this.searchService.searches[ServiceType.Rail].inBoundDateTime.toDate();
|
|
11673
|
+
this.outdate = {
|
|
11674
|
+
day: startDate.getUTCDate(),
|
|
11675
|
+
month: startDate.getUTCMonth() + 1,
|
|
11676
|
+
year: startDate.getUTCFullYear()
|
|
11677
|
+
};
|
|
11678
|
+
this.indate = {
|
|
11679
|
+
day: endDate.getUTCDate(),
|
|
11680
|
+
month: endDate.getUTCMonth() + 1,
|
|
11681
|
+
year: endDate.getUTCFullYear()
|
|
11682
|
+
};
|
|
11683
|
+
}
|
|
11684
|
+
catch (_h) {
|
|
11685
|
+
console.error('Error trying to prepopulate parking from rail item');
|
|
11686
|
+
}
|
|
11687
|
+
}
|
|
11688
|
+
else if (irlItem) {
|
|
11689
|
+
try {
|
|
11690
|
+
let startDate = this.searchService.searches[ServiceType.InternationalRail].outBoundDateTime.toDate();
|
|
11691
|
+
let endDate = this.searchService.searches[ServiceType.InternationalRail].returnDepartureDateTime.toDate();
|
|
11692
|
+
this.outdate = {
|
|
11693
|
+
day: startDate.getUTCDate(),
|
|
11694
|
+
month: startDate.getUTCMonth() + 1,
|
|
11695
|
+
year: startDate.getUTCFullYear()
|
|
11696
|
+
};
|
|
11697
|
+
this.indate = {
|
|
11698
|
+
day: endDate.getUTCDate(),
|
|
11699
|
+
month: endDate.getUTCMonth() + 1,
|
|
11700
|
+
year: endDate.getUTCFullYear()
|
|
11701
|
+
};
|
|
11702
|
+
}
|
|
11703
|
+
catch (_j) {
|
|
11704
|
+
console.error('Error trying to prepopulate parking from international rail item');
|
|
11705
|
+
}
|
|
11706
|
+
}
|
|
11707
|
+
else if (hotelItem) {
|
|
11708
|
+
try {
|
|
11709
|
+
let startDate = this.searchService.searches[ServiceType.Hotel].checkin_date.toDate();
|
|
11710
|
+
let endDate = this.searchService.searches[ServiceType.Hotel].checkout_date.toDate();
|
|
11711
|
+
this.outdate = {
|
|
11712
|
+
day: startDate.getUTCDate(),
|
|
11713
|
+
month: startDate.getUTCMonth() + 1,
|
|
11714
|
+
year: startDate.getUTCFullYear()
|
|
11715
|
+
};
|
|
11716
|
+
this.indate = {
|
|
11717
|
+
day: endDate.getUTCDate(),
|
|
11718
|
+
month: endDate.getUTCMonth() + 1,
|
|
11719
|
+
year: endDate.getUTCFullYear()
|
|
11720
|
+
};
|
|
11721
|
+
}
|
|
11722
|
+
catch (_k) {
|
|
11723
|
+
console.error('Error trying to prepopulate parking from hotel item');
|
|
11724
|
+
}
|
|
11725
|
+
}
|
|
11726
|
+
else if (carItem) {
|
|
11727
|
+
try {
|
|
11728
|
+
let startDate = this.searchService.searches[ServiceType.Car].pickup_datetime.toDate();
|
|
11729
|
+
let endDate = this.searchService.searches[ServiceType.Car].dropoff_datetime.toDate();
|
|
11730
|
+
this.outdate = {
|
|
11731
|
+
day: startDate.getUTCDate(),
|
|
11732
|
+
month: startDate.getUTCMonth() + 1,
|
|
11733
|
+
year: startDate.getUTCFullYear()
|
|
11734
|
+
};
|
|
11735
|
+
this.indate = {
|
|
11736
|
+
day: endDate.getUTCDate(),
|
|
11737
|
+
month: endDate.getUTCMonth() + 1,
|
|
11738
|
+
year: endDate.getUTCFullYear()
|
|
11739
|
+
};
|
|
11740
|
+
this.locationCode = this.searchService.searches[ServiceType.Car]
|
|
11741
|
+
.pickup_location;
|
|
11742
|
+
}
|
|
11743
|
+
catch (_l) {
|
|
11744
|
+
console.error('Error trying to prepopulate parking from car item');
|
|
11745
|
+
}
|
|
11746
|
+
}
|
|
11747
|
+
else if (loungeItem) {
|
|
11748
|
+
try {
|
|
11749
|
+
let startDate = this.searchService.searches[ServiceType.Lounge].arrivalDatetime.toDate();
|
|
11750
|
+
this.outdate = {
|
|
11751
|
+
day: startDate.getUTCDate(),
|
|
11752
|
+
month: startDate.getUTCMonth() + 1,
|
|
11753
|
+
year: startDate.getUTCFullYear()
|
|
11754
|
+
};
|
|
11755
|
+
this.locationCode = this.searchService.searches[ServiceType.Lounge]
|
|
11756
|
+
.locationCode;
|
|
11757
|
+
}
|
|
11758
|
+
catch (_m) {
|
|
11759
|
+
console.error('Error trying to prepopulate parking from lounge item');
|
|
11760
|
+
}
|
|
11761
|
+
}
|
|
11145
11762
|
}
|
|
11146
11763
|
addParkingToBasket(parkingQuote, parkingQuery) {
|
|
11764
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11147
11765
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11148
11766
|
const intBasket = yield this.basketService.getDefaultBasket();
|
|
11149
11767
|
const basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
|
|
@@ -11166,7 +11784,11 @@ class ParkingEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11166
11784
|
currency: parkingQuote.currency,
|
|
11167
11785
|
searchQuery: parkingQuery,
|
|
11168
11786
|
outboundDate: parkingQuery.arrivalDatetime.format(),
|
|
11169
|
-
inboundDate: parkingQuery.departDatetime.format()
|
|
11787
|
+
inboundDate: parkingQuery.departDatetime.format(),
|
|
11788
|
+
lowestPrice: ((_a = this.cheapestPrice) === null || _a === void 0 ? void 0 : _a.amount) != parkingQuote.price || ((_b = this.cheapestPrice) === null || _b === void 0 ? void 0 : _b.currencyCode) != parkingQuote.currency
|
|
11789
|
+
? (_c = this.cheapestPrice) === null || _c === void 0 ? void 0 : _c.amount : null,
|
|
11790
|
+
lowestPriceCurrency: ((_d = this.cheapestPrice) === null || _d === void 0 ? void 0 : _d.amount) != parkingQuote.price || ((_e = this.cheapestPrice) === null || _e === void 0 ? void 0 : _e.currencyCode) != parkingQuote.currency
|
|
11791
|
+
? (_f = this.cheapestPrice) === null || _f === void 0 ? void 0 : _f.currencyCode : null
|
|
11170
11792
|
}, intBasket, this.searchService, this.travellers, parkingQuote.requiresReason);
|
|
11171
11793
|
if (whatHappened === DifferentInvokdedUserReasons.research) {
|
|
11172
11794
|
this.performSearch();
|
|
@@ -11324,11 +11946,12 @@ var SortMethod;
|
|
|
11324
11946
|
SortMethod["sortByDate"] = "sortByDate";
|
|
11325
11947
|
})(SortMethod || (SortMethod = {}));
|
|
11326
11948
|
class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
11327
|
-
constructor(eurostarFetcher, helpers, userService, basketService, storageService, searchService, modalService) {
|
|
11328
|
-
super(storageService, helpers, searchService);
|
|
11949
|
+
constructor(eurostarFetcher, helpers, userService, basketService, storageService, searchService, modalService, applyFlightRules) {
|
|
11950
|
+
super(storageService, helpers, searchService, userService);
|
|
11329
11951
|
this.eurostarFetcher = eurostarFetcher;
|
|
11330
11952
|
this.basketService = basketService;
|
|
11331
11953
|
this.modalService = modalService;
|
|
11954
|
+
this.applyFlightRules = applyFlightRules;
|
|
11332
11955
|
this.type = ServiceType.Eurostar;
|
|
11333
11956
|
this.avaliableClasses = new BehaviorSubject([]);
|
|
11334
11957
|
this.timeCriteriaOptions = new BehaviorSubject([]);
|
|
@@ -11738,12 +12361,18 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11738
12361
|
}
|
|
11739
12362
|
processResults(results1) {
|
|
11740
12363
|
this.resultQuery = this.getSearchQuery();
|
|
11741
|
-
|
|
12364
|
+
this.multi = results1.multi;
|
|
12365
|
+
// delete this.resultQuery['withGrouped'];
|
|
11742
12366
|
this.filters.next(this.helpers.createFlightFilters(results1.journeys, DEFAULT_FILTERS));
|
|
11743
12367
|
if (results1 && this.searchService.isFlightsGrouped()) {
|
|
12368
|
+
this._ruleActionSummary = Object.assign({}, {
|
|
12369
|
+
journeyWhenSelected: {},
|
|
12370
|
+
dualSingleWhenSelected: {},
|
|
12371
|
+
whenSelectedAlone: {}
|
|
12372
|
+
}, results1.ruleActionSummary || {});
|
|
11744
12373
|
const returndata = (results1.journeys || []).reduce((acc, result, index) => {
|
|
11745
12374
|
if (result.outboundFlights.length) {
|
|
11746
|
-
const euroResult = this.formatEurostarResults(result.outboundFlights, result.total, index);
|
|
12375
|
+
const euroResult = this.formatEurostarResults(result.outboundFlights, result.total, result.journeyHash, index);
|
|
11747
12376
|
euroResult.co2PerPassenger = result.co2PerPassenger;
|
|
11748
12377
|
euroResult.co2PerItem = result.co2PerItem;
|
|
11749
12378
|
euroResult.sourceId = result.sourceId;
|
|
@@ -11756,7 +12385,7 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11756
12385
|
}
|
|
11757
12386
|
}
|
|
11758
12387
|
if (result.inboundFlights.length) {
|
|
11759
|
-
const euroResult = this.formatEurostarResults(result.inboundFlights, result.total, index);
|
|
12388
|
+
const euroResult = this.formatEurostarResults(result.inboundFlights, result.total, result.journeyHash, index);
|
|
11760
12389
|
euroResult.co2PerPassenger = result.co2PerPassenger;
|
|
11761
12390
|
euroResult.co2PerItem = result.co2PerItem;
|
|
11762
12391
|
euroResult.sourceId = result.sourceId;
|
|
@@ -11804,8 +12433,8 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11804
12433
|
}
|
|
11805
12434
|
return acc;
|
|
11806
12435
|
}
|
|
11807
|
-
formatEurostarResults(results, total, index) {
|
|
11808
|
-
|
|
12436
|
+
formatEurostarResults(results, total, journeyHash, index) {
|
|
12437
|
+
let returnObject = {
|
|
11809
12438
|
dateArrival: null,
|
|
11810
12439
|
dateDeparture: null,
|
|
11811
12440
|
duration: null,
|
|
@@ -11823,7 +12452,21 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11823
12452
|
isDisabled: true,
|
|
11824
12453
|
price: NaN,
|
|
11825
12454
|
currency: 'GBP',
|
|
11826
|
-
selected: false
|
|
12455
|
+
selected: false,
|
|
12456
|
+
requiresReason: false,
|
|
12457
|
+
preferred: false,
|
|
12458
|
+
preferredMessages: '',
|
|
12459
|
+
companyPreferred: false,
|
|
12460
|
+
companyPreferredMessage: '',
|
|
12461
|
+
officePreferred: false,
|
|
12462
|
+
officePreferredMessage: '',
|
|
12463
|
+
tmcPreferred: false,
|
|
12464
|
+
tmcPreferredMessage: '',
|
|
12465
|
+
unavailable: false,
|
|
12466
|
+
unavailableMessage: '',
|
|
12467
|
+
requiresReasonMessage: '',
|
|
12468
|
+
canSelect: false,
|
|
12469
|
+
journeyHash: ''
|
|
11827
12470
|
},
|
|
11828
12471
|
standardFare: {
|
|
11829
12472
|
class: null,
|
|
@@ -11831,7 +12474,21 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11831
12474
|
isDisabled: true,
|
|
11832
12475
|
price: NaN,
|
|
11833
12476
|
currency: 'GBP',
|
|
11834
|
-
selected: false
|
|
12477
|
+
selected: false,
|
|
12478
|
+
requiresReason: false,
|
|
12479
|
+
preferred: false,
|
|
12480
|
+
preferredMessages: '',
|
|
12481
|
+
companyPreferred: false,
|
|
12482
|
+
companyPreferredMessage: '',
|
|
12483
|
+
officePreferred: false,
|
|
12484
|
+
officePreferredMessage: '',
|
|
12485
|
+
tmcPreferred: false,
|
|
12486
|
+
tmcPreferredMessage: '',
|
|
12487
|
+
unavailable: false,
|
|
12488
|
+
unavailableMessage: '',
|
|
12489
|
+
requiresReasonMessage: '',
|
|
12490
|
+
canSelect: false,
|
|
12491
|
+
journeyHash: ''
|
|
11835
12492
|
},
|
|
11836
12493
|
standardPremierFare: {
|
|
11837
12494
|
class: null,
|
|
@@ -11839,9 +12496,22 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11839
12496
|
isDisabled: true,
|
|
11840
12497
|
price: NaN,
|
|
11841
12498
|
currency: 'GBP',
|
|
11842
|
-
selected: false
|
|
11843
|
-
|
|
11844
|
-
|
|
12499
|
+
selected: false,
|
|
12500
|
+
requiresReason: false,
|
|
12501
|
+
preferred: false,
|
|
12502
|
+
preferredMessages: '',
|
|
12503
|
+
companyPreferred: false,
|
|
12504
|
+
companyPreferredMessage: '',
|
|
12505
|
+
officePreferred: false,
|
|
12506
|
+
officePreferredMessage: '',
|
|
12507
|
+
tmcPreferred: false,
|
|
12508
|
+
tmcPreferredMessage: '',
|
|
12509
|
+
unavailable: false,
|
|
12510
|
+
unavailableMessage: '',
|
|
12511
|
+
requiresReasonMessage: '',
|
|
12512
|
+
canSelect: false,
|
|
12513
|
+
journeyHash: ''
|
|
12514
|
+
}
|
|
11845
12515
|
};
|
|
11846
12516
|
// returnObject.duration = results.outboundTotalDuration;
|
|
11847
12517
|
results.forEach((flight) => {
|
|
@@ -11867,6 +12537,8 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11867
12537
|
returnObject.standardFare.currency = total.currency;
|
|
11868
12538
|
returnObject.standardFare.class = flight.cabinClass;
|
|
11869
12539
|
returnObject.standardFare.selected = false;
|
|
12540
|
+
returnObject.standardFare.journeyHash = journeyHash;
|
|
12541
|
+
returnObject = this.updateRules(returnObject, journeyHash, 'standardFare');
|
|
11870
12542
|
break;
|
|
11871
12543
|
case 'Premium':
|
|
11872
12544
|
returnObject.standardPremierFare.isDisabled = false;
|
|
@@ -11875,6 +12547,8 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11875
12547
|
returnObject.standardPremierFare.currency = total.currency;
|
|
11876
12548
|
returnObject.standardPremierFare.class = flight.cabinClass;
|
|
11877
12549
|
returnObject.standardPremierFare.selected = false;
|
|
12550
|
+
returnObject.standardPremierFare.journeyHash = journeyHash;
|
|
12551
|
+
returnObject = this.updateRules(returnObject, journeyHash, 'standardPremierFare');
|
|
11878
12552
|
break;
|
|
11879
12553
|
case FlightCabinClass.Business:
|
|
11880
12554
|
returnObject.businessPremierFare.isDisabled = false;
|
|
@@ -11883,6 +12557,8 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11883
12557
|
returnObject.businessPremierFare.currency = total.currency;
|
|
11884
12558
|
returnObject.businessPremierFare.class = flight.cabinClass;
|
|
11885
12559
|
returnObject.businessPremierFare.selected = false;
|
|
12560
|
+
returnObject.businessPremierFare.journeyHash = journeyHash;
|
|
12561
|
+
returnObject = this.updateRules(returnObject, journeyHash, 'businessPremierFare');
|
|
11886
12562
|
break;
|
|
11887
12563
|
default:
|
|
11888
12564
|
console.warn('new class to be implemented: ', flight.cabinClass);
|
|
@@ -11890,6 +12566,108 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
11890
12566
|
});
|
|
11891
12567
|
return returnObject;
|
|
11892
12568
|
}
|
|
12569
|
+
updateRules(returnObject, journeyHash, fareType) {
|
|
12570
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33;
|
|
12571
|
+
const selectedRuleSummary = this._ruleActionSummary.dualSingleWhenSelected[(_a = this.selectedGroupFlight) === null || _a === void 0 ? void 0 : _a.journeyHash] || {};
|
|
12572
|
+
const hasField = (journeyHash, field, def) => {
|
|
12573
|
+
return (this.helpers.fieldFromObject(this._ruleActionSummary, [
|
|
12574
|
+
'journeyWhenSelected',
|
|
12575
|
+
journeyHash,
|
|
12576
|
+
field
|
|
12577
|
+
]) ||
|
|
12578
|
+
this.helpers.fieldFromObject(this._ruleActionSummary, [
|
|
12579
|
+
'whenSelectedAlone',
|
|
12580
|
+
journeyHash,
|
|
12581
|
+
field
|
|
12582
|
+
]) ||
|
|
12583
|
+
this.helpers.fieldFromObject(selectedRuleSummary, [
|
|
12584
|
+
journeyHash,
|
|
12585
|
+
field
|
|
12586
|
+
]) ||
|
|
12587
|
+
def);
|
|
12588
|
+
};
|
|
12589
|
+
switch (fareType) {
|
|
12590
|
+
case 'standardFare':
|
|
12591
|
+
returnObject.standardFare.companyPreferred =
|
|
12592
|
+
((_b = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _b === void 0 ? void 0 : _b.companyPreferred) || ((_c = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _c === void 0 ? void 0 : _c.companyPreferred) ||
|
|
12593
|
+
false;
|
|
12594
|
+
returnObject.standardFare.companyPreferredMessage =
|
|
12595
|
+
((_d = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _d === void 0 ? void 0 : _d.companyPreferredMessage) || ((_e = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _e === void 0 ? void 0 : _e.companyPreferredMessage) ||
|
|
12596
|
+
'';
|
|
12597
|
+
returnObject.standardFare.officePreferred =
|
|
12598
|
+
((_f = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _f === void 0 ? void 0 : _f.officePreferred) || ((_g = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _g === void 0 ? void 0 : _g.officePreferred) ||
|
|
12599
|
+
false;
|
|
12600
|
+
returnObject.standardFare.officePreferredMessage =
|
|
12601
|
+
((_h = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _h === void 0 ? void 0 : _h.officePreferredMessage) || ((_j = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _j === void 0 ? void 0 : _j.officePreferredMessage) ||
|
|
12602
|
+
'';
|
|
12603
|
+
returnObject.standardFare.tmcPreferred =
|
|
12604
|
+
((_k = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _k === void 0 ? void 0 : _k.tmcPreferred) || ((_l = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _l === void 0 ? void 0 : _l.tmcPreferred) ||
|
|
12605
|
+
false;
|
|
12606
|
+
returnObject.standardFare.tmcPreferredMessage =
|
|
12607
|
+
((_m = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _m === void 0 ? void 0 : _m.tmcPreferredMessage) || ((_o = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _o === void 0 ? void 0 : _o.tmcPreferredMessage) ||
|
|
12608
|
+
'';
|
|
12609
|
+
returnObject.standardFare.preferred =
|
|
12610
|
+
((_p = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _p === void 0 ? void 0 : _p.companyPreferred) || ((_q = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _q === void 0 ? void 0 : _q.companyPreferred) || ((_r = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _r === void 0 ? void 0 : _r.officePreferred) || ((_s = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _s === void 0 ? void 0 : _s.officePreferred) || ((_t = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _t === void 0 ? void 0 : _t.tmcPreferred) || ((_u = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _u === void 0 ? void 0 : _u.tmcPreferred);
|
|
12611
|
+
returnObject.standardFare.selected = returnObject.uid === ((_v = this.selectedGroupFlight) === null || _v === void 0 ? void 0 : _v.uid);
|
|
12612
|
+
returnObject.standardFare.unavailable = hasField(journeyHash, 'unavailable', false);
|
|
12613
|
+
returnObject.standardFare.unavailableMessage = hasField(journeyHash, 'unavailableMessage', '');
|
|
12614
|
+
returnObject.standardFare.requiresReason = hasField(journeyHash, 'requiresReason', false);
|
|
12615
|
+
returnObject.standardFare.requiresReasonMessage = hasField(journeyHash, 'requiresReasonMessage', '');
|
|
12616
|
+
case 'standardPremierFare':
|
|
12617
|
+
returnObject.standardPremierFare.companyPreferred =
|
|
12618
|
+
((_w = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _w === void 0 ? void 0 : _w.companyPreferred) || ((_x = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _x === void 0 ? void 0 : _x.companyPreferred) ||
|
|
12619
|
+
false;
|
|
12620
|
+
returnObject.standardPremierFare.companyPreferredMessage =
|
|
12621
|
+
((_y = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _y === void 0 ? void 0 : _y.companyPreferredMessage) || ((_z = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _z === void 0 ? void 0 : _z.companyPreferredMessage) ||
|
|
12622
|
+
'';
|
|
12623
|
+
returnObject.standardPremierFare.officePreferred =
|
|
12624
|
+
((_0 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _0 === void 0 ? void 0 : _0.officePreferred) || ((_1 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _1 === void 0 ? void 0 : _1.officePreferred) ||
|
|
12625
|
+
false;
|
|
12626
|
+
returnObject.standardPremierFare.officePreferredMessage =
|
|
12627
|
+
((_2 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _2 === void 0 ? void 0 : _2.officePreferredMessage) || ((_3 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _3 === void 0 ? void 0 : _3.officePreferredMessage) ||
|
|
12628
|
+
'';
|
|
12629
|
+
returnObject.standardPremierFare.tmcPreferred =
|
|
12630
|
+
((_4 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _4 === void 0 ? void 0 : _4.tmcPreferred) || ((_5 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _5 === void 0 ? void 0 : _5.tmcPreferred) ||
|
|
12631
|
+
false;
|
|
12632
|
+
returnObject.standardPremierFare.tmcPreferredMessage =
|
|
12633
|
+
((_6 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _6 === void 0 ? void 0 : _6.tmcPreferredMessage) || ((_7 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _7 === void 0 ? void 0 : _7.tmcPreferredMessage) ||
|
|
12634
|
+
'';
|
|
12635
|
+
returnObject.standardPremierFare.preferred =
|
|
12636
|
+
((_8 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _8 === void 0 ? void 0 : _8.companyPreferred) || ((_9 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _9 === void 0 ? void 0 : _9.companyPreferred) || ((_10 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _10 === void 0 ? void 0 : _10.officePreferred) || ((_11 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _11 === void 0 ? void 0 : _11.officePreferred) || ((_12 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _12 === void 0 ? void 0 : _12.tmcPreferred) || ((_13 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _13 === void 0 ? void 0 : _13.tmcPreferred);
|
|
12637
|
+
returnObject.standardPremierFare.selected = returnObject.uid === ((_14 = this.selectedGroupFlight) === null || _14 === void 0 ? void 0 : _14.uid);
|
|
12638
|
+
returnObject.standardPremierFare.unavailable = hasField(journeyHash, 'unavailable', false);
|
|
12639
|
+
returnObject.standardPremierFare.unavailableMessage = hasField(journeyHash, 'unavailableMessage', '');
|
|
12640
|
+
returnObject.standardPremierFare.requiresReason = hasField(journeyHash, 'requiresReason', false);
|
|
12641
|
+
returnObject.standardPremierFare.requiresReasonMessage = hasField(journeyHash, 'requiresReasonMessage', '');
|
|
12642
|
+
case 'businessPremierFare':
|
|
12643
|
+
returnObject.businessPremierFare.companyPreferred =
|
|
12644
|
+
((_15 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _15 === void 0 ? void 0 : _15.companyPreferred) || ((_16 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _16 === void 0 ? void 0 : _16.companyPreferred) ||
|
|
12645
|
+
false;
|
|
12646
|
+
returnObject.businessPremierFare.companyPreferredMessage =
|
|
12647
|
+
((_17 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _17 === void 0 ? void 0 : _17.companyPreferredMessage) || ((_18 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _18 === void 0 ? void 0 : _18.companyPreferredMessage) ||
|
|
12648
|
+
'';
|
|
12649
|
+
returnObject.businessPremierFare.officePreferred =
|
|
12650
|
+
((_19 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _19 === void 0 ? void 0 : _19.officePreferred) || ((_20 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _20 === void 0 ? void 0 : _20.officePreferred) ||
|
|
12651
|
+
false;
|
|
12652
|
+
returnObject.businessPremierFare.officePreferredMessage =
|
|
12653
|
+
((_21 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _21 === void 0 ? void 0 : _21.officePreferredMessage) || ((_22 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _22 === void 0 ? void 0 : _22.officePreferredMessage) ||
|
|
12654
|
+
'';
|
|
12655
|
+
returnObject.businessPremierFare.tmcPreferred =
|
|
12656
|
+
((_23 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _23 === void 0 ? void 0 : _23.tmcPreferred) || ((_24 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _24 === void 0 ? void 0 : _24.tmcPreferred) ||
|
|
12657
|
+
false;
|
|
12658
|
+
returnObject.businessPremierFare.tmcPreferredMessage =
|
|
12659
|
+
((_25 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _25 === void 0 ? void 0 : _25.tmcPreferredMessage) || ((_26 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _26 === void 0 ? void 0 : _26.tmcPreferredMessage) ||
|
|
12660
|
+
'';
|
|
12661
|
+
returnObject.businessPremierFare.preferred =
|
|
12662
|
+
((_27 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _27 === void 0 ? void 0 : _27.companyPreferred) || ((_28 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _28 === void 0 ? void 0 : _28.companyPreferred) || ((_29 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _29 === void 0 ? void 0 : _29.officePreferred) || ((_30 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _30 === void 0 ? void 0 : _30.officePreferred) || ((_31 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _31 === void 0 ? void 0 : _31.tmcPreferred) || ((_32 = this._ruleActionSummary.whenSelectedAlone[journeyHash]) === null || _32 === void 0 ? void 0 : _32.tmcPreferred);
|
|
12663
|
+
returnObject.businessPremierFare.selected = returnObject.uid === ((_33 = this.selectedGroupFlight) === null || _33 === void 0 ? void 0 : _33.uid);
|
|
12664
|
+
returnObject.businessPremierFare.unavailable = hasField(journeyHash, 'unavailable', false);
|
|
12665
|
+
returnObject.businessPremierFare.unavailableMessage = hasField(journeyHash, 'unavailableMessage', '');
|
|
12666
|
+
returnObject.businessPremierFare.requiresReason = hasField(journeyHash, 'requiresReason', false);
|
|
12667
|
+
returnObject.businessPremierFare.requiresReasonMessage = hasField(journeyHash, 'requiresReasonMessage', '');
|
|
12668
|
+
}
|
|
12669
|
+
return returnObject;
|
|
12670
|
+
}
|
|
11893
12671
|
resetQuery(checkIsValid = true) {
|
|
11894
12672
|
this.updateTempParams(this.searchService.makeEurostarQuery());
|
|
11895
12673
|
if (checkIsValid) {
|
|
@@ -12316,10 +13094,118 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
12316
13094
|
}
|
|
12317
13095
|
}
|
|
12318
13096
|
updateFromPreviousSearches(previousItems) {
|
|
12319
|
-
var _a;
|
|
13097
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
12320
13098
|
const flightItem = (_a = previousItems[ServiceType.Flight]) === null || _a === void 0 ? void 0 : _a.searchQuery;
|
|
13099
|
+
const railItem = (_b = previousItems[ServiceType.Rail]) === null || _b === void 0 ? void 0 : _b.searchQuery;
|
|
13100
|
+
const irlItem = (_c = previousItems[ServiceType.InternationalRail]) === null || _c === void 0 ? void 0 : _c.searchQuery;
|
|
13101
|
+
const hotelItem = (_d = previousItems[ServiceType.Rail]) === null || _d === void 0 ? void 0 : _d.searchQuery;
|
|
13102
|
+
const carItem = (_e = previousItems[ServiceType.Car]) === null || _e === void 0 ? void 0 : _e.searchQuery;
|
|
13103
|
+
const loungeItem = (_f = previousItems[ServiceType.Lounge]) === null || _f === void 0 ? void 0 : _f.searchQuery;
|
|
13104
|
+
const parkingItem = (_g = previousItems[ServiceType.Parking]) === null || _g === void 0 ? void 0 : _g.searchQuery;
|
|
12321
13105
|
if (flightItem) {
|
|
12322
|
-
|
|
13106
|
+
try {
|
|
13107
|
+
this.outBoundDate = moment(previousItems.FLIGHT.outboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13108
|
+
if (this.outBoundDate.minutes() % 30)
|
|
13109
|
+
this.outBoundDate = this.outBoundDate.subtract(this.outBoundDate.minutes() % 30, "minutes");
|
|
13110
|
+
if (previousItems.FLIGHT.inboundDate) {
|
|
13111
|
+
this.inboundDate = moment(previousItems.FLIGHT.inboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13112
|
+
if (this.inboundDate.minutes() % 30)
|
|
13113
|
+
this.inboundDate = this.inboundDate.subtract(this.inboundDate.minutes() % 30, "minutes");
|
|
13114
|
+
}
|
|
13115
|
+
}
|
|
13116
|
+
catch (_h) {
|
|
13117
|
+
console.error('Error trying to prepopulate eurostar from flight item');
|
|
13118
|
+
}
|
|
13119
|
+
}
|
|
13120
|
+
else if (railItem) {
|
|
13121
|
+
try {
|
|
13122
|
+
this.outBoundDate = moment(previousItems.RAIL.outboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13123
|
+
if (this.outBoundDate.minutes() % 30)
|
|
13124
|
+
this.outBoundDate = this.outBoundDate.subtract(this.outBoundDate.minutes() % 30, "minutes");
|
|
13125
|
+
if (previousItems.RAIL.inboundDate) {
|
|
13126
|
+
this.inboundDate = moment(previousItems.RAIL.inboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13127
|
+
if (this.inboundDate.minutes() % 30)
|
|
13128
|
+
this.inboundDate = this.inboundDate.subtract(this.inboundDate.minutes() % 30, "minutes");
|
|
13129
|
+
}
|
|
13130
|
+
}
|
|
13131
|
+
catch (_j) {
|
|
13132
|
+
console.error('Error trying to prepopulate eurostar from rail item');
|
|
13133
|
+
}
|
|
13134
|
+
}
|
|
13135
|
+
else if (irlItem) {
|
|
13136
|
+
try {
|
|
13137
|
+
this.outBoundDate = moment(previousItems.INTERNATIONAL_RAIL.outboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13138
|
+
if (this.outBoundDate.minutes() % 30)
|
|
13139
|
+
this.outBoundDate = this.outBoundDate.subtract(this.outBoundDate.minutes() % 30, "minutes");
|
|
13140
|
+
if (previousItems.INTERNATIONAL_RAIL.inboundDate) {
|
|
13141
|
+
this.inboundDate = moment(previousItems.INTERNATIONAL_RAIL.inboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13142
|
+
if (this.inboundDate.minutes() % 30)
|
|
13143
|
+
this.inboundDate = this.inboundDate.subtract(this.inboundDate.minutes() % 30, "minutes");
|
|
13144
|
+
}
|
|
13145
|
+
}
|
|
13146
|
+
catch (_k) {
|
|
13147
|
+
console.error('Error trying to prepopulate eurostar from international rail item');
|
|
13148
|
+
}
|
|
13149
|
+
}
|
|
13150
|
+
else if (hotelItem) {
|
|
13151
|
+
try {
|
|
13152
|
+
this.outBoundDate = moment(previousItems.HOTEL.outboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13153
|
+
if (this.outBoundDate.minutes() % 30)
|
|
13154
|
+
this.outBoundDate = this.outBoundDate.subtract(this.outBoundDate.minutes() % 30, "minutes");
|
|
13155
|
+
if (previousItems.HOTEL.inboundDate) {
|
|
13156
|
+
this.inboundDate = moment(previousItems.HOTEL.inboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13157
|
+
if (this.inboundDate.minutes() % 30)
|
|
13158
|
+
this.inboundDate = this.inboundDate.subtract(this.inboundDate.minutes() % 30, "minutes");
|
|
13159
|
+
}
|
|
13160
|
+
}
|
|
13161
|
+
catch (_l) {
|
|
13162
|
+
console.error('Error trying to prepopulate eurostar from hotel item');
|
|
13163
|
+
}
|
|
13164
|
+
}
|
|
13165
|
+
else if (carItem) {
|
|
13166
|
+
try {
|
|
13167
|
+
this.outBoundDate = moment(previousItems.CAR.outboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13168
|
+
if (this.outBoundDate.minutes() % 30)
|
|
13169
|
+
this.outBoundDate = this.outBoundDate.subtract(this.outBoundDate.minutes() % 30, "minutes");
|
|
13170
|
+
if (previousItems.CAR.inboundDate) {
|
|
13171
|
+
this.inboundDate = moment(previousItems.CAR.inboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13172
|
+
if (this.inboundDate.minutes() % 30)
|
|
13173
|
+
this.inboundDate = this.inboundDate.subtract(this.inboundDate.minutes() % 30, "minutes");
|
|
13174
|
+
}
|
|
13175
|
+
}
|
|
13176
|
+
catch (_m) {
|
|
13177
|
+
console.error('Error trying to prepopulate eurostar from car item');
|
|
13178
|
+
}
|
|
13179
|
+
}
|
|
13180
|
+
else if (loungeItem) {
|
|
13181
|
+
try {
|
|
13182
|
+
this.outBoundDate = moment(previousItems.LOUNGE.outboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13183
|
+
if (this.outBoundDate.minutes() % 30)
|
|
13184
|
+
this.outBoundDate = this.outBoundDate.subtract(this.outBoundDate.minutes() % 30, "minutes");
|
|
13185
|
+
if (previousItems.LOUNGE.inboundDate) {
|
|
13186
|
+
this.inboundDate = moment(previousItems.LOUNGE.inboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13187
|
+
if (this.inboundDate.minutes() % 30)
|
|
13188
|
+
this.inboundDate = this.inboundDate.subtract(this.inboundDate.minutes() % 30, "minutes");
|
|
13189
|
+
}
|
|
13190
|
+
}
|
|
13191
|
+
catch (_o) {
|
|
13192
|
+
console.error('Error trying to prepopulate eurostar from lounge item');
|
|
13193
|
+
}
|
|
13194
|
+
}
|
|
13195
|
+
else if (parkingItem) {
|
|
13196
|
+
try {
|
|
13197
|
+
this.outBoundDate = moment(previousItems.PARKING.outboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13198
|
+
if (this.outBoundDate.minutes() % 30)
|
|
13199
|
+
this.outBoundDate = this.outBoundDate.subtract(this.outBoundDate.minutes() % 30, "minutes");
|
|
13200
|
+
if (previousItems.PARKING.inboundDate) {
|
|
13201
|
+
this.inboundDate = moment(previousItems.PARKING.inboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
13202
|
+
if (this.inboundDate.minutes() % 30)
|
|
13203
|
+
this.inboundDate = this.inboundDate.subtract(this.inboundDate.minutes() % 30, "minutes");
|
|
13204
|
+
}
|
|
13205
|
+
}
|
|
13206
|
+
catch (_p) {
|
|
13207
|
+
console.error('Error trying to prepopulate eurostar from parking item');
|
|
13208
|
+
}
|
|
12323
13209
|
}
|
|
12324
13210
|
}
|
|
12325
13211
|
getTotalBaggage(result) {
|
|
@@ -12481,7 +13367,7 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
12481
13367
|
outboundFlights: [this.makeSchemaFlights(fare.fare, 'outbound', 0)],
|
|
12482
13368
|
inboundFlights: [],
|
|
12483
13369
|
journeyType: 'single'
|
|
12484
|
-
}, selectedEurostar.dateDeparture, null, fare.price,
|
|
13370
|
+
}, selectedEurostar.dateDeparture, null, fare.price, fare.requiresReason);
|
|
12485
13371
|
return;
|
|
12486
13372
|
}
|
|
12487
13373
|
// return logic needs updating - either accept outbound or return and somehow distiguish them
|
|
@@ -12503,7 +13389,7 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
12503
13389
|
this.makeSchemaFlights(fare.fare, 'outbound', 0)
|
|
12504
13390
|
],
|
|
12505
13391
|
journeyType: 'roundtrip'
|
|
12506
|
-
}, selectedEurostar.dateDeparture, this.selectedGroupEurostar.item.dateArrival, price,
|
|
13392
|
+
}, selectedEurostar.dateDeparture, this.selectedGroupEurostar.item.dateArrival, price, fare.requiresReason);
|
|
12507
13393
|
this.resetSelectedFares();
|
|
12508
13394
|
this.basketService.toggleMenu();
|
|
12509
13395
|
this.results.next(this.fullResults.map(this.removeSelectedFlags));
|
|
@@ -12543,7 +13429,7 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
12543
13429
|
],
|
|
12544
13430
|
inboundFlights: [this.makeSchemaFlights(fare.fare, 'inbound', 0)],
|
|
12545
13431
|
journeyType: 'roundtrip'
|
|
12546
|
-
}, selectedEurostar.dateDeparture, this.selectedGroupEurostar.item.dateArrival, price,
|
|
13432
|
+
}, selectedEurostar.dateDeparture, this.selectedGroupEurostar.item.dateArrival, price, fare.requiresReason);
|
|
12547
13433
|
this.resetSelectedFares();
|
|
12548
13434
|
this.basketService.toggleMenu();
|
|
12549
13435
|
this.results.next(this.fullResults.map(this.removeSelectedFlags));
|
|
@@ -12567,11 +13453,44 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
12567
13453
|
const inbound = result.inbound.filter((item) => index === item.uid);
|
|
12568
13454
|
return { inbound, outbound: result.outbound };
|
|
12569
13455
|
}));
|
|
13456
|
+
this._updateTravelPolicies();
|
|
12570
13457
|
}
|
|
12571
13458
|
}
|
|
12572
13459
|
}
|
|
12573
13460
|
});
|
|
12574
13461
|
}
|
|
13462
|
+
_updateTravelPolicies() {
|
|
13463
|
+
if (!this.selectedGroupEurostar ||
|
|
13464
|
+
this._ruleActionSummary.dualSingleWhenSelected[this._selectedEurostarFare.item.journeyHash] ||
|
|
13465
|
+
!this.multi ||
|
|
13466
|
+
this.multi.length === 0) {
|
|
13467
|
+
return;
|
|
13468
|
+
}
|
|
13469
|
+
const multiInbounds = (this.multi || []).reduce((acc, item) => {
|
|
13470
|
+
if (item.order === 1 && item.results && item.results.length > 0) {
|
|
13471
|
+
acc = acc.concat(item.results);
|
|
13472
|
+
}
|
|
13473
|
+
return acc;
|
|
13474
|
+
}, []);
|
|
13475
|
+
if (multiInbounds.length > 0) {
|
|
13476
|
+
if (!this.rawResults) {
|
|
13477
|
+
this.rawResults = this.storageService.getSessionItem(this.resultsSessionName + '_raw');
|
|
13478
|
+
}
|
|
13479
|
+
console.log(this.rawResults);
|
|
13480
|
+
this.applyFlightRules
|
|
13481
|
+
.fetchOne({
|
|
13482
|
+
selectedOutboundFlight: this.selectedGroupFlight,
|
|
13483
|
+
availableInboundFlights: multiInbounds,
|
|
13484
|
+
searchId: this.rawResults.searchId
|
|
13485
|
+
})
|
|
13486
|
+
.pipe(take(1))
|
|
13487
|
+
.subscribe((rules) => {
|
|
13488
|
+
if (rules) {
|
|
13489
|
+
this._ruleActionSummary = this.helpers.mergeObjects(this._ruleActionSummary, rules);
|
|
13490
|
+
}
|
|
13491
|
+
});
|
|
13492
|
+
}
|
|
13493
|
+
}
|
|
12575
13494
|
resetSelectedFares() {
|
|
12576
13495
|
this.selectedGroupEurostar = {
|
|
12577
13496
|
direction: null,
|
|
@@ -12599,7 +13518,7 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
12599
13518
|
}
|
|
12600
13519
|
updateLowestPrice(results) {
|
|
12601
13520
|
if (!results.length || this.searchService.isFlightsGrouped())
|
|
12602
|
-
return;
|
|
13521
|
+
return; //
|
|
12603
13522
|
const result = results[0];
|
|
12604
13523
|
const journeys = result.journeys;
|
|
12605
13524
|
if (!journeys.length)
|
|
@@ -12613,6 +13532,7 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
12613
13532
|
}, { amount: Number.MAX_SAFE_INTEGER, currencyCode: currency });
|
|
12614
13533
|
}
|
|
12615
13534
|
doBooking(intBasket, selectedFlight, schemaDetails, outboundDate, inboundDate, price, requiresReason) {
|
|
13535
|
+
var _a, _b;
|
|
12616
13536
|
return __awaiter(this, void 0, void 0, function* () {
|
|
12617
13537
|
const { sourceId, co2PerItem, co2PerPassenger, total } = selectedFlight;
|
|
12618
13538
|
const booking = {
|
|
@@ -12626,7 +13546,9 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
12626
13546
|
price,
|
|
12627
13547
|
searchQuery: this.resultQuery,
|
|
12628
13548
|
service: sourceId.toString(),
|
|
12629
|
-
outboundDate
|
|
13549
|
+
outboundDate,
|
|
13550
|
+
lowestPrice: (_a = this.lowestPrice) === null || _a === void 0 ? void 0 : _a.amount,
|
|
13551
|
+
lowestPriceCurrency: (_b = this.lowestPrice) === null || _b === void 0 ? void 0 : _b.currencyCode
|
|
12630
13552
|
};
|
|
12631
13553
|
if (inboundDate) {
|
|
12632
13554
|
booking.inboundDate = inboundDate;
|
|
@@ -12638,6 +13560,36 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
12638
13560
|
return whatHappened;
|
|
12639
13561
|
});
|
|
12640
13562
|
}
|
|
13563
|
+
get lowestPrice() {
|
|
13564
|
+
if (this.cheapestPrice)
|
|
13565
|
+
return this.cheapestPrice;
|
|
13566
|
+
const outbound = this.fullResults[0].outbound;
|
|
13567
|
+
const currency = outbound[0].standardFare.currency;
|
|
13568
|
+
let cheapestOutbound;
|
|
13569
|
+
outbound.forEach(a => {
|
|
13570
|
+
if (!cheapestOutbound || a.standardFare.price < cheapestOutbound)
|
|
13571
|
+
cheapestOutbound = a.standardFare.price;
|
|
13572
|
+
if (a.standardPremierFare.price < cheapestOutbound)
|
|
13573
|
+
cheapestOutbound = a.standardPremierFare.price;
|
|
13574
|
+
if (a.businessPremierFare.price < cheapestOutbound)
|
|
13575
|
+
cheapestOutbound = a.businessPremierFare.price;
|
|
13576
|
+
});
|
|
13577
|
+
const inbound = this.fullResults[0].inbound;
|
|
13578
|
+
let cheapestinbound;
|
|
13579
|
+
if (inbound) {
|
|
13580
|
+
inbound.forEach(a => {
|
|
13581
|
+
if (!cheapestinbound || a.standardFare.price < cheapestinbound)
|
|
13582
|
+
cheapestinbound = a.standardFare.price;
|
|
13583
|
+
if (a.standardPremierFare.price < cheapestinbound)
|
|
13584
|
+
cheapestinbound = a.standardPremierFare.price;
|
|
13585
|
+
if (a.businessPremierFare.price < cheapestinbound)
|
|
13586
|
+
cheapestinbound = a.businessPremierFare.price;
|
|
13587
|
+
});
|
|
13588
|
+
}
|
|
13589
|
+
else
|
|
13590
|
+
cheapestinbound = 0;
|
|
13591
|
+
return { amount: cheapestOutbound + cheapestinbound, currencyCode: currency };
|
|
13592
|
+
}
|
|
12641
13593
|
makeSchemaFlights(selectedFlight, flightGroup, groupIndex, segmentIndex) {
|
|
12642
13594
|
return Object.assign(Object.assign({}, selectedFlight), { journeyInfo: {
|
|
12643
13595
|
flightGroup,
|
|
@@ -13007,7 +13959,7 @@ var RailJourneyFareType;
|
|
|
13007
13959
|
})(RailJourneyFareType || (RailJourneyFareType = {}));
|
|
13008
13960
|
class RailEnterpriseSearch extends BaseEnterpriseSearch {
|
|
13009
13961
|
constructor(Railfetcher, getRailStationFetcher, helpers, basketService, storageService, searchService, userService, modalService) {
|
|
13010
|
-
super(storageService, helpers, searchService);
|
|
13962
|
+
super(storageService, helpers, searchService, userService);
|
|
13011
13963
|
this.Railfetcher = Railfetcher;
|
|
13012
13964
|
this.getRailStationFetcher = getRailStationFetcher;
|
|
13013
13965
|
this.basketService = basketService;
|
|
@@ -13981,6 +14933,7 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
13981
14933
|
if (basket) {
|
|
13982
14934
|
const outboundLegs = this.getLegsFromRailJourneyOption(outbound);
|
|
13983
14935
|
const inboundLegs = this.getLegsFromRailJourneyOption(inbound);
|
|
14936
|
+
const lowestTicket = this.findCheapestTicket();
|
|
13984
14937
|
const basketItem = {
|
|
13985
14938
|
basket: basket.id,
|
|
13986
14939
|
service: serviceId,
|
|
@@ -14050,7 +15003,11 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
14050
15003
|
co2PerItem: outbound.co2PerItem,
|
|
14051
15004
|
co2PerPassenger: outbound.co2PerPassenger,
|
|
14052
15005
|
outboundDate: outbound.arriveDateTime,
|
|
14053
|
-
inboundDate: inbound.arriveDateTime
|
|
15006
|
+
inboundDate: inbound.arriveDateTime,
|
|
15007
|
+
lowestPrice: lowestTicket.amount != Number(outboundFare.price + inboundFare.price) || lowestTicket.currencyCode != outboundFare.currency ?
|
|
15008
|
+
lowestTicket.amount : null,
|
|
15009
|
+
lowestPriceCurrency: (lowestTicket.amount != Number(outboundFare.price + inboundFare.price) || lowestTicket.currencyCode != outboundFare.currency) ?
|
|
15010
|
+
lowestTicket.currencyCode : null
|
|
14054
15011
|
};
|
|
14055
15012
|
// if inTicketExtras or outTicketExtras exists add the object to basketItem
|
|
14056
15013
|
if (inTicketExtras) {
|
|
@@ -14069,7 +15026,49 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
14069
15026
|
});
|
|
14070
15027
|
}
|
|
14071
15028
|
findCheapestTicket() {
|
|
14072
|
-
|
|
15029
|
+
if (this.cheapestPrice)
|
|
15030
|
+
return this.cheapestPrice;
|
|
15031
|
+
let cheapestOutboundTicket;
|
|
15032
|
+
let cheapestOpenReturnTicket;
|
|
15033
|
+
this.fullResults[0].outbound.forEach(element => {
|
|
15034
|
+
Object.keys(element.dualSingleJourneyFares).forEach(key => {
|
|
15035
|
+
const cheapestOnJourney = element.dualSingleJourneyFares[key].filter(a => a != null).sort(a => a.price)[0];
|
|
15036
|
+
if (cheapestOnJourney && (!cheapestOutboundTicket || cheapestOutboundTicket.price > cheapestOnJourney.price))
|
|
15037
|
+
cheapestOutboundTicket = cheapestOnJourney;
|
|
15038
|
+
});
|
|
15039
|
+
Object.keys(element.returnJourneyFares).forEach(key => {
|
|
15040
|
+
const cheapestOnJourney = element.returnJourneyFares[key].filter(a => a != null).sort(a => a.price)[0];
|
|
15041
|
+
if (cheapestOnJourney && (!cheapestOpenReturnTicket || cheapestOpenReturnTicket.price > cheapestOnJourney.price))
|
|
15042
|
+
cheapestOpenReturnTicket = cheapestOnJourney;
|
|
15043
|
+
});
|
|
15044
|
+
});
|
|
15045
|
+
let cheapestReturnTicket;
|
|
15046
|
+
if (this.fullResults[0].return) {
|
|
15047
|
+
this.fullResults[0].return.forEach(element => {
|
|
15048
|
+
Object.keys(element.dualSingleJourneyFares).forEach(key => {
|
|
15049
|
+
const cheapestOnJourney = element.dualSingleJourneyFares[key].filter(a => a != null).sort(a => a.price)[0];
|
|
15050
|
+
if (cheapestOnJourney && (!cheapestReturnTicket || cheapestReturnTicket.price > cheapestOnJourney.price))
|
|
15051
|
+
cheapestReturnTicket = cheapestOnJourney;
|
|
15052
|
+
});
|
|
15053
|
+
Object.keys(element.returnJourneyFares).forEach(key => {
|
|
15054
|
+
const cheapestOnJourney = element.returnJourneyFares[key].filter(a => a != null).sort(a => a.price)[0];
|
|
15055
|
+
if (cheapestOnJourney && (!cheapestOpenReturnTicket || cheapestOpenReturnTicket.price > cheapestOnJourney.price))
|
|
15056
|
+
cheapestOpenReturnTicket = cheapestOnJourney;
|
|
15057
|
+
});
|
|
15058
|
+
});
|
|
15059
|
+
}
|
|
15060
|
+
if (cheapestOpenReturnTicket) {
|
|
15061
|
+
if (cheapestReturnTicket) {
|
|
15062
|
+
if (cheapestOutboundTicket.price + cheapestReturnTicket.price < cheapestOpenReturnTicket.price && cheapestOutboundTicket.currency == cheapestReturnTicket.currency)
|
|
15063
|
+
return { amount: cheapestOutboundTicket.price + cheapestReturnTicket.price, currencyCode: cheapestOutboundTicket.currency };
|
|
15064
|
+
}
|
|
15065
|
+
else if (cheapestOutboundTicket.price < cheapestOpenReturnTicket.price)
|
|
15066
|
+
return { amount: cheapestOutboundTicket.price, currencyCode: cheapestOutboundTicket.currency };
|
|
15067
|
+
return { amount: cheapestOpenReturnTicket.price, currencyCode: cheapestOpenReturnTicket.currency };
|
|
15068
|
+
}
|
|
15069
|
+
else if (cheapestReturnTicket)
|
|
15070
|
+
return { amount: cheapestOutboundTicket.price + cheapestReturnTicket.price, currencyCode: cheapestOutboundTicket.currency };
|
|
15071
|
+
return { amount: cheapestOutboundTicket.price, currencyCode: cheapestOutboundTicket.currency };
|
|
14073
15072
|
}
|
|
14074
15073
|
resetQuery() {
|
|
14075
15074
|
this.updateTempParams(this.searchService.makeRailQuery());
|
|
@@ -14299,7 +15298,24 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
14299
15298
|
return null;
|
|
14300
15299
|
}
|
|
14301
15300
|
}
|
|
14302
|
-
updateFromPreviousSearches(previousItems) {
|
|
15301
|
+
updateFromPreviousSearches(previousItems) {
|
|
15302
|
+
console.log(previousItems);
|
|
15303
|
+
if (previousItems.FLIGHT) {
|
|
15304
|
+
try {
|
|
15305
|
+
this.outBoundDateTime = moment(previousItems.FLIGHT.outboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
15306
|
+
if (this.outBoundDateTime.minutes() % 30)
|
|
15307
|
+
this.outBoundDateTime = this.outBoundDateTime.subtract(this.outBoundDateTime.minutes() % 30, "minutes");
|
|
15308
|
+
if (previousItems.FLIGHT.inboundDate) {
|
|
15309
|
+
this.inBoundDateTime = moment(previousItems.FLIGHT.inboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
15310
|
+
if (this.inBoundDateTime.minutes() % 30)
|
|
15311
|
+
this.inBoundDateTime = this.inBoundDateTime.subtract(this.inBoundDateTime.minutes() % 30, "minutes");
|
|
15312
|
+
}
|
|
15313
|
+
}
|
|
15314
|
+
catch (_a) {
|
|
15315
|
+
console.error('Error trying to prepopulate Rail from flight item');
|
|
15316
|
+
}
|
|
15317
|
+
}
|
|
15318
|
+
}
|
|
14303
15319
|
updateSearchFromExpiredBasketItem(basketItem) {
|
|
14304
15320
|
const searchRailQuery = basketItem.searchQuery;
|
|
14305
15321
|
this.chosenSearchType = searchRailQuery.journeyType;
|
|
@@ -14434,6 +15450,7 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
14434
15450
|
// };
|
|
14435
15451
|
// }
|
|
14436
15452
|
// );
|
|
15453
|
+
const lowestTicket = this.findCheapestTicket();
|
|
14437
15454
|
const basketItem = {
|
|
14438
15455
|
basket: basket.id,
|
|
14439
15456
|
service: serviceId.toString(),
|
|
@@ -14481,7 +15498,11 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
14481
15498
|
searchQuery: railQuery,
|
|
14482
15499
|
co2PerItem: railJourneyOption.co2PerItem,
|
|
14483
15500
|
co2PerPassenger: railJourneyOption.co2PerPassenger,
|
|
14484
|
-
outboundDate: railJourneyOption.departDateTime
|
|
15501
|
+
outboundDate: railJourneyOption.departDateTime,
|
|
15502
|
+
lowestPrice: lowestTicket.amount != Number(railFare.price) || lowestTicket.currencyCode != railFare.currency ?
|
|
15503
|
+
lowestTicket.amount : null,
|
|
15504
|
+
lowestPriceCurrency: (lowestTicket.amount != Number(railFare.price) || lowestTicket.currencyCode != railFare.currency) ?
|
|
15505
|
+
lowestTicket.currencyCode : null
|
|
14485
15506
|
};
|
|
14486
15507
|
// if ticketExtras exists add the object to basketItem
|
|
14487
15508
|
if (outTicketExtras) {
|
|
@@ -14514,6 +15535,7 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
14514
15535
|
if (basket) {
|
|
14515
15536
|
const outboundLegs = this.getLegsFromRailJourneyOption(outbound);
|
|
14516
15537
|
const inboundLegs = this.getLegsFromRailJourneyOption(inbound);
|
|
15538
|
+
const lowestTicket = this.findCheapestTicket();
|
|
14517
15539
|
const basketItem = {
|
|
14518
15540
|
basket: basket.id,
|
|
14519
15541
|
service: serviceId,
|
|
@@ -14581,7 +15603,11 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
14581
15603
|
co2PerItem: outbound.co2PerItem,
|
|
14582
15604
|
co2PerPassenger: outbound.co2PerPassenger,
|
|
14583
15605
|
outboundDate: outbound.arriveDateTime,
|
|
14584
|
-
inboundDate: inbound.arriveDateTime
|
|
15606
|
+
inboundDate: inbound.arriveDateTime,
|
|
15607
|
+
lowestPrice: lowestTicket.amount != Number(outboundFare.price) || lowestTicket.currencyCode != outboundFare.currency ?
|
|
15608
|
+
lowestTicket.amount : null,
|
|
15609
|
+
lowestPriceCurrency: (lowestTicket.amount != Number(outboundFare.price) || lowestTicket.currencyCode != outboundFare.currency) ?
|
|
15610
|
+
lowestTicket.currencyCode : null
|
|
14585
15611
|
};
|
|
14586
15612
|
// if ticketExtras exists add the object to basketItem
|
|
14587
15613
|
if (ticketExtras) {
|
|
@@ -14839,9 +15865,11 @@ class TravellerObject {
|
|
|
14839
15865
|
return !!item;
|
|
14840
15866
|
}
|
|
14841
15867
|
static fullname(traveller) {
|
|
14842
|
-
return [traveller.title, traveller.forename, traveller.surname]
|
|
15868
|
+
return [traveller.title, traveller.forename, traveller.surname]
|
|
15869
|
+
.filter(this.hasItem)
|
|
15870
|
+
.join(' ');
|
|
14843
15871
|
}
|
|
14844
|
-
static
|
|
15872
|
+
static makeTravellerObjectFromUserData(user) {
|
|
14845
15873
|
return {
|
|
14846
15874
|
id: user.user_id.toString(),
|
|
14847
15875
|
forename: user.forename,
|
|
@@ -14856,6 +15884,22 @@ class TravellerObject {
|
|
|
14856
15884
|
dob: user.dob
|
|
14857
15885
|
};
|
|
14858
15886
|
}
|
|
15887
|
+
static makeTravellerObjectFromUser(user) {
|
|
15888
|
+
return {
|
|
15889
|
+
id: user.id.toString(),
|
|
15890
|
+
forename: user.forename,
|
|
15891
|
+
surname: user.surname,
|
|
15892
|
+
email: user.email,
|
|
15893
|
+
username: user.username,
|
|
15894
|
+
title: user.title,
|
|
15895
|
+
isChild: false,
|
|
15896
|
+
isInfant: false,
|
|
15897
|
+
childDOB: null,
|
|
15898
|
+
guest: false,
|
|
15899
|
+
name: user.surname + ' ' + user.forename,
|
|
15900
|
+
dob: user.dob
|
|
15901
|
+
};
|
|
15902
|
+
}
|
|
14859
15903
|
static equals(first, second) {
|
|
14860
15904
|
return first.email === second.email;
|
|
14861
15905
|
}
|
|
@@ -14887,8 +15931,8 @@ var ClassType;
|
|
|
14887
15931
|
ClassType["First_Class"] = "1st Class";
|
|
14888
15932
|
})(ClassType || (ClassType = {}));
|
|
14889
15933
|
class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
14890
|
-
constructor(Irlfetcher, irlDiscountCardsFetcher, helpers, basketService, storageService, searchService, getIrlSupplierStationFetcher) {
|
|
14891
|
-
super(storageService, helpers, searchService);
|
|
15934
|
+
constructor(Irlfetcher, irlDiscountCardsFetcher, helpers, basketService, storageService, searchService, getIrlSupplierStationFetcher, userService) {
|
|
15935
|
+
super(storageService, helpers, searchService, userService);
|
|
14892
15936
|
this.Irlfetcher = Irlfetcher;
|
|
14893
15937
|
this.irlDiscountCardsFetcher = irlDiscountCardsFetcher;
|
|
14894
15938
|
this.basketService = basketService;
|
|
@@ -14956,6 +16000,7 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
14956
16000
|
this._ageRange = null;
|
|
14957
16001
|
this._priceDir = true;
|
|
14958
16002
|
this._dateDir = true;
|
|
16003
|
+
this._discountCard = [];
|
|
14959
16004
|
this._irlDiscountCardsArray = [];
|
|
14960
16005
|
// !date and time is handled differently for LU
|
|
14961
16006
|
this._outbound_date = null;
|
|
@@ -15023,23 +16068,26 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15023
16068
|
this._isValid();
|
|
15024
16069
|
}
|
|
15025
16070
|
get travellingTo() {
|
|
15026
|
-
return this.tempParams.
|
|
16071
|
+
return this.tempParams.travellingTo;
|
|
15027
16072
|
}
|
|
15028
16073
|
set travellingTo(tt) {
|
|
15029
16074
|
var _a;
|
|
15030
|
-
this.tempParams.
|
|
16075
|
+
this.tempParams.travellingTo = tt;
|
|
15031
16076
|
this._travellingTo = '';
|
|
15032
16077
|
if ((_a = tt === null || tt === void 0 ? void 0 : tt.railstation) === null || _a === void 0 ? void 0 : _a.id) {
|
|
15033
16078
|
this._travellingTo = tt.railstation.id;
|
|
15034
16079
|
}
|
|
16080
|
+
else if (tt === null || tt === void 0 ? void 0 : tt.id) {
|
|
16081
|
+
this._travellingTo = tt.id;
|
|
16082
|
+
}
|
|
15035
16083
|
this._isValid();
|
|
15036
16084
|
}
|
|
15037
16085
|
get travellingFrom() {
|
|
15038
|
-
return this.tempParams.
|
|
16086
|
+
return this.tempParams.travellingFrom;
|
|
15039
16087
|
}
|
|
15040
16088
|
set travellingFrom(tt) {
|
|
15041
16089
|
var _a;
|
|
15042
|
-
this.tempParams.
|
|
16090
|
+
this.tempParams.travellingFrom = tt;
|
|
15043
16091
|
this._travellingFrom = '';
|
|
15044
16092
|
if ((_a = tt === null || tt === void 0 ? void 0 : tt.railstation) === null || _a === void 0 ? void 0 : _a.id) {
|
|
15045
16093
|
this._travellingFrom = tt.railstation.id;
|
|
@@ -15048,6 +16096,9 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15048
16096
|
this.irlDiscountCardsArray = data;
|
|
15049
16097
|
});
|
|
15050
16098
|
}
|
|
16099
|
+
else if (tt === null || tt === void 0 ? void 0 : tt.id) {
|
|
16100
|
+
this._travellingFrom = tt.id;
|
|
16101
|
+
}
|
|
15051
16102
|
this._isValid();
|
|
15052
16103
|
}
|
|
15053
16104
|
get supplier() {
|
|
@@ -15086,12 +16137,14 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15086
16137
|
return this._departureLocationId;
|
|
15087
16138
|
}
|
|
15088
16139
|
set departureLocationId(data) {
|
|
16140
|
+
this.travellingFrom = data;
|
|
15089
16141
|
this._departureLocationId = data;
|
|
15090
16142
|
}
|
|
15091
16143
|
get arrivalLocationId() {
|
|
15092
16144
|
return this._arrivalLocationId;
|
|
15093
16145
|
}
|
|
15094
16146
|
set arrivalLocationId(data) {
|
|
16147
|
+
this.travellingTo = data;
|
|
15095
16148
|
this._arrivalLocationId = data;
|
|
15096
16149
|
}
|
|
15097
16150
|
get adults() {
|
|
@@ -15152,12 +16205,17 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15152
16205
|
this._isValid();
|
|
15153
16206
|
}
|
|
15154
16207
|
get discountCard() {
|
|
15155
|
-
return this.
|
|
16208
|
+
return this._discountCard;
|
|
15156
16209
|
}
|
|
15157
16210
|
set discountCard(data) {
|
|
15158
|
-
this.
|
|
16211
|
+
this._discountCard = data;
|
|
15159
16212
|
this._isValid();
|
|
15160
16213
|
}
|
|
16214
|
+
get discountCardsList() {
|
|
16215
|
+
var _a;
|
|
16216
|
+
return ((_a = this._discountCard) === null || _a === void 0 ? void 0 : _a.length) ? this._discountCard.map(card => card.id).join(',') : null;
|
|
16217
|
+
}
|
|
16218
|
+
;
|
|
15161
16219
|
get irlDiscountCardsArray() {
|
|
15162
16220
|
return this._irlDiscountCardsArray;
|
|
15163
16221
|
}
|
|
@@ -15296,8 +16354,21 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15296
16354
|
}
|
|
15297
16355
|
resetQuery() {
|
|
15298
16356
|
this.updateTempParams(this.searchService.makeIrlQuery());
|
|
16357
|
+
this.resetIrlForm();
|
|
15299
16358
|
this._isValid();
|
|
15300
16359
|
}
|
|
16360
|
+
resetIrlForm() {
|
|
16361
|
+
const time = this.helpers.momentRoundMinutes(moment(), 30);
|
|
16362
|
+
this.additionalInstructions = '';
|
|
16363
|
+
this.trainNumber = '';
|
|
16364
|
+
this.travellingTo = '';
|
|
16365
|
+
this.travellingFrom = '';
|
|
16366
|
+
this.discountCard = [];
|
|
16367
|
+
this.class = IrlClass.All;
|
|
16368
|
+
this.outboundDepartureDateTime = time;
|
|
16369
|
+
this.journeyType = IrlJourneyType.SingleJourney;
|
|
16370
|
+
this.offline = false;
|
|
16371
|
+
}
|
|
15301
16372
|
_isValid() {
|
|
15302
16373
|
var _a;
|
|
15303
16374
|
this.storageService.setSessionItem(IRLEnterpriseSearch.STORAGE_SESSION_PARAMS, {
|
|
@@ -15418,14 +16489,14 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15418
16489
|
const query = {
|
|
15419
16490
|
supplier: this.supplier,
|
|
15420
16491
|
countryCode: 'GB',
|
|
15421
|
-
irlDiscountCards: this.
|
|
16492
|
+
irlDiscountCards: this.discountCardsList,
|
|
15422
16493
|
class: this.class,
|
|
15423
|
-
outboundDepartureDateTime: this.tempParams.outboundDepartureDateTime,
|
|
16494
|
+
outboundDepartureDateTime: this.helpers.formatGraphQLDateTime(this.tempParams.outboundDepartureDateTime),
|
|
15424
16495
|
departureLocationId: this._travellingFrom,
|
|
15425
16496
|
arrivalLocationId: this._travellingTo,
|
|
15426
16497
|
adults: this.tempParams.adults,
|
|
15427
16498
|
children: this.tempParams.children,
|
|
15428
|
-
returnDepartureDateTime: this.tempParams.returnDepartureDateTime,
|
|
16499
|
+
returnDepartureDateTime: this.helpers.formatGraphQLDateTime(this.tempParams.returnDepartureDateTime),
|
|
15429
16500
|
journeyType: this.journeyType
|
|
15430
16501
|
};
|
|
15431
16502
|
if (this.tempParams.children === 0) {
|
|
@@ -15488,7 +16559,39 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15488
16559
|
});
|
|
15489
16560
|
}
|
|
15490
16561
|
}
|
|
15491
|
-
updateFromPreviousSearches(previousItems) {
|
|
16562
|
+
updateFromPreviousSearches(previousItems) {
|
|
16563
|
+
console.log(previousItems);
|
|
16564
|
+
if (previousItems.FLIGHT) {
|
|
16565
|
+
try {
|
|
16566
|
+
this.outBoundDateTime = moment(previousItems.FLIGHT.outboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
16567
|
+
if (this.outBoundDateTime.minutes() % 30)
|
|
16568
|
+
this.outBoundDateTime = this.outBoundDateTime.subtract(this.outBoundDateTime.minutes() % 30, "minutes");
|
|
16569
|
+
if (previousItems.FLIGHT.inboundDate) {
|
|
16570
|
+
this.inBoundDateTime = moment(previousItems.FLIGHT.inboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
16571
|
+
if (this.inBoundDateTime.minutes() % 30)
|
|
16572
|
+
this.inBoundDateTime = this.inBoundDateTime.subtract(this.inBoundDateTime.minutes() % 30, "minutes");
|
|
16573
|
+
}
|
|
16574
|
+
}
|
|
16575
|
+
catch (_a) {
|
|
16576
|
+
console.error('Error trying to prepopulate international rail from flight item');
|
|
16577
|
+
}
|
|
16578
|
+
}
|
|
16579
|
+
else if (previousItems.RAIL) {
|
|
16580
|
+
try {
|
|
16581
|
+
this.outBoundDateTime = moment(previousItems.RAIL.outboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
16582
|
+
if (this.outBoundDateTime.minutes() % 30)
|
|
16583
|
+
this.outBoundDateTime = this.outBoundDateTime.subtract(this.outBoundDateTime.minutes() % 30, "minutes");
|
|
16584
|
+
if (previousItems.RAIL.inboundDate) {
|
|
16585
|
+
this.inBoundDateTime = moment(previousItems.RAIL.inboundDate.replace("T", "").split(".")[0], "YYYY-MM-DDhh:mm:ss");
|
|
16586
|
+
if (this.inBoundDateTime.minutes() % 30)
|
|
16587
|
+
this.inBoundDateTime = this.inBoundDateTime.subtract(this.inBoundDateTime.minutes() % 30, "minutes");
|
|
16588
|
+
}
|
|
16589
|
+
}
|
|
16590
|
+
catch (_b) {
|
|
16591
|
+
console.error('Error trying to prepopulate international rail from rail item');
|
|
16592
|
+
}
|
|
16593
|
+
}
|
|
16594
|
+
}
|
|
15492
16595
|
updateCanCombine(tkt) {
|
|
15493
16596
|
(tkt.identifiers.allowedWith || []).forEach((allowed) => {
|
|
15494
16597
|
if (!this._canCombine[tkt.type][allowed.journeyIdentifier]) {
|
|
@@ -15535,6 +16638,7 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15535
16638
|
const legs = this.getLegsFromIrlJourneyOption(irlJourneyOption);
|
|
15536
16639
|
const termsAndConditions = this.getTermsAndCond(irlJourneyOption);
|
|
15537
16640
|
// selectedIrlTicketOption.identifiers.provider;
|
|
16641
|
+
const cheapestPrice = this.findCheapestTotal(this.fullResults);
|
|
15538
16642
|
const basketItem = {
|
|
15539
16643
|
basket: basket.id,
|
|
15540
16644
|
service: serviceId,
|
|
@@ -15563,7 +16667,8 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15563
16667
|
journeyIdentifier: selectedIrlTicketOption.identifiers.journeyIdentifier
|
|
15564
16668
|
},
|
|
15565
16669
|
supplier: irlJourneyOption.providers[0].providerId,
|
|
15566
|
-
termsAndCond: termsAndConditions
|
|
16670
|
+
termsAndCond: termsAndConditions,
|
|
16671
|
+
railcardsDetail: irlQuery.irlDiscountCards ? irlQuery.irlDiscountCards.split(',') : []
|
|
15567
16672
|
},
|
|
15568
16673
|
adults: irlQuery.adults,
|
|
15569
16674
|
price: selectedIrlTicketOption.price,
|
|
@@ -15571,7 +16676,9 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15571
16676
|
searchQuery: irlQuery,
|
|
15572
16677
|
// co2PerItem: irlJourneyOption.co2PerItem,
|
|
15573
16678
|
// co2PerPassenger: irlJourneyOption.co2PerPassenger,
|
|
15574
|
-
outboundDate: irlJourneyOption.departDateTime
|
|
16679
|
+
outboundDate: irlJourneyOption.departDateTime,
|
|
16680
|
+
lowestPrice: cheapestPrice.amount != selectedIrlTicketOption.price ? cheapestPrice.amount : null,
|
|
16681
|
+
lowestPriceCurrency: cheapestPrice.amount != selectedIrlTicketOption.price ? cheapestPrice.currencyCode : null
|
|
15575
16682
|
};
|
|
15576
16683
|
const whatHappened = yield this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, false // TODO
|
|
15577
16684
|
);
|
|
@@ -15593,9 +16700,12 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15593
16700
|
const basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
|
|
15594
16701
|
if (basket) {
|
|
15595
16702
|
const selectedIrlTicketOption = this.getSelectedIrlTicketOption(outJourneyOption, outbound, 0);
|
|
16703
|
+
const selectedIrlTicketOptionInbound = this.getSelectedIrlTicketOption(inJourneyOption, inbound, 0);
|
|
15596
16704
|
const outboundLegs = this.getLegsFromIrlJourneyOption(outJourneyOption);
|
|
15597
16705
|
const inboundLegs = this.getLegsFromIrlJourneyOption(inJourneyOption);
|
|
15598
16706
|
const termsAndConditions = this.getTermsAndCond(outJourneyOption);
|
|
16707
|
+
const cheapestPrice = this.findCheapestTotal(this.fullResults);
|
|
16708
|
+
const price = Number((Number(selectedIrlTicketOption.price) + Number(inbound.price)).toFixed(2));
|
|
15599
16709
|
const basketItem = {
|
|
15600
16710
|
basket: basket.id,
|
|
15601
16711
|
service: serviceId,
|
|
@@ -15638,14 +16748,23 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15638
16748
|
],
|
|
15639
16749
|
journeyIdentifier: selectedIrlTicketOption.identifiers.journeyIdentifier
|
|
15640
16750
|
},
|
|
16751
|
+
return: {
|
|
16752
|
+
fareIdentifiers: [
|
|
16753
|
+
selectedIrlTicketOptionInbound.identifiers.fareIdentifier
|
|
16754
|
+
],
|
|
16755
|
+
journeyIdentifier: selectedIrlTicketOptionInbound.identifiers.journeyIdentifier
|
|
16756
|
+
},
|
|
15641
16757
|
supplier: outJourneyOption.providers[0].providerId,
|
|
15642
|
-
termsAndCond: termsAndConditions
|
|
16758
|
+
termsAndCond: termsAndConditions,
|
|
16759
|
+
railcardsDetail: irlQuery.irlDiscountCards ? irlQuery.irlDiscountCards.split(',') : []
|
|
15643
16760
|
},
|
|
15644
16761
|
adults: irlQuery.adults,
|
|
15645
|
-
price:
|
|
16762
|
+
price: price,
|
|
15646
16763
|
currency: selectedIrlTicketOption.currency,
|
|
15647
16764
|
searchQuery: irlQuery,
|
|
15648
|
-
outboundDate: outJourneyOption.departDateTime
|
|
16765
|
+
outboundDate: outJourneyOption.departDateTime,
|
|
16766
|
+
lowestPrice: cheapestPrice.amount != price ? cheapestPrice.amount : null,
|
|
16767
|
+
lowestPriceCurrency: cheapestPrice.amount != price ? cheapestPrice.currencyCode : null
|
|
15649
16768
|
// co2PerItem: outbound.co2PerItem,
|
|
15650
16769
|
// co2PerPassenger: outbound.co2PerPassenger
|
|
15651
16770
|
};
|
|
@@ -15671,6 +16790,36 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
15671
16790
|
currencyCode: currency
|
|
15672
16791
|
};
|
|
15673
16792
|
}
|
|
16793
|
+
findCheapestTotal(results) {
|
|
16794
|
+
const cheapestOutbound = this.findCheapestTicket(results);
|
|
16795
|
+
const cheapestArr = [];
|
|
16796
|
+
results.map((result) => {
|
|
16797
|
+
result.outbound.map((out) => {
|
|
16798
|
+
out.providers.map((tkt) => {
|
|
16799
|
+
const cheapestTicket = tkt.cheapestTicket.price;
|
|
16800
|
+
tkt.ticketOptions.map((tktOption) => {
|
|
16801
|
+
var _a, _b;
|
|
16802
|
+
const tktPrice = tktOption.price;
|
|
16803
|
+
const tktClass = tktOption.class;
|
|
16804
|
+
if (tktClass === 'First' &&
|
|
16805
|
+
(((_a = this._cheapestFirst) === null || _a === void 0 ? void 0 : _a.price) > tktPrice || !this._cheapestFirst)) {
|
|
16806
|
+
this._cheapestFirst = tktOption;
|
|
16807
|
+
}
|
|
16808
|
+
else if (tktClass === 'Standard' &&
|
|
16809
|
+
(((_b = this._cheapestStandard) === null || _b === void 0 ? void 0 : _b.price) > tktPrice ||
|
|
16810
|
+
!this._cheapestStandard)) {
|
|
16811
|
+
this._cheapestStandard = tktOption;
|
|
16812
|
+
}
|
|
16813
|
+
if (tktPrice === cheapestTicket) {
|
|
16814
|
+
cheapestArr.push(cheapestTicket);
|
|
16815
|
+
}
|
|
16816
|
+
});
|
|
16817
|
+
});
|
|
16818
|
+
});
|
|
16819
|
+
});
|
|
16820
|
+
const cheapestInbound = Math.min(...cheapestArr);
|
|
16821
|
+
return { amount: cheapestOutbound + cheapestInbound, currencyCode: results[0].outbound[0].providers[0].ticketOptions[0].currency };
|
|
16822
|
+
}
|
|
15674
16823
|
findCheapestTicket(results) {
|
|
15675
16824
|
this._cheapestFirst = null;
|
|
15676
16825
|
this._cheapestStandard = null;
|
|
@@ -16259,6 +17408,14 @@ class SupplementaryBookingInfoImpl {
|
|
|
16259
17408
|
if ((_b = userValue.supplementaryInfo.passport.dateOfIssue) === null || _b === void 0 ? void 0 : _b.year) {
|
|
16260
17409
|
userValue.supplementaryInfo.passport.dateOfIssue = this.helpers.formatIsoDate(this.helpers.ngDateToMoment(userValue.supplementaryInfo.passport.dateOfIssue));
|
|
16261
17410
|
}
|
|
17411
|
+
if (!userValue.supplementaryInfo.passport.documentId && (!userValue.supplementaryInfo.passport.number ||
|
|
17412
|
+
!userValue.supplementaryInfo.passport.dateOfExpiry ||
|
|
17413
|
+
!userValue.supplementaryInfo.passport.dateOfIssue ||
|
|
17414
|
+
!userValue.supplementaryInfo.passport.codeOfIssuingState ||
|
|
17415
|
+
!userValue.supplementaryInfo.passport.gender ||
|
|
17416
|
+
!userValue.supplementaryInfo.passport.nationality)) {
|
|
17417
|
+
delete userValue.supplementaryInfo.passport;
|
|
17418
|
+
}
|
|
16262
17419
|
}
|
|
16263
17420
|
return userValue;
|
|
16264
17421
|
});
|
|
@@ -16283,6 +17440,14 @@ class SupplementaryBookingInfoImpl {
|
|
|
16283
17440
|
if ((_b = userValue.supplementaryInfo.passport.dateOfIssue) === null || _b === void 0 ? void 0 : _b.year) {
|
|
16284
17441
|
userValue.supplementaryInfo.passport.dateOfIssue = this.helpers.formatIsoDate(this.helpers.ngDateToMoment(userValue.supplementaryInfo.passport.dateOfIssue));
|
|
16285
17442
|
}
|
|
17443
|
+
if (!userValue.supplementaryInfo.passport.documentId && (!userValue.supplementaryInfo.passport.number ||
|
|
17444
|
+
!userValue.supplementaryInfo.passport.dateOfExpiry ||
|
|
17445
|
+
!userValue.supplementaryInfo.passport.dateOfIssue ||
|
|
17446
|
+
!userValue.supplementaryInfo.passport.codeOfIssuingState ||
|
|
17447
|
+
!userValue.supplementaryInfo.passport.gender ||
|
|
17448
|
+
!userValue.supplementaryInfo.passport.nationality)) {
|
|
17449
|
+
delete userValue.supplementaryInfo.passport;
|
|
17450
|
+
}
|
|
16286
17451
|
}
|
|
16287
17452
|
return userValue;
|
|
16288
17453
|
});
|
|
@@ -16444,8 +17609,8 @@ class BaseEurostarQuoteFetcher extends FetchableList {
|
|
|
16444
17609
|
super(gql, helpers, modalService);
|
|
16445
17610
|
}
|
|
16446
17611
|
getDataFromResult(results) {
|
|
16447
|
-
var _a, _b;
|
|
16448
|
-
return (_b = (_a = results === null || results === void 0 ? void 0 : results.data) === null || _a === void 0 ? void 0 : _a.searchEurostar) === null || _b === void 0 ? void 0 : _b.results;
|
|
17612
|
+
var _a, _b, _c, _d, _e, _f;
|
|
17613
|
+
return Object.assign(Object.assign({}, (_b = (_a = results === null || results === void 0 ? void 0 : results.data) === null || _a === void 0 ? void 0 : _a.searchEurostar) === null || _b === void 0 ? void 0 : _b.results), { ruleActionSummary: (_d = (_c = results === null || results === void 0 ? void 0 : results.data) === null || _c === void 0 ? void 0 : _c.searchEurostar) === null || _d === void 0 ? void 0 : _d.ruleActionSummary, searchId: (_f = (_e = results === null || results === void 0 ? void 0 : results.data) === null || _e === void 0 ? void 0 : _e.searchEurostar) === null || _f === void 0 ? void 0 : _f.searchId });
|
|
16449
17614
|
}
|
|
16450
17615
|
}
|
|
16451
17616
|
|
|
@@ -16472,8 +17637,8 @@ class BaseFlightQuoteFetcher extends FetchableList {
|
|
|
16472
17637
|
return super.fetchList(queryArgs);
|
|
16473
17638
|
}
|
|
16474
17639
|
getDataFromResult(results) {
|
|
16475
|
-
var _a, _b, _c, _d;
|
|
16476
|
-
return Object.assign(Object.assign({}, (_b = (_a = results === null || results === void 0 ? void 0 : results.data) === null || _a === void 0 ? void 0 : _a.searchFlightsV2) === null || _b === void 0 ? void 0 : _b.results), { ruleActionSummary: (_d = (_c = results === null || results === void 0 ? void 0 : results.data) === null || _c === void 0 ? void 0 : _c.searchFlightsV2) === null || _d === void 0 ? void 0 : _d.ruleActionSummary });
|
|
17640
|
+
var _a, _b, _c, _d, _e, _f;
|
|
17641
|
+
return Object.assign(Object.assign({}, (_b = (_a = results === null || results === void 0 ? void 0 : results.data) === null || _a === void 0 ? void 0 : _a.searchFlightsV2) === null || _b === void 0 ? void 0 : _b.results), { ruleActionSummary: (_d = (_c = results === null || results === void 0 ? void 0 : results.data) === null || _c === void 0 ? void 0 : _c.searchFlightsV2) === null || _d === void 0 ? void 0 : _d.ruleActionSummary, searchId: (_f = (_e = results === null || results === void 0 ? void 0 : results.data) === null || _e === void 0 ? void 0 : _e.searchFlightsV2) === null || _f === void 0 ? void 0 : _f.searchId });
|
|
16477
17642
|
}
|
|
16478
17643
|
}
|
|
16479
17644
|
|
|
@@ -16947,6 +18112,25 @@ class BaseGetUserGuestsFetcher extends FetchableList {
|
|
|
16947
18112
|
}
|
|
16948
18113
|
}
|
|
16949
18114
|
|
|
18115
|
+
class BaseGetOfficeFetcher extends FetchableList {
|
|
18116
|
+
constructor(queryGQL, helpers, modalService) {
|
|
18117
|
+
super(queryGQL, helpers, modalService);
|
|
18118
|
+
}
|
|
18119
|
+
getDataFromResult(results) {
|
|
18120
|
+
var _a;
|
|
18121
|
+
return (_a = results.data) === null || _a === void 0 ? void 0 : _a.getOffice;
|
|
18122
|
+
}
|
|
18123
|
+
}
|
|
18124
|
+
|
|
18125
|
+
class BaseGetUserDefaultMIValueFetcher extends FetchableObject {
|
|
18126
|
+
constructor(query, helpers, modalService) {
|
|
18127
|
+
super(query, modalService, helpers);
|
|
18128
|
+
}
|
|
18129
|
+
getDataFromResult(results) {
|
|
18130
|
+
return results.data.getUserDefaultMIValue;
|
|
18131
|
+
}
|
|
18132
|
+
}
|
|
18133
|
+
|
|
16950
18134
|
// | 'fareTypes';
|
|
16951
18135
|
|
|
16952
18136
|
;
|
|
@@ -17128,7 +18312,7 @@ class InternalBasket {
|
|
|
17128
18312
|
}
|
|
17129
18313
|
this.id = basket.id;
|
|
17130
18314
|
this.title = basket.title;
|
|
17131
|
-
const toSend = Object.assign(Object.assign({}, basket), (basket.basketItems || []).reduce((accum, item
|
|
18315
|
+
const toSend = Object.assign(Object.assign({}, basket), (basket.basketItems || []).reduce((accum, item) => {
|
|
17132
18316
|
var _a, _b, _c;
|
|
17133
18317
|
if (!accum.prices[item.currency]) {
|
|
17134
18318
|
accum.prices[item.currency] = 0;
|
|
@@ -17162,7 +18346,7 @@ class InternalBasket {
|
|
|
17162
18346
|
}
|
|
17163
18347
|
}
|
|
17164
18348
|
class BaseEnterpriseBasketService {
|
|
17165
|
-
constructor(acceptNewPriceUpdater, addItemToBasketUpdater, addUserToBasketItem, basketCreator, basketFetcher, bookBasketUpdater, deleteBasketUpdater, getMiAutoSugestionFetcher, helpers, removeItemFromBasketUpdater, revalidateBasketUpdater, setBasketItemMiGroupUpdater, setBasketItemMiValueUpdater, validateMiFreeValue, sendBasketForApprovalUpdater, getUserFetcher, getUserBasketsFetcher, SetBasketItemLeadPassenger, moveItemToADifferentBasket, updateBasketNotesUpdater, updateBasketTitleUpdater, setPaymentMethodUpdater, getCancellationInfoFetcher, userService, modalService
|
|
18349
|
+
constructor(acceptNewPriceUpdater, addItemToBasketUpdater, addUserToBasketItem, basketCreator, basketFetcher, bookBasketUpdater, deleteBasketUpdater, getMiAutoSugestionFetcher, getUserDefaultMIValueFetcher, helpers, removeItemFromBasketUpdater, revalidateBasketUpdater, setBasketItemMiGroupUpdater, setBasketItemMiValueUpdater, validateMiFreeValue, sendBasketForApprovalUpdater, getUserFetcher, getUserBasketsFetcher, SetBasketItemLeadPassenger, moveItemToADifferentBasket, updateBasketNotesUpdater, updateBasketTitleUpdater, setPaymentMethodUpdater, getCancellationInfoFetcher, userService, modalService) {
|
|
17166
18350
|
this.acceptNewPriceUpdater = acceptNewPriceUpdater;
|
|
17167
18351
|
this.addItemToBasketUpdater = addItemToBasketUpdater;
|
|
17168
18352
|
this.addUserToBasketItem = addUserToBasketItem;
|
|
@@ -17171,6 +18355,7 @@ class BaseEnterpriseBasketService {
|
|
|
17171
18355
|
this.bookBasketUpdater = bookBasketUpdater;
|
|
17172
18356
|
this.deleteBasketUpdater = deleteBasketUpdater;
|
|
17173
18357
|
this.getMiAutoSugestionFetcher = getMiAutoSugestionFetcher;
|
|
18358
|
+
this.getUserDefaultMIValueFetcher = getUserDefaultMIValueFetcher;
|
|
17174
18359
|
this.helpers = helpers;
|
|
17175
18360
|
this.removeItemFromBasketUpdater = removeItemFromBasketUpdater;
|
|
17176
18361
|
this.revalidateBasketUpdater = revalidateBasketUpdater;
|
|
@@ -17188,7 +18373,6 @@ class BaseEnterpriseBasketService {
|
|
|
17188
18373
|
this.getCancellationInfoFetcher = getCancellationInfoFetcher;
|
|
17189
18374
|
this.userService = userService;
|
|
17190
18375
|
this.modalService = modalService;
|
|
17191
|
-
this.webTokenService = webTokenService;
|
|
17192
18376
|
this.currentBaskets = [];
|
|
17193
18377
|
this.highlightBasketItemsEmitter = new Subject();
|
|
17194
18378
|
this.basketChangeEmitter = new BehaviorSubject('');
|
|
@@ -17257,7 +18441,7 @@ class BaseEnterpriseBasketService {
|
|
|
17257
18441
|
this.menuState = MenuSlideEnum.OUT;
|
|
17258
18442
|
this.requiresService = new BaseRequiresReasonService(modalService, this);
|
|
17259
18443
|
this.userService.changeUser.subscribe({
|
|
17260
|
-
next: (
|
|
18444
|
+
next: () => {
|
|
17261
18445
|
this.reset();
|
|
17262
18446
|
}
|
|
17263
18447
|
});
|
|
@@ -17333,7 +18517,7 @@ class BaseEnterpriseBasketService {
|
|
|
17333
18517
|
}
|
|
17334
18518
|
addToBasket(item, intBasket, searchService, travellers = [], requiresReason) {
|
|
17335
18519
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17336
|
-
switch (yield this.checkBasketForInvoked(intBasket, this.
|
|
18520
|
+
switch (yield this.checkBasketForInvoked(intBasket, this.userService.bobo)) {
|
|
17337
18521
|
case DifferentInvokdedUserReasons.continue:
|
|
17338
18522
|
break;
|
|
17339
18523
|
case DifferentInvokdedUserReasons.cancel:
|
|
@@ -17343,7 +18527,7 @@ class BaseEnterpriseBasketService {
|
|
|
17343
18527
|
this.currentBasketID = intBasket.id;
|
|
17344
18528
|
break;
|
|
17345
18529
|
case DifferentInvokdedUserReasons.research:
|
|
17346
|
-
this.
|
|
18530
|
+
this.userService.setBobo(TravellerObject.makeTravellerObjectFromUser(intBasket.subject.value.invokedUser));
|
|
17347
18531
|
return DifferentInvokdedUserReasons.research;
|
|
17348
18532
|
}
|
|
17349
18533
|
item.basket = intBasket.id;
|
|
@@ -17364,6 +18548,21 @@ class BaseEnterpriseBasketService {
|
|
|
17364
18548
|
: item.inboundDate;
|
|
17365
18549
|
item.requiresReason = requiresReason;
|
|
17366
18550
|
item = this.checkDetails(item);
|
|
18551
|
+
const service = this.userService.findService(item.service).type;
|
|
18552
|
+
// let cheapestPrice: number
|
|
18553
|
+
// if (searchService.searches[service].cheapestPrice) cheapestPrice = searchService.searches[service].cheapestPrice.amount
|
|
18554
|
+
// else if (service == ServiceType.Flight) {
|
|
18555
|
+
// const cheapestPriceObject = searchService.searches[service].cheapestPriceObject
|
|
18556
|
+
// cheapestPrice = cheapestPriceObject.dualInbound.amount + cheapestPriceObject.dualOutbound.amount < cheapestPriceObject.returns.amount
|
|
18557
|
+
// ? cheapestPriceObject.dualInbound.amount + cheapestPriceObject.dualOutbound.amount : cheapestPriceObject.returns.amount
|
|
18558
|
+
// }
|
|
18559
|
+
// else if (service == ServiceType.Rail) {
|
|
18560
|
+
// searchService.searches[service].cheapest.subscribe(a =>{
|
|
18561
|
+
// console.log(a)
|
|
18562
|
+
// })
|
|
18563
|
+
// // cheapestPrice = cheapestPriceObject.dualInbound.amount + cheapestPriceObject.dualOutbound.amount < cheapestPriceObject.returns.amount
|
|
18564
|
+
// // ? cheapestPriceObject.dualInbound.amount + cheapestPriceObject.dualOutbound.amount : cheapestPriceObject.returns.amount
|
|
18565
|
+
// }
|
|
17367
18566
|
this.removeBookedBasket();
|
|
17368
18567
|
if (item && intBasket) {
|
|
17369
18568
|
this.addItemToBasketUpdater
|
|
@@ -17371,7 +18570,6 @@ class BaseEnterpriseBasketService {
|
|
|
17371
18570
|
.pipe(take(1))
|
|
17372
18571
|
.subscribe((newBasket) => {
|
|
17373
18572
|
intBasket.next(Object.assign(Object.assign({}, intBasket.subject.value), newBasket));
|
|
17374
|
-
const service = this.userService.findService(item.service).type;
|
|
17375
18573
|
searchService.search_objects[service].booking_chosen = true;
|
|
17376
18574
|
searchService.search_objects[service].chosen = false;
|
|
17377
18575
|
const bi = newBasket.basketItems;
|
|
@@ -17471,7 +18669,6 @@ class BaseEnterpriseBasketService {
|
|
|
17471
18669
|
}
|
|
17472
18670
|
getDefaultBasket(getBookedBasket = false) {
|
|
17473
18671
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17474
|
-
const internalBasket = null;
|
|
17475
18672
|
// console.log(this.currentBasketID);
|
|
17476
18673
|
return yield this.findOrCreateBasket(this.currentBasketID, getBookedBasket).then((data) => {
|
|
17477
18674
|
return data;
|
|
@@ -17539,7 +18736,7 @@ class BaseEnterpriseBasketService {
|
|
|
17539
18736
|
}
|
|
17540
18737
|
createBasketOnDB(intBasket) {
|
|
17541
18738
|
var _a, _b;
|
|
17542
|
-
const mutation = ((_a = this.
|
|
18739
|
+
const mutation = ((_a = this.userService.bobo) === null || _a === void 0 ? void 0 : _a.id) ? { invokedUser: (_b = this.userService.bobo) === null || _b === void 0 ? void 0 : _b.id }
|
|
17543
18740
|
: {};
|
|
17544
18741
|
return new Promise((resolve, reject) => {
|
|
17545
18742
|
this.basketCreator
|
|
@@ -17588,13 +18785,13 @@ class BaseEnterpriseBasketService {
|
|
|
17588
18785
|
}
|
|
17589
18786
|
return !isNaN(Date.parse(dateTimeString)); // any test that returns true/false
|
|
17590
18787
|
});
|
|
17591
|
-
ajv.addFormat('railSeating', (
|
|
18788
|
+
ajv.addFormat('railSeating', () => {
|
|
17592
18789
|
return true;
|
|
17593
18790
|
});
|
|
17594
|
-
ajv.addFormat('passport', (
|
|
18791
|
+
ajv.addFormat('passport', () => {
|
|
17595
18792
|
return true;
|
|
17596
18793
|
});
|
|
17597
|
-
ajv.addFormat('specialRequest', (
|
|
18794
|
+
ajv.addFormat('specialRequest', () => {
|
|
17598
18795
|
return true;
|
|
17599
18796
|
});
|
|
17600
18797
|
const validateDetailSchema = ajv.compile(serviceToCheck.detailSchema);
|
|
@@ -17792,14 +18989,23 @@ class BaseEnterpriseBasketService {
|
|
|
17792
18989
|
}
|
|
17793
18990
|
return this.updateBasket(basketid, this.setBasketItemMiValueUpdater.updateOne(args));
|
|
17794
18991
|
}
|
|
17795
|
-
getMiAutoSugestions(miId,
|
|
18992
|
+
getMiAutoSugestions(miId, term, isLoading) {
|
|
17796
18993
|
isLoading === null || isLoading === void 0 ? void 0 : isLoading.next(true);
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
|
|
18994
|
+
const getMiAutoByValue = this.getMiAutoSugestionFetcher.fetchList({ mi: miId, partialValue: term });
|
|
18995
|
+
const getMiAutoByLabel = this.getMiAutoSugestionFetcher.fetchList({ mi: miId, partialLabel: term });
|
|
18996
|
+
return forkJoin([getMiAutoByValue, getMiAutoByLabel]).pipe(map(([miByValue, miByLabel]) => {
|
|
18997
|
+
let miByValueLabel = [...miByValue, ...miByLabel];
|
|
18998
|
+
miByValueLabel = miByValueLabel.filter((miItem, index) => miByValueLabel.findIndex(item => item.id == miItem.id) === index);
|
|
18999
|
+
console.log(miByValueLabel);
|
|
17800
19000
|
isLoading === null || isLoading === void 0 ? void 0 : isLoading.next(false);
|
|
19001
|
+
return miByValueLabel;
|
|
17801
19002
|
}));
|
|
17802
19003
|
}
|
|
19004
|
+
getUserDefaultMIValue(mi, user, isLoading) {
|
|
19005
|
+
isLoading === null || isLoading === void 0 ? void 0 : isLoading.next(true);
|
|
19006
|
+
return this.getUserDefaultMIValueFetcher
|
|
19007
|
+
.fetchOne({ mi: mi, user: user }).pipe(take(1));
|
|
19008
|
+
}
|
|
17803
19009
|
saveMiData(basketId, bmiArray) {
|
|
17804
19010
|
bmiArray.forEach((bmi) => {
|
|
17805
19011
|
bmi.miPerItem.forEach((item) => {
|
|
@@ -18128,7 +19334,7 @@ class AbstractHttpCallService {
|
|
|
18128
19334
|
const USER_SIGNEDOUT = 'USER_SIGNEDOUT';
|
|
18129
19335
|
const USER_SIGNEDIN = 'USER_SIGNEDIN';
|
|
18130
19336
|
class BaseUserService {
|
|
18131
|
-
constructor(getUserFetcher, userUiConfigsFetcher, userProductsFetcher, userMessagesFetcher, baseConfirmMessagesUpdater, getCompaniesFetcher, getCompanyFetcher, setUserLanguageUpdater, editUserUpdater, createGuestUpdater, getUserGuestsFetcher, storageService, helpers) {
|
|
19337
|
+
constructor(getUserFetcher, userUiConfigsFetcher, userProductsFetcher, userMessagesFetcher, baseConfirmMessagesUpdater, getCompaniesFetcher, getCompanyFetcher, setUserLanguageUpdater, editUserUpdater, createGuestUpdater, getUserGuestsFetcher, getOfficeFetcher, storageService, helpers, webTokenService) {
|
|
18132
19338
|
this.getUserFetcher = getUserFetcher;
|
|
18133
19339
|
this.userUiConfigsFetcher = userUiConfigsFetcher;
|
|
18134
19340
|
this.userProductsFetcher = userProductsFetcher;
|
|
@@ -18140,8 +19346,10 @@ class BaseUserService {
|
|
|
18140
19346
|
this.editUserUpdater = editUserUpdater;
|
|
18141
19347
|
this.createGuestUpdater = createGuestUpdater;
|
|
18142
19348
|
this.getUserGuestsFetcher = getUserGuestsFetcher;
|
|
19349
|
+
this.getOfficeFetcher = getOfficeFetcher;
|
|
18143
19350
|
this.storageService = storageService;
|
|
18144
19351
|
this.helpers = helpers;
|
|
19352
|
+
this.webTokenService = webTokenService;
|
|
18145
19353
|
this.fullUserDetails = {
|
|
18146
19354
|
bookingAllowedFor: '',
|
|
18147
19355
|
messages: new BehaviorSubject(null),
|
|
@@ -18152,6 +19360,35 @@ class BaseUserService {
|
|
|
18152
19360
|
allDetails: new BehaviorSubject(null)
|
|
18153
19361
|
};
|
|
18154
19362
|
this.changeUser = new BehaviorSubject(null);
|
|
19363
|
+
this._bobo = null;
|
|
19364
|
+
this.invokedUserUpdater = webTokenService.getInvokedUserObservable();
|
|
19365
|
+
}
|
|
19366
|
+
setBobo(value) {
|
|
19367
|
+
var _a;
|
|
19368
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19369
|
+
if (!value || value.id) {
|
|
19370
|
+
if (value === this._bobo || ((value === null || value === void 0 ? void 0 : value.id) && (value === null || value === void 0 ? void 0 : value.id) === ((_a = this._bobo) === null || _a === void 0 ? void 0 : _a.id))) {
|
|
19371
|
+
return true;
|
|
19372
|
+
}
|
|
19373
|
+
this._bobo = value;
|
|
19374
|
+
this.invokedUserUpdater.next(value || null);
|
|
19375
|
+
return this.updateServices();
|
|
19376
|
+
}
|
|
19377
|
+
return false;
|
|
19378
|
+
});
|
|
19379
|
+
}
|
|
19380
|
+
get bobo() {
|
|
19381
|
+
return this._bobo;
|
|
19382
|
+
}
|
|
19383
|
+
updateServices() {
|
|
19384
|
+
return new Promise((resolve, reject) => {
|
|
19385
|
+
this.userProductsFetcher.fetchKeyedObjectArray('type').subscribe((result2) => {
|
|
19386
|
+
this.fullUserDetails.userServices.next(result2);
|
|
19387
|
+
this.checkEmitUser();
|
|
19388
|
+
}, (err) => {
|
|
19389
|
+
resolve(false);
|
|
19390
|
+
}, () => resolve(true));
|
|
19391
|
+
});
|
|
18155
19392
|
}
|
|
18156
19393
|
setUser(user_data) {
|
|
18157
19394
|
const userdata = this.fullUserDetails.userData.value;
|
|
@@ -18185,7 +19422,7 @@ class BaseUserService {
|
|
|
18185
19422
|
}, (error) => {
|
|
18186
19423
|
console.error(error);
|
|
18187
19424
|
});
|
|
18188
|
-
this.fullUserDetails.travllerObject.next(TravellerObject.
|
|
19425
|
+
this.fullUserDetails.travllerObject.next(TravellerObject.makeTravellerObjectFromUserData(user_data));
|
|
18189
19426
|
}
|
|
18190
19427
|
if (user_data === null || user_data === void 0 ? void 0 : user_data.user_id) {
|
|
18191
19428
|
this.getUserFetcher
|
|
@@ -18366,6 +19603,12 @@ class BaseUserService {
|
|
|
18366
19603
|
userIsCompanyAdmin() {
|
|
18367
19604
|
return this.fullUserDetails.userData.value.company_admin;
|
|
18368
19605
|
}
|
|
19606
|
+
userIsTmcAdmin() {
|
|
19607
|
+
return this.fullUserDetails.userData.value.tmc_admin;
|
|
19608
|
+
}
|
|
19609
|
+
userTmcId() {
|
|
19610
|
+
return this.fullUserDetails.userData.value.tmc_id;
|
|
19611
|
+
}
|
|
18369
19612
|
isSelfBook() {
|
|
18370
19613
|
return (this.fullUserDetails.userData.value.booker_type === BookerType.SelfBook);
|
|
18371
19614
|
}
|
|
@@ -18411,6 +19654,9 @@ class BaseUserService {
|
|
|
18411
19654
|
getCompanyById(id, withUsers = false) {
|
|
18412
19655
|
return this.getCompanyFetcher.fetchOne({ id }).pipe(take(1));
|
|
18413
19656
|
}
|
|
19657
|
+
getUserCompany() {
|
|
19658
|
+
return this.getCompanyById(this.fullUserDetails.userData.value.company_id.toString());
|
|
19659
|
+
}
|
|
18414
19660
|
getUser(userId) {
|
|
18415
19661
|
const user = this.getfullUserDetails();
|
|
18416
19662
|
return this.getUserFetcher.fetchOne({
|
|
@@ -18441,10 +19687,13 @@ class BaseUserService {
|
|
|
18441
19687
|
canInvokeUser() {
|
|
18442
19688
|
return this.fullUserDetails.allDetails.value.canInvokeUser;
|
|
18443
19689
|
}
|
|
19690
|
+
getOffice() {
|
|
19691
|
+
return this.getOfficeFetcher.fetchList();
|
|
19692
|
+
}
|
|
18444
19693
|
}
|
|
18445
19694
|
|
|
18446
19695
|
class BaseLogonService {
|
|
18447
|
-
constructor(userService, modalService, http, router, eventMessenager, storageService, environment,
|
|
19696
|
+
constructor(userService, modalService, http, router, eventMessenager, storageService, environment, searchService) {
|
|
18448
19697
|
this.userService = userService;
|
|
18449
19698
|
this.modalService = modalService;
|
|
18450
19699
|
this.http = http;
|
|
@@ -18452,7 +19701,7 @@ class BaseLogonService {
|
|
|
18452
19701
|
this.eventMessenager = eventMessenager;
|
|
18453
19702
|
this.storageService = storageService;
|
|
18454
19703
|
this.environment = environment;
|
|
18455
|
-
this.
|
|
19704
|
+
this.searchService = searchService;
|
|
18456
19705
|
this.loading = false;
|
|
18457
19706
|
this.isLoggedIn = false;
|
|
18458
19707
|
this.redirectUrl = '';
|
|
@@ -18522,6 +19771,7 @@ class BaseLogonService {
|
|
|
18522
19771
|
becomeUser(username) {
|
|
18523
19772
|
return new Promise((resolve, reject) => {
|
|
18524
19773
|
this.clearRefresh();
|
|
19774
|
+
this.storageService.clearSessionData();
|
|
18525
19775
|
this.http
|
|
18526
19776
|
.post(URLS.BECOME_USER, { username })
|
|
18527
19777
|
.pipe(take(1))
|
|
@@ -18538,6 +19788,7 @@ class BaseLogonService {
|
|
|
18538
19788
|
endBecomeUserSession() {
|
|
18539
19789
|
return new Promise((resolve, reject) => {
|
|
18540
19790
|
this.clearRefresh();
|
|
19791
|
+
this.storageService.clearSessionData();
|
|
18541
19792
|
this.http
|
|
18542
19793
|
.post(URLS.END_BECOME_USER, {})
|
|
18543
19794
|
.pipe(take(1))
|
|
@@ -18554,13 +19805,13 @@ class BaseLogonService {
|
|
|
18554
19805
|
this.userService.emptyUserData();
|
|
18555
19806
|
this.storageService.clearSessionData();
|
|
18556
19807
|
this.clearRefresh();
|
|
19808
|
+
this.userService.setBobo(null);
|
|
18557
19809
|
return this.http
|
|
18558
19810
|
.formEncodedPostNoErrorHandling(URLS.AccessToken, {
|
|
18559
19811
|
username,
|
|
18560
19812
|
password
|
|
18561
19813
|
})
|
|
18562
19814
|
.pipe(take(1), map((value, index) => {
|
|
18563
|
-
this.webTokenService.bobo = null;
|
|
18564
19815
|
this.setRefresh();
|
|
18565
19816
|
return this.handleResponse(value);
|
|
18566
19817
|
}));
|
|
@@ -18590,7 +19841,8 @@ class BaseLogonService {
|
|
|
18590
19841
|
const isSSO = this.userService.isUserFavoriteSet(UserFavorurite.SSO_no_password);
|
|
18591
19842
|
this.clearRefresh();
|
|
18592
19843
|
this.isLoggedIn = false;
|
|
18593
|
-
this.
|
|
19844
|
+
this.userService.setBobo(null);
|
|
19845
|
+
this.searchService.removeAllTravellers();
|
|
18594
19846
|
this.userService.emptyUserData();
|
|
18595
19847
|
this.storageService.clearSessionData();
|
|
18596
19848
|
this.http.post(URLS.LOGOUT_URL).subscribe((data) => {
|
|
@@ -18693,7 +19945,8 @@ class BaseEnterpriseMyBookingsService {
|
|
|
18693
19945
|
[ServiceType.Lounge]: 'ico-material ico-lounge',
|
|
18694
19946
|
[ServiceType.Parking]: 'ico-material ico-parking',
|
|
18695
19947
|
[ServiceType.Rail]: 'ico-rail',
|
|
18696
|
-
[ServiceType.Eurostar]: 'ico-rail'
|
|
19948
|
+
[ServiceType.Eurostar]: 'ico-rail',
|
|
19949
|
+
[ServiceType.Ferry]: 'ico-rail'
|
|
18697
19950
|
};
|
|
18698
19951
|
}
|
|
18699
19952
|
getUserBaskets(query, isLoading) {
|
|
@@ -18796,1212 +20049,1454 @@ var Countries = [
|
|
|
18796
20049
|
{
|
|
18797
20050
|
cName: "Afghanistan",
|
|
18798
20051
|
dCode: "93",
|
|
18799
|
-
cCode: "AF"
|
|
20052
|
+
cCode: "AF",
|
|
20053
|
+
tCode: "AFG"
|
|
18800
20054
|
},
|
|
18801
20055
|
{
|
|
18802
20056
|
cName: "Aland Islands",
|
|
18803
20057
|
dCode: "358",
|
|
18804
|
-
cCode: "AX"
|
|
20058
|
+
cCode: "AX",
|
|
20059
|
+
tCode: "ALA"
|
|
18805
20060
|
},
|
|
18806
20061
|
{
|
|
18807
20062
|
cName: "Albania",
|
|
18808
20063
|
dCode: "355",
|
|
18809
|
-
cCode: "AL"
|
|
20064
|
+
cCode: "AL",
|
|
20065
|
+
tCode: "ALB"
|
|
18810
20066
|
},
|
|
18811
20067
|
{
|
|
18812
20068
|
cName: "Algeria",
|
|
18813
20069
|
dCode: "213",
|
|
18814
|
-
cCode: "DZ"
|
|
20070
|
+
cCode: "DZ",
|
|
20071
|
+
tCode: "DZA"
|
|
18815
20072
|
},
|
|
18816
20073
|
{
|
|
18817
20074
|
cName: "AmericanSamoa",
|
|
18818
20075
|
dCode: "1684",
|
|
18819
|
-
cCode: "AS"
|
|
20076
|
+
cCode: "AS",
|
|
20077
|
+
tCode: "ASM"
|
|
18820
20078
|
},
|
|
18821
20079
|
{
|
|
18822
20080
|
cName: "Andorra",
|
|
18823
20081
|
dCode: "376",
|
|
18824
|
-
cCode: "AD"
|
|
20082
|
+
cCode: "AD",
|
|
20083
|
+
tCode: "AND"
|
|
18825
20084
|
},
|
|
18826
20085
|
{
|
|
18827
20086
|
cName: "Angola",
|
|
18828
20087
|
dCode: "244",
|
|
18829
|
-
cCode: "AO"
|
|
20088
|
+
cCode: "AO",
|
|
20089
|
+
tCode: "AGO"
|
|
18830
20090
|
},
|
|
18831
20091
|
{
|
|
18832
20092
|
cName: "Anguilla",
|
|
18833
20093
|
dCode: "1264",
|
|
18834
|
-
cCode: "AI"
|
|
20094
|
+
cCode: "AI",
|
|
20095
|
+
tCode: "AIA"
|
|
18835
20096
|
},
|
|
18836
20097
|
{
|
|
18837
20098
|
cName: "Antarctica",
|
|
18838
20099
|
dCode: "672",
|
|
18839
|
-
cCode: "AQ"
|
|
20100
|
+
cCode: "AQ",
|
|
20101
|
+
tCode: "ATA"
|
|
18840
20102
|
},
|
|
18841
20103
|
{
|
|
18842
20104
|
cName: "Antigua and Barbuda",
|
|
18843
20105
|
dCode: "1268",
|
|
18844
|
-
cCode: "AG"
|
|
20106
|
+
cCode: "AG",
|
|
20107
|
+
tCode: "ATG"
|
|
18845
20108
|
},
|
|
18846
20109
|
{
|
|
18847
20110
|
cName: "Argentina",
|
|
18848
20111
|
dCode: "54",
|
|
18849
|
-
cCode: "AR"
|
|
20112
|
+
cCode: "AR",
|
|
20113
|
+
tCode: "ARG"
|
|
18850
20114
|
},
|
|
18851
20115
|
{
|
|
18852
20116
|
cName: "Armenia",
|
|
18853
20117
|
dCode: "374",
|
|
18854
|
-
cCode: "AM"
|
|
20118
|
+
cCode: "AM",
|
|
20119
|
+
tCode: "ARM"
|
|
18855
20120
|
},
|
|
18856
20121
|
{
|
|
18857
20122
|
cName: "Aruba",
|
|
18858
20123
|
dCode: "297",
|
|
18859
|
-
cCode: "AW"
|
|
20124
|
+
cCode: "AW",
|
|
20125
|
+
tCode: "ABW"
|
|
18860
20126
|
},
|
|
18861
20127
|
{
|
|
18862
20128
|
cName: "Australia",
|
|
18863
20129
|
dCode: "61",
|
|
18864
|
-
cCode: "AU"
|
|
20130
|
+
cCode: "AU",
|
|
20131
|
+
tCode: "AUS"
|
|
18865
20132
|
},
|
|
18866
20133
|
{
|
|
18867
20134
|
cName: "Austria",
|
|
18868
20135
|
dCode: "43",
|
|
18869
|
-
cCode: "AT"
|
|
20136
|
+
cCode: "AT",
|
|
20137
|
+
tCode: "AUT"
|
|
18870
20138
|
},
|
|
18871
20139
|
{
|
|
18872
20140
|
cName: "Azerbaijan",
|
|
18873
20141
|
dCode: "994",
|
|
18874
|
-
cCode: "AZ"
|
|
20142
|
+
cCode: "AZ",
|
|
20143
|
+
tCode: "AZE"
|
|
18875
20144
|
},
|
|
18876
20145
|
{
|
|
18877
20146
|
cName: "Bahamas",
|
|
18878
20147
|
dCode: "1242",
|
|
18879
|
-
cCode: "BS"
|
|
20148
|
+
cCode: "BS",
|
|
20149
|
+
tCode: "BHS"
|
|
18880
20150
|
},
|
|
18881
20151
|
{
|
|
18882
20152
|
cName: "Bahrain",
|
|
18883
20153
|
dCode: "973",
|
|
18884
|
-
cCode: "BH"
|
|
20154
|
+
cCode: "BH",
|
|
20155
|
+
tCode: "BHR"
|
|
18885
20156
|
},
|
|
18886
20157
|
{
|
|
18887
20158
|
cName: "Bangladesh",
|
|
18888
20159
|
dCode: "880",
|
|
18889
|
-
cCode: "BD"
|
|
20160
|
+
cCode: "BD",
|
|
20161
|
+
tCode: "BGD"
|
|
18890
20162
|
},
|
|
18891
20163
|
{
|
|
18892
20164
|
cName: "Barbados",
|
|
18893
20165
|
dCode: "1246",
|
|
18894
|
-
cCode: "BB"
|
|
20166
|
+
cCode: "BB",
|
|
20167
|
+
tCode: "BRB"
|
|
18895
20168
|
},
|
|
18896
20169
|
{
|
|
18897
20170
|
cName: "Belarus",
|
|
18898
20171
|
dCode: "375",
|
|
18899
|
-
cCode: "BY"
|
|
20172
|
+
cCode: "BY",
|
|
20173
|
+
tCode: "BLR"
|
|
18900
20174
|
},
|
|
18901
20175
|
{
|
|
18902
20176
|
cName: "Belgium",
|
|
18903
20177
|
dCode: "32",
|
|
18904
|
-
cCode: "BE"
|
|
20178
|
+
cCode: "BE",
|
|
20179
|
+
tCode: "BEL"
|
|
18905
20180
|
},
|
|
18906
20181
|
{
|
|
18907
20182
|
cName: "Belize",
|
|
18908
20183
|
dCode: "501",
|
|
18909
|
-
cCode: "BZ"
|
|
20184
|
+
cCode: "BZ",
|
|
20185
|
+
tCode: "BLZ"
|
|
18910
20186
|
},
|
|
18911
20187
|
{
|
|
18912
20188
|
cName: "Benin",
|
|
18913
20189
|
dCode: "229",
|
|
18914
|
-
cCode: "BJ"
|
|
20190
|
+
cCode: "BJ",
|
|
20191
|
+
tCode: "BEN"
|
|
18915
20192
|
},
|
|
18916
20193
|
{
|
|
18917
20194
|
cName: "Bermuda",
|
|
18918
20195
|
dCode: "1441",
|
|
18919
|
-
cCode: "BM"
|
|
20196
|
+
cCode: "BM",
|
|
20197
|
+
tCode: "BMU"
|
|
18920
20198
|
},
|
|
18921
20199
|
{
|
|
18922
20200
|
cName: "Bhutan",
|
|
18923
20201
|
dCode: "975",
|
|
18924
|
-
cCode: "BT"
|
|
20202
|
+
cCode: "BT",
|
|
20203
|
+
tCode: "BTN"
|
|
18925
20204
|
},
|
|
18926
20205
|
{
|
|
18927
20206
|
cName: "Bolivia, Plurinational State of",
|
|
18928
20207
|
dCode: "591",
|
|
18929
|
-
cCode: "BO"
|
|
20208
|
+
cCode: "BO",
|
|
20209
|
+
tCode: "BOL"
|
|
18930
20210
|
},
|
|
18931
20211
|
{
|
|
18932
20212
|
cName: "Bosnia and Herzegovina",
|
|
18933
20213
|
dCode: "387",
|
|
18934
|
-
cCode: "BA"
|
|
20214
|
+
cCode: "BA",
|
|
20215
|
+
tCode: "BIH"
|
|
18935
20216
|
},
|
|
18936
20217
|
{
|
|
18937
20218
|
cName: "Botswana",
|
|
18938
20219
|
dCode: "267",
|
|
18939
|
-
cCode: "BW"
|
|
20220
|
+
cCode: "BW",
|
|
20221
|
+
tCode: "BWA"
|
|
18940
20222
|
},
|
|
18941
20223
|
{
|
|
18942
20224
|
cName: "Brazil",
|
|
18943
20225
|
dCode: "55",
|
|
18944
|
-
cCode: "BR"
|
|
20226
|
+
cCode: "BR",
|
|
20227
|
+
tCode: "BRA"
|
|
18945
20228
|
},
|
|
18946
20229
|
{
|
|
18947
20230
|
cName: "British Indian Ocean Territory",
|
|
18948
20231
|
dCode: "246",
|
|
18949
|
-
cCode: "IO"
|
|
20232
|
+
cCode: "IO",
|
|
20233
|
+
tCode: "IOT"
|
|
18950
20234
|
},
|
|
18951
20235
|
{
|
|
18952
20236
|
cName: "Brunei Darussalam",
|
|
18953
20237
|
dCode: "673",
|
|
18954
|
-
cCode: "BN"
|
|
20238
|
+
cCode: "BN",
|
|
20239
|
+
tCode: "BRN"
|
|
18955
20240
|
},
|
|
18956
20241
|
{
|
|
18957
20242
|
cName: "Bulgaria",
|
|
18958
20243
|
dCode: "359",
|
|
18959
|
-
cCode: "BG"
|
|
20244
|
+
cCode: "BG",
|
|
20245
|
+
tCode: "BGR"
|
|
18960
20246
|
},
|
|
18961
20247
|
{
|
|
18962
20248
|
cName: "Burkina Faso",
|
|
18963
20249
|
dCode: "226",
|
|
18964
|
-
cCode: "BF"
|
|
20250
|
+
cCode: "BF",
|
|
20251
|
+
tCode: "BFA"
|
|
18965
20252
|
},
|
|
18966
20253
|
{
|
|
18967
20254
|
cName: "Burundi",
|
|
18968
20255
|
dCode: "257",
|
|
18969
|
-
cCode: "BI"
|
|
20256
|
+
cCode: "BI",
|
|
20257
|
+
tCode: "BDI"
|
|
18970
20258
|
},
|
|
18971
20259
|
{
|
|
18972
20260
|
cName: "Cambodia",
|
|
18973
20261
|
dCode: "855",
|
|
18974
|
-
cCode: "KH"
|
|
20262
|
+
cCode: "KH",
|
|
20263
|
+
tCode: "KHM"
|
|
18975
20264
|
},
|
|
18976
20265
|
{
|
|
18977
20266
|
cName: "Cameroon",
|
|
18978
20267
|
dCode: "237",
|
|
18979
|
-
cCode: "CM"
|
|
20268
|
+
cCode: "CM",
|
|
20269
|
+
tCode: "CMR"
|
|
18980
20270
|
},
|
|
18981
20271
|
{
|
|
18982
20272
|
cName: "Canada",
|
|
18983
20273
|
dCode: "1",
|
|
18984
|
-
cCode: "CA"
|
|
20274
|
+
cCode: "CA",
|
|
20275
|
+
tCode: "CAN"
|
|
18985
20276
|
},
|
|
18986
20277
|
{
|
|
18987
20278
|
cName: "Cape Verde",
|
|
18988
20279
|
dCode: "238",
|
|
18989
|
-
cCode: "CV"
|
|
20280
|
+
cCode: "CV",
|
|
20281
|
+
tCode: "CPV"
|
|
18990
20282
|
},
|
|
18991
20283
|
{
|
|
18992
20284
|
cName: "Cayman Islands",
|
|
18993
20285
|
dCode: " 345",
|
|
18994
|
-
cCode: "KY"
|
|
20286
|
+
cCode: "KY",
|
|
20287
|
+
tCode: "CYM"
|
|
18995
20288
|
},
|
|
18996
20289
|
{
|
|
18997
20290
|
cName: "Central African Republic",
|
|
18998
20291
|
dCode: "236",
|
|
18999
|
-
cCode: "CF"
|
|
20292
|
+
cCode: "CF",
|
|
20293
|
+
tCode: "CAF"
|
|
19000
20294
|
},
|
|
19001
20295
|
{
|
|
19002
20296
|
cName: "Chad",
|
|
19003
20297
|
dCode: "235",
|
|
19004
|
-
cCode: "TD"
|
|
20298
|
+
cCode: "TD",
|
|
20299
|
+
tCode: "TCD"
|
|
19005
20300
|
},
|
|
19006
20301
|
{
|
|
19007
20302
|
cName: "Chile",
|
|
19008
20303
|
dCode: "56",
|
|
19009
|
-
cCode: "CL"
|
|
20304
|
+
cCode: "CL",
|
|
20305
|
+
tCode: "CHL"
|
|
19010
20306
|
},
|
|
19011
20307
|
{
|
|
19012
20308
|
cName: "China",
|
|
19013
20309
|
dCode: "86",
|
|
19014
|
-
cCode: "CN"
|
|
20310
|
+
cCode: "CN",
|
|
20311
|
+
tCode: "CHN"
|
|
19015
20312
|
},
|
|
19016
20313
|
{
|
|
19017
20314
|
cName: "Christmas Island",
|
|
19018
20315
|
dCode: "61",
|
|
19019
|
-
cCode: "CX"
|
|
20316
|
+
cCode: "CX",
|
|
20317
|
+
tCode: "CXR"
|
|
19020
20318
|
},
|
|
19021
20319
|
{
|
|
19022
20320
|
cName: "Cocos (Keeling) Islands",
|
|
19023
20321
|
dCode: "61",
|
|
19024
|
-
cCode: "CC"
|
|
20322
|
+
cCode: "CC",
|
|
20323
|
+
tCode: "CCK"
|
|
19025
20324
|
},
|
|
19026
20325
|
{
|
|
19027
20326
|
cName: "Colombia",
|
|
19028
20327
|
dCode: "57",
|
|
19029
|
-
cCode: "CO"
|
|
20328
|
+
cCode: "CO",
|
|
20329
|
+
tCode: "COL"
|
|
19030
20330
|
},
|
|
19031
20331
|
{
|
|
19032
20332
|
cName: "Comoros",
|
|
19033
20333
|
dCode: "269",
|
|
19034
|
-
cCode: "KM"
|
|
20334
|
+
cCode: "KM",
|
|
20335
|
+
tCode: "COM"
|
|
19035
20336
|
},
|
|
19036
20337
|
{
|
|
19037
20338
|
cName: "Congo",
|
|
19038
20339
|
dCode: "242",
|
|
19039
|
-
cCode: "CG"
|
|
20340
|
+
cCode: "CG",
|
|
20341
|
+
tCode: "COG"
|
|
19040
20342
|
},
|
|
19041
20343
|
{
|
|
19042
20344
|
cName: "Congo, The Democratic Republic of the Congo",
|
|
19043
20345
|
dCode: "243",
|
|
19044
|
-
cCode: "CD"
|
|
20346
|
+
cCode: "CD",
|
|
20347
|
+
tCode: "COD"
|
|
19045
20348
|
},
|
|
19046
20349
|
{
|
|
19047
20350
|
cName: "Cook Islands",
|
|
19048
20351
|
dCode: "682",
|
|
19049
|
-
cCode: "CK"
|
|
20352
|
+
cCode: "CK",
|
|
20353
|
+
tCode: "COK"
|
|
19050
20354
|
},
|
|
19051
20355
|
{
|
|
19052
20356
|
cName: "Costa Rica",
|
|
19053
20357
|
dCode: "506",
|
|
19054
|
-
cCode: "CR"
|
|
20358
|
+
cCode: "CR",
|
|
20359
|
+
tCode: "CRI"
|
|
19055
20360
|
},
|
|
19056
20361
|
{
|
|
19057
20362
|
cName: "Cote d'Ivoire",
|
|
19058
20363
|
dCode: "225",
|
|
19059
|
-
cCode: "CI"
|
|
20364
|
+
cCode: "CI",
|
|
20365
|
+
tCode: "CIV"
|
|
19060
20366
|
},
|
|
19061
20367
|
{
|
|
19062
20368
|
cName: "Croatia",
|
|
19063
20369
|
dCode: "385",
|
|
19064
|
-
cCode: "HR"
|
|
20370
|
+
cCode: "HR",
|
|
20371
|
+
tCode: "HRV"
|
|
19065
20372
|
},
|
|
19066
20373
|
{
|
|
19067
20374
|
cName: "Cuba",
|
|
19068
20375
|
dCode: "53",
|
|
19069
|
-
cCode: "CU"
|
|
20376
|
+
cCode: "CU",
|
|
20377
|
+
tCode: "CUB"
|
|
19070
20378
|
},
|
|
19071
20379
|
{
|
|
19072
20380
|
cName: "Cyprus",
|
|
19073
20381
|
dCode: "357",
|
|
19074
|
-
cCode: "CY"
|
|
20382
|
+
cCode: "CY",
|
|
20383
|
+
tCode: "CYP"
|
|
19075
20384
|
},
|
|
19076
20385
|
{
|
|
19077
20386
|
cName: "Czech Republic",
|
|
19078
20387
|
dCode: "420",
|
|
19079
|
-
cCode: "CZ"
|
|
20388
|
+
cCode: "CZ",
|
|
20389
|
+
tCode: "CZE"
|
|
19080
20390
|
},
|
|
19081
20391
|
{
|
|
19082
20392
|
cName: "Denmark",
|
|
19083
20393
|
dCode: "45",
|
|
19084
|
-
cCode: "DK"
|
|
20394
|
+
cCode: "DK",
|
|
20395
|
+
tCode: "DNK"
|
|
19085
20396
|
},
|
|
19086
20397
|
{
|
|
19087
20398
|
cName: "Djibouti",
|
|
19088
20399
|
dCode: "253",
|
|
19089
|
-
cCode: "DJ"
|
|
20400
|
+
cCode: "DJ",
|
|
20401
|
+
tCode: "DJI"
|
|
19090
20402
|
},
|
|
19091
20403
|
{
|
|
19092
20404
|
cName: "Dominica",
|
|
19093
20405
|
dCode: "1767",
|
|
19094
|
-
cCode: "DM"
|
|
20406
|
+
cCode: "DM",
|
|
20407
|
+
tCode: "DMA"
|
|
19095
20408
|
},
|
|
19096
20409
|
{
|
|
19097
20410
|
cName: "Dominican Republic",
|
|
19098
20411
|
dCode: "1849",
|
|
19099
|
-
cCode: "DO"
|
|
20412
|
+
cCode: "DO",
|
|
20413
|
+
tCode: "DOM"
|
|
19100
20414
|
},
|
|
19101
20415
|
{
|
|
19102
20416
|
cName: "Ecuador",
|
|
19103
20417
|
dCode: "593",
|
|
19104
|
-
cCode: "EC"
|
|
20418
|
+
cCode: "EC",
|
|
20419
|
+
tCode: "ECU"
|
|
19105
20420
|
},
|
|
19106
20421
|
{
|
|
19107
20422
|
cName: "Egypt",
|
|
19108
20423
|
dCode: "20",
|
|
19109
|
-
cCode: "EG"
|
|
20424
|
+
cCode: "EG",
|
|
20425
|
+
tCode: "EGY"
|
|
19110
20426
|
},
|
|
19111
20427
|
{
|
|
19112
20428
|
cName: "El Salvador",
|
|
19113
20429
|
dCode: "503",
|
|
19114
|
-
cCode: "SV"
|
|
20430
|
+
cCode: "SV",
|
|
20431
|
+
tCode: "SLV"
|
|
19115
20432
|
},
|
|
19116
20433
|
{
|
|
19117
20434
|
cName: "Equatorial Guinea",
|
|
19118
20435
|
dCode: "240",
|
|
19119
|
-
cCode: "GQ"
|
|
20436
|
+
cCode: "GQ",
|
|
20437
|
+
tCode: "GNQ"
|
|
19120
20438
|
},
|
|
19121
20439
|
{
|
|
19122
20440
|
cName: "Eritrea",
|
|
19123
20441
|
dCode: "291",
|
|
19124
|
-
cCode: "ER"
|
|
20442
|
+
cCode: "ER",
|
|
20443
|
+
tCode: "ERI"
|
|
19125
20444
|
},
|
|
19126
20445
|
{
|
|
19127
20446
|
cName: "Estonia",
|
|
19128
20447
|
dCode: "372",
|
|
19129
|
-
cCode: "EE"
|
|
20448
|
+
cCode: "EE",
|
|
20449
|
+
tCode: "EST"
|
|
19130
20450
|
},
|
|
19131
20451
|
{
|
|
19132
20452
|
cName: "Ethiopia",
|
|
19133
20453
|
dCode: "251",
|
|
19134
|
-
cCode: "ET"
|
|
20454
|
+
cCode: "ET",
|
|
20455
|
+
tCode: "ETH"
|
|
19135
20456
|
},
|
|
19136
20457
|
{
|
|
19137
20458
|
cName: "Falkland Islands (Malvinas)",
|
|
19138
20459
|
dCode: "500",
|
|
19139
|
-
cCode: "FK"
|
|
20460
|
+
cCode: "FK",
|
|
20461
|
+
tCode: "FLK"
|
|
19140
20462
|
},
|
|
19141
20463
|
{
|
|
19142
20464
|
cName: "Faroe Islands",
|
|
19143
20465
|
dCode: "298",
|
|
19144
|
-
cCode: "FO"
|
|
20466
|
+
cCode: "FO",
|
|
20467
|
+
tCode: "FRO"
|
|
19145
20468
|
},
|
|
19146
20469
|
{
|
|
19147
20470
|
cName: "Fiji",
|
|
19148
20471
|
dCode: "679",
|
|
19149
|
-
cCode: "FJ"
|
|
20472
|
+
cCode: "FJ",
|
|
20473
|
+
tCode: "FJI"
|
|
19150
20474
|
},
|
|
19151
20475
|
{
|
|
19152
20476
|
cName: "Finland",
|
|
19153
20477
|
dCode: "358",
|
|
19154
|
-
cCode: "FI"
|
|
20478
|
+
cCode: "FI",
|
|
20479
|
+
tCode: "FIN"
|
|
19155
20480
|
},
|
|
19156
20481
|
{
|
|
19157
20482
|
cName: "France",
|
|
19158
20483
|
dCode: "33",
|
|
19159
|
-
cCode: "FR"
|
|
20484
|
+
cCode: "FR",
|
|
20485
|
+
tCode: "FRA"
|
|
19160
20486
|
},
|
|
19161
20487
|
{
|
|
19162
20488
|
cName: "French Guiana",
|
|
19163
20489
|
dCode: "594",
|
|
19164
|
-
cCode: "GF"
|
|
20490
|
+
cCode: "GF",
|
|
20491
|
+
tCode: "GUF"
|
|
19165
20492
|
},
|
|
19166
20493
|
{
|
|
19167
20494
|
cName: "French Polynesia",
|
|
19168
20495
|
dCode: "689",
|
|
19169
|
-
cCode: "PF"
|
|
20496
|
+
cCode: "PF",
|
|
20497
|
+
tCode: "PYF"
|
|
19170
20498
|
},
|
|
19171
20499
|
{
|
|
19172
20500
|
cName: "Gabon",
|
|
19173
20501
|
dCode: "241",
|
|
19174
|
-
cCode: "GA"
|
|
20502
|
+
cCode: "GA",
|
|
20503
|
+
tCode: "GAB"
|
|
19175
20504
|
},
|
|
19176
20505
|
{
|
|
19177
20506
|
cName: "Gambia",
|
|
19178
20507
|
dCode: "220",
|
|
19179
|
-
cCode: "GM"
|
|
20508
|
+
cCode: "GM",
|
|
20509
|
+
tCode: "GMB"
|
|
19180
20510
|
},
|
|
19181
20511
|
{
|
|
19182
20512
|
cName: "Georgia",
|
|
19183
20513
|
dCode: "995",
|
|
19184
|
-
cCode: "GE"
|
|
20514
|
+
cCode: "GE",
|
|
20515
|
+
tCode: "GEO"
|
|
19185
20516
|
},
|
|
19186
20517
|
{
|
|
19187
20518
|
cName: "Germany",
|
|
19188
20519
|
dCode: "49",
|
|
19189
|
-
cCode: "DE"
|
|
20520
|
+
cCode: "DE",
|
|
20521
|
+
tCode: "DEU"
|
|
19190
20522
|
},
|
|
19191
20523
|
{
|
|
19192
20524
|
cName: "Ghana",
|
|
19193
20525
|
dCode: "233",
|
|
19194
|
-
cCode: "GH"
|
|
20526
|
+
cCode: "GH",
|
|
20527
|
+
tCode: "GHA"
|
|
19195
20528
|
},
|
|
19196
20529
|
{
|
|
19197
20530
|
cName: "Gibraltar",
|
|
19198
20531
|
dCode: "350",
|
|
19199
|
-
cCode: "GI"
|
|
20532
|
+
cCode: "GI",
|
|
20533
|
+
tCode: "GIB"
|
|
19200
20534
|
},
|
|
19201
20535
|
{
|
|
19202
20536
|
cName: "Greece",
|
|
19203
20537
|
dCode: "30",
|
|
19204
|
-
cCode: "GR"
|
|
20538
|
+
cCode: "GR",
|
|
20539
|
+
tCode: "GRC"
|
|
19205
20540
|
},
|
|
19206
20541
|
{
|
|
19207
20542
|
cName: "Greenland",
|
|
19208
20543
|
dCode: "299",
|
|
19209
|
-
cCode: "GL"
|
|
20544
|
+
cCode: "GL",
|
|
20545
|
+
tCode: "GRL"
|
|
19210
20546
|
},
|
|
19211
20547
|
{
|
|
19212
20548
|
cName: "Grenada",
|
|
19213
20549
|
dCode: "1473",
|
|
19214
|
-
cCode: "GD"
|
|
20550
|
+
cCode: "GD",
|
|
20551
|
+
tCode: "GRD"
|
|
19215
20552
|
},
|
|
19216
20553
|
{
|
|
19217
20554
|
cName: "Guadeloupe",
|
|
19218
20555
|
dCode: "590",
|
|
19219
|
-
cCode: "GP"
|
|
20556
|
+
cCode: "GP",
|
|
20557
|
+
tCode: "GLP"
|
|
19220
20558
|
},
|
|
19221
20559
|
{
|
|
19222
20560
|
cName: "Guam",
|
|
19223
20561
|
dCode: "1671",
|
|
19224
|
-
cCode: "GU"
|
|
20562
|
+
cCode: "GU",
|
|
20563
|
+
tCode: "GUM"
|
|
19225
20564
|
},
|
|
19226
20565
|
{
|
|
19227
20566
|
cName: "Guatemala",
|
|
19228
20567
|
dCode: "502",
|
|
19229
|
-
cCode: "GT"
|
|
20568
|
+
cCode: "GT",
|
|
20569
|
+
tCode: "GTM"
|
|
19230
20570
|
},
|
|
19231
20571
|
{
|
|
19232
20572
|
cName: "Guernsey",
|
|
19233
20573
|
dCode: "44",
|
|
19234
|
-
cCode: "GG"
|
|
20574
|
+
cCode: "GG",
|
|
20575
|
+
tCode: "GGY"
|
|
19235
20576
|
},
|
|
19236
20577
|
{
|
|
19237
20578
|
cName: "Guinea",
|
|
19238
20579
|
dCode: "224",
|
|
19239
|
-
cCode: "GN"
|
|
20580
|
+
cCode: "GN",
|
|
20581
|
+
tCode: "GIN"
|
|
19240
20582
|
},
|
|
19241
20583
|
{
|
|
19242
20584
|
cName: "Guinea-Bissau",
|
|
19243
20585
|
dCode: "245",
|
|
19244
|
-
cCode: "GW"
|
|
20586
|
+
cCode: "GW",
|
|
20587
|
+
tCode: "GNB"
|
|
19245
20588
|
},
|
|
19246
20589
|
{
|
|
19247
20590
|
cName: "Guyana",
|
|
19248
20591
|
dCode: "595",
|
|
19249
|
-
cCode: "GY"
|
|
20592
|
+
cCode: "GY",
|
|
20593
|
+
tCode: "GUY"
|
|
19250
20594
|
},
|
|
19251
20595
|
{
|
|
19252
20596
|
cName: "Haiti",
|
|
19253
20597
|
dCode: "509",
|
|
19254
|
-
cCode: "HT"
|
|
20598
|
+
cCode: "HT",
|
|
20599
|
+
tCode: "HTI"
|
|
19255
20600
|
},
|
|
19256
20601
|
{
|
|
19257
20602
|
cName: "Holy See (Vatican City State)",
|
|
19258
20603
|
dCode: "379",
|
|
19259
|
-
cCode: "VA"
|
|
20604
|
+
cCode: "VA",
|
|
20605
|
+
tCode: "VAT"
|
|
19260
20606
|
},
|
|
19261
20607
|
{
|
|
19262
20608
|
cName: "Honduras",
|
|
19263
20609
|
dCode: "504",
|
|
19264
|
-
cCode: "HN"
|
|
20610
|
+
cCode: "HN",
|
|
20611
|
+
tCode: "HND"
|
|
19265
20612
|
},
|
|
19266
20613
|
{
|
|
19267
20614
|
cName: "Hong Kong",
|
|
19268
20615
|
dCode: "852",
|
|
19269
|
-
cCode: "HK"
|
|
20616
|
+
cCode: "HK",
|
|
20617
|
+
tCode: "HKG"
|
|
19270
20618
|
},
|
|
19271
20619
|
{
|
|
19272
20620
|
cName: "Hungary",
|
|
19273
20621
|
dCode: "36",
|
|
19274
|
-
cCode: "HU"
|
|
20622
|
+
cCode: "HU",
|
|
20623
|
+
tCode: "HUN"
|
|
19275
20624
|
},
|
|
19276
20625
|
{
|
|
19277
20626
|
cName: "Iceland",
|
|
19278
20627
|
dCode: "354",
|
|
19279
|
-
cCode: "IS"
|
|
20628
|
+
cCode: "IS",
|
|
20629
|
+
tCode: "ISL"
|
|
19280
20630
|
},
|
|
19281
20631
|
{
|
|
19282
20632
|
cName: "India",
|
|
19283
20633
|
dCode: "91",
|
|
19284
|
-
cCode: "IN"
|
|
20634
|
+
cCode: "IN",
|
|
20635
|
+
tCode: "IND"
|
|
19285
20636
|
},
|
|
19286
20637
|
{
|
|
19287
20638
|
cName: "Indonesia",
|
|
19288
20639
|
dCode: "62",
|
|
19289
|
-
cCode: "ID"
|
|
20640
|
+
cCode: "ID",
|
|
20641
|
+
tCode: "IDN"
|
|
19290
20642
|
},
|
|
19291
20643
|
{
|
|
19292
20644
|
cName: "Iran, Islamic Republic of Persian Gulf",
|
|
19293
20645
|
dCode: "98",
|
|
19294
|
-
cCode: "IR"
|
|
20646
|
+
cCode: "IR",
|
|
20647
|
+
tCode: "IRN"
|
|
19295
20648
|
},
|
|
19296
20649
|
{
|
|
19297
20650
|
cName: "Iraq",
|
|
19298
20651
|
dCode: "964",
|
|
19299
|
-
cCode: "IQ"
|
|
20652
|
+
cCode: "IQ",
|
|
20653
|
+
tCode: "IRQ"
|
|
19300
20654
|
},
|
|
19301
20655
|
{
|
|
19302
20656
|
cName: "Ireland",
|
|
19303
20657
|
dCode: "353",
|
|
19304
|
-
cCode: "IE"
|
|
20658
|
+
cCode: "IE",
|
|
20659
|
+
tCode: "IRL"
|
|
19305
20660
|
},
|
|
19306
20661
|
{
|
|
19307
20662
|
cName: "Isle of Man",
|
|
19308
20663
|
dCode: "44",
|
|
19309
|
-
cCode: "IM"
|
|
20664
|
+
cCode: "IM",
|
|
20665
|
+
tCode: "IMN"
|
|
19310
20666
|
},
|
|
19311
20667
|
{
|
|
19312
20668
|
cName: "Israel",
|
|
19313
20669
|
dCode: "972",
|
|
19314
|
-
cCode: "IL"
|
|
20670
|
+
cCode: "IL",
|
|
20671
|
+
tCode: "ISR"
|
|
19315
20672
|
},
|
|
19316
20673
|
{
|
|
19317
20674
|
cName: "Italy",
|
|
19318
20675
|
dCode: "39",
|
|
19319
|
-
cCode: "IT"
|
|
20676
|
+
cCode: "IT",
|
|
20677
|
+
tCode: "ITA"
|
|
19320
20678
|
},
|
|
19321
20679
|
{
|
|
19322
20680
|
cName: "Jamaica",
|
|
19323
20681
|
dCode: "1876",
|
|
19324
|
-
cCode: "JM"
|
|
20682
|
+
cCode: "JM",
|
|
20683
|
+
tCode: "JAM"
|
|
19325
20684
|
},
|
|
19326
20685
|
{
|
|
19327
20686
|
cName: "Japan",
|
|
19328
20687
|
dCode: "81",
|
|
19329
|
-
cCode: "JP"
|
|
20688
|
+
cCode: "JP",
|
|
20689
|
+
tCode: "JPN"
|
|
19330
20690
|
},
|
|
19331
20691
|
{
|
|
19332
20692
|
cName: "Jersey",
|
|
19333
20693
|
dCode: "44",
|
|
19334
|
-
cCode: "JE"
|
|
20694
|
+
cCode: "JE",
|
|
20695
|
+
tCode: "JEY"
|
|
19335
20696
|
},
|
|
19336
20697
|
{
|
|
19337
20698
|
cName: "Jordan",
|
|
19338
20699
|
dCode: "962",
|
|
19339
|
-
cCode: "JO"
|
|
20700
|
+
cCode: "JO",
|
|
20701
|
+
tCode: "JOR"
|
|
19340
20702
|
},
|
|
19341
20703
|
{
|
|
19342
20704
|
cName: "Kazakhstan",
|
|
19343
20705
|
dCode: "77",
|
|
19344
|
-
cCode: "KZ"
|
|
20706
|
+
cCode: "KZ",
|
|
20707
|
+
tCode: "KAZ"
|
|
19345
20708
|
},
|
|
19346
20709
|
{
|
|
19347
20710
|
cName: "Kenya",
|
|
19348
20711
|
dCode: "254",
|
|
19349
|
-
cCode: "KE"
|
|
20712
|
+
cCode: "KE",
|
|
20713
|
+
tCode: "KEN"
|
|
19350
20714
|
},
|
|
19351
20715
|
{
|
|
19352
20716
|
cName: "Kiribati",
|
|
19353
20717
|
dCode: "686",
|
|
19354
|
-
cCode: "KI"
|
|
20718
|
+
cCode: "KI",
|
|
20719
|
+
tCode: "KIR"
|
|
19355
20720
|
},
|
|
19356
20721
|
{
|
|
19357
20722
|
cName: "Korea, Democratic People's Republic of Korea",
|
|
19358
20723
|
dCode: "850",
|
|
19359
|
-
cCode: "KP"
|
|
20724
|
+
cCode: "KP",
|
|
20725
|
+
tCode: "PRK"
|
|
19360
20726
|
},
|
|
19361
20727
|
{
|
|
19362
20728
|
cName: "Korea, Republic of South Korea",
|
|
19363
20729
|
dCode: "82",
|
|
19364
|
-
cCode: "KR"
|
|
20730
|
+
cCode: "KR",
|
|
20731
|
+
tCode: "KOR"
|
|
19365
20732
|
},
|
|
19366
20733
|
{
|
|
19367
20734
|
cName: "Kuwait",
|
|
19368
20735
|
dCode: "965",
|
|
19369
|
-
cCode: "KW"
|
|
20736
|
+
cCode: "KW",
|
|
20737
|
+
tCode: "KWT"
|
|
19370
20738
|
},
|
|
19371
20739
|
{
|
|
19372
20740
|
cName: "Kyrgyzstan",
|
|
19373
20741
|
dCode: "996",
|
|
19374
|
-
cCode: "KG"
|
|
20742
|
+
cCode: "KG",
|
|
20743
|
+
tCode: "KGZ"
|
|
19375
20744
|
},
|
|
19376
20745
|
{
|
|
19377
20746
|
cName: "Laos",
|
|
19378
20747
|
dCode: "856",
|
|
19379
|
-
cCode: "LA"
|
|
20748
|
+
cCode: "LA",
|
|
20749
|
+
tCode: "LAO"
|
|
19380
20750
|
},
|
|
19381
20751
|
{
|
|
19382
20752
|
cName: "Latvia",
|
|
19383
20753
|
dCode: "371",
|
|
19384
|
-
cCode: "LV"
|
|
20754
|
+
cCode: "LV",
|
|
20755
|
+
tCode: "LVA"
|
|
19385
20756
|
},
|
|
19386
20757
|
{
|
|
19387
20758
|
cName: "Lebanon",
|
|
19388
20759
|
dCode: "961",
|
|
19389
|
-
cCode: "LB"
|
|
20760
|
+
cCode: "LB",
|
|
20761
|
+
tCode: "LBN"
|
|
19390
20762
|
},
|
|
19391
20763
|
{
|
|
19392
20764
|
cName: "Lesotho",
|
|
19393
20765
|
dCode: "266",
|
|
19394
|
-
cCode: "LS"
|
|
20766
|
+
cCode: "LS",
|
|
20767
|
+
tCode: "LSO"
|
|
19395
20768
|
},
|
|
19396
20769
|
{
|
|
19397
20770
|
cName: "Liberia",
|
|
19398
20771
|
dCode: "231",
|
|
19399
|
-
cCode: "LR"
|
|
20772
|
+
cCode: "LR",
|
|
20773
|
+
tCode: "LBR"
|
|
19400
20774
|
},
|
|
19401
20775
|
{
|
|
19402
20776
|
cName: "Libyan Arab Jamahiriya",
|
|
19403
20777
|
dCode: "218",
|
|
19404
|
-
cCode: "LY"
|
|
20778
|
+
cCode: "LY",
|
|
20779
|
+
tCode: "LBY"
|
|
19405
20780
|
},
|
|
19406
20781
|
{
|
|
19407
20782
|
cName: "Liechtenstein",
|
|
19408
20783
|
dCode: "423",
|
|
19409
|
-
cCode: "LI"
|
|
20784
|
+
cCode: "LI",
|
|
20785
|
+
tCode: "LIE"
|
|
19410
20786
|
},
|
|
19411
20787
|
{
|
|
19412
20788
|
cName: "Lithuania",
|
|
19413
20789
|
dCode: "370",
|
|
19414
|
-
cCode: "LT"
|
|
20790
|
+
cCode: "LT",
|
|
20791
|
+
tCode: "LTU"
|
|
19415
20792
|
},
|
|
19416
20793
|
{
|
|
19417
20794
|
cName: "Luxembourg",
|
|
19418
20795
|
dCode: "352",
|
|
19419
|
-
cCode: "LU"
|
|
20796
|
+
cCode: "LU",
|
|
20797
|
+
tCode: "LUX"
|
|
19420
20798
|
},
|
|
19421
20799
|
{
|
|
19422
20800
|
cName: "Macao",
|
|
19423
20801
|
dCode: "853",
|
|
19424
|
-
cCode: "MO"
|
|
20802
|
+
cCode: "MO",
|
|
20803
|
+
tCode: "MAC"
|
|
19425
20804
|
},
|
|
19426
20805
|
{
|
|
19427
20806
|
cName: "Macedonia",
|
|
19428
20807
|
dCode: "389",
|
|
19429
|
-
cCode: "MK"
|
|
20808
|
+
cCode: "MK",
|
|
20809
|
+
tCode: "MKD"
|
|
19430
20810
|
},
|
|
19431
20811
|
{
|
|
19432
20812
|
cName: "Madagascar",
|
|
19433
20813
|
dCode: "261",
|
|
19434
|
-
cCode: "MG"
|
|
20814
|
+
cCode: "MG",
|
|
20815
|
+
tCode: "MDG"
|
|
19435
20816
|
},
|
|
19436
20817
|
{
|
|
19437
20818
|
cName: "Malawi",
|
|
19438
20819
|
dCode: "265",
|
|
19439
|
-
cCode: "MW"
|
|
20820
|
+
cCode: "MW",
|
|
20821
|
+
tCode: "MWI"
|
|
19440
20822
|
},
|
|
19441
20823
|
{
|
|
19442
20824
|
cName: "Malaysia",
|
|
19443
20825
|
dCode: "60",
|
|
19444
|
-
cCode: "MY"
|
|
20826
|
+
cCode: "MY",
|
|
20827
|
+
tCode: "MYS"
|
|
19445
20828
|
},
|
|
19446
20829
|
{
|
|
19447
20830
|
cName: "Maldives",
|
|
19448
20831
|
dCode: "960",
|
|
19449
|
-
cCode: "MV"
|
|
20832
|
+
cCode: "MV",
|
|
20833
|
+
tCode: "MDV"
|
|
19450
20834
|
},
|
|
19451
20835
|
{
|
|
19452
20836
|
cName: "Mali",
|
|
19453
20837
|
dCode: "223",
|
|
19454
|
-
cCode: "ML"
|
|
20838
|
+
cCode: "ML",
|
|
20839
|
+
tCode: "MLI"
|
|
19455
20840
|
},
|
|
19456
20841
|
{
|
|
19457
20842
|
cName: "Malta",
|
|
19458
20843
|
dCode: "356",
|
|
19459
|
-
cCode: "MT"
|
|
20844
|
+
cCode: "MT",
|
|
20845
|
+
tCode: "MLT"
|
|
19460
20846
|
},
|
|
19461
20847
|
{
|
|
19462
20848
|
cName: "Marshall Islands",
|
|
19463
20849
|
dCode: "692",
|
|
19464
|
-
cCode: "MH"
|
|
20850
|
+
cCode: "MH",
|
|
20851
|
+
tCode: "MHL"
|
|
19465
20852
|
},
|
|
19466
20853
|
{
|
|
19467
20854
|
cName: "Martinique",
|
|
19468
20855
|
dCode: "596",
|
|
19469
|
-
cCode: "MQ"
|
|
20856
|
+
cCode: "MQ",
|
|
20857
|
+
tCode: "MTQ"
|
|
19470
20858
|
},
|
|
19471
20859
|
{
|
|
19472
20860
|
cName: "Mauritania",
|
|
19473
20861
|
dCode: "222",
|
|
19474
|
-
cCode: "MR"
|
|
20862
|
+
cCode: "MR",
|
|
20863
|
+
tCode: "MRT"
|
|
19475
20864
|
},
|
|
19476
20865
|
{
|
|
19477
20866
|
cName: "Mauritius",
|
|
19478
20867
|
dCode: "230",
|
|
19479
|
-
cCode: "MU"
|
|
20868
|
+
cCode: "MU",
|
|
20869
|
+
tCode: "MUS"
|
|
19480
20870
|
},
|
|
19481
20871
|
{
|
|
19482
20872
|
cName: "Mayotte",
|
|
19483
20873
|
dCode: "262",
|
|
19484
|
-
cCode: "YT"
|
|
20874
|
+
cCode: "YT",
|
|
20875
|
+
tCode: "MYT"
|
|
19485
20876
|
},
|
|
19486
20877
|
{
|
|
19487
20878
|
cName: "Mexico",
|
|
19488
20879
|
dCode: "52",
|
|
19489
|
-
cCode: "MX"
|
|
20880
|
+
cCode: "MX",
|
|
20881
|
+
tCode: "MEX"
|
|
19490
20882
|
},
|
|
19491
20883
|
{
|
|
19492
20884
|
cName: "Micronesia, Federated States of Micronesia",
|
|
19493
20885
|
dCode: "691",
|
|
19494
|
-
cCode: "FM"
|
|
20886
|
+
cCode: "FM",
|
|
20887
|
+
tCode: "FSM"
|
|
19495
20888
|
},
|
|
19496
20889
|
{
|
|
19497
20890
|
cName: "Moldova",
|
|
19498
20891
|
dCode: "373",
|
|
19499
|
-
cCode: "MD"
|
|
20892
|
+
cCode: "MD",
|
|
20893
|
+
tCode: "MDA"
|
|
19500
20894
|
},
|
|
19501
20895
|
{
|
|
19502
20896
|
cName: "Monaco",
|
|
19503
20897
|
dCode: "377",
|
|
19504
|
-
cCode: "MC"
|
|
20898
|
+
cCode: "MC",
|
|
20899
|
+
tCode: "MCO"
|
|
19505
20900
|
},
|
|
19506
20901
|
{
|
|
19507
20902
|
cName: "Mongolia",
|
|
19508
20903
|
dCode: "976",
|
|
19509
|
-
cCode: "MN"
|
|
20904
|
+
cCode: "MN",
|
|
20905
|
+
tCode: "MNG"
|
|
19510
20906
|
},
|
|
19511
20907
|
{
|
|
19512
20908
|
cName: "Montenegro",
|
|
19513
20909
|
dCode: "382",
|
|
19514
|
-
cCode: "ME"
|
|
20910
|
+
cCode: "ME",
|
|
20911
|
+
tCode: "MNE"
|
|
19515
20912
|
},
|
|
19516
20913
|
{
|
|
19517
20914
|
cName: "Montserrat",
|
|
19518
20915
|
dCode: "1664",
|
|
19519
|
-
cCode: "MS"
|
|
20916
|
+
cCode: "MS",
|
|
20917
|
+
tCode: "MSR"
|
|
19520
20918
|
},
|
|
19521
20919
|
{
|
|
19522
20920
|
cName: "Morocco",
|
|
19523
20921
|
dCode: "212",
|
|
19524
|
-
cCode: "MA"
|
|
20922
|
+
cCode: "MA",
|
|
20923
|
+
tCode: "MAR"
|
|
19525
20924
|
},
|
|
19526
20925
|
{
|
|
19527
20926
|
cName: "Mozambique",
|
|
19528
20927
|
dCode: "258",
|
|
19529
|
-
cCode: "MZ"
|
|
20928
|
+
cCode: "MZ",
|
|
20929
|
+
tCode: "MOZ"
|
|
19530
20930
|
},
|
|
19531
20931
|
{
|
|
19532
20932
|
cName: "Myanmar",
|
|
19533
20933
|
dCode: "95",
|
|
19534
|
-
cCode: "MM"
|
|
20934
|
+
cCode: "MM",
|
|
20935
|
+
tCode: "MMR"
|
|
19535
20936
|
},
|
|
19536
20937
|
{
|
|
19537
20938
|
cName: "Namibia",
|
|
19538
20939
|
dCode: "264",
|
|
19539
|
-
cCode: "NA"
|
|
20940
|
+
cCode: "NA",
|
|
20941
|
+
tCode: "NAM"
|
|
19540
20942
|
},
|
|
19541
20943
|
{
|
|
19542
20944
|
cName: "Nauru",
|
|
19543
20945
|
dCode: "674",
|
|
19544
|
-
cCode: "NR"
|
|
20946
|
+
cCode: "NR",
|
|
20947
|
+
tCode: "NRU"
|
|
19545
20948
|
},
|
|
19546
20949
|
{
|
|
19547
20950
|
cName: "Nepal",
|
|
19548
20951
|
dCode: "977",
|
|
19549
|
-
cCode: "NP"
|
|
20952
|
+
cCode: "NP",
|
|
20953
|
+
tCode: "NPL"
|
|
19550
20954
|
},
|
|
19551
20955
|
{
|
|
19552
20956
|
cName: "Netherlands",
|
|
19553
20957
|
dCode: "31",
|
|
19554
|
-
cCode: "NL"
|
|
20958
|
+
cCode: "NL",
|
|
20959
|
+
tCode: "NLD"
|
|
19555
20960
|
},
|
|
19556
20961
|
{
|
|
19557
20962
|
cName: "Netherlands Antilles",
|
|
19558
20963
|
dCode: "599",
|
|
19559
|
-
cCode: "AN"
|
|
20964
|
+
cCode: "AN",
|
|
20965
|
+
tCode: "ANT"
|
|
19560
20966
|
},
|
|
19561
20967
|
{
|
|
19562
20968
|
cName: "New Caledonia",
|
|
19563
20969
|
dCode: "687",
|
|
19564
|
-
cCode: "NC"
|
|
20970
|
+
cCode: "NC",
|
|
20971
|
+
tCode: "NCL"
|
|
19565
20972
|
},
|
|
19566
20973
|
{
|
|
19567
20974
|
cName: "New Zealand",
|
|
19568
20975
|
dCode: "64",
|
|
19569
|
-
cCode: "NZ"
|
|
20976
|
+
cCode: "NZ",
|
|
20977
|
+
tCode: "NZL"
|
|
19570
20978
|
},
|
|
19571
20979
|
{
|
|
19572
20980
|
cName: "Nicaragua",
|
|
19573
20981
|
dCode: "505",
|
|
19574
|
-
cCode: "NI"
|
|
20982
|
+
cCode: "NI",
|
|
20983
|
+
tCode: "NIC"
|
|
19575
20984
|
},
|
|
19576
20985
|
{
|
|
19577
20986
|
cName: "Niger",
|
|
19578
20987
|
dCode: "227",
|
|
19579
|
-
cCode: "NE"
|
|
20988
|
+
cCode: "NE",
|
|
20989
|
+
tCode: "NER"
|
|
19580
20990
|
},
|
|
19581
20991
|
{
|
|
19582
20992
|
cName: "Nigeria",
|
|
19583
20993
|
dCode: "234",
|
|
19584
|
-
cCode: "NG"
|
|
20994
|
+
cCode: "NG",
|
|
20995
|
+
tCode: "NGA"
|
|
19585
20996
|
},
|
|
19586
20997
|
{
|
|
19587
20998
|
cName: "Niue",
|
|
19588
20999
|
dCode: "683",
|
|
19589
|
-
cCode: "NU"
|
|
21000
|
+
cCode: "NU",
|
|
21001
|
+
tCode: "NIU"
|
|
19590
21002
|
},
|
|
19591
21003
|
{
|
|
19592
21004
|
cName: "Norfolk Island",
|
|
19593
21005
|
dCode: "672",
|
|
19594
|
-
cCode: "NF"
|
|
21006
|
+
cCode: "NF",
|
|
21007
|
+
tCode: "NFK"
|
|
19595
21008
|
},
|
|
19596
21009
|
{
|
|
19597
21010
|
cName: "Northern Mariana Islands",
|
|
19598
21011
|
dCode: "1670",
|
|
19599
|
-
cCode: "MP"
|
|
21012
|
+
cCode: "MP",
|
|
21013
|
+
tCode: "MNP"
|
|
19600
21014
|
},
|
|
19601
21015
|
{
|
|
19602
21016
|
cName: "Norway",
|
|
19603
21017
|
dCode: "47",
|
|
19604
|
-
cCode: "NO"
|
|
21018
|
+
cCode: "NO",
|
|
21019
|
+
tCode: "NOR"
|
|
19605
21020
|
},
|
|
19606
21021
|
{
|
|
19607
21022
|
cName: "Oman",
|
|
19608
21023
|
dCode: "968",
|
|
19609
|
-
cCode: "OM"
|
|
21024
|
+
cCode: "OM",
|
|
21025
|
+
tCode: "OMN"
|
|
19610
21026
|
},
|
|
19611
21027
|
{
|
|
19612
21028
|
cName: "Pakistan",
|
|
19613
21029
|
dCode: "92",
|
|
19614
|
-
cCode: "PK"
|
|
21030
|
+
cCode: "PK",
|
|
21031
|
+
tCode: "PAK"
|
|
19615
21032
|
},
|
|
19616
21033
|
{
|
|
19617
21034
|
cName: "Palau",
|
|
19618
21035
|
dCode: "680",
|
|
19619
|
-
cCode: "PW"
|
|
21036
|
+
cCode: "PW",
|
|
21037
|
+
tCode: "PLW"
|
|
19620
21038
|
},
|
|
19621
21039
|
{
|
|
19622
21040
|
cName: "Palestinian Territory, Occupied",
|
|
19623
21041
|
dCode: "970",
|
|
19624
|
-
cCode: "PS"
|
|
21042
|
+
cCode: "PS",
|
|
21043
|
+
tCode: "PSE"
|
|
19625
21044
|
},
|
|
19626
21045
|
{
|
|
19627
21046
|
cName: "Panama",
|
|
19628
21047
|
dCode: "507",
|
|
19629
|
-
cCode: "PA"
|
|
21048
|
+
cCode: "PA",
|
|
21049
|
+
tCode: "PAN"
|
|
19630
21050
|
},
|
|
19631
21051
|
{
|
|
19632
21052
|
cName: "Papua New Guinea",
|
|
19633
21053
|
dCode: "675",
|
|
19634
|
-
cCode: "PG"
|
|
21054
|
+
cCode: "PG",
|
|
21055
|
+
tCode: "PNG"
|
|
19635
21056
|
},
|
|
19636
21057
|
{
|
|
19637
21058
|
cName: "Paraguay",
|
|
19638
21059
|
dCode: "595",
|
|
19639
|
-
cCode: "PY"
|
|
21060
|
+
cCode: "PY",
|
|
21061
|
+
tCode: "PRY"
|
|
19640
21062
|
},
|
|
19641
21063
|
{
|
|
19642
21064
|
cName: "Peru",
|
|
19643
21065
|
dCode: "51",
|
|
19644
|
-
cCode: "PE"
|
|
21066
|
+
cCode: "PE",
|
|
21067
|
+
tCode: "PER"
|
|
19645
21068
|
},
|
|
19646
21069
|
{
|
|
19647
21070
|
cName: "Philippines",
|
|
19648
21071
|
dCode: "63",
|
|
19649
|
-
cCode: "PH"
|
|
21072
|
+
cCode: "PH",
|
|
21073
|
+
tCode: "PHL"
|
|
19650
21074
|
},
|
|
19651
21075
|
{
|
|
19652
21076
|
cName: "Pitcairn",
|
|
19653
21077
|
dCode: "872",
|
|
19654
|
-
cCode: "PN"
|
|
21078
|
+
cCode: "PN",
|
|
21079
|
+
tCode: "PCN"
|
|
19655
21080
|
},
|
|
19656
21081
|
{
|
|
19657
21082
|
cName: "Poland",
|
|
19658
21083
|
dCode: "48",
|
|
19659
|
-
cCode: "PL"
|
|
21084
|
+
cCode: "PL",
|
|
21085
|
+
tCode: "POL"
|
|
19660
21086
|
},
|
|
19661
21087
|
{
|
|
19662
21088
|
cName: "Portugal",
|
|
19663
21089
|
dCode: "351",
|
|
19664
|
-
cCode: "PT"
|
|
21090
|
+
cCode: "PT",
|
|
21091
|
+
tCode: "PRT"
|
|
19665
21092
|
},
|
|
19666
21093
|
{
|
|
19667
21094
|
cName: "Puerto Rico",
|
|
19668
21095
|
dCode: "1939",
|
|
19669
|
-
cCode: "PR"
|
|
21096
|
+
cCode: "PR",
|
|
21097
|
+
tCode: "PRI"
|
|
19670
21098
|
},
|
|
19671
21099
|
{
|
|
19672
21100
|
cName: "Qatar",
|
|
19673
21101
|
dCode: "974",
|
|
19674
|
-
cCode: "QA"
|
|
21102
|
+
cCode: "QA",
|
|
21103
|
+
tCode: "QAT"
|
|
19675
21104
|
},
|
|
19676
21105
|
{
|
|
19677
21106
|
cName: "Romania",
|
|
19678
21107
|
dCode: "40",
|
|
19679
|
-
cCode: "RO"
|
|
21108
|
+
cCode: "RO",
|
|
21109
|
+
tCode: "ROU"
|
|
19680
21110
|
},
|
|
19681
21111
|
{
|
|
19682
21112
|
cName: "Russia",
|
|
19683
21113
|
dCode: "7",
|
|
19684
|
-
cCode: "RU"
|
|
21114
|
+
cCode: "RU",
|
|
21115
|
+
tCode: "RUS"
|
|
19685
21116
|
},
|
|
19686
21117
|
{
|
|
19687
21118
|
cName: "Rwanda",
|
|
19688
21119
|
dCode: "250",
|
|
19689
|
-
cCode: "RW"
|
|
21120
|
+
cCode: "RW",
|
|
21121
|
+
tCode: "RWA"
|
|
19690
21122
|
},
|
|
19691
21123
|
{
|
|
19692
21124
|
cName: "Reunion",
|
|
19693
21125
|
dCode: "262",
|
|
19694
|
-
cCode: "RE"
|
|
21126
|
+
cCode: "RE",
|
|
21127
|
+
tCode: "REU"
|
|
19695
21128
|
},
|
|
19696
21129
|
{
|
|
19697
21130
|
cName: "Saint Barthelemy",
|
|
19698
21131
|
dCode: "590",
|
|
19699
|
-
cCode: "BL"
|
|
21132
|
+
cCode: "BL",
|
|
21133
|
+
tCode: "BLM"
|
|
19700
21134
|
},
|
|
19701
21135
|
{
|
|
19702
21136
|
cName: "Saint Helena, Ascension and Tristan Da Cunha",
|
|
19703
21137
|
dCode: "290",
|
|
19704
|
-
cCode: "SH"
|
|
21138
|
+
cCode: "SH",
|
|
21139
|
+
tCode: "SHN"
|
|
19705
21140
|
},
|
|
19706
21141
|
{
|
|
19707
21142
|
cName: "Saint Kitts and Nevis",
|
|
19708
21143
|
dCode: "1869",
|
|
19709
|
-
cCode: "KN"
|
|
21144
|
+
cCode: "KN",
|
|
21145
|
+
tCode: "KNA"
|
|
19710
21146
|
},
|
|
19711
21147
|
{
|
|
19712
21148
|
cName: "Saint Lucia",
|
|
19713
21149
|
dCode: "1758",
|
|
19714
|
-
cCode: "LC"
|
|
21150
|
+
cCode: "LC",
|
|
21151
|
+
tCode: "LCA"
|
|
19715
21152
|
},
|
|
19716
21153
|
{
|
|
19717
21154
|
cName: "Saint Martin",
|
|
19718
21155
|
dCode: "590",
|
|
19719
|
-
cCode: "MF"
|
|
21156
|
+
cCode: "MF",
|
|
21157
|
+
tCode: "MAF"
|
|
19720
21158
|
},
|
|
19721
21159
|
{
|
|
19722
21160
|
cName: "Saint Pierre and Miquelon",
|
|
19723
21161
|
dCode: "508",
|
|
19724
|
-
cCode: "PM"
|
|
21162
|
+
cCode: "PM",
|
|
21163
|
+
tCode: "SPM"
|
|
19725
21164
|
},
|
|
19726
21165
|
{
|
|
19727
21166
|
cName: "Saint Vincent and the Grenadines",
|
|
19728
21167
|
dCode: "1784",
|
|
19729
|
-
cCode: "VC"
|
|
21168
|
+
cCode: "VC",
|
|
21169
|
+
tCode: "VCT"
|
|
19730
21170
|
},
|
|
19731
21171
|
{
|
|
19732
21172
|
cName: "Samoa",
|
|
19733
21173
|
dCode: "685",
|
|
19734
|
-
cCode: "WS"
|
|
21174
|
+
cCode: "WS",
|
|
21175
|
+
tCode: "WSM"
|
|
19735
21176
|
},
|
|
19736
21177
|
{
|
|
19737
21178
|
cName: "San Marino",
|
|
19738
21179
|
dCode: "378",
|
|
19739
|
-
cCode: "SM"
|
|
21180
|
+
cCode: "SM",
|
|
21181
|
+
tCode: "SMR"
|
|
19740
21182
|
},
|
|
19741
21183
|
{
|
|
19742
21184
|
cName: "Sao Tome and Principe",
|
|
19743
21185
|
dCode: "239",
|
|
19744
|
-
cCode: "ST"
|
|
21186
|
+
cCode: "ST",
|
|
21187
|
+
tCode: "STP"
|
|
19745
21188
|
},
|
|
19746
21189
|
{
|
|
19747
21190
|
cName: "Saudi Arabia",
|
|
19748
21191
|
dCode: "966",
|
|
19749
|
-
cCode: "SA"
|
|
21192
|
+
cCode: "SA",
|
|
21193
|
+
tCode: "SAU"
|
|
19750
21194
|
},
|
|
19751
21195
|
{
|
|
19752
21196
|
cName: "Senegal",
|
|
19753
21197
|
dCode: "221",
|
|
19754
|
-
cCode: "SN"
|
|
21198
|
+
cCode: "SN",
|
|
21199
|
+
tCode: "SEN"
|
|
19755
21200
|
},
|
|
19756
21201
|
{
|
|
19757
21202
|
cName: "Serbia",
|
|
19758
21203
|
dCode: "381",
|
|
19759
|
-
cCode: "RS"
|
|
21204
|
+
cCode: "RS",
|
|
21205
|
+
tCode: "SRB"
|
|
19760
21206
|
},
|
|
19761
21207
|
{
|
|
19762
21208
|
cName: "Seychelles",
|
|
19763
21209
|
dCode: "248",
|
|
19764
|
-
cCode: "SC"
|
|
21210
|
+
cCode: "SC",
|
|
21211
|
+
tCode: "SYC"
|
|
19765
21212
|
},
|
|
19766
21213
|
{
|
|
19767
21214
|
cName: "Sierra Leone",
|
|
19768
21215
|
dCode: "232",
|
|
19769
|
-
cCode: "SL"
|
|
21216
|
+
cCode: "SL",
|
|
21217
|
+
tCode: "SLE"
|
|
19770
21218
|
},
|
|
19771
21219
|
{
|
|
19772
21220
|
cName: "Singapore",
|
|
19773
21221
|
dCode: "65",
|
|
19774
|
-
cCode: "SG"
|
|
21222
|
+
cCode: "SG",
|
|
21223
|
+
tCode: "SGP"
|
|
19775
21224
|
},
|
|
19776
21225
|
{
|
|
19777
21226
|
cName: "Slovakia",
|
|
19778
21227
|
dCode: "421",
|
|
19779
|
-
cCode: "SK"
|
|
21228
|
+
cCode: "SK",
|
|
21229
|
+
tCode: "SVK"
|
|
19780
21230
|
},
|
|
19781
21231
|
{
|
|
19782
21232
|
cName: "Slovenia",
|
|
19783
21233
|
dCode: "386",
|
|
19784
|
-
cCode: "SI"
|
|
21234
|
+
cCode: "SI",
|
|
21235
|
+
tCode: "SVN"
|
|
19785
21236
|
},
|
|
19786
21237
|
{
|
|
19787
21238
|
cName: "Solomon Islands",
|
|
19788
21239
|
dCode: "677",
|
|
19789
|
-
cCode: "SB"
|
|
21240
|
+
cCode: "SB",
|
|
21241
|
+
tCode: "SLB"
|
|
19790
21242
|
},
|
|
19791
21243
|
{
|
|
19792
21244
|
cName: "Somalia",
|
|
19793
21245
|
dCode: "252",
|
|
19794
|
-
cCode: "SO"
|
|
21246
|
+
cCode: "SO",
|
|
21247
|
+
tCode: "SOM"
|
|
19795
21248
|
},
|
|
19796
21249
|
{
|
|
19797
21250
|
cName: "South Africa",
|
|
19798
21251
|
dCode: "27",
|
|
19799
|
-
cCode: "ZA"
|
|
21252
|
+
cCode: "ZA",
|
|
21253
|
+
tCode: "ZAF"
|
|
19800
21254
|
},
|
|
19801
21255
|
{
|
|
19802
21256
|
cName: "South Sudan",
|
|
19803
21257
|
dCode: "211",
|
|
19804
|
-
cCode: "SS"
|
|
21258
|
+
cCode: "SS",
|
|
21259
|
+
tCode: "SSD"
|
|
19805
21260
|
},
|
|
19806
21261
|
{
|
|
19807
21262
|
cName: "South Georgia and the South Sandwich Islands",
|
|
19808
21263
|
dCode: "500",
|
|
19809
|
-
cCode: "GS"
|
|
21264
|
+
cCode: "GS",
|
|
21265
|
+
tCode: "SGS"
|
|
19810
21266
|
},
|
|
19811
21267
|
{
|
|
19812
21268
|
cName: "Spain",
|
|
19813
21269
|
dCode: "34",
|
|
19814
|
-
cCode: "ES"
|
|
21270
|
+
cCode: "ES",
|
|
21271
|
+
tCode: "ESP"
|
|
19815
21272
|
},
|
|
19816
21273
|
{
|
|
19817
21274
|
cName: "Sri Lanka",
|
|
19818
21275
|
dCode: "94",
|
|
19819
|
-
cCode: "LK"
|
|
21276
|
+
cCode: "LK",
|
|
21277
|
+
tCode: "LKA"
|
|
19820
21278
|
},
|
|
19821
21279
|
{
|
|
19822
21280
|
cName: "Sudan",
|
|
19823
21281
|
dCode: "249",
|
|
19824
|
-
cCode: "SD"
|
|
21282
|
+
cCode: "SD",
|
|
21283
|
+
tCode: "SSD"
|
|
19825
21284
|
},
|
|
19826
21285
|
{
|
|
19827
21286
|
cName: "SuricName",
|
|
19828
21287
|
dCode: "597",
|
|
19829
|
-
cCode: "SR"
|
|
21288
|
+
cCode: "SR",
|
|
21289
|
+
tCode: "SUR"
|
|
19830
21290
|
},
|
|
19831
21291
|
{
|
|
19832
21292
|
cName: "Svalbard and Jan Mayen",
|
|
19833
21293
|
dCode: "47",
|
|
19834
|
-
cCode: "SJ"
|
|
21294
|
+
cCode: "SJ",
|
|
21295
|
+
tCode: "SJM"
|
|
19835
21296
|
},
|
|
19836
21297
|
{
|
|
19837
21298
|
cName: "Swaziland",
|
|
19838
21299
|
dCode: "268",
|
|
19839
|
-
cCode: "SZ"
|
|
21300
|
+
cCode: "SZ",
|
|
21301
|
+
tCode: "SWZ"
|
|
19840
21302
|
},
|
|
19841
21303
|
{
|
|
19842
21304
|
cName: "Sweden",
|
|
19843
21305
|
dCode: "46",
|
|
19844
|
-
cCode: "SE"
|
|
21306
|
+
cCode: "SE",
|
|
21307
|
+
tCode: "SWE"
|
|
19845
21308
|
},
|
|
19846
21309
|
{
|
|
19847
21310
|
cName: "Switzerland",
|
|
19848
21311
|
dCode: "41",
|
|
19849
|
-
cCode: "CH"
|
|
21312
|
+
cCode: "CH",
|
|
21313
|
+
tCode: "CHE"
|
|
19850
21314
|
},
|
|
19851
21315
|
{
|
|
19852
21316
|
cName: "Syrian Arab Republic",
|
|
19853
21317
|
dCode: "963",
|
|
19854
|
-
cCode: "SY"
|
|
21318
|
+
cCode: "SY",
|
|
21319
|
+
tCode: "SYR"
|
|
19855
21320
|
},
|
|
19856
21321
|
{
|
|
19857
21322
|
cName: "Taiwan",
|
|
19858
21323
|
dCode: "886",
|
|
19859
|
-
cCode: "TW"
|
|
21324
|
+
cCode: "TW",
|
|
21325
|
+
tCode: "TWN"
|
|
19860
21326
|
},
|
|
19861
21327
|
{
|
|
19862
21328
|
cName: "Tajikistan",
|
|
19863
21329
|
dCode: "992",
|
|
19864
|
-
cCode: "TJ"
|
|
21330
|
+
cCode: "TJ",
|
|
21331
|
+
tCode: "TJK"
|
|
19865
21332
|
},
|
|
19866
21333
|
{
|
|
19867
21334
|
cName: "Tanzania, United Republic of Tanzania",
|
|
19868
21335
|
dCode: "255",
|
|
19869
|
-
cCode: "TZ"
|
|
21336
|
+
cCode: "TZ",
|
|
21337
|
+
tCode: "TZA"
|
|
19870
21338
|
},
|
|
19871
21339
|
{
|
|
19872
21340
|
cName: "Thailand",
|
|
19873
21341
|
dCode: "66",
|
|
19874
|
-
cCode: "TH"
|
|
21342
|
+
cCode: "TH",
|
|
21343
|
+
tCode: "THA"
|
|
19875
21344
|
},
|
|
19876
21345
|
{
|
|
19877
21346
|
cName: "Timor-Leste",
|
|
19878
21347
|
dCode: "670",
|
|
19879
|
-
cCode: "TL"
|
|
21348
|
+
cCode: "TL",
|
|
21349
|
+
tCode: "TLS"
|
|
19880
21350
|
},
|
|
19881
21351
|
{
|
|
19882
21352
|
cName: "Togo",
|
|
19883
21353
|
dCode: "228",
|
|
19884
|
-
cCode: "TG"
|
|
21354
|
+
cCode: "TG",
|
|
21355
|
+
tCode: "TGO"
|
|
19885
21356
|
},
|
|
19886
21357
|
{
|
|
19887
21358
|
cName: "Tokelau",
|
|
19888
21359
|
dCode: "690",
|
|
19889
|
-
cCode: "TK"
|
|
21360
|
+
cCode: "TK",
|
|
21361
|
+
tCode: "TKL"
|
|
19890
21362
|
},
|
|
19891
21363
|
{
|
|
19892
21364
|
cName: "Tonga",
|
|
19893
21365
|
dCode: "676",
|
|
19894
|
-
cCode: "TO"
|
|
21366
|
+
cCode: "TO",
|
|
21367
|
+
tCode: "TON"
|
|
19895
21368
|
},
|
|
19896
21369
|
{
|
|
19897
21370
|
cName: "Trinidad and Tobago",
|
|
19898
21371
|
dCode: "1868",
|
|
19899
|
-
cCode: "TT"
|
|
21372
|
+
cCode: "TT",
|
|
21373
|
+
tCode: "TTO"
|
|
19900
21374
|
},
|
|
19901
21375
|
{
|
|
19902
21376
|
cName: "Tunisia",
|
|
19903
21377
|
dCode: "216",
|
|
19904
|
-
cCode: "TN"
|
|
21378
|
+
cCode: "TN",
|
|
21379
|
+
tCode: "TUN"
|
|
19905
21380
|
},
|
|
19906
21381
|
{
|
|
19907
21382
|
cName: "Turkey",
|
|
19908
21383
|
dCode: "90",
|
|
19909
|
-
cCode: "TR"
|
|
21384
|
+
cCode: "TR",
|
|
21385
|
+
tCode: "TUR"
|
|
19910
21386
|
},
|
|
19911
21387
|
{
|
|
19912
21388
|
cName: "Turkmenistan",
|
|
19913
21389
|
dCode: "993",
|
|
19914
|
-
cCode: "TM"
|
|
21390
|
+
cCode: "TM",
|
|
21391
|
+
tCode: "TKM"
|
|
19915
21392
|
},
|
|
19916
21393
|
{
|
|
19917
21394
|
cName: "Turks and Caicos Islands",
|
|
19918
21395
|
dCode: "1649",
|
|
19919
|
-
cCode: "TC"
|
|
21396
|
+
cCode: "TC",
|
|
21397
|
+
tCode: "TCA"
|
|
19920
21398
|
},
|
|
19921
21399
|
{
|
|
19922
21400
|
cName: "Tuvalu",
|
|
19923
21401
|
dCode: "688",
|
|
19924
|
-
cCode: "TV"
|
|
21402
|
+
cCode: "TV",
|
|
21403
|
+
tCode: "TUV"
|
|
19925
21404
|
},
|
|
19926
21405
|
{
|
|
19927
21406
|
cName: "Uganda",
|
|
19928
21407
|
dCode: "256",
|
|
19929
|
-
cCode: "UG"
|
|
21408
|
+
cCode: "UG",
|
|
21409
|
+
tCode: "UGA"
|
|
19930
21410
|
},
|
|
19931
21411
|
{
|
|
19932
21412
|
cName: "Ukraine",
|
|
19933
21413
|
dCode: "380",
|
|
19934
|
-
cCode: "UA"
|
|
21414
|
+
cCode: "UA",
|
|
21415
|
+
tCode: "UKR"
|
|
19935
21416
|
},
|
|
19936
21417
|
{
|
|
19937
21418
|
cName: "United Arab Emirates",
|
|
19938
21419
|
dCode: "971",
|
|
19939
|
-
cCode: "AE"
|
|
21420
|
+
cCode: "AE",
|
|
21421
|
+
tCode: "ARE"
|
|
19940
21422
|
},
|
|
19941
21423
|
{
|
|
19942
21424
|
cName: "United Kingdom",
|
|
19943
21425
|
dCode: "44",
|
|
19944
|
-
cCode: "GB"
|
|
21426
|
+
cCode: "GB",
|
|
21427
|
+
tCode: "GBR"
|
|
19945
21428
|
},
|
|
19946
21429
|
{
|
|
19947
21430
|
cName: "United States",
|
|
19948
21431
|
dCode: "1",
|
|
19949
|
-
cCode: "US"
|
|
21432
|
+
cCode: "US",
|
|
21433
|
+
tCode: "USA"
|
|
19950
21434
|
},
|
|
19951
21435
|
{
|
|
19952
21436
|
cName: "Uruguay",
|
|
19953
21437
|
dCode: "598",
|
|
19954
|
-
cCode: "UY"
|
|
21438
|
+
cCode: "UY",
|
|
21439
|
+
tCode: "URY"
|
|
19955
21440
|
},
|
|
19956
21441
|
{
|
|
19957
21442
|
cName: "Uzbekistan",
|
|
19958
21443
|
dCode: "998",
|
|
19959
|
-
cCode: "UZ"
|
|
21444
|
+
cCode: "UZ",
|
|
21445
|
+
tCode: "UZB"
|
|
19960
21446
|
},
|
|
19961
21447
|
{
|
|
19962
21448
|
cName: "Vanuatu",
|
|
19963
21449
|
dCode: "678",
|
|
19964
|
-
cCode: "VU"
|
|
21450
|
+
cCode: "VU",
|
|
21451
|
+
tCode: "VUT"
|
|
19965
21452
|
},
|
|
19966
21453
|
{
|
|
19967
21454
|
cName: "Venezuela, Bolivarian Republic of Venezuela",
|
|
19968
21455
|
dCode: "58",
|
|
19969
|
-
cCode: "VE"
|
|
21456
|
+
cCode: "VE",
|
|
21457
|
+
tCode: "VEN"
|
|
19970
21458
|
},
|
|
19971
21459
|
{
|
|
19972
21460
|
cName: "Vietnam",
|
|
19973
21461
|
dCode: "84",
|
|
19974
|
-
cCode: "VN"
|
|
21462
|
+
cCode: "VN",
|
|
21463
|
+
tCode: "VNM"
|
|
19975
21464
|
},
|
|
19976
21465
|
{
|
|
19977
21466
|
cName: "Virgin Islands, British",
|
|
19978
21467
|
dCode: "1284",
|
|
19979
|
-
cCode: "VG"
|
|
21468
|
+
cCode: "VG",
|
|
21469
|
+
tCode: "VGB"
|
|
19980
21470
|
},
|
|
19981
21471
|
{
|
|
19982
21472
|
cName: "Virgin Islands, U.S.",
|
|
19983
21473
|
dCode: "1340",
|
|
19984
|
-
cCode: "VI"
|
|
21474
|
+
cCode: "VI",
|
|
21475
|
+
tCode: "VIR"
|
|
19985
21476
|
},
|
|
19986
21477
|
{
|
|
19987
21478
|
cName: "Wallis and Futuna",
|
|
19988
21479
|
dCode: "681",
|
|
19989
|
-
cCode: "WF"
|
|
21480
|
+
cCode: "WF",
|
|
21481
|
+
tCode: "WLF"
|
|
19990
21482
|
},
|
|
19991
21483
|
{
|
|
19992
21484
|
cName: "Yemen",
|
|
19993
21485
|
dCode: "967",
|
|
19994
|
-
cCode: "YE"
|
|
21486
|
+
cCode: "YE",
|
|
21487
|
+
tCode: "YEM"
|
|
19995
21488
|
},
|
|
19996
21489
|
{
|
|
19997
21490
|
cName: "Zambia",
|
|
19998
21491
|
dCode: "260",
|
|
19999
|
-
cCode: "ZM"
|
|
21492
|
+
cCode: "ZM",
|
|
21493
|
+
tCode: "ZMB"
|
|
20000
21494
|
},
|
|
20001
21495
|
{
|
|
20002
21496
|
cName: "Zimbabwe",
|
|
20003
21497
|
dCode: "263",
|
|
20004
|
-
cCode: "ZW"
|
|
21498
|
+
cCode: "ZW",
|
|
21499
|
+
tCode: "ZWE"
|
|
20005
21500
|
}
|
|
20006
21501
|
];
|
|
20007
21502
|
|
|
@@ -20045,8 +21540,8 @@ var EuroStations = [
|
|
|
20045
21540
|
];
|
|
20046
21541
|
|
|
20047
21542
|
class FastTrackEnterpriseSearch extends BaseEnterpriseSearch {
|
|
20048
|
-
constructor(fasttrackFetcher, helpers, basketService, storageService, searchService) {
|
|
20049
|
-
super(storageService, helpers, searchService);
|
|
21543
|
+
constructor(fasttrackFetcher, helpers, basketService, storageService, searchService, userService) {
|
|
21544
|
+
super(storageService, helpers, searchService, userService);
|
|
20050
21545
|
this.fasttrackFetcher = fasttrackFetcher;
|
|
20051
21546
|
this.basketService = basketService;
|
|
20052
21547
|
this.type = ServiceType.FastTrack;
|
|
@@ -20267,7 +21762,7 @@ class FastTrackEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
20267
21762
|
}, { amount: Number.MAX_SAFE_INTEGER, currencyCode: currency });
|
|
20268
21763
|
}
|
|
20269
21764
|
addFastTrackToBasket(fasttrackQuote, fasttrackQuery) {
|
|
20270
|
-
var _a;
|
|
21765
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
20271
21766
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20272
21767
|
if (fasttrackQuote.unavailable) {
|
|
20273
21768
|
return Promise.resolve(DifferentInvokdedUserReasons.cancel);
|
|
@@ -20291,7 +21786,10 @@ class FastTrackEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
20291
21786
|
price: fasttrackQuote.price,
|
|
20292
21787
|
currency: fasttrackQuote.currency,
|
|
20293
21788
|
searchQuery: fasttrackQuery,
|
|
20294
|
-
outboundDate: fasttrackQuery.arrivalDatetime.format()
|
|
21789
|
+
outboundDate: fasttrackQuery.arrivalDatetime.format(),
|
|
21790
|
+
lowestPrice: ((_b = this.cheapestPrice) === null || _b === void 0 ? void 0 : _b.amount) != fasttrackQuote.price || ((_c = this.cheapestPrice) === null || _c === void 0 ? void 0 : _c.currencyCode) != fasttrackQuote.currency ? (_d = this.cheapestPrice) === null || _d === void 0 ? void 0 : _d.amount : null,
|
|
21791
|
+
lowestPriceCurrency: ((_e = this.cheapestPrice) === null || _e === void 0 ? void 0 : _e.amount) != fasttrackQuote.price || ((_f = this.cheapestPrice) === null || _f === void 0 ? void 0 : _f.currencyCode) != fasttrackQuote.currency ?
|
|
21792
|
+
(_g = this.cheapestPrice) === null || _g === void 0 ? void 0 : _g.currencyCode : null
|
|
20295
21793
|
}, intBasket, this.searchService, this.travellers, fasttrackQuote.requiresReason);
|
|
20296
21794
|
if (whatHappened === DifferentInvokdedUserReasons.research) {
|
|
20297
21795
|
this.performSearch();
|
|
@@ -20364,7 +21862,7 @@ var TravellerSearchTypes;
|
|
|
20364
21862
|
TravellerSearchTypes["employeeNumber"] = "employeeNumber";
|
|
20365
21863
|
})(TravellerSearchTypes || (TravellerSearchTypes = {}));
|
|
20366
21864
|
class BaseEnterpriseSearchService {
|
|
20367
|
-
constructor(searchAirportsFetcher, searchAirlinesFetcher, storageService, userService, modalService, router, helpers, hotelAvalibilityService, citiesFetcher, confermaCitiesFetcher, postcodeFetcher, railStationFetcher, saveUserAddressUpdater, userAddressesFetcher, basketService, getUserCompanyOfficesFetcher, searchHotelChainsFetcher, getConfermaRoomImagesFetcher, baseValidateIsPostcodeValidTester, depotFetcher, confermaOfficeNamesFetcher, confermaOfficeFetcher, baseDeleteUserAddressUpdater, baseDeleteRecentSearchUpdater, baseSaveRecentSearchUpdater, getUserCurrentCarbonAllowanceFetcher, baseSaveFavouriteSearchUpdater, environment, loungeFetcher, parkingFetcher, httpCallService, flightFetcher, hotelFetcher, carhireFetcher, carHireAvailabilityDetailFetcher, cabhireFetcher, railFetcher, irlFetcher, getRailStationFetcher, getIrlSupplierStationFetcher,
|
|
21865
|
+
constructor(searchAirportsFetcher, searchAirlinesFetcher, storageService, userService, modalService, router, helpers, hotelAvalibilityService, citiesFetcher, confermaCitiesFetcher, postcodeFetcher, railStationFetcher, saveUserAddressUpdater, userAddressesFetcher, basketService, getUserCompanyOfficesFetcher, searchHotelChainsFetcher, getConfermaRoomImagesFetcher, baseValidateIsPostcodeValidTester, depotFetcher, confermaOfficeNamesFetcher, confermaOfficeFetcher, baseDeleteUserAddressUpdater, baseDeleteRecentSearchUpdater, baseSaveRecentSearchUpdater, getUserCurrentCarbonAllowanceFetcher, baseSaveFavouriteSearchUpdater, environment, loungeFetcher, parkingFetcher, httpCallService, flightFetcher, hotelFetcher, carhireFetcher, carHireAvailabilityDetailFetcher, cabhireFetcher, railFetcher, irlFetcher, getRailStationFetcher, getIrlSupplierStationFetcher, webTokenService, riskAlertsFetcher, quicklistFetcher, getUserRecentSearchesFetcher, getRailCardsFetcher, getCovidMicrositeTokenFetcher, eurostarFetcher, searchUsersCanBookForFetcher, searchIrlStationsFetcher, irlDiscountCardsFetcher, getFlightFareRulesFetcher, getFlightSeatMapFetcher, getRailLiveDeparturesFetcher, applyHotelRulesFetcher, applyFlightRules, getUserFavouriteSearchesFetcher, deleteFavouriteSearchUpdater, emailBasketFetcher, fasttrackFetcher, sendOfflineNotificationFetcher, getHotelChainsFetcher, getRailProvidersFetcher, getAllAirlinesFetcher, getCarHireProvidersFetcher) {
|
|
20368
21866
|
this.searchAirportsFetcher = searchAirportsFetcher;
|
|
20369
21867
|
this.searchAirlinesFetcher = searchAirlinesFetcher;
|
|
20370
21868
|
this.storageService = storageService;
|
|
@@ -20394,7 +21892,7 @@ class BaseEnterpriseSearchService {
|
|
|
20394
21892
|
this.baseSaveFavouriteSearchUpdater = baseSaveFavouriteSearchUpdater;
|
|
20395
21893
|
this.getRailStationFetcher = getRailStationFetcher;
|
|
20396
21894
|
this.getIrlSupplierStationFetcher = getIrlSupplierStationFetcher;
|
|
20397
|
-
this.
|
|
21895
|
+
this.webTokenService = webTokenService;
|
|
20398
21896
|
this.riskAlertsFetcher = riskAlertsFetcher;
|
|
20399
21897
|
this.getUserRecentSearchesFetcher = getUserRecentSearchesFetcher;
|
|
20400
21898
|
this.getRailCardsFetcher = getRailCardsFetcher;
|
|
@@ -20433,17 +21931,18 @@ class BaseEnterpriseSearchService {
|
|
|
20433
21931
|
this.eurostations = _.toArray(EuroStations);
|
|
20434
21932
|
console.log('Enterpise search service being inited');
|
|
20435
21933
|
this.searches = {
|
|
20436
|
-
[ServiceType.Lounge]: new LoungesEnterpriseSearch(loungeFetcher, helpers, basketService, storageService, this),
|
|
20437
|
-
[ServiceType.Parking]: new ParkingEnterpriseSearch(parkingFetcher, helpers, basketService, storageService, this),
|
|
21934
|
+
[ServiceType.Lounge]: new LoungesEnterpriseSearch(loungeFetcher, helpers, basketService, storageService, this, userService),
|
|
21935
|
+
[ServiceType.Parking]: new ParkingEnterpriseSearch(parkingFetcher, helpers, basketService, storageService, this, userService),
|
|
20438
21936
|
[ServiceType.Flight]: new FlightEnterpriseSearch(flightFetcher, helpers, userService, basketService, storageService, this, applyFlightRules, modalService),
|
|
20439
21937
|
[ServiceType.Hotel]: new HotelEnterpriseSearch(hotelFetcher, helpers, userService, environment, hotelAvalibilityService, basketService, storageService, this, httpCallService, quicklistFetcher, getRailStationFetcher, applyHotelRulesFetcher),
|
|
20440
|
-
[ServiceType.Car]: new CarhireEnterpriseSearch(carhireFetcher, carHireAvailabilityDetailFetcher, helpers, basketService, storageService, this),
|
|
20441
|
-
[ServiceType.Cab]: new CabHireEnterpriseSearch(cabhireFetcher, helpers, storageService, this, basketService),
|
|
20442
|
-
[ServiceType.InternationalRail]: new IRLEnterpriseSearch(irlFetcher, irlDiscountCardsFetcher, helpers, basketService, storageService, this, getIrlSupplierStationFetcher),
|
|
20443
|
-
[ServiceType.FastTrack]: new FastTrackEnterpriseSearch(fasttrackFetcher, helpers, basketService, storageService, this),
|
|
21938
|
+
[ServiceType.Car]: new CarhireEnterpriseSearch(carhireFetcher, carHireAvailabilityDetailFetcher, helpers, basketService, storageService, this, userService),
|
|
21939
|
+
[ServiceType.Cab]: new CabHireEnterpriseSearch(cabhireFetcher, helpers, storageService, this, basketService, userService),
|
|
21940
|
+
[ServiceType.InternationalRail]: new IRLEnterpriseSearch(irlFetcher, irlDiscountCardsFetcher, helpers, basketService, storageService, this, getIrlSupplierStationFetcher, userService),
|
|
21941
|
+
[ServiceType.FastTrack]: new FastTrackEnterpriseSearch(fasttrackFetcher, helpers, basketService, storageService, this, userService),
|
|
20444
21942
|
[ServiceType.Coach]: null,
|
|
21943
|
+
[ServiceType.Ferry]: null,
|
|
20445
21944
|
[ServiceType.Rail]: new RailEnterpriseSearch(railFetcher, getRailStationFetcher, helpers, basketService, storageService, this, userService, modalService),
|
|
20446
|
-
[ServiceType.Eurostar]: new EurostarEnterpriseSearch(eurostarFetcher, helpers, userService, basketService, storageService, this, modalService)
|
|
21945
|
+
[ServiceType.Eurostar]: new EurostarEnterpriseSearch(eurostarFetcher, helpers, userService, basketService, storageService, this, modalService, applyFlightRules)
|
|
20447
21946
|
};
|
|
20448
21947
|
console.log('Newly created search objects: ', this.searches);
|
|
20449
21948
|
this.search_objects = this.helpers.clone(this.init_search_objects());
|
|
@@ -20454,9 +21953,14 @@ class BaseEnterpriseSearchService {
|
|
|
20454
21953
|
this.search_objects = Object.keys(this.search_objects).reduce((objects, key) => {
|
|
20455
21954
|
objects[key].enabled =
|
|
20456
21955
|
!!services && !!services[key];
|
|
21956
|
+
if (!(!!services && !!services[key])) {
|
|
21957
|
+
objects[key].chosen = false;
|
|
21958
|
+
objects[key].originalChosen = false;
|
|
21959
|
+
}
|
|
20457
21960
|
return objects;
|
|
20458
21961
|
}, this.search_objects);
|
|
20459
21962
|
}
|
|
21963
|
+
this.determineHighestSearchPriority();
|
|
20460
21964
|
});
|
|
20461
21965
|
if (Array.isArray(this.countries)) {
|
|
20462
21966
|
this.countries = this.countries.sort((a, b) => {
|
|
@@ -20469,7 +21973,7 @@ class BaseEnterpriseSearchService {
|
|
|
20469
21973
|
return 0;
|
|
20470
21974
|
});
|
|
20471
21975
|
}
|
|
20472
|
-
|
|
21976
|
+
webTokenService.autoLogoutConfig = this.getAutoLogoutConfig();
|
|
20473
21977
|
}
|
|
20474
21978
|
ngOnDestroy() {
|
|
20475
21979
|
if (this.allSubscription) {
|
|
@@ -20877,6 +22381,9 @@ class BaseEnterpriseSearchService {
|
|
|
20877
22381
|
this.updateTravellerInformation();
|
|
20878
22382
|
}
|
|
20879
22383
|
_removeTraveller(traveller) {
|
|
22384
|
+
if (this.userService.bobo && this.userService.bobo.id === traveller.id) {
|
|
22385
|
+
return;
|
|
22386
|
+
}
|
|
20880
22387
|
this.selectedTravellers = this.selectedTravellers.filter((travellerToTest) => {
|
|
20881
22388
|
return !TravellerObject.equals(travellerToTest, traveller);
|
|
20882
22389
|
});
|
|
@@ -21050,7 +22557,7 @@ class BaseEnterpriseSearchService {
|
|
|
21050
22557
|
}
|
|
21051
22558
|
break;
|
|
21052
22559
|
case BookerType.BookerWithSelf:
|
|
21053
|
-
if (
|
|
22560
|
+
if (this.selectedTravellers.length < 1 ||
|
|
21054
22561
|
!this.travellersContainUser()) {
|
|
21055
22562
|
this.travellerValidationMessages.push('Please add your self.');
|
|
21056
22563
|
this.traveller_error = true;
|
|
@@ -21104,14 +22611,7 @@ class BaseEnterpriseSearchService {
|
|
|
21104
22611
|
if (searchObject) {
|
|
21105
22612
|
searchObject.chosen = true;
|
|
21106
22613
|
}
|
|
21107
|
-
if (url) {
|
|
21108
|
-
this.router.navigate([url]);
|
|
21109
|
-
if (this.searches.INTERNATIONAL_RAIL) {
|
|
21110
|
-
this.submitIrlForm();
|
|
21111
|
-
}
|
|
21112
|
-
}
|
|
21113
|
-
else if (searchObject &&
|
|
21114
|
-
!this.router.url.includes(searchObject.resultUrl)) {
|
|
22614
|
+
if (searchObject && !this.router.url.includes(searchObject.resultUrl)) {
|
|
21115
22615
|
this.router.navigate([searchObject.resultUrl]);
|
|
21116
22616
|
}
|
|
21117
22617
|
/*If the search exceeds the timeout time, cancel search and tell OBT that it's timed out*/
|
|
@@ -21133,6 +22633,12 @@ class BaseEnterpriseSearchService {
|
|
|
21133
22633
|
})).finally(() => {
|
|
21134
22634
|
this.search_loading = false;
|
|
21135
22635
|
this.searchLoadingDone.next(true);
|
|
22636
|
+
if (url) {
|
|
22637
|
+
this.router.navigate([url]);
|
|
22638
|
+
if (this.searches.INTERNATIONAL_RAIL) {
|
|
22639
|
+
this.submitIrlForm();
|
|
22640
|
+
}
|
|
22641
|
+
}
|
|
21136
22642
|
});
|
|
21137
22643
|
}
|
|
21138
22644
|
catch (error) {
|
|
@@ -21586,8 +23092,8 @@ class BaseEnterpriseSearchService {
|
|
|
21586
23092
|
journeyType: IrlJourneyType.ReturnJourney,
|
|
21587
23093
|
class: null,
|
|
21588
23094
|
outboundDepartureDateTime: time,
|
|
21589
|
-
|
|
21590
|
-
|
|
23095
|
+
travellingFrom: null,
|
|
23096
|
+
travellingTo: null,
|
|
21591
23097
|
adults: 0,
|
|
21592
23098
|
children: 0,
|
|
21593
23099
|
returnDepartureDateTime: time,
|
|
@@ -21774,7 +23280,7 @@ class BaseEnterpriseSearchService {
|
|
|
21774
23280
|
});
|
|
21775
23281
|
}
|
|
21776
23282
|
getFlightSeatMap(flight) {
|
|
21777
|
-
return this.getFlightSeatMapFetcher.fetchList({ flight
|
|
23283
|
+
return this.getFlightSeatMapFetcher.fetchList({ flight }).pipe(map((data) => {
|
|
21778
23284
|
if (data) {
|
|
21779
23285
|
return data.results;
|
|
21780
23286
|
}
|
|
@@ -21833,7 +23339,6 @@ class BaseEnterpriseSearchService {
|
|
|
21833
23339
|
additionalInfo: searchParams.additionalInstructions || 'No additional instructions',
|
|
21834
23340
|
serviceClass: searchParams.irlClass || 'Any',
|
|
21835
23341
|
offlineReference: this.jrfReference,
|
|
21836
|
-
notifyEmail: currentUserEmail,
|
|
21837
23342
|
onBehalfOf,
|
|
21838
23343
|
passengers
|
|
21839
23344
|
};
|
|
@@ -21846,6 +23351,7 @@ class BaseEnterpriseSearchService {
|
|
|
21846
23351
|
this.modalService.open(ModalTypes.ModalErrorComponent, { centered: true }, { error: 'Unable to send offline notification' });
|
|
21847
23352
|
}
|
|
21848
23353
|
});
|
|
23354
|
+
this.resetSearchParams();
|
|
21849
23355
|
}
|
|
21850
23356
|
}
|
|
21851
23357
|
sendOfflineNotification(jrfReference) {
|
|
@@ -21869,6 +23375,7 @@ class BaseWebTokenService {
|
|
|
21869
23375
|
this.timeoutDuration = 60 * 60;
|
|
21870
23376
|
this.autoLogoutConfig = {};
|
|
21871
23377
|
this._bobo = null;
|
|
23378
|
+
this._boboFetched = false;
|
|
21872
23379
|
this.timeOutDuration = environment.autoLogoutTime;
|
|
21873
23380
|
}
|
|
21874
23381
|
/**
|
|
@@ -21885,11 +23392,16 @@ class BaseWebTokenService {
|
|
|
21885
23392
|
get jwtToken() {
|
|
21886
23393
|
return this._jwtToken || null;
|
|
21887
23394
|
}
|
|
21888
|
-
|
|
21889
|
-
this.
|
|
21890
|
-
|
|
21891
|
-
|
|
21892
|
-
|
|
23395
|
+
getInvokedUserObservable() {
|
|
23396
|
+
if (this._boboFetched) {
|
|
23397
|
+
throw new Error('Only one service can access the service which should be the searchService');
|
|
23398
|
+
}
|
|
23399
|
+
this._boboFetched = true;
|
|
23400
|
+
return Object.freeze({
|
|
23401
|
+
next: (traveller) => {
|
|
23402
|
+
this._bobo = !traveller || traveller.id ? traveller : null;
|
|
23403
|
+
}
|
|
23404
|
+
});
|
|
21893
23405
|
}
|
|
21894
23406
|
_updateTimer() {
|
|
21895
23407
|
window.clearTimeout(this.timer);
|
|
@@ -22415,5 +23927,5 @@ class BaseCreateGuestUpdater extends UpdateableObject {
|
|
|
22415
23927
|
* Generated bundle index. Do not edit.
|
|
22416
23928
|
*/
|
|
22417
23929
|
|
|
22418
|
-
export { AbstractHttpCallService, ActionType, AddressImpl, Airlines, AirportSearchMode, AuthInfo, BaseAcceptNewPriceUpdater, BaseAddItemToBasketUpdater, BaseAddUserToBasketItemUpdater, BaseApplyJitFlightRulesFetcher, BaseBookBasketUpdater, BaseCabhireQuoteFetcher, BaseCancelBookingUpdater, BaseCarHireAvailabilityDetailFetcher, BaseCarhireQuoteFetcher, BaseConfermaOfficeFetcher, BaseConfermaOfficeNamesFetcher, BaseConfirmMessagesUpdater, BaseCreateBasketUpdater, BaseCreateGuestUpdater, BaseDeleteBasketUpdater, BaseDeleteFavouriteSearchUpdater, BaseDeleteRecentSearchUpdater, BaseDeleteUserAddressUpdater, BaseEditUserUpdater, BaseEmailBasketFetcher, BaseEnterpriseBasketService, BaseEnterpriseMyBookingsService, BaseEnterpriseSearch, BaseEnterpriseSearchService, BaseEnvironment, BaseEurostarQuoteFetcher, BaseEventMessenager, BaseFastTrackQuoteFetcher, BaseFlightQuoteFetcher, BaseGetAllAirlinesFetcher, BaseGetBasketFetcher, BaseGetCancellationInfoFetcher, BaseGetCarHireProvidersFetcher, BaseGetCompaniesFetcher, BaseGetCompanyFetcher, BaseGetConfermaRoomImagesFetcher, BaseGetCovidMicrositeTokenFetcher, BaseGetFlightFareRulesFetcher, BaseGetFlightSeatMapFetcher, BaseGetHotelChainsFetcher, BaseGetIrlSupplierStationFetcher, BaseGetMiAutoSugestionFetcher, BaseGetRailLiveDeparturesFetcher, BaseGetRailProvidersFetcher, BaseGetRailStationFetcher, BaseGetRailcardsFetcher, BaseGetRiskAlertsFetcher, BaseGetUserBasketsFetcher, BaseGetUserCompanyOfficesFetcher, BaseGetUserCurrentCarbonAllowanceFetcher, BaseGetUserFavouriteSearchesFetcher, BaseGetUserFetcher, BaseGetUserGuestsFetcher, BaseGetUserRecentSearchesFetcher, BaseHelperRoutines, BaseHotelAvalibilityQuoteFetcher, BaseHotelAvalibilityService, BaseHotelQuoteFetcher, BaseHotelRulesFetcher, BaseIrlDiscountCardFetcher, BaseIrlQuoteFetcher, BaseLogonService, BaseLoungeQuoteFetcher, BaseModalOpenerService, BaseNetworkCall, BaseParkingQuoteFetcher, BaseRailQuoteFetcher, BaseRemoveItemFromBasketUpdater, BaseRequiresReasonService, BaseRevalidateBasketUpdater, BaseRouteHappyService, BaseSaveFavouriteSearchUpdater, BaseSaveRecentSearchUpdater, BaseSaveUserAddressUpdater, BaseSearchAirlinesFetcher, BaseSearchAirportsFetcher, BaseSearchCityFetcher, BaseSearchConfermaCityFetcher, BaseSearchConfermaQuicklistFetcher, BaseSearchDepotFetcher, BaseSearchHotelChainsFetcher, BaseSearchIrlStationsFetcher, BaseSearchPostcodeFetcher, BaseSearchRailStationsFetcher, BaseSearchUsersCanBookForFetcher, BaseSendBasketForApprovalUpdater, BaseSendOfflineNotificationFetcher, BaseSetBasketItemLeadPassengerUpdater, BaseSetBasketItemMiGroupUpdater, BaseSetBasketItemMiValueUpdater, BaseSetPaymentOptionUpdater, BaseSetUserLanguageUpdater, BaseStorageService, BaseUpdateBasketNoteUpdater, BaseUpdateBasketTitleUpdater, BaseUserAddressesFetcher, BaseUserMessagesFetcher, BaseUserProductsFetcher, BaseUserService, BaseUserUiConfigsFetcher, BaseValidateIsPostcodeValidTester, BaseValidateMiFreeValueTester, BaseWebTokenService, BasemoveBasketItemToBasket, BasketInfoMiDetailsImpl, BookableBasket, BookingStatus, BreatfastTypes, CabHireEnterpriseSearch, CarCompanies, CarhireEnterpriseSearch, ClassType, DEFAULT_FLIGHT_FILTERS, DifferentInvokdedUserReasons, DistanceType, DocTypes, EurostarClassEnum, EurostarEnterpriseSearch, EurostarSearchType, FlightDirectionEnum, FlightDisplayTypes, FlightEnterpriseSearch, FlightSearchType, FlightSortTypes, Genders, HotelChains, HotelEnterpriseSearch, HotelFilters, HotelPolicyEnum, HotelView, IRLEnterpriseSearch, IncludedType, InternalBasket, IrlDirection, LimitedCache, LocationTypes, LoginError, LoginErrorReason, LogoutEnum, LoungesEnterpriseSearch, MAX_TRAVELLERS, ManagementInfoAndIsValid, Memorise, MenuSlideEnum, ModalTypes, OBTFlightCabinClass, PREFERENCE_VALUES, ParkingEnterpriseSearch, PersonTitles, PhoneNumberImpl, PreferredFlags, RailCompanies, RailDirection, RailEnterpriseSearch, RailJourneyFareType, RailSearchCriteria, RegExps, RiskLevelRanking, SchemaFormat, SearchHandler, ServiceProvider, SortMethod, SortTypesCar, SortTypesEurostar, SortTypesHotel, SortTypesIrl, SupplementaryBookingInfoImpl, Suppliers, TaxiFormMode, TimeWindow, TravellerObject, TravellerSearchTypes, URLS, USER_SIGNEDIN, USER_SIGNEDOUT, UserFavorurite, UserInfoImpl, ValidatorChecker, WellbeingEnum, Widgets, ages, defaultValidations, excludedExpression, filtersKeys, includedAccessibilityExpression, includedExpression, makeManagamentInfo, maxTravellerWellbeing, ɵ0, DistanceTypes as ɵb, DocGender as ɵc, DocType as ɵd, PreferenceKey as ɵf, FetchableList as ɵh, FetchableObject as ɵi, UpdateableObject as ɵj, BaseTester as ɵk };
|
|
23930
|
+
export { AbstractHttpCallService, ActionType, AddressImpl, Airlines, AirportSearchMode, AuthInfo, BaseAcceptNewPriceUpdater, BaseAddItemToBasketUpdater, BaseAddUserToBasketItemUpdater, BaseApplyJitFlightRulesFetcher, BaseBookBasketUpdater, BaseCabhireQuoteFetcher, BaseCancelBookingUpdater, BaseCarHireAvailabilityDetailFetcher, BaseCarhireQuoteFetcher, BaseConfermaOfficeFetcher, BaseConfermaOfficeNamesFetcher, BaseConfirmMessagesUpdater, BaseCreateBasketUpdater, BaseCreateGuestUpdater, BaseDeleteBasketUpdater, BaseDeleteFavouriteSearchUpdater, BaseDeleteRecentSearchUpdater, BaseDeleteUserAddressUpdater, BaseEditUserUpdater, BaseEmailBasketFetcher, BaseEnterpriseBasketService, BaseEnterpriseMyBookingsService, BaseEnterpriseSearch, BaseEnterpriseSearchService, BaseEnvironment, BaseEurostarQuoteFetcher, BaseEventMessenager, BaseFastTrackQuoteFetcher, BaseFlightQuoteFetcher, BaseGetAllAirlinesFetcher, BaseGetBasketFetcher, BaseGetCancellationInfoFetcher, BaseGetCarHireProvidersFetcher, BaseGetCompaniesFetcher, BaseGetCompanyFetcher, BaseGetConfermaRoomImagesFetcher, BaseGetCovidMicrositeTokenFetcher, BaseGetFlightFareRulesFetcher, BaseGetFlightSeatMapFetcher, BaseGetHotelChainsFetcher, BaseGetIrlSupplierStationFetcher, BaseGetMiAutoSugestionFetcher, BaseGetOfficeFetcher, BaseGetRailLiveDeparturesFetcher, BaseGetRailProvidersFetcher, BaseGetRailStationFetcher, BaseGetRailcardsFetcher, BaseGetRiskAlertsFetcher, BaseGetUserBasketsFetcher, BaseGetUserCompanyOfficesFetcher, BaseGetUserCurrentCarbonAllowanceFetcher, BaseGetUserDefaultMIValueFetcher, BaseGetUserFavouriteSearchesFetcher, BaseGetUserFetcher, BaseGetUserGuestsFetcher, BaseGetUserRecentSearchesFetcher, BaseHelperRoutines, BaseHotelAvalibilityQuoteFetcher, BaseHotelAvalibilityService, BaseHotelQuoteFetcher, BaseHotelRulesFetcher, BaseIrlDiscountCardFetcher, BaseIrlQuoteFetcher, BaseLogonService, BaseLoungeQuoteFetcher, BaseModalOpenerService, BaseNetworkCall, BaseParkingQuoteFetcher, BaseRailQuoteFetcher, BaseRemoveItemFromBasketUpdater, BaseRequiresReasonService, BaseRevalidateBasketUpdater, BaseRouteHappyService, BaseSaveFavouriteSearchUpdater, BaseSaveRecentSearchUpdater, BaseSaveUserAddressUpdater, BaseSearchAirlinesFetcher, BaseSearchAirportsFetcher, BaseSearchCityFetcher, BaseSearchConfermaCityFetcher, BaseSearchConfermaQuicklistFetcher, BaseSearchDepotFetcher, BaseSearchHotelChainsFetcher, BaseSearchIrlStationsFetcher, BaseSearchPostcodeFetcher, BaseSearchRailStationsFetcher, BaseSearchUsersCanBookForFetcher, BaseSendBasketForApprovalUpdater, BaseSendOfflineNotificationFetcher, BaseSetBasketItemLeadPassengerUpdater, BaseSetBasketItemMiGroupUpdater, BaseSetBasketItemMiValueUpdater, BaseSetPaymentOptionUpdater, BaseSetUserLanguageUpdater, BaseStorageService, BaseUpdateBasketNoteUpdater, BaseUpdateBasketTitleUpdater, BaseUserAddressesFetcher, BaseUserMessagesFetcher, BaseUserProductsFetcher, BaseUserService, BaseUserUiConfigsFetcher, BaseValidateIsPostcodeValidTester, BaseValidateMiFreeValueTester, BaseWebTokenService, BasemoveBasketItemToBasket, BasketInfoMiDetailsImpl, BookableBasket, BookingStatus, BreatfastTypes, CabHireEnterpriseSearch, CarCompanies, CarhireEnterpriseSearch, ClassType, DEFAULT_FLIGHT_FILTERS, DifferentInvokdedUserReasons, DistanceType, DocTypes, EurostarClassEnum, EurostarEnterpriseSearch, EurostarSearchType, FlightDirectionEnum, FlightDisplayTypes, FlightEnterpriseSearch, FlightSearchType, FlightSortTypes, Genders, HotelChains, HotelEnterpriseSearch, HotelFilters, HotelPolicyEnum, HotelView, IRLEnterpriseSearch, IncludedType, InternalBasket, IrlDirection, LimitedCache, LocationTypes, LoginError, LoginErrorReason, LogoutEnum, LoungesEnterpriseSearch, MAX_TRAVELLERS, ManagementInfoAndIsValid, Memorise, MenuSlideEnum, ModalTypes, OBTFlightCabinClass, PREFERENCE_VALUES, ParkingEnterpriseSearch, PersonTitles, PhoneNumberImpl, PreferredFlags, RailCompanies, RailDirection, RailEnterpriseSearch, RailJourneyFareType, RailSearchCriteria, RegExps, RiskLevelRanking, SchemaFormat, SearchHandler, ServiceProvider, SortMethod, SortTypesCar, SortTypesEurostar, SortTypesHotel, SortTypesIrl, SupplementaryBookingInfoImpl, Suppliers, TaxiFormMode, TimeWindow, TravellerObject, TravellerSearchTypes, URLS, USER_SIGNEDIN, USER_SIGNEDOUT, UserFavorurite, UserInfoImpl, ValidatorChecker, WellbeingEnum, Widgets, ages, defaultValidations, excludedExpression, filtersKeys, includedAccessibilityExpression, includedExpression, makeManagamentInfo, maxTravellerWellbeing, ɵ0, DistanceTypes as ɵb, DocGender as ɵc, DocType as ɵd, PreferenceKey as ɵf, FetchableList as ɵh, FetchableObject as ɵi, UpdateableObject as ɵj, BaseTester as ɵk };
|
|
22419
23931
|
//# sourceMappingURL=sabstravtech-obtservices-base.js.map
|