@hyper.software/common-helpers 1.3.18 → 1.3.20
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/lib/interfaces.d.ts +345 -6
- package/lib/interfaces.js +49 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/services/bookingService/bookingReceiptService.d.ts +173 -0
- package/lib/services/bookingService/bookingReceiptService.js +340 -0
- package/lib/services/bookingService/bookingReceiptService.js.map +1 -0
- package/lib/services/bookingService/bookingServicesService.d.ts +4 -0
- package/lib/services/bookingService/bookingServicesService.js +74 -0
- package/lib/services/bookingService/bookingServicesService.js.map +1 -0
- package/lib/services/bookingService/bookingsService.js +22 -10
- package/lib/services/bookingService/bookingsService.js.map +1 -1
- package/lib/services/bookingService/bookingsService.test.js +4815 -19582
- package/lib/services/bookingService/bookingsService.test.js.map +1 -1
- package/lib/services/roomBookingServices/index.d.ts +2 -0
- package/lib/services/roomBookingServices/index.js +25 -1
- package/lib/services/roomBookingServices/index.js.map +1 -1
- package/package.json +3 -1
package/lib/interfaces.d.ts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
import { IAddress } from './services/bookingService/bookingReceiptService';
|
|
2
|
+
export interface IUser extends ITimestamps {
|
|
3
|
+
id?: string;
|
|
4
|
+
email?: string;
|
|
5
|
+
password?: string;
|
|
6
|
+
tokenInfo?: any;
|
|
7
|
+
firstName?: string;
|
|
8
|
+
lastName?: string;
|
|
9
|
+
profilePhoto?: string;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
resetPasswordId?: string;
|
|
12
|
+
phoneNumber?: string;
|
|
13
|
+
areTermsAccepted?: boolean;
|
|
14
|
+
dateAcceptedTerms?: Date;
|
|
15
|
+
registerIpAddress?: string;
|
|
16
|
+
lastLoggedIn?: DateOrString;
|
|
17
|
+
currentCompany?: ICompany;
|
|
18
|
+
companies?: ICompany[];
|
|
19
|
+
isTenant?: boolean;
|
|
20
|
+
language?: LANGUAGE;
|
|
21
|
+
}
|
|
1
22
|
export declare enum LANGUAGE {
|
|
2
23
|
DE_DE = "de-DE",
|
|
3
24
|
EN_US = "en-US",
|
|
@@ -105,6 +126,42 @@ export interface IBookingService extends ITimestamps {
|
|
|
105
126
|
service?: IService;
|
|
106
127
|
data?: any;
|
|
107
128
|
}
|
|
129
|
+
export declare enum CUSTOMER_SOURCE {
|
|
130
|
+
PHONE_CALL = "PHONE_CALL",
|
|
131
|
+
WEBSITE = "WEBSITE",
|
|
132
|
+
BOOKING = "BOOKING",
|
|
133
|
+
AIRBNB = "AIRBNB",
|
|
134
|
+
GOOGLE = "GOOGLE",
|
|
135
|
+
MANUAL = "MANUAL"
|
|
136
|
+
}
|
|
137
|
+
export interface ICustomerGroup extends ITimestamps {
|
|
138
|
+
id?: string;
|
|
139
|
+
companyId?: string;
|
|
140
|
+
name?: string;
|
|
141
|
+
phoneNumber?: string;
|
|
142
|
+
email?: string;
|
|
143
|
+
address?: IAddress;
|
|
144
|
+
customers?: ICustomer[];
|
|
145
|
+
}
|
|
146
|
+
export interface ICustomer extends ITimestamps {
|
|
147
|
+
id?: string;
|
|
148
|
+
companyId?: string;
|
|
149
|
+
firstName: string;
|
|
150
|
+
lastName: string;
|
|
151
|
+
phoneNumber?: string;
|
|
152
|
+
email?: string;
|
|
153
|
+
birthDate?: DateOrString;
|
|
154
|
+
address?: IAddress;
|
|
155
|
+
nationality?: string;
|
|
156
|
+
identificationNumber?: string;
|
|
157
|
+
identificationDocument?: IFile[];
|
|
158
|
+
optedInPromotionalOffers?: boolean;
|
|
159
|
+
notes?: string;
|
|
160
|
+
isAnonymized?: boolean;
|
|
161
|
+
bookings?: IBooking[];
|
|
162
|
+
customerGroupId?: string;
|
|
163
|
+
customerGroup?: ICustomerGroup;
|
|
164
|
+
}
|
|
108
165
|
export interface IBooking extends ITimestamps {
|
|
109
166
|
id?: string;
|
|
110
167
|
companyId?: string;
|
|
@@ -116,28 +173,91 @@ export interface IBooking extends ITimestamps {
|
|
|
116
173
|
totalCost?: number;
|
|
117
174
|
isConfirmed?: boolean;
|
|
118
175
|
isCheckedIn?: boolean;
|
|
176
|
+
isCheckedOut?: boolean;
|
|
119
177
|
city?: string;
|
|
120
178
|
bookingSource?: BOOKING_SOURCE;
|
|
121
179
|
notificationStatuses?: IBookingNotificationStatuses;
|
|
122
180
|
roomBookings?: IRoomBooking[];
|
|
123
|
-
customer?:
|
|
124
|
-
admin?:
|
|
125
|
-
company?:
|
|
181
|
+
customer?: ICustomer;
|
|
182
|
+
admin?: IUser;
|
|
183
|
+
company?: ICompany;
|
|
126
184
|
extra?: IBookingExtraInformation;
|
|
185
|
+
checkinInformation?: IBookingCheckinInformation;
|
|
127
186
|
bookingServices?: IBookingService[];
|
|
187
|
+
receipts?: IBookingReceipts;
|
|
128
188
|
}
|
|
129
189
|
export interface IBookingNotificationStatuses {
|
|
130
190
|
sentCustomerReviewRequest?: boolean;
|
|
131
191
|
sentCustomerReviewRequestAfter2Days?: boolean;
|
|
132
192
|
sentCustomerReviewRequestAfter10Days?: boolean;
|
|
193
|
+
shouldNotifyCustomerByEmail?: boolean;
|
|
133
194
|
}
|
|
134
195
|
export interface IBookingExtraInformation {
|
|
135
|
-
isPaid?: boolean;
|
|
136
|
-
otaComission?: number;
|
|
137
196
|
otaBookingId?: string;
|
|
138
197
|
arrivalTime?: string;
|
|
139
198
|
code?: string;
|
|
140
|
-
|
|
199
|
+
payment?: {
|
|
200
|
+
isPaid?: boolean;
|
|
201
|
+
paymentMethod?: PAYMENT_METHOD;
|
|
202
|
+
advancedPayment?: {
|
|
203
|
+
type?: string;
|
|
204
|
+
amountDue?: number;
|
|
205
|
+
amountPaid?: number;
|
|
206
|
+
};
|
|
207
|
+
otaComission?: number;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
export interface IBookingCheckinInformation {
|
|
211
|
+
additionalGuests?: Array<{
|
|
212
|
+
firstName?: string;
|
|
213
|
+
lastName?: string;
|
|
214
|
+
nationality?: string;
|
|
215
|
+
birthDate?: DateOrString;
|
|
216
|
+
}>;
|
|
217
|
+
}
|
|
218
|
+
export interface IBookingCompanyInformation {
|
|
219
|
+
address?: {
|
|
220
|
+
fullAddress?: string;
|
|
221
|
+
zipCodeCity?: string;
|
|
222
|
+
streetInformation?: string;
|
|
223
|
+
};
|
|
224
|
+
companyLegalName?: string;
|
|
225
|
+
registrationNumber?: string;
|
|
226
|
+
vatNumber?: string;
|
|
227
|
+
responsibleName?: string;
|
|
228
|
+
name?: string;
|
|
229
|
+
email?: string;
|
|
230
|
+
phoneNumber?: string;
|
|
231
|
+
bankName?: string;
|
|
232
|
+
iban?: string;
|
|
233
|
+
swift?: string;
|
|
234
|
+
}
|
|
235
|
+
export interface IReceiptCustomerInformation {
|
|
236
|
+
fullName?: string;
|
|
237
|
+
address?: {
|
|
238
|
+
zipCodeCity?: string;
|
|
239
|
+
streetInformation?: string;
|
|
240
|
+
country?: string;
|
|
241
|
+
};
|
|
242
|
+
customerCompanyName?: string;
|
|
243
|
+
company?: string;
|
|
244
|
+
}
|
|
245
|
+
export interface IBookingReceipt {
|
|
246
|
+
currentInvoiceId?: string;
|
|
247
|
+
paymentMethod?: PAYMENT_METHOD;
|
|
248
|
+
paymentMethodText?: string;
|
|
249
|
+
lastUpdated?: string;
|
|
250
|
+
receiptDate?: DateOrString;
|
|
251
|
+
dueDate?: DateOrString;
|
|
252
|
+
notes?: string;
|
|
253
|
+
company?: IBookingCompanyInformation;
|
|
254
|
+
products?: IProduct[];
|
|
255
|
+
customer?: IReceiptCustomerInformation;
|
|
256
|
+
}
|
|
257
|
+
export type IBookingReceipts = IBookingReceipt[];
|
|
258
|
+
export interface IProduct {
|
|
259
|
+
itemName?: IRoom[];
|
|
260
|
+
services?: IBookingService[];
|
|
141
261
|
}
|
|
142
262
|
export interface IRoomBookingIntegrations {
|
|
143
263
|
bnovo?: {
|
|
@@ -229,3 +349,222 @@ export interface IChildrenTourismTaxRates {
|
|
|
229
349
|
minChildAge?: number;
|
|
230
350
|
maxChildAge?: number;
|
|
231
351
|
}
|
|
352
|
+
export declare enum CANCELLATION_TYPE {
|
|
353
|
+
NON_REFUNDABLE = "NON_REFUNDABLE",
|
|
354
|
+
PARTIALLY_REFUNDABLE = "PARTIALLY_REFUNDABLE",
|
|
355
|
+
FULLY_REFUNDABLE = "FULLY_REFUNDABLE"
|
|
356
|
+
}
|
|
357
|
+
export declare const ALL_CANCELLATION_TYPE: CANCELLATION_TYPE[];
|
|
358
|
+
export declare enum COMPANY_AMENITY_CATEGORY {
|
|
359
|
+
GENERAL = "GENERAL",
|
|
360
|
+
SAFETY_FEATURES = "SAFETY_FEATURES",
|
|
361
|
+
PHYSICAL_DISTANCING = "PHYSICAL_DISTANCING",
|
|
362
|
+
CLEANLINESS_AND_DISINFECTION = "CLEANLINESS_AND_DISINFECTING",
|
|
363
|
+
FOOD_AND_DRINKS_SAFETY = "FOOD_AND_DRINKS_SAFETY",
|
|
364
|
+
ACTIVITIES = "ACTIVITIES",
|
|
365
|
+
FOOD_AND_DRINKS = "FOOD_AND_DRINKS",
|
|
366
|
+
POOL_AND_WELLNESS = "POOL_AND_WELLNESS",
|
|
367
|
+
TRANSPORT = "TRANSPORT",
|
|
368
|
+
ADDITIONAL_SERVICES = "ADDITIONAL_SERVICES",
|
|
369
|
+
COMMON_AREAS = "COMMON_AREAS",
|
|
370
|
+
FAMILY_ENTERTAINMENT = "FAMILY_ENTERTAINMENT",
|
|
371
|
+
CLEANING_SERVICES = "CLEANING_SERVICES",
|
|
372
|
+
BUSINESS_FACILITIES = "BUSINESS_FACILITIES",
|
|
373
|
+
MISCELLANEOUS = "MISCELLANEOUS",
|
|
374
|
+
SAFETY_AND_SECURITY = "SAFETY_AND_SECURITY",
|
|
375
|
+
PETS = "PETS"
|
|
376
|
+
}
|
|
377
|
+
export declare enum HOLIDAY {
|
|
378
|
+
LOCAL_HOLIDAY = "LOCAL_HOLIDAY",
|
|
379
|
+
COMMON_HOLIDAY = "COMMON_HOLIDAY"
|
|
380
|
+
}
|
|
381
|
+
export declare const ALL_COMPANY_AMENITY_CATEGORY: COMPANY_AMENITY_CATEGORY[];
|
|
382
|
+
export interface ICompanyAmenity {
|
|
383
|
+
key?: string | null;
|
|
384
|
+
category: COMPANY_AMENITY_CATEGORY;
|
|
385
|
+
hasExtraCost?: boolean;
|
|
386
|
+
isSelected?: boolean;
|
|
387
|
+
}
|
|
388
|
+
export interface ICompanyPublicInformation {
|
|
389
|
+
description: {
|
|
390
|
+
highlights?: {
|
|
391
|
+
title?: string;
|
|
392
|
+
description?: string;
|
|
393
|
+
}[];
|
|
394
|
+
general: string;
|
|
395
|
+
location: string;
|
|
396
|
+
};
|
|
397
|
+
cancellations: {
|
|
398
|
+
type: CANCELLATION_TYPE;
|
|
399
|
+
description: string;
|
|
400
|
+
};
|
|
401
|
+
quietHours: {
|
|
402
|
+
startTime: DateOrString;
|
|
403
|
+
endTime: DateOrString;
|
|
404
|
+
};
|
|
405
|
+
nearbyPlaces?: {
|
|
406
|
+
name: string;
|
|
407
|
+
distance: number;
|
|
408
|
+
}[];
|
|
409
|
+
generalRules: string;
|
|
410
|
+
payment: string;
|
|
411
|
+
}
|
|
412
|
+
export interface IHoliday {
|
|
413
|
+
name: string;
|
|
414
|
+
description: string;
|
|
415
|
+
date: string;
|
|
416
|
+
type: HOLIDAY;
|
|
417
|
+
}
|
|
418
|
+
export interface IBaseFile {
|
|
419
|
+
name: string;
|
|
420
|
+
resourcePath: string;
|
|
421
|
+
size: number;
|
|
422
|
+
disabled?: true;
|
|
423
|
+
}
|
|
424
|
+
export interface IFile extends IBaseFile {
|
|
425
|
+
type: string;
|
|
426
|
+
order: number;
|
|
427
|
+
height?: number;
|
|
428
|
+
width?: number;
|
|
429
|
+
}
|
|
430
|
+
export interface ICompany extends ITimestamps {
|
|
431
|
+
id?: string;
|
|
432
|
+
name?: string;
|
|
433
|
+
stars?: number;
|
|
434
|
+
partnerId?: string;
|
|
435
|
+
parentCompanyId?: string;
|
|
436
|
+
companyCreatedByUserId?: string;
|
|
437
|
+
mainUserId?: string;
|
|
438
|
+
subdomain?: string;
|
|
439
|
+
isEnabled?: boolean;
|
|
440
|
+
isDefault?: boolean;
|
|
441
|
+
language?: LANGUAGE;
|
|
442
|
+
phoneNumbers?: string[];
|
|
443
|
+
whatsappNumber?: string;
|
|
444
|
+
timezone?: string;
|
|
445
|
+
checkinTime?: {
|
|
446
|
+
start: DateOrString;
|
|
447
|
+
end: DateOrString;
|
|
448
|
+
};
|
|
449
|
+
checkoutTime?: {
|
|
450
|
+
start: DateOrString;
|
|
451
|
+
end: DateOrString;
|
|
452
|
+
};
|
|
453
|
+
pricing?: {
|
|
454
|
+
[key: string]: number;
|
|
455
|
+
};
|
|
456
|
+
currency?: CURRENCY;
|
|
457
|
+
email?: string;
|
|
458
|
+
integrations?: {
|
|
459
|
+
bnovo: {
|
|
460
|
+
id: string;
|
|
461
|
+
};
|
|
462
|
+
stripe?: {
|
|
463
|
+
accountId: string;
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
address?: IAddress;
|
|
467
|
+
locationDescription?: {
|
|
468
|
+
title?: string;
|
|
469
|
+
description?: string;
|
|
470
|
+
};
|
|
471
|
+
amenities?: ICompanyAmenity[];
|
|
472
|
+
parentCompany?: ICompany;
|
|
473
|
+
partner?: any;
|
|
474
|
+
themeData?: {
|
|
475
|
+
logo?: IFile | null;
|
|
476
|
+
palette?: {
|
|
477
|
+
primary?: {
|
|
478
|
+
main?: string;
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
data?: any;
|
|
483
|
+
images?: IFile[];
|
|
484
|
+
google?: {
|
|
485
|
+
mapsId?: string;
|
|
486
|
+
reviewUrl?: string;
|
|
487
|
+
minimumRating?: number;
|
|
488
|
+
credentials?: {
|
|
489
|
+
accessToken?: string;
|
|
490
|
+
refreshToken?: string;
|
|
491
|
+
expiresIn?: string;
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
smartPricing?: {
|
|
495
|
+
minimum?: number;
|
|
496
|
+
maximum?: number;
|
|
497
|
+
};
|
|
498
|
+
publicInformation?: ICompanyPublicInformation;
|
|
499
|
+
website?: {
|
|
500
|
+
url?: string;
|
|
501
|
+
shortUrl?: string;
|
|
502
|
+
connectToVisitorDBW?: boolean;
|
|
503
|
+
requestCreditCardInformation?: boolean;
|
|
504
|
+
requestAddressInformation?: boolean;
|
|
505
|
+
stripePaymentsEnabled?: boolean;
|
|
506
|
+
enableMyLike?: boolean;
|
|
507
|
+
websiteBookingsConfirmationNeeded?: boolean;
|
|
508
|
+
headerLinks?: Array<{
|
|
509
|
+
name?: string;
|
|
510
|
+
url?: string;
|
|
511
|
+
}>;
|
|
512
|
+
footerLinks?: Array<{
|
|
513
|
+
name?: string;
|
|
514
|
+
url?: string;
|
|
515
|
+
}>;
|
|
516
|
+
};
|
|
517
|
+
socials?: {
|
|
518
|
+
instagramUrl?: string;
|
|
519
|
+
facebookUrl?: string;
|
|
520
|
+
};
|
|
521
|
+
npsScore?: number;
|
|
522
|
+
holidays?: IHoliday[];
|
|
523
|
+
owDiscountRules?: IOWDiscountRule[];
|
|
524
|
+
bookings?: ICompanyBookingsSettings;
|
|
525
|
+
legalInformation?: ICompanyLegalInformation;
|
|
526
|
+
bankInformation?: ICompanyBankInformation;
|
|
527
|
+
receipts?: ICompanyReceiptsInformation;
|
|
528
|
+
trialEndDate?: DateOrString;
|
|
529
|
+
isPayingCustomer?: boolean;
|
|
530
|
+
includeFeesInFinalCostExternalBookings?: boolean;
|
|
531
|
+
includeMainUserAsEmailCC?: boolean;
|
|
532
|
+
customerDataStoragePeriod?: CUSTOMER_DATA_STORAGE_PERIOD;
|
|
533
|
+
lastExternalBookingsSync?: DateOrString;
|
|
534
|
+
mainUser?: IUser;
|
|
535
|
+
nextInvoiceId?: string;
|
|
536
|
+
}
|
|
537
|
+
export declare enum CUSTOMER_DATA_STORAGE_PERIOD {
|
|
538
|
+
SIX_MONTHS = "SIX_MONTHS",
|
|
539
|
+
ONE_YEAR = "ONE_YEAR",
|
|
540
|
+
TWO_YEARS = "TWO_YEARS"
|
|
541
|
+
}
|
|
542
|
+
export interface ICompanyLegalInformation {
|
|
543
|
+
name?: string;
|
|
544
|
+
registrationNumber?: string;
|
|
545
|
+
vatNumber?: string;
|
|
546
|
+
}
|
|
547
|
+
export interface ICompanyBankInformation {
|
|
548
|
+
bankName?: string;
|
|
549
|
+
iban?: string;
|
|
550
|
+
swift?: string;
|
|
551
|
+
}
|
|
552
|
+
export interface ICompanyReceiptsInformation {
|
|
553
|
+
tourismTax?: number;
|
|
554
|
+
reducedSalesTax?: number;
|
|
555
|
+
salesTax?: number;
|
|
556
|
+
splitBreakfastIntoFoodAndDrinks?: boolean;
|
|
557
|
+
showHeaderFooterReceipts?: boolean;
|
|
558
|
+
headerSpacing?: number;
|
|
559
|
+
}
|
|
560
|
+
export interface IOWDiscountRule {
|
|
561
|
+
lengthOfStay: number;
|
|
562
|
+
type?: DISCOUNT_TYPE;
|
|
563
|
+
value?: number;
|
|
564
|
+
}
|
|
565
|
+
export interface ICompanyBookingsSettings {
|
|
566
|
+
hasManualCheckout?: boolean;
|
|
567
|
+
gatherAdditionalGuestsInformation?: boolean;
|
|
568
|
+
digitsOnlyBookingCode?: boolean;
|
|
569
|
+
blockSamedayCheckinsAfter?: DateOrString;
|
|
570
|
+
}
|
package/lib/interfaces.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ALL_PAYMENT_METHOD = exports.PAYMENT_METHOD = exports.ALL_ROOM_TYPE_BREAKFAST_INFORMATION_TYPE = exports.ROOM_TYPE_BREAKFAST_INFORMATION_TYPE = exports.ALL_SERVICE_DISPLAY_SECTION = exports.SERVICE_DISPLAY_SECTION = exports.ALL_SERVICE_TAX_TYPE = exports.SERVICE_TAX_TYPE = exports.ALL_SERVICE_PRICING_UNIT = exports.SERVICE_PRICING_UNIT = exports.ALL_BOOKING_SOURCE = exports.BOOKING_STATUS = exports.BOOKING_SOURCE = exports.ALL_CHANNEL_TYPE = exports.CHANNEL_TYPE = exports.ALL_DISCOUNT_TYPE = exports.DISCOUNT_TYPE = exports.ALL_CURRENCY = exports.CURRENCY = exports.ALL_LANGUAGE = exports.LANGUAGE = void 0;
|
|
3
|
+
exports.CUSTOMER_DATA_STORAGE_PERIOD = exports.ALL_COMPANY_AMENITY_CATEGORY = exports.HOLIDAY = exports.COMPANY_AMENITY_CATEGORY = exports.ALL_CANCELLATION_TYPE = exports.CANCELLATION_TYPE = exports.ALL_PAYMENT_METHOD = exports.PAYMENT_METHOD = exports.ALL_ROOM_TYPE_BREAKFAST_INFORMATION_TYPE = exports.ROOM_TYPE_BREAKFAST_INFORMATION_TYPE = exports.CUSTOMER_SOURCE = exports.ALL_SERVICE_DISPLAY_SECTION = exports.SERVICE_DISPLAY_SECTION = exports.ALL_SERVICE_TAX_TYPE = exports.SERVICE_TAX_TYPE = exports.ALL_SERVICE_PRICING_UNIT = exports.SERVICE_PRICING_UNIT = exports.ALL_BOOKING_SOURCE = exports.BOOKING_STATUS = exports.BOOKING_SOURCE = exports.ALL_CHANNEL_TYPE = exports.CHANNEL_TYPE = exports.ALL_DISCOUNT_TYPE = exports.DISCOUNT_TYPE = exports.ALL_CURRENCY = exports.CURRENCY = exports.ALL_LANGUAGE = exports.LANGUAGE = void 0;
|
|
4
4
|
var getAllEnumStatuses = function (value) { return Object.keys(value).map(function (key) { return value[key]; }); };
|
|
5
5
|
var LANGUAGE;
|
|
6
6
|
(function (LANGUAGE) {
|
|
@@ -77,6 +77,15 @@ var SERVICE_DISPLAY_SECTION;
|
|
|
77
77
|
SERVICE_DISPLAY_SECTION["OWN_WEBSITE"] = "OWN_WEBSITE";
|
|
78
78
|
})(SERVICE_DISPLAY_SECTION || (exports.SERVICE_DISPLAY_SECTION = SERVICE_DISPLAY_SECTION = {}));
|
|
79
79
|
exports.ALL_SERVICE_DISPLAY_SECTION = getAllEnumStatuses(SERVICE_DISPLAY_SECTION);
|
|
80
|
+
var CUSTOMER_SOURCE;
|
|
81
|
+
(function (CUSTOMER_SOURCE) {
|
|
82
|
+
CUSTOMER_SOURCE["PHONE_CALL"] = "PHONE_CALL";
|
|
83
|
+
CUSTOMER_SOURCE["WEBSITE"] = "WEBSITE";
|
|
84
|
+
CUSTOMER_SOURCE["BOOKING"] = "BOOKING";
|
|
85
|
+
CUSTOMER_SOURCE["AIRBNB"] = "AIRBNB";
|
|
86
|
+
CUSTOMER_SOURCE["GOOGLE"] = "GOOGLE";
|
|
87
|
+
CUSTOMER_SOURCE["MANUAL"] = "MANUAL";
|
|
88
|
+
})(CUSTOMER_SOURCE || (exports.CUSTOMER_SOURCE = CUSTOMER_SOURCE = {}));
|
|
80
89
|
var ROOM_TYPE_BREAKFAST_INFORMATION_TYPE;
|
|
81
90
|
(function (ROOM_TYPE_BREAKFAST_INFORMATION_TYPE) {
|
|
82
91
|
ROOM_TYPE_BREAKFAST_INFORMATION_TYPE["NOT_AVAILABLE"] = "NOT_AVAILABLE";
|
|
@@ -95,4 +104,43 @@ var PAYMENT_METHOD;
|
|
|
95
104
|
PAYMENT_METHOD["STRIPE_ONLINE_PAYMENT"] = "STRIPE_ONLINE_PAYMENT";
|
|
96
105
|
})(PAYMENT_METHOD || (exports.PAYMENT_METHOD = PAYMENT_METHOD = {}));
|
|
97
106
|
exports.ALL_PAYMENT_METHOD = getAllEnumStatuses(PAYMENT_METHOD);
|
|
107
|
+
var CANCELLATION_TYPE;
|
|
108
|
+
(function (CANCELLATION_TYPE) {
|
|
109
|
+
CANCELLATION_TYPE["NON_REFUNDABLE"] = "NON_REFUNDABLE";
|
|
110
|
+
CANCELLATION_TYPE["PARTIALLY_REFUNDABLE"] = "PARTIALLY_REFUNDABLE";
|
|
111
|
+
CANCELLATION_TYPE["FULLY_REFUNDABLE"] = "FULLY_REFUNDABLE";
|
|
112
|
+
})(CANCELLATION_TYPE || (exports.CANCELLATION_TYPE = CANCELLATION_TYPE = {}));
|
|
113
|
+
exports.ALL_CANCELLATION_TYPE = getAllEnumStatuses(CANCELLATION_TYPE);
|
|
114
|
+
var COMPANY_AMENITY_CATEGORY;
|
|
115
|
+
(function (COMPANY_AMENITY_CATEGORY) {
|
|
116
|
+
COMPANY_AMENITY_CATEGORY["GENERAL"] = "GENERAL";
|
|
117
|
+
COMPANY_AMENITY_CATEGORY["SAFETY_FEATURES"] = "SAFETY_FEATURES";
|
|
118
|
+
COMPANY_AMENITY_CATEGORY["PHYSICAL_DISTANCING"] = "PHYSICAL_DISTANCING";
|
|
119
|
+
COMPANY_AMENITY_CATEGORY["CLEANLINESS_AND_DISINFECTION"] = "CLEANLINESS_AND_DISINFECTING";
|
|
120
|
+
COMPANY_AMENITY_CATEGORY["FOOD_AND_DRINKS_SAFETY"] = "FOOD_AND_DRINKS_SAFETY";
|
|
121
|
+
COMPANY_AMENITY_CATEGORY["ACTIVITIES"] = "ACTIVITIES";
|
|
122
|
+
COMPANY_AMENITY_CATEGORY["FOOD_AND_DRINKS"] = "FOOD_AND_DRINKS";
|
|
123
|
+
COMPANY_AMENITY_CATEGORY["POOL_AND_WELLNESS"] = "POOL_AND_WELLNESS";
|
|
124
|
+
COMPANY_AMENITY_CATEGORY["TRANSPORT"] = "TRANSPORT";
|
|
125
|
+
COMPANY_AMENITY_CATEGORY["ADDITIONAL_SERVICES"] = "ADDITIONAL_SERVICES";
|
|
126
|
+
COMPANY_AMENITY_CATEGORY["COMMON_AREAS"] = "COMMON_AREAS";
|
|
127
|
+
COMPANY_AMENITY_CATEGORY["FAMILY_ENTERTAINMENT"] = "FAMILY_ENTERTAINMENT";
|
|
128
|
+
COMPANY_AMENITY_CATEGORY["CLEANING_SERVICES"] = "CLEANING_SERVICES";
|
|
129
|
+
COMPANY_AMENITY_CATEGORY["BUSINESS_FACILITIES"] = "BUSINESS_FACILITIES";
|
|
130
|
+
COMPANY_AMENITY_CATEGORY["MISCELLANEOUS"] = "MISCELLANEOUS";
|
|
131
|
+
COMPANY_AMENITY_CATEGORY["SAFETY_AND_SECURITY"] = "SAFETY_AND_SECURITY";
|
|
132
|
+
COMPANY_AMENITY_CATEGORY["PETS"] = "PETS";
|
|
133
|
+
})(COMPANY_AMENITY_CATEGORY || (exports.COMPANY_AMENITY_CATEGORY = COMPANY_AMENITY_CATEGORY = {}));
|
|
134
|
+
var HOLIDAY;
|
|
135
|
+
(function (HOLIDAY) {
|
|
136
|
+
HOLIDAY["LOCAL_HOLIDAY"] = "LOCAL_HOLIDAY";
|
|
137
|
+
HOLIDAY["COMMON_HOLIDAY"] = "COMMON_HOLIDAY";
|
|
138
|
+
})(HOLIDAY || (exports.HOLIDAY = HOLIDAY = {}));
|
|
139
|
+
exports.ALL_COMPANY_AMENITY_CATEGORY = getAllEnumStatuses(COMPANY_AMENITY_CATEGORY);
|
|
140
|
+
var CUSTOMER_DATA_STORAGE_PERIOD;
|
|
141
|
+
(function (CUSTOMER_DATA_STORAGE_PERIOD) {
|
|
142
|
+
CUSTOMER_DATA_STORAGE_PERIOD["SIX_MONTHS"] = "SIX_MONTHS";
|
|
143
|
+
CUSTOMER_DATA_STORAGE_PERIOD["ONE_YEAR"] = "ONE_YEAR";
|
|
144
|
+
CUSTOMER_DATA_STORAGE_PERIOD["TWO_YEARS"] = "TWO_YEARS";
|
|
145
|
+
})(CUSTOMER_DATA_STORAGE_PERIOD || (exports.CUSTOMER_DATA_STORAGE_PERIOD = CUSTOMER_DATA_STORAGE_PERIOD = {}));
|
|
98
146
|
//# sourceMappingURL=interfaces.js.map
|
package/lib/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;AAEA,IAAM,kBAAkB,GAAG,UAAU,KAAU,IAAU,OAAA,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CAA2B,wBAAwB,CAAC,CAAA;AAkKlH,IAAY,4BAIX;AAJD,WAAY,4BAA4B;IACtC,yDAAyB,CAAA;IACzB,qDAAqB,CAAA;IACrB,uDAAuB,CAAA;AACzB,CAAC,EAJW,4BAA4B,4CAA5B,4BAA4B,QAIvC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import moment from 'moment';
|
|
2
|
+
import { IBooking, ICompany, IUser } from '../../interfaces';
|
|
3
|
+
export interface IAddress {
|
|
4
|
+
streetName?: string;
|
|
5
|
+
streetNumber?: string;
|
|
6
|
+
zipCode?: string;
|
|
7
|
+
city?: string;
|
|
8
|
+
country?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare enum RECEIPT_PRODUCT {
|
|
11
|
+
DRINKS = "DRINKS",
|
|
12
|
+
BREAKFAST = "BREAKFAST",
|
|
13
|
+
ACCOMMODATION = "ACCOMMODATION",
|
|
14
|
+
SERVICE = "SERVICE"
|
|
15
|
+
}
|
|
16
|
+
export declare const getFullAddress: (address: IAddress | null | undefined, withCountry?: boolean) => string | null;
|
|
17
|
+
export declare const initialiseProducts: (company: ICompany, booking: IBooking, intl: any) => any[];
|
|
18
|
+
export declare const initialiseReceiptData: (company: ICompany, user: IUser, booking: IBooking, intl: any) => {
|
|
19
|
+
adminFullName: string;
|
|
20
|
+
registrationNumber: string;
|
|
21
|
+
company: {
|
|
22
|
+
address: any;
|
|
23
|
+
phoneNumber: string;
|
|
24
|
+
ownerName: any;
|
|
25
|
+
companyLegalName?: string;
|
|
26
|
+
registrationNumber?: string;
|
|
27
|
+
vatNumber?: string;
|
|
28
|
+
responsibleName?: string;
|
|
29
|
+
name?: string;
|
|
30
|
+
email?: string;
|
|
31
|
+
bankName?: string;
|
|
32
|
+
iban?: string;
|
|
33
|
+
swift?: string;
|
|
34
|
+
id?: string;
|
|
35
|
+
stars?: number;
|
|
36
|
+
partnerId?: string;
|
|
37
|
+
parentCompanyId?: string;
|
|
38
|
+
companyCreatedByUserId?: string;
|
|
39
|
+
mainUserId?: string;
|
|
40
|
+
subdomain?: string;
|
|
41
|
+
isEnabled?: boolean;
|
|
42
|
+
isDefault?: boolean;
|
|
43
|
+
language?: import("../../interfaces").LANGUAGE;
|
|
44
|
+
phoneNumbers?: string[];
|
|
45
|
+
whatsappNumber?: string;
|
|
46
|
+
timezone?: string;
|
|
47
|
+
checkinTime?: {
|
|
48
|
+
start: import("../../interfaces").DateOrString;
|
|
49
|
+
end: import("../../interfaces").DateOrString;
|
|
50
|
+
};
|
|
51
|
+
checkoutTime?: {
|
|
52
|
+
start: import("../../interfaces").DateOrString;
|
|
53
|
+
end: import("../../interfaces").DateOrString;
|
|
54
|
+
};
|
|
55
|
+
pricing?: {
|
|
56
|
+
[key: string]: number;
|
|
57
|
+
};
|
|
58
|
+
currency?: import("../../interfaces").CURRENCY;
|
|
59
|
+
integrations?: {
|
|
60
|
+
bnovo: {
|
|
61
|
+
id: string;
|
|
62
|
+
};
|
|
63
|
+
stripe?: {
|
|
64
|
+
accountId: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
locationDescription?: {
|
|
68
|
+
title?: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
};
|
|
71
|
+
amenities?: import("../../interfaces").ICompanyAmenity[];
|
|
72
|
+
parentCompany?: ICompany;
|
|
73
|
+
partner?: any;
|
|
74
|
+
themeData?: {
|
|
75
|
+
logo?: import("../../interfaces").IFile | null;
|
|
76
|
+
palette?: {
|
|
77
|
+
primary?: {
|
|
78
|
+
main?: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
data?: any;
|
|
83
|
+
images?: import("../../interfaces").IFile[];
|
|
84
|
+
google?: {
|
|
85
|
+
mapsId?: string;
|
|
86
|
+
reviewUrl?: string;
|
|
87
|
+
minimumRating?: number;
|
|
88
|
+
credentials?: {
|
|
89
|
+
accessToken?: string;
|
|
90
|
+
refreshToken?: string;
|
|
91
|
+
expiresIn?: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
smartPricing?: {
|
|
95
|
+
minimum?: number;
|
|
96
|
+
maximum?: number;
|
|
97
|
+
};
|
|
98
|
+
publicInformation?: import("../../interfaces").ICompanyPublicInformation;
|
|
99
|
+
website?: {
|
|
100
|
+
url?: string;
|
|
101
|
+
shortUrl?: string;
|
|
102
|
+
connectToVisitorDBW?: boolean;
|
|
103
|
+
requestCreditCardInformation?: boolean;
|
|
104
|
+
requestAddressInformation?: boolean;
|
|
105
|
+
stripePaymentsEnabled?: boolean;
|
|
106
|
+
enableMyLike?: boolean;
|
|
107
|
+
websiteBookingsConfirmationNeeded?: boolean;
|
|
108
|
+
headerLinks?: Array<{
|
|
109
|
+
name?: string;
|
|
110
|
+
url?: string;
|
|
111
|
+
}>;
|
|
112
|
+
footerLinks?: Array<{
|
|
113
|
+
name?: string;
|
|
114
|
+
url?: string;
|
|
115
|
+
}>;
|
|
116
|
+
};
|
|
117
|
+
socials?: {
|
|
118
|
+
instagramUrl?: string;
|
|
119
|
+
facebookUrl?: string;
|
|
120
|
+
};
|
|
121
|
+
npsScore?: number;
|
|
122
|
+
holidays?: import("../../interfaces").IHoliday[];
|
|
123
|
+
owDiscountRules?: import("../../interfaces").IOWDiscountRule[];
|
|
124
|
+
bookings?: import("../../interfaces").ICompanyBookingsSettings;
|
|
125
|
+
legalInformation?: import("../../interfaces").ICompanyLegalInformation;
|
|
126
|
+
bankInformation?: import("../../interfaces").ICompanyBankInformation;
|
|
127
|
+
receipts?: import("../../interfaces").ICompanyReceiptsInformation;
|
|
128
|
+
trialEndDate?: import("../../interfaces").DateOrString;
|
|
129
|
+
isPayingCustomer?: boolean;
|
|
130
|
+
includeFeesInFinalCostExternalBookings?: boolean;
|
|
131
|
+
includeMainUserAsEmailCC?: boolean;
|
|
132
|
+
customerDataStoragePeriod?: import("../../interfaces").CUSTOMER_DATA_STORAGE_PERIOD;
|
|
133
|
+
lastExternalBookingsSync?: import("../../interfaces").DateOrString;
|
|
134
|
+
mainUser?: IUser;
|
|
135
|
+
nextInvoiceId?: string;
|
|
136
|
+
createdAt?: import("../../interfaces").DateOrString;
|
|
137
|
+
updatedAt?: import("../../interfaces").DateOrString;
|
|
138
|
+
deletedAt?: import("../../interfaces").DateOrString;
|
|
139
|
+
};
|
|
140
|
+
customer: {
|
|
141
|
+
address: any;
|
|
142
|
+
fullName: string;
|
|
143
|
+
id?: string;
|
|
144
|
+
companyId?: string;
|
|
145
|
+
firstName: string;
|
|
146
|
+
lastName: string;
|
|
147
|
+
phoneNumber?: string;
|
|
148
|
+
email?: string;
|
|
149
|
+
birthDate?: import("../../interfaces").DateOrString;
|
|
150
|
+
nationality?: string;
|
|
151
|
+
identificationNumber?: string;
|
|
152
|
+
identificationDocument?: import("../../interfaces").IFile[];
|
|
153
|
+
optedInPromotionalOffers?: boolean;
|
|
154
|
+
notes?: string;
|
|
155
|
+
isAnonymized?: boolean;
|
|
156
|
+
bookings?: IBooking[];
|
|
157
|
+
customerGroupId?: string;
|
|
158
|
+
customerGroup?: import("../../interfaces").ICustomerGroup;
|
|
159
|
+
createdAt?: import("../../interfaces").DateOrString;
|
|
160
|
+
updatedAt?: import("../../interfaces").DateOrString;
|
|
161
|
+
deletedAt?: import("../../interfaces").DateOrString;
|
|
162
|
+
};
|
|
163
|
+
products: any[];
|
|
164
|
+
notesLabel: any;
|
|
165
|
+
notesText: string;
|
|
166
|
+
currentInvoiceId: string;
|
|
167
|
+
createdAt: moment.Moment;
|
|
168
|
+
receiptDate: moment.Moment;
|
|
169
|
+
dueDate: moment.Moment;
|
|
170
|
+
paymentMethod: any;
|
|
171
|
+
companyId: string;
|
|
172
|
+
}[];
|
|
173
|
+
export declare const calculateSalesTax: (value: number, taxRate: number, divisor?: number) => number;
|