@roomstay/core 0.1.85-0 → 0.1.85-1

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.
@@ -0,0 +1,14 @@
1
+ export declare enum AddonPricingType {
2
+ PER_STAY = "Per stay",
3
+ PER_NIGHT = "Per night",
4
+ PER_PERSON = "Per person",
5
+ PER_PERSON_PER_NIGHT = "Per person per night",
6
+ PER_ALL_PERSONS = "Per all persons",
7
+ PER_ALL_PERSONS_PER_NIGHT = "Per all persons per night",
8
+ PER_QUANTITY_NAME_PER_NIGHT = "Per Quantity Name Per Night",
9
+ PER_ROOM_QUANTITY_PER_NIGHT = "Per Room Quantity Per Night",
10
+ PER_PERSON_OCCUPANCY_PER_NIGHT = "Per Person Occupancy Per Night",
11
+ PER_ADULT_OCCUPANCY_PER_NIGHT = "Per Adult Occupancy Per Night",
12
+ PER_CHILD_OCCUPANCY_PER_NIGHT = "Per Child Occupancy Per Night"
13
+ }
14
+ export declare const ADDON_PER_NIGHT_TYPES: AddonPricingType[];
@@ -0,0 +1,24 @@
1
+ import { SimpleItemisedFee } from "types/Fees/IFee.type";
2
+ export type BasketAddonDTO = {
3
+ availability: any;
4
+ code: string;
5
+ inclusive: false;
6
+ pricingType: string;
7
+ quantity: number;
8
+ adultQuantity: number;
9
+ childQuantity?: number;
10
+ description: string;
11
+ name: string;
12
+ category: string;
13
+ image: string;
14
+ price: number;
15
+ adultPrice?: number;
16
+ childPrice?: number;
17
+ fee: number;
18
+ adultFee?: number;
19
+ childFee?: number;
20
+ fees?: SimpleItemisedFee[];
21
+ adultFees?: SimpleItemisedFee[];
22
+ childFees?: SimpleItemisedFee[];
23
+ nights?: number;
24
+ };
@@ -100,9 +100,6 @@ export type IPaymentCheckoutDetails = {
100
100
  };
101
101
  paypal?: {
102
102
  orderId: string;
103
- clientId: string;
104
- successUrl: string;
105
- currencyCode: string;
106
103
  };
107
104
  windcave?: {
108
105
  links: {
@@ -0,0 +1,6 @@
1
+ export declare enum ERuleType {
2
+ Schedule = "Schedule",
3
+ DeviceTarget = "DeviceTarget",
4
+ GeoLock = "GeoLock",
5
+ CheapestOf = "CheapestOf"
6
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum ERuleType {
2
+ Schedule = "Schedule",
3
+ DeviceTarget = "DeviceTarget",
4
+ GeoLock = "GeoLock",
5
+ CheapestOf = "CheapestOf"
6
+ }
@@ -0,0 +1,25 @@
1
+ import { ERuleType } from './ERuleType';
2
+ export interface IDisplayPolicy {
3
+ id: number;
4
+ name: string;
5
+ description: string;
6
+ applicableRates: string[];
7
+ conditions: ICondition[];
8
+ }
9
+ export type IScheduleConfiguration = {
10
+ rruleSet: string;
11
+ durationMs: number;
12
+ };
13
+ export type ICondition = {
14
+ ruleType: ERuleType.Schedule;
15
+ configuration: IScheduleConfiguration;
16
+ } | {
17
+ ruleType: ERuleType.DeviceTarget;
18
+ configuration: unknown;
19
+ } | {
20
+ ruleType: ERuleType.GeoLock;
21
+ configuration: unknown;
22
+ } | {
23
+ ruleType: ERuleType.CheapestOf;
24
+ configuration: unknown;
25
+ };
@@ -0,0 +1,8 @@
1
+ export declare enum ERMSAuthSyncHistoryStatus {
2
+ Success = "success",
3
+ Failure = "failure",
4
+ New = "new",
5
+ Queued = "queued",
6
+ InProgress = "in_progress",
7
+ RequireResume = "require_resume"
8
+ }
@@ -0,0 +1,34 @@
1
+ import { ERMSDiscountType } from './ERMSDiscountType.enum';
2
+ import { IRuleSpec } from '../Rule/IRuleConfigurations.type';
3
+ export type IRMSDiscount = {
4
+ name: string;
5
+ rmsDiscountId: number;
6
+ description: string;
7
+ discountType: ERMSDiscountType;
8
+ amount?: {
9
+ amount: number;
10
+ };
11
+ percentage?: {
12
+ percentage: number;
13
+ noGreaterThan: number;
14
+ includePackage: boolean;
15
+ includeAdditionals: boolean;
16
+ appliesToTotalRate: boolean;
17
+ };
18
+ bogo?: {
19
+ buyXNights: number;
20
+ getXNights: number;
21
+ getXNightsCycles: number;
22
+ includeAdditionals: boolean;
23
+ };
24
+ nightlyRateOverride?: {
25
+ firstXNights: number;
26
+ totalCharge: number;
27
+ includeAdditionals: boolean;
28
+ };
29
+ availableToIbe: boolean;
30
+ minimumNightStay: number;
31
+ maximumNightStay: number;
32
+ availableToMembers: boolean;
33
+ rules: IRuleSpec[];
34
+ };
@@ -0,0 +1,8 @@
1
+ import { ERMSAuthSyncHistoryStatus } from './ERMSAuthSyncHistoryStatus.type';
2
+ export type IRMSSyncResponse = {
3
+ id: number;
4
+ status: ERMSAuthSyncHistoryStatus;
5
+ additionalData: any;
6
+ syncData: string | null;
7
+ syncType: string;
8
+ };
@@ -0,0 +1,9 @@
1
+ export declare enum EDayOfWeek {
2
+ MON = "MON",
3
+ TUE = "TUE",
4
+ WED = "WED",
5
+ THU = "THU",
6
+ FRI = "FRI",
7
+ SAT = "SAT",
8
+ SUN = "SUN"
9
+ }
@@ -0,0 +1,11 @@
1
+ export declare enum EDisplayPolicyEffectType {
2
+ Visibility = "visibility",
3
+ Exclusivity = "exclusivity"
4
+ }
5
+ export declare enum EDisplayPolicyExclusivityMode {
6
+ Cheapest = "cheapest",
7
+ MostExpensive = "most_expensive"
8
+ }
9
+ export interface IDisplayPolicyExclusivityConfiguration {
10
+ mode: EDisplayPolicyExclusivityMode;
11
+ }
@@ -0,0 +1,11 @@
1
+ export declare enum ERuleType {
2
+ Schedule = "Schedule",
3
+ GeoLock = "GeoLock",
4
+ DeviceTarget = "DeviceTarget",
5
+ DayOfWeek = "DayOfWeek",
6
+ HotelRestriction = "HotelRestriction",
7
+ RoomRestriction = "RoomRestriction",
8
+ RateRestriction = "RateRestriction",
9
+ NightCount = "NightCount",
10
+ AnyOf = "AnyOf"
11
+ }
@@ -0,0 +1 @@
1
+ export type { IRuleSpec } from './IRuleConfigurations.type';
@@ -0,0 +1,68 @@
1
+ import { EDayOfWeek } from './EDayOfWeek.enum';
2
+ import { ERuleType } from './ERuleType.enum';
3
+ export interface IScheduleConfig {
4
+ type: 'clock' | 'stay';
5
+ rules: Array<{
6
+ type: 'include' | 'exclude';
7
+ startDate: string;
8
+ endDate: string;
9
+ rrule?: string;
10
+ }>;
11
+ }
12
+ export interface IGeoLockConfig {
13
+ applicableCountryCodes: string[];
14
+ mode: 'allow' | 'deny';
15
+ }
16
+ export type TDeviceTarget = 'mobile' | 'desktop';
17
+ export interface IDeviceTargetConfig {
18
+ allowedDevices: TDeviceTarget[];
19
+ }
20
+ export type TDayOfWeekSource = 'arrival' | 'night' | 'booking';
21
+ export interface IDayOfWeekConfig {
22
+ source: TDayOfWeekSource;
23
+ allowedDays: EDayOfWeek[];
24
+ }
25
+ export interface IHotelRestrictionConfig {
26
+ hotelIds: string[];
27
+ }
28
+ export interface IRoomRestrictionConfig {
29
+ roomCodes: string[];
30
+ }
31
+ export interface IRateRestrictionConfig {
32
+ rateCodes: string[];
33
+ }
34
+ export interface INightCountConfig {
35
+ min?: number;
36
+ max?: number;
37
+ }
38
+ export interface IAnyOfConfig {
39
+ branches: IRuleSpec[][];
40
+ }
41
+ export type IRuleSpec = {
42
+ ruleType: ERuleType.Schedule;
43
+ configuration: IScheduleConfig;
44
+ } | {
45
+ ruleType: ERuleType.GeoLock;
46
+ configuration: IGeoLockConfig;
47
+ } | {
48
+ ruleType: ERuleType.DeviceTarget;
49
+ configuration: IDeviceTargetConfig;
50
+ } | {
51
+ ruleType: ERuleType.DayOfWeek;
52
+ configuration: IDayOfWeekConfig;
53
+ } | {
54
+ ruleType: ERuleType.HotelRestriction;
55
+ configuration: IHotelRestrictionConfig;
56
+ } | {
57
+ ruleType: ERuleType.RoomRestriction;
58
+ configuration: IRoomRestrictionConfig;
59
+ } | {
60
+ ruleType: ERuleType.RateRestriction;
61
+ configuration: IRateRestrictionConfig;
62
+ } | {
63
+ ruleType: ERuleType.NightCount;
64
+ configuration: INightCountConfig;
65
+ } | {
66
+ ruleType: ERuleType.AnyOf;
67
+ configuration: IAnyOfConfig;
68
+ };
@@ -0,0 +1,13 @@
1
+ export interface IRuleContextDescriptor {
2
+ hasHotel: true;
3
+ hasNow: true;
4
+ optional: {
5
+ checkInDate?: true;
6
+ checkOutDate?: true;
7
+ nightDate?: true;
8
+ event?: true;
9
+ geolocation?: true;
10
+ rateCode?: true;
11
+ roomCode?: true;
12
+ };
13
+ }
@@ -0,0 +1,4 @@
1
+ export * from './EDayOfWeek.enum';
2
+ export * from './EDisplayPolicyEffectType.enum';
3
+ export * from './ERuleType.enum';
4
+ export * from './IRuleConfigurations.type';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomstay/core",
3
- "version": "0.1.85-0",
3
+ "version": "0.1.85-1",
4
4
  "description": "Details shared between Roomstay libraries. Anything from Currency, to Generic types",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [