@hyper.software/visitor-integrations-client 1.2.36 → 1.2.38
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/.yarn/install-state.gz +0 -0
- package/.yarnrc.yml +1 -1
- package/lib/client/src/service.d.ts +5 -5
- package/lib/client/src/service.js +11 -11
- package/lib/client/src/service.js.map +1 -1
- package/lib/src/interfaces/bookings.d.ts +57 -18
- package/lib/src/interfaces/bookings.js +9 -0
- package/lib/src/interfaces/bookings.js.map +1 -1
- package/lib/src/interfaces/channels.d.ts +12 -0
- package/lib/src/interfaces/index.d.ts +30 -1
- package/lib/src/interfaces/index.js.map +1 -1
- package/package.json +1 -1
- package/src/service.ts +13 -13
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/.yarnrc.yml
CHANGED
|
@@ -48,7 +48,7 @@ enableColors: true
|
|
|
48
48
|
npmRegistryServer: 'https://registry.npmjs.org'
|
|
49
49
|
|
|
50
50
|
# Set the npm authentication token for private packages
|
|
51
|
-
npmAuthToken: '
|
|
51
|
+
npmAuthToken: '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'
|
|
52
52
|
|
|
53
53
|
# Set the node linker
|
|
54
54
|
nodeLinker: node-modules
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IRequestOptions, IBackendApiClientResponse } from '@hyper.software/backend-api-client';
|
|
2
2
|
import { ISyncChannelData, IInboundMappedChannel, ICompany, IRoomType, IRoomTypesAvailability, IChannel, IUpsertRestrictionsPayload, IAcceptRejectBooking } from './interfaces';
|
|
3
|
-
import {
|
|
3
|
+
import { IRatePlan, IUpdatePricingPayload } from '../../src/interfaces';
|
|
4
4
|
export declare const createCompany: (company: ICompany, config?: IRequestOptions) => Promise<IBackendApiClientResponse<string>>;
|
|
5
5
|
export declare const updateCompany: (company: ICompany, config?: IRequestOptions) => Promise<IBackendApiClientResponse<void>>;
|
|
6
6
|
export declare const deleteCompany: (company: ICompany, config?: IRequestOptions) => Promise<IBackendApiClientResponse<void>>;
|
|
@@ -9,10 +9,10 @@ export declare const updateRoomType: (company: ICompany, roomType: IRoomType, co
|
|
|
9
9
|
export declare const deleteRoomType: (company: ICompany, roomType: IRoomType, config?: IRequestOptions) => Promise<IBackendApiClientResponse<void>>;
|
|
10
10
|
export declare const createOrUpdateAvailability: (company: ICompany, availability: IRoomTypesAvailability, config?: IRequestOptions) => Promise<IBackendApiClientResponse<string>>;
|
|
11
11
|
export declare const upsertRestrictions: (company: ICompany, restrictions: IUpsertRestrictionsPayload, config?: IRequestOptions) => Promise<IBackendApiClientResponse<string>>;
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const updatePricing: (company: ICompany, planId: string, pricing: IUpdatePricingPayload, config?: IRequestOptions) => Promise<IBackendApiClientResponse<
|
|
15
|
-
export declare const
|
|
12
|
+
export declare const getRatePlans: (company: ICompany, config?: IRequestOptions) => Promise<IBackendApiClientResponse<IRatePlan[]>>;
|
|
13
|
+
export declare const createRatePlan: (company: ICompany, ratePlan: IRatePlan, config?: IRequestOptions) => Promise<IBackendApiClientResponse<string>>;
|
|
14
|
+
export declare const updatePricing: (company: ICompany, planId: string, pricing: IUpdatePricingPayload, config?: IRequestOptions) => Promise<IBackendApiClientResponse<IRatePlan[]>>;
|
|
15
|
+
export declare const deleteRatePlan: (company: ICompany, ratePlan: IRatePlan, config?: IRequestOptions) => Promise<IBackendApiClientResponse<IRatePlan[]>>;
|
|
16
16
|
export declare const createChannel: (company: ICompany, channel: IChannel, config?: IRequestOptions) => Promise<IBackendApiClientResponse<{
|
|
17
17
|
oauthConnectLink?: string;
|
|
18
18
|
id?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rejectBooking = exports.acceptBooking = exports.syncChannelData = exports.deleteChannel = exports.updateChannel = exports.getChannelById = exports.createChannel = exports.
|
|
3
|
+
exports.rejectBooking = exports.acceptBooking = exports.syncChannelData = exports.deleteChannel = exports.updateChannel = exports.getChannelById = exports.createChannel = exports.deleteRatePlan = exports.updatePricing = exports.createRatePlan = exports.getRatePlans = exports.upsertRestrictions = exports.createOrUpdateAvailability = exports.deleteRoomType = exports.updateRoomType = exports.createRoomType = exports.deleteCompany = exports.updateCompany = exports.createCompany = void 0;
|
|
4
4
|
const backend_api_client_1 = require("@hyper.software/backend-api-client");
|
|
5
5
|
const config_1 = require("./config");
|
|
6
6
|
const httpClient = () => new backend_api_client_1.BackendApiClient({
|
|
@@ -47,26 +47,26 @@ const upsertRestrictions = async (company, restrictions, config) => {
|
|
|
47
47
|
return httpClient().post(`/companies/${(_b = (_a = company.integrations) === null || _a === void 0 ? void 0 : _a.bnovo) === null || _b === void 0 ? void 0 : _b.id}/restrictions`, restrictions, config);
|
|
48
48
|
};
|
|
49
49
|
exports.upsertRestrictions = upsertRestrictions;
|
|
50
|
-
const
|
|
50
|
+
const getRatePlans = async (company, config) => {
|
|
51
51
|
var _a, _b;
|
|
52
|
-
return httpClient().get(`/companies/${(_b = (_a = company.integrations) === null || _a === void 0 ? void 0 : _a.bnovo) === null || _b === void 0 ? void 0 : _b.id}/
|
|
52
|
+
return httpClient().get(`/companies/${(_b = (_a = company.integrations) === null || _a === void 0 ? void 0 : _a.bnovo) === null || _b === void 0 ? void 0 : _b.id}/rate-plans`, config);
|
|
53
53
|
};
|
|
54
|
-
exports.
|
|
55
|
-
const
|
|
54
|
+
exports.getRatePlans = getRatePlans;
|
|
55
|
+
const createRatePlan = async (company, ratePlan, config) => {
|
|
56
56
|
var _a, _b;
|
|
57
|
-
return httpClient().post(`/companies/${(_b = (_a = company.integrations) === null || _a === void 0 ? void 0 : _a.bnovo) === null || _b === void 0 ? void 0 : _b.id}/
|
|
57
|
+
return httpClient().post(`/companies/${(_b = (_a = company.integrations) === null || _a === void 0 ? void 0 : _a.bnovo) === null || _b === void 0 ? void 0 : _b.id}/rate-plans`, ratePlan, config);
|
|
58
58
|
};
|
|
59
|
-
exports.
|
|
59
|
+
exports.createRatePlan = createRatePlan;
|
|
60
60
|
const updatePricing = async (company, planId, pricing, config) => {
|
|
61
61
|
var _a, _b;
|
|
62
|
-
return httpClient().put(`/companies/${(_b = (_a = company.integrations) === null || _a === void 0 ? void 0 : _a.bnovo) === null || _b === void 0 ? void 0 : _b.id}/
|
|
62
|
+
return httpClient().put(`/companies/${(_b = (_a = company.integrations) === null || _a === void 0 ? void 0 : _a.bnovo) === null || _b === void 0 ? void 0 : _b.id}/rate-plans/${planId}`, pricing, config);
|
|
63
63
|
};
|
|
64
64
|
exports.updatePricing = updatePricing;
|
|
65
|
-
const
|
|
65
|
+
const deleteRatePlan = async (company, ratePlan, config) => {
|
|
66
66
|
var _a, _b;
|
|
67
|
-
return httpClient().del(`/companies/${(_b = (_a = company.integrations) === null || _a === void 0 ? void 0 : _a.bnovo) === null || _b === void 0 ? void 0 : _b.id}/
|
|
67
|
+
return httpClient().del(`/companies/${(_b = (_a = company.integrations) === null || _a === void 0 ? void 0 : _a.bnovo) === null || _b === void 0 ? void 0 : _b.id}/rate-plans/${ratePlan.integrations.bnovo.id}`, config);
|
|
68
68
|
};
|
|
69
|
-
exports.
|
|
69
|
+
exports.deleteRatePlan = deleteRatePlan;
|
|
70
70
|
const createChannel = async (company, channel, config) => {
|
|
71
71
|
var _a, _b;
|
|
72
72
|
return httpClient().post(`/companies/${(_b = (_a = company.integrations) === null || _a === void 0 ? void 0 : _a.bnovo) === null || _b === void 0 ? void 0 : _b.id}/channels`, channel, config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/service.ts"],"names":[],"mappings":";;;AAAA,2EAAkH;AAClH,qCAAyC;AAazC,MAAM,UAAU,GAAG,GAAG,EAAE,CACtB,IAAI,qCAAgB,CAAC;IACnB,OAAO,EAAE,sBAAa,CAAC,OAAO;IAC9B,WAAW,EAAE,yBAAyB;IAC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AAXW,QAAA,eAAe,mBAW1B;AAEK,MAAM,aAAa,GAAG,KAAK,EAChC,OAAiB,EACjB,oBAA0C,EAC1C,MAAwB,EAC2C,EAAE;;IACrE,OAAO,UAAU,EAAE,CAAC,IAAI,CAAC,cAAc,MAAA,MAAA,OAAO,CAAC,YAAY,0CAAE,KAAK,0CAAE,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,CAAC,CAAC;AAC1H,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB;AAEK,MAAM,aAAa,GAAG,KAAK,EAChC,OAAiB,EACjB,oBAA0C,EAC1C,MAAwB,EAC2C,EAAE;;IACrE,OAAO,UAAU,EAAE,CAAC,IAAI,CAAC,cAAc,MAAA,MAAA,OAAO,CAAC,YAAY,0CAAE,KAAK,0CAAE,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,CAAC,CAAC;AAC1H,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ROOM_TYPE_BREAKFAST_INFORMATION_TYPE } from '@hyper.software/common-models/lib/interfaces';
|
|
2
|
-
import { BOOKING_SOURCE
|
|
1
|
+
import { PAYMENT_METHOD, ROOM_TYPE_BREAKFAST_INFORMATION_TYPE } from '@hyper.software/common-models/lib/interfaces';
|
|
2
|
+
import { BOOKING_SOURCE } from '@hyper.software/visitor-main-api-client';
|
|
3
|
+
import { ChannelManagerType } from '.';
|
|
3
4
|
export interface IInboundBooking {
|
|
4
5
|
data: {
|
|
5
6
|
account_id: string;
|
|
@@ -10,9 +11,18 @@ export interface IInboundBooking {
|
|
|
10
11
|
export interface IAcceptRejectBooking {
|
|
11
12
|
channelId?: string;
|
|
12
13
|
code?: string;
|
|
14
|
+
channelType?: ChannelManagerType;
|
|
15
|
+
revisionId?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare enum EXTERNAL_BOOKING_STATUS {
|
|
18
|
+
CREATED = "CREATED",
|
|
19
|
+
NEW = "NEW",
|
|
20
|
+
MODIFIED = "MODIFIED",
|
|
21
|
+
CANCELED = "CANCELED",
|
|
22
|
+
CANCELLED = "CANCELLED"
|
|
13
23
|
}
|
|
14
24
|
export interface IExternalBooking {
|
|
15
|
-
status?:
|
|
25
|
+
status?: EXTERNAL_BOOKING_STATUS | null;
|
|
16
26
|
companyId: string;
|
|
17
27
|
code: string;
|
|
18
28
|
roomTypeId: string;
|
|
@@ -23,25 +33,54 @@ export interface IExternalBooking {
|
|
|
23
33
|
lastName: string;
|
|
24
34
|
email: string;
|
|
25
35
|
phoneNumber?: string;
|
|
36
|
+
address?: string;
|
|
37
|
+
city?: string;
|
|
38
|
+
country?: string;
|
|
39
|
+
postalCode?: string;
|
|
40
|
+
companyName?: string;
|
|
26
41
|
numberOfAdults?: number;
|
|
27
42
|
numberOfChildren?: number;
|
|
28
43
|
numberOfRooms?: number;
|
|
29
44
|
isFetched?: boolean;
|
|
30
45
|
bookingSource: BOOKING_SOURCE;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
isPaid?: boolean;
|
|
34
|
-
otaComission?: number;
|
|
35
|
-
otaBookingId?: string;
|
|
36
|
-
arrivalTime?: string;
|
|
37
|
-
breakfastType?: ROOM_TYPE_BREAKFAST_INFORMATION_TYPE;
|
|
38
|
-
breakfastIncluded?: boolean;
|
|
39
|
-
breakfastCost?: number;
|
|
40
|
-
excludedFees?: number;
|
|
41
|
-
childrenAges?: Array<{
|
|
42
|
-
age: number | null | undefined;
|
|
43
|
-
}>;
|
|
44
|
-
paymentMethod?: PAYMENT_METHOD;
|
|
45
|
-
};
|
|
46
|
+
channelType?: ChannelManagerType;
|
|
47
|
+
extra: IBookingExtra;
|
|
46
48
|
isSynced?: boolean;
|
|
47
49
|
}
|
|
50
|
+
export interface IBookingExtra {
|
|
51
|
+
isPaid?: boolean;
|
|
52
|
+
otaComission?: number;
|
|
53
|
+
arrivalTime?: string;
|
|
54
|
+
details?: string;
|
|
55
|
+
otaBookingId?: string;
|
|
56
|
+
childrenAges?: Array<{
|
|
57
|
+
age: number | null | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
paymentMethod?: PAYMENT_METHOD;
|
|
60
|
+
currency?: string;
|
|
61
|
+
excludedFees?: number;
|
|
62
|
+
breakfastType?: ROOM_TYPE_BREAKFAST_INFORMATION_TYPE;
|
|
63
|
+
breakfastIncluded?: boolean;
|
|
64
|
+
breakfastCost?: number;
|
|
65
|
+
revisionId?: string;
|
|
66
|
+
insertedAt?: string;
|
|
67
|
+
isModification?: boolean;
|
|
68
|
+
originalBookingId?: string;
|
|
69
|
+
dailyRates?: Array<{
|
|
70
|
+
date: string;
|
|
71
|
+
rate: number;
|
|
72
|
+
currency: string;
|
|
73
|
+
}>;
|
|
74
|
+
mealPlan?: string;
|
|
75
|
+
policies?: {
|
|
76
|
+
cancellation?: string;
|
|
77
|
+
guarantee?: string;
|
|
78
|
+
};
|
|
79
|
+
guarantee?: {
|
|
80
|
+
cardNumber?: string;
|
|
81
|
+
cardType?: string;
|
|
82
|
+
cardholderName?: string;
|
|
83
|
+
expirationDate?: string;
|
|
84
|
+
isVirtual?: boolean;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EXTERNAL_BOOKING_STATUS = void 0;
|
|
4
|
+
var EXTERNAL_BOOKING_STATUS;
|
|
5
|
+
(function (EXTERNAL_BOOKING_STATUS) {
|
|
6
|
+
EXTERNAL_BOOKING_STATUS["CREATED"] = "CREATED";
|
|
7
|
+
EXTERNAL_BOOKING_STATUS["NEW"] = "NEW";
|
|
8
|
+
EXTERNAL_BOOKING_STATUS["MODIFIED"] = "MODIFIED";
|
|
9
|
+
EXTERNAL_BOOKING_STATUS["CANCELED"] = "CANCELED";
|
|
10
|
+
EXTERNAL_BOOKING_STATUS["CANCELLED"] = "CANCELLED"; // This is for channex
|
|
11
|
+
})(EXTERNAL_BOOKING_STATUS || (exports.EXTERNAL_BOOKING_STATUS = EXTERNAL_BOOKING_STATUS = {}));
|
|
3
12
|
//# sourceMappingURL=bookings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings.js","sourceRoot":"","sources":["../../../../src/interfaces/bookings.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"bookings.js","sourceRoot":"","sources":["../../../../src/interfaces/bookings.ts"],"names":[],"mappings":";;;AAoBA,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,8CAAmB,CAAA;IACnB,sCAAW,CAAA;IACX,gDAAqB,CAAA;IACrB,gDAAqB,CAAA;IACrB,kDAAuB,CAAA,CAAC,sBAAsB;AAChD,CAAC,EANW,uBAAuB,uCAAvB,uBAAuB,QAMlC"}
|
|
@@ -13,3 +13,15 @@ export interface ISyncChannelData {
|
|
|
13
13
|
otaPlanId: string;
|
|
14
14
|
}[];
|
|
15
15
|
}
|
|
16
|
+
export interface ITestConnection {
|
|
17
|
+
channel: string;
|
|
18
|
+
settings: {
|
|
19
|
+
hotel_id: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface IGetMappingDetails {
|
|
23
|
+
channel: string;
|
|
24
|
+
settings: {
|
|
25
|
+
hotel_id: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -50,10 +50,18 @@ export interface ICompany extends ITimestamps {
|
|
|
50
50
|
currency?: CURRENCY;
|
|
51
51
|
email?: string;
|
|
52
52
|
integrations?: {
|
|
53
|
+
channelManagerType?: ChannelManagerType;
|
|
53
54
|
bnovo?: {
|
|
54
55
|
id?: string;
|
|
55
56
|
isEnabled?: boolean;
|
|
56
57
|
};
|
|
58
|
+
stripe?: {
|
|
59
|
+
accountId?: string;
|
|
60
|
+
};
|
|
61
|
+
channex?: {
|
|
62
|
+
id?: string;
|
|
63
|
+
isEnabled?: boolean;
|
|
64
|
+
};
|
|
57
65
|
};
|
|
58
66
|
}
|
|
59
67
|
export interface IRoomType extends ITimestamps {
|
|
@@ -68,10 +76,16 @@ export interface IRoomType extends ITimestamps {
|
|
|
68
76
|
integrations?: IRoomTypeIntegrations;
|
|
69
77
|
}
|
|
70
78
|
export interface IRoomTypeIntegrations {
|
|
79
|
+
channelManagerType?: ChannelManagerType;
|
|
71
80
|
bnovo?: {
|
|
72
81
|
id?: string;
|
|
73
82
|
isEnabled?: boolean;
|
|
74
83
|
};
|
|
84
|
+
channex?: {
|
|
85
|
+
id?: string;
|
|
86
|
+
isEnabled?: boolean;
|
|
87
|
+
propertyId?: string;
|
|
88
|
+
};
|
|
75
89
|
}
|
|
76
90
|
export type IRoomTypesAvailability = {
|
|
77
91
|
[roomTypeId: string]: {
|
|
@@ -88,6 +102,15 @@ export type IUpdatePricingPayload = {
|
|
|
88
102
|
[date: string]: number;
|
|
89
103
|
};
|
|
90
104
|
};
|
|
105
|
+
integrations?: {
|
|
106
|
+
channelManagerType?: ChannelManagerType;
|
|
107
|
+
channex?: {
|
|
108
|
+
id?: string;
|
|
109
|
+
};
|
|
110
|
+
bnovo?: {
|
|
111
|
+
id?: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
91
114
|
};
|
|
92
115
|
export interface IPartner extends ITimestamps {
|
|
93
116
|
id?: string;
|
|
@@ -125,15 +148,21 @@ export interface IFile {
|
|
|
125
148
|
type?: string;
|
|
126
149
|
name?: string;
|
|
127
150
|
}
|
|
151
|
+
export type ChannelManagerType = 'BNOVO' | 'CHANNEX';
|
|
128
152
|
export interface IChannel {
|
|
129
153
|
id?: string;
|
|
130
154
|
type?: CHANNEL_TYPE;
|
|
131
155
|
credentials?: any;
|
|
132
156
|
integrations?: {
|
|
157
|
+
channelManagerType?: ChannelManagerType;
|
|
133
158
|
bnovo?: {
|
|
134
159
|
id?: string;
|
|
135
160
|
isEnabled?: boolean;
|
|
136
161
|
};
|
|
162
|
+
channex?: {
|
|
163
|
+
id?: string;
|
|
164
|
+
isEnabled?: boolean;
|
|
165
|
+
};
|
|
137
166
|
};
|
|
138
167
|
}
|
|
139
168
|
export interface IInboundMappedChannel extends IChannel {
|
|
@@ -177,7 +206,7 @@ export interface IInboundMappedChannel extends IChannel {
|
|
|
177
206
|
}[];
|
|
178
207
|
}
|
|
179
208
|
export interface IUpsertRestrictionsPayload {
|
|
180
|
-
|
|
209
|
+
ratePlanId: number;
|
|
181
210
|
restrictions: {
|
|
182
211
|
[roomTypeId: string]: {
|
|
183
212
|
[date: string]: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGA,2EAAkF;AAAzE,sGAAA,QAAQ,OAAA;AAAE,sGAAA,QAAQ,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGA,2EAAkF;AAAzE,sGAAA,QAAQ,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAuJ3B,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAsFD,6CAA2B;AAC3B,6CAA2B;AAC3B,+EAA6D"}
|
package/package.json
CHANGED
package/src/service.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
IUpsertRestrictionsPayload,
|
|
11
11
|
IAcceptRejectBooking,
|
|
12
12
|
} from './interfaces';
|
|
13
|
-
import {
|
|
13
|
+
import { IRatePlan, IUpdatePricingPayload } from '../../src/interfaces';
|
|
14
14
|
|
|
15
15
|
const httpClient = () =>
|
|
16
16
|
new BackendApiClient({
|
|
@@ -90,19 +90,19 @@ export const upsertRestrictions = async (
|
|
|
90
90
|
return httpClient().post(`/companies/${company.integrations?.bnovo?.id}/restrictions`, restrictions, config);
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
-
export const
|
|
93
|
+
export const getRatePlans = async (
|
|
94
94
|
company: ICompany,
|
|
95
95
|
config?: IRequestOptions,
|
|
96
|
-
): Promise<IBackendApiClientResponse<
|
|
97
|
-
return httpClient().get(`/companies/${company.integrations?.bnovo?.id}/
|
|
96
|
+
): Promise<IBackendApiClientResponse<IRatePlan[]>> => {
|
|
97
|
+
return httpClient().get(`/companies/${company.integrations?.bnovo?.id}/rate-plans`, config);
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
export const
|
|
100
|
+
export const createRatePlan = async (
|
|
101
101
|
company: ICompany,
|
|
102
|
-
|
|
102
|
+
ratePlan: IRatePlan,
|
|
103
103
|
config?: IRequestOptions,
|
|
104
104
|
): Promise<IBackendApiClientResponse<string>> => {
|
|
105
|
-
return httpClient().post(`/companies/${company.integrations?.bnovo?.id}/
|
|
105
|
+
return httpClient().post(`/companies/${company.integrations?.bnovo?.id}/rate-plans`, ratePlan, config);
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
export const updatePricing = async (
|
|
@@ -110,17 +110,17 @@ export const updatePricing = async (
|
|
|
110
110
|
planId: string,
|
|
111
111
|
pricing: IUpdatePricingPayload,
|
|
112
112
|
config?: IRequestOptions,
|
|
113
|
-
): Promise<IBackendApiClientResponse<
|
|
114
|
-
return httpClient().put(`/companies/${company.integrations?.bnovo?.id}/
|
|
113
|
+
): Promise<IBackendApiClientResponse<IRatePlan[]>> => {
|
|
114
|
+
return httpClient().put(`/companies/${company.integrations?.bnovo?.id}/rate-plans/${planId}`, pricing, config);
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
export const
|
|
117
|
+
export const deleteRatePlan = async (
|
|
118
118
|
company: ICompany,
|
|
119
|
-
|
|
119
|
+
ratePlan: IRatePlan,
|
|
120
120
|
config?: IRequestOptions,
|
|
121
|
-
): Promise<IBackendApiClientResponse<
|
|
121
|
+
): Promise<IBackendApiClientResponse<IRatePlan[]>> => {
|
|
122
122
|
return httpClient().del(
|
|
123
|
-
`/companies/${company.integrations?.bnovo?.id}/
|
|
123
|
+
`/companies/${company.integrations?.bnovo?.id}/rate-plans/${ratePlan.integrations.bnovo.id}`,
|
|
124
124
|
config,
|
|
125
125
|
);
|
|
126
126
|
};
|