@dv4resi/dvss-backend-module-offering-im 0.0.13 → 0.0.15
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/README.md +284 -40
- package/dist/index.d.ts +178 -8
- package/dist/index.js +376 -254
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,72 +1,316 @@
|
|
|
1
|
-
# dvss-backend-module-offering-im
|
|
1
|
+
# @dv4resi/dvss-backend-module-offering-im
|
|
2
2
|
|
|
3
|
-
Offering Integration Manager module for UIF. This app
|
|
4
|
-
integration packages and provides the offering integration runtime.
|
|
3
|
+
Offering Integration Manager module for UIF. This app aggregates and bundles the internal integration packages into a single publishable npm package that consuming microservices install.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Overview](#overview)
|
|
10
|
+
- [What Gets Bundled](#what-gets-bundled)
|
|
11
|
+
- [How Consuming Microservices Use This](#how-consuming-microservices-use-this)
|
|
12
|
+
- [Bundling Configuration](#bundling-configuration)
|
|
13
|
+
- [Scripts](#scripts)
|
|
14
|
+
- [Local Development](#local-development)
|
|
15
|
+
- [Local Linking with yarn link](#local-linking-with-yarn-link)
|
|
16
|
+
- [Release Checklist](#release-checklist)
|
|
17
|
+
- [Dependencies](#dependencies)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Overview
|
|
7
22
|
|
|
8
|
-
|
|
23
|
+
This is the **published app** for the offering integration domain. It acts as an aggregator module that:
|
|
9
24
|
|
|
10
|
-
|
|
11
|
-
-
|
|
25
|
+
1. Imports `IntegrationLibsModule` and `IntegrationTrybeModule`
|
|
26
|
+
2. Re-exports both modules and all their public APIs
|
|
27
|
+
3. Bundles the internal packages into `dist/` using `tsup` so consumers only install this single package
|
|
28
|
+
|
|
29
|
+
```mermaid
|
|
30
|
+
graph TB
|
|
31
|
+
subgraph "UIF Monorepo (Internal)"
|
|
32
|
+
libs["@dvss/dvss-integration-libs"]
|
|
33
|
+
trybe["@dvss/dvss-integration-trybe"]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
subgraph "This Package"
|
|
37
|
+
offering["@dv4resi/dvss-backend-module-offering-im<br/><b>OfferingIntegrationManager</b>"]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
subgraph "Consuming Microservices"
|
|
41
|
+
booking["dvss-backend-capability-offering-booking-ms"]
|
|
42
|
+
hooks["dvss-backend-hooks-ms"]
|
|
43
|
+
others["Other microservices"]
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
libs -->|bundled into| offering
|
|
47
|
+
trybe -->|bundled into| offering
|
|
48
|
+
offering -->|"npm install"| booking
|
|
49
|
+
offering -->|"npm install"| hooks
|
|
50
|
+
offering -->|"npm install"| others
|
|
51
|
+
```
|
|
12
52
|
|
|
13
|
-
|
|
53
|
+
---
|
|
14
54
|
|
|
15
|
-
|
|
16
|
-
- Internal UIF packages are bundled into `dist/` so consumers only install
|
|
17
|
-
`@dv4resi/dvss-backend-module-offering-im`
|
|
55
|
+
## What Gets Bundled
|
|
18
56
|
|
|
19
|
-
|
|
57
|
+
At build time, `tsup` bundles the following internal packages into `dist/`:
|
|
58
|
+
|
|
59
|
+
| Internal Package | What It Provides |
|
|
60
|
+
| ------------------------------ | ---------------------------------------------------- |
|
|
61
|
+
| `@dvss/dvss-integration-libs` | Base classes, DAOs, traffic router, common utilities |
|
|
62
|
+
| `@dvss/dvss-integration-trybe` | Trybe-specific capability implementations |
|
|
63
|
+
|
|
64
|
+
The following are kept **external** (not bundled) and must be present in the consuming microservice:
|
|
65
|
+
|
|
66
|
+
- `@nestjs/*` packages
|
|
67
|
+
- `@dv4resi/dvss-backend-module-datastore`
|
|
68
|
+
- `@dv4resi/dvss-backend-module-utility`
|
|
69
|
+
- `rxjs`, `reflect-metadata`, `class-transformer`, `class-validator`
|
|
70
|
+
- `drizzle-orm`
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## How Consuming Microservices Use This
|
|
75
|
+
|
|
76
|
+
### Installation
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Install in the consuming microservice
|
|
80
|
+
npm install @dv4resi/dvss-backend-module-offering-im
|
|
81
|
+
# or
|
|
82
|
+
yarn add @dv4resi/dvss-backend-module-offering-im
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Importing `OfferingIntegrationManager`
|
|
86
|
+
|
|
87
|
+
The primary export is `OfferingIntegrationManager` -- a NestJS module that wraps and re-exports both `IntegrationTrybeModule` and `IntegrationLibsModule`. Consuming microservices only need this single import to get access to all integration services:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
import { OfferingIntegrationManager } from '@dv4resi/dvss-backend-module-offering-im';
|
|
91
|
+
|
|
92
|
+
@Module({
|
|
93
|
+
imports: [
|
|
94
|
+
OfferingIntegrationManager, // brings in all Trybe + Libs services
|
|
95
|
+
// ... other modules
|
|
96
|
+
],
|
|
97
|
+
})
|
|
98
|
+
export class SomeFeatureModule {}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Once imported, all exported services from both internal packages are available for injection:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
import {
|
|
105
|
+
TrybeAuthService,
|
|
106
|
+
TrybeCustomerManagement,
|
|
107
|
+
TrybeCreditBooking,
|
|
108
|
+
TrybeWellnessManagement,
|
|
109
|
+
TrybeIntegrationConfigurationService,
|
|
110
|
+
TrybeIntegrationResourceManagementService,
|
|
111
|
+
// ... any other exported service or model
|
|
112
|
+
} from '@dv4resi/dvss-backend-module-offering-im';
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### What `OfferingIntegrationManager` provides under the hood
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
// apps/dvss-backend-module-offering-im/src/app.module.ts
|
|
119
|
+
@Module({
|
|
120
|
+
imports: [IntegrationTrybeModule, IntegrationLibsModule],
|
|
121
|
+
exports: [IntegrationTrybeModule, IntegrationLibsModule],
|
|
122
|
+
})
|
|
123
|
+
export class OfferingIntegrationManager {}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
// apps/dvss-backend-module-offering-im/src/index.ts
|
|
128
|
+
export { AppModule as OfferingIntegrationManager } from './app.module';
|
|
129
|
+
export { IntegrationTrybeModule } from '@dvss/dvss-integration-trybe';
|
|
130
|
+
export { IntegrationLibsModule } from '@dvss/dvss-integration-libs';
|
|
131
|
+
export * from '@dvss/dvss-integration-libs'; // all libs services, models, utils
|
|
132
|
+
export * from '@dvss/dvss-integration-trybe'; // all trybe services, models, utils
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Real-world example
|
|
136
|
+
|
|
137
|
+
Here is how `dvss-backend-capability-offering-configuration-ms` uses it:
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { OfferingIntegrationManager } from '@dv4resi/dvss-backend-module-offering-im';
|
|
141
|
+
|
|
142
|
+
@Module({
|
|
143
|
+
imports: [
|
|
144
|
+
LoggerModule,
|
|
145
|
+
DatastoreModule,
|
|
146
|
+
GraphQLIntercommunicationModule,
|
|
147
|
+
HttpModule,
|
|
148
|
+
PubSubModule,
|
|
149
|
+
OfferingIntegrationManager, // <-- single import for all integration services
|
|
150
|
+
forwardRef(() => IntegrationsModule),
|
|
151
|
+
forwardRef(() => OfferingIntegrationManagementModule),
|
|
152
|
+
],
|
|
153
|
+
// ...
|
|
154
|
+
})
|
|
155
|
+
export class OfferingManagementModule {}
|
|
156
|
+
```
|
|
20
157
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
158
|
+
```mermaid
|
|
159
|
+
graph TB
|
|
160
|
+
subgraph "OfferingIntegrationManager (single import)"
|
|
161
|
+
direction TB
|
|
162
|
+
TrybeModule["IntegrationTrybeModule"]
|
|
163
|
+
LibsModule["IntegrationLibsModule"]
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
subgraph "Trybe Services (available for injection)"
|
|
167
|
+
TrybeAuth["TrybeAuthService"]
|
|
168
|
+
TrybeCust["TrybeCustomerManagement"]
|
|
169
|
+
TrybeCredit["TrybeCreditBooking"]
|
|
170
|
+
TrybeWellness["TrybeWellnessManagement"]
|
|
171
|
+
TrybeConfig["TrybeIntegrationConfigurationService"]
|
|
172
|
+
TrybeResource["TrybeIntegrationResourceManagementService"]
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
subgraph "Libs Services (available for injection)"
|
|
176
|
+
Gateway["TrafficGatewayService"]
|
|
177
|
+
Logger["IntegrationRequestLoggerService"]
|
|
178
|
+
ConfigDao["IntegrationConfigurationDao"]
|
|
179
|
+
ResourceDao["IntegrationResourceManagementDao"]
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
TrybeModule --> TrybeAuth
|
|
183
|
+
TrybeModule --> TrybeCust
|
|
184
|
+
TrybeModule --> TrybeCredit
|
|
185
|
+
TrybeModule --> TrybeWellness
|
|
186
|
+
TrybeModule --> TrybeConfig
|
|
187
|
+
TrybeModule --> TrybeResource
|
|
188
|
+
LibsModule --> Gateway
|
|
189
|
+
LibsModule --> Logger
|
|
190
|
+
LibsModule --> ConfigDao
|
|
191
|
+
LibsModule --> ResourceDao
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Bundling Configuration
|
|
197
|
+
|
|
198
|
+
The `tsup.config.ts` handles:
|
|
199
|
+
|
|
200
|
+
- **Internal package resolution** - Resolves `@dvss/dvss-integration-libs` and `@dvss/dvss-integration-trybe` to their source files and bundles them
|
|
201
|
+
- **Path resolution** - Fixes `__dirname` references for `.env` file resolution so it works in both monorepo and installed contexts
|
|
202
|
+
- **Output format** - CommonJS (for NestJS compatibility)
|
|
203
|
+
- **Type declarations** - Generates `.d.ts` files for TypeScript consumers
|
|
204
|
+
- **Source maps** - Enabled for debugging
|
|
205
|
+
- **SWC** - Used for decorator metadata support
|
|
206
|
+
- **Tree-shaking** - Enabled to remove unused code
|
|
207
|
+
|
|
208
|
+
---
|
|
25
209
|
|
|
26
210
|
## Scripts
|
|
27
211
|
|
|
28
212
|
```bash
|
|
29
213
|
# Start in dev mode with watch on dependent packages
|
|
30
|
-
#
|
|
214
|
+
# Watches: ./src, ../../packages/dvss-integration-libs/src, ../../packages/dvss-integration-trybe/src
|
|
31
215
|
yarn run start:dev
|
|
32
216
|
|
|
33
|
-
# Build the package
|
|
217
|
+
# Build the package (tsup)
|
|
34
218
|
yarn run build
|
|
35
219
|
|
|
36
220
|
# Watch builds (tsup)
|
|
37
221
|
yarn run build:dev
|
|
38
222
|
|
|
39
|
-
# Build all local dependencies
|
|
223
|
+
# Build all local dependencies first, then build this package
|
|
40
224
|
yarn run build:with-deps
|
|
41
225
|
|
|
42
226
|
# Tests
|
|
43
227
|
yarn run test
|
|
228
|
+
yarn run test:cov
|
|
229
|
+
yarn run test:watch
|
|
44
230
|
```
|
|
45
231
|
|
|
46
|
-
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Local Development
|
|
47
235
|
|
|
48
236
|
From the monorepo root:
|
|
49
237
|
|
|
50
238
|
```bash
|
|
51
|
-
|
|
239
|
+
# Build this app with all its internal deps in order
|
|
240
|
+
yarn --cwd apps/dvss-backend-module-offering-im run build:with-deps
|
|
241
|
+
|
|
242
|
+
# Watch mode - auto-rebuilds when libs or trybe source files change
|
|
243
|
+
yarn --cwd apps/dvss-backend-module-offering-im run start:dev
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
The `start:dev` script uses `nodemon` to watch source files across three locations:
|
|
247
|
+
|
|
248
|
+
- `./src` (this app)
|
|
249
|
+
- `../../packages/dvss-integration-libs/src`
|
|
250
|
+
- `../../packages/dvss-integration-trybe/src`
|
|
251
|
+
|
|
252
|
+
Any `.ts` file change in these directories triggers a `tsup` rebuild.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Local Linking with yarn link
|
|
257
|
+
|
|
258
|
+
To test local changes in a consuming microservice without publishing:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# 1. Build with deps
|
|
262
|
+
yarn --cwd apps/dvss-backend-module-offering-im run build:with-deps
|
|
263
|
+
|
|
264
|
+
# 2. Register the link (from the app directory)
|
|
265
|
+
cd apps/dvss-backend-module-offering-im
|
|
266
|
+
yarn link
|
|
267
|
+
|
|
268
|
+
# 3. Use the link in the consuming microservice
|
|
269
|
+
cd /path/to/consuming-microservice
|
|
270
|
+
yarn link "@dv4resi/dvss-backend-module-offering-im"
|
|
271
|
+
|
|
272
|
+
# 4. Unlink when done
|
|
273
|
+
yarn unlink "@dv4resi/dvss-backend-module-offering-im"
|
|
274
|
+
yarn install --force
|
|
52
275
|
```
|
|
53
276
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
277
|
+
> **Tip:** Run `start:dev` in the UIF monorepo while linked so changes to `libs` or `trybe` automatically rebuild this package, and the consuming microservice picks them up.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Release Checklist
|
|
282
|
+
|
|
283
|
+
1. Bump the `version` field in this app's `package.json`
|
|
284
|
+
2. Lint and tests run automatically on commit via Husky
|
|
285
|
+
3. Merge to `master` to trigger the CI lint/build pipeline
|
|
286
|
+
4. After the pipeline passes, trigger the publish pipeline from the latest merged commit on `master`
|
|
287
|
+
5. Tag format: `dvss-backend-module-offering-im-vX.Y.Z`
|
|
288
|
+
- Version must be exactly the next patch/minor/major from npm (no skipping)
|
|
289
|
+
- The tag prefix must be in the `ALLOWED_APP_NAMES` allowlist in `scripts/validate-tag-and-publish.sh`
|
|
290
|
+
|
|
291
|
+
**Example:** If current published version is `0.0.14`, valid next versions are:
|
|
292
|
+
|
|
293
|
+
- `dvss-backend-module-offering-im-v0.0.15` (patch)
|
|
294
|
+
- `dvss-backend-module-offering-im-v0.1.0` (minor)
|
|
295
|
+
- `dvss-backend-module-offering-im-v1.0.0` (major)
|
|
296
|
+
|
|
297
|
+
> The `package.json` version must match the tag version.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Dependencies
|
|
302
|
+
|
|
303
|
+
**Runtime** (must be present in consuming microservice):
|
|
304
|
+
|
|
305
|
+
| Dependency | Purpose |
|
|
306
|
+
| ------------------------------------------------------------ | ------------------- |
|
|
307
|
+
| `@nestjs/common`, `@nestjs/core`, `@nestjs/platform-express` | NestJS framework |
|
|
308
|
+
| `rxjs` | Reactive extensions |
|
|
309
|
+
| `reflect-metadata` | Decorator metadata |
|
|
310
|
+
|
|
311
|
+
**Dev / Bundled** (bundled into `dist/`, not required by consumers):
|
|
312
|
+
|
|
313
|
+
| Dependency | Purpose |
|
|
314
|
+
| ------------------------------ | -------------------------------------------- |
|
|
315
|
+
| `@dvss/dvss-integration-libs` | Internal: base classes, DAOs, traffic router |
|
|
316
|
+
| `@dvss/dvss-integration-trybe` | Internal: Trybe capability implementations |
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CONFIGURED_FOR_TYPE_ENUM, MEDIA_PROVIDER_ENUM, DAY_OF_WEEK, OFFERING_RESOURCE_TYPE, STATUS } from '@dv4resi/dvss-backend-module-datastore/dist/datastore/models';
|
|
2
|
-
import { LoggerService, GraphQLContext, AddAPIResponse } from '@dv4resi/dvss-backend-module-utility';
|
|
2
|
+
import { LoggerService, GraphQLContext, IMedia, AddAPIResponse } from '@dv4resi/dvss-backend-module-utility';
|
|
3
3
|
import { HttpService } from '@nestjs/axios';
|
|
4
4
|
import { CAPABILITY_PROVIDER_INTEGRATION_ENUM, CAPABILITY_CATEGORY_ENUM, ICapability } from '@dv4resi/dvss-backend-module-datastore/dist/datastore/models/capability.model';
|
|
5
5
|
import { schema, CommonValidationDatabaseService as CommonValidationDatabaseService$1 } from '@dv4resi/dvss-backend-module-datastore';
|
|
@@ -528,8 +528,9 @@ interface ICreateOrderRequest {
|
|
|
528
528
|
}
|
|
529
529
|
interface ICreateOrderResponse {
|
|
530
530
|
externalBookingId: string;
|
|
531
|
-
items: (IBookableItem & {
|
|
531
|
+
items: (Pick<IBookableItem, 'externalId' | 'type' | 'name'> & {
|
|
532
532
|
totalPrice?: number;
|
|
533
|
+
primaryAsset?: IMedia;
|
|
533
534
|
})[];
|
|
534
535
|
}
|
|
535
536
|
interface IAddItemToOrderItemConfig {
|
|
@@ -1166,11 +1167,6 @@ interface ITrybeAddOrderItemResponse {
|
|
|
1166
1167
|
net_total?: number;
|
|
1167
1168
|
};
|
|
1168
1169
|
}
|
|
1169
|
-
interface ITrybeSubmitOrderResponse {
|
|
1170
|
-
data: {
|
|
1171
|
-
id: string;
|
|
1172
|
-
};
|
|
1173
|
-
}
|
|
1174
1170
|
interface ITrybeCancelOrderResponse {
|
|
1175
1171
|
data: {
|
|
1176
1172
|
id: string;
|
|
@@ -1203,6 +1199,15 @@ interface ITrybeZone {
|
|
|
1203
1199
|
interface ITrybeCreateOrderResponse extends ICreateOrderResponse {
|
|
1204
1200
|
meta: {
|
|
1205
1201
|
orderReference: string;
|
|
1202
|
+
room?: {
|
|
1203
|
+
id: string;
|
|
1204
|
+
name: string;
|
|
1205
|
+
capacity: number;
|
|
1206
|
+
};
|
|
1207
|
+
total: number;
|
|
1208
|
+
subTotal: number;
|
|
1209
|
+
totalTax: number;
|
|
1210
|
+
discount: number;
|
|
1206
1211
|
};
|
|
1207
1212
|
}
|
|
1208
1213
|
interface ITrybeGetOrderResponse extends IGetOrderResponse {
|
|
@@ -1218,6 +1223,149 @@ interface ITrybeUpdateOrderItemResponse {
|
|
|
1218
1223
|
id: string;
|
|
1219
1224
|
};
|
|
1220
1225
|
}
|
|
1226
|
+
interface ITrybeSubmitOrderResponse {
|
|
1227
|
+
data?: {
|
|
1228
|
+
id: string;
|
|
1229
|
+
order_ref: string;
|
|
1230
|
+
guests?: {
|
|
1231
|
+
id: string;
|
|
1232
|
+
name: string;
|
|
1233
|
+
first_name: string;
|
|
1234
|
+
last_name: string;
|
|
1235
|
+
email: string | null;
|
|
1236
|
+
intake_form_complete: boolean;
|
|
1237
|
+
checked_in_at: string | null;
|
|
1238
|
+
checked_out_at: string | null;
|
|
1239
|
+
is_lead_booker: boolean;
|
|
1240
|
+
customer_id: string;
|
|
1241
|
+
}[];
|
|
1242
|
+
labels: [];
|
|
1243
|
+
sales_channel: null;
|
|
1244
|
+
items_status: 'pending_confirmation';
|
|
1245
|
+
booking_items?: {
|
|
1246
|
+
id: string;
|
|
1247
|
+
status: string;
|
|
1248
|
+
item_type: string;
|
|
1249
|
+
date: string;
|
|
1250
|
+
type_id: string;
|
|
1251
|
+
type_name: string;
|
|
1252
|
+
type_product_code: string | null;
|
|
1253
|
+
guests: {
|
|
1254
|
+
id: string;
|
|
1255
|
+
name: string;
|
|
1256
|
+
first_name: string;
|
|
1257
|
+
last_name: string;
|
|
1258
|
+
email: string | null;
|
|
1259
|
+
intake_form_complete: boolean;
|
|
1260
|
+
checked_in_at: string | null;
|
|
1261
|
+
checked_out_at: string | null;
|
|
1262
|
+
is_lead_booker: boolean;
|
|
1263
|
+
customer_id: string;
|
|
1264
|
+
}[];
|
|
1265
|
+
price: number;
|
|
1266
|
+
discount_amount: number;
|
|
1267
|
+
discounts: [];
|
|
1268
|
+
order_discount_amount: number;
|
|
1269
|
+
booking_summary?: {
|
|
1270
|
+
id: string;
|
|
1271
|
+
status: string;
|
|
1272
|
+
offering: {
|
|
1273
|
+
id: string;
|
|
1274
|
+
type: string;
|
|
1275
|
+
name: string;
|
|
1276
|
+
product_code: string | null;
|
|
1277
|
+
};
|
|
1278
|
+
start_time: string;
|
|
1279
|
+
end_time: string;
|
|
1280
|
+
duration: number;
|
|
1281
|
+
practitioner_ids: string[];
|
|
1282
|
+
practitioners: {
|
|
1283
|
+
id: string;
|
|
1284
|
+
name: string;
|
|
1285
|
+
}[];
|
|
1286
|
+
room_id: string;
|
|
1287
|
+
room?: {
|
|
1288
|
+
id: string;
|
|
1289
|
+
name: string;
|
|
1290
|
+
capacity: number;
|
|
1291
|
+
};
|
|
1292
|
+
equipment_ids: string[];
|
|
1293
|
+
equipment: {
|
|
1294
|
+
id: string;
|
|
1295
|
+
name: string;
|
|
1296
|
+
}[];
|
|
1297
|
+
practitioner_was_requested: false;
|
|
1298
|
+
room_was_requested: false;
|
|
1299
|
+
};
|
|
1300
|
+
total_cost: number;
|
|
1301
|
+
net_total: number;
|
|
1302
|
+
inclusive_tax_amount: number;
|
|
1303
|
+
exclusive_tax_amount: number;
|
|
1304
|
+
booking_reserved_until: string;
|
|
1305
|
+
guest: {
|
|
1306
|
+
id: string;
|
|
1307
|
+
name: string;
|
|
1308
|
+
first_name: string;
|
|
1309
|
+
last_name: string;
|
|
1310
|
+
email: string | null;
|
|
1311
|
+
intake_form_complete: boolean;
|
|
1312
|
+
checked_in_at: string | null;
|
|
1313
|
+
checked_out_at: string | null;
|
|
1314
|
+
is_lead_booker: boolean;
|
|
1315
|
+
customer_id: string;
|
|
1316
|
+
};
|
|
1317
|
+
is_modifiable: boolean;
|
|
1318
|
+
}[];
|
|
1319
|
+
purchase_items: [];
|
|
1320
|
+
package_items: [];
|
|
1321
|
+
booking_items_start_date: string;
|
|
1322
|
+
booking_items_end_date: string;
|
|
1323
|
+
booking_items_span_multiple_days: false;
|
|
1324
|
+
currency: string;
|
|
1325
|
+
totals?: {
|
|
1326
|
+
subtotal?: number;
|
|
1327
|
+
inclusive_tax?: number;
|
|
1328
|
+
exclusive_tax?: number;
|
|
1329
|
+
order_discount?: number;
|
|
1330
|
+
total?: number;
|
|
1331
|
+
};
|
|
1332
|
+
total_cost: number;
|
|
1333
|
+
discount_total: number;
|
|
1334
|
+
total_tax: number;
|
|
1335
|
+
net_total: number;
|
|
1336
|
+
tip_amount: number;
|
|
1337
|
+
tips: [];
|
|
1338
|
+
service_charge: {
|
|
1339
|
+
amount: number;
|
|
1340
|
+
percentage: number;
|
|
1341
|
+
item_amounts: {
|
|
1342
|
+
item_id: string;
|
|
1343
|
+
amount: number;
|
|
1344
|
+
percentage: number;
|
|
1345
|
+
}[];
|
|
1346
|
+
};
|
|
1347
|
+
submit_payment_amount: number;
|
|
1348
|
+
submit_auth_amount: number;
|
|
1349
|
+
outstanding_payment_amount: number;
|
|
1350
|
+
payment_totals: {
|
|
1351
|
+
paid: number;
|
|
1352
|
+
pending: number;
|
|
1353
|
+
chargeable: number;
|
|
1354
|
+
provided: number;
|
|
1355
|
+
missing: number;
|
|
1356
|
+
unpaid: number;
|
|
1357
|
+
};
|
|
1358
|
+
total_paid_or_authed: number;
|
|
1359
|
+
taxes: [];
|
|
1360
|
+
payments: [];
|
|
1361
|
+
discounts: [];
|
|
1362
|
+
applied_promo_code_id: null;
|
|
1363
|
+
applied_promo_code_discount_total: number;
|
|
1364
|
+
is_promo_code_discount_applied: boolean;
|
|
1365
|
+
coupon_codes: [];
|
|
1366
|
+
voucher_codes: [];
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1221
1369
|
|
|
1222
1370
|
declare enum TRYBE_SUPPORTED_JOURNEYS_ENUM {
|
|
1223
1371
|
APPOINTMENT = "APPOINTMENT",
|
|
@@ -1301,25 +1449,47 @@ declare class TrybeWellnessManagement implements BaseWellnessManagement {
|
|
|
1301
1449
|
createWellnessAppointmentSessionOrder(): Promise<void>;
|
|
1302
1450
|
addWellnessAppointmentSessionOrderItems(): Promise<void>;
|
|
1303
1451
|
confirmWellnessAppointmentSessionOrder(): Promise<void>;
|
|
1452
|
+
getOffering(request: {
|
|
1453
|
+
offeringId: string;
|
|
1454
|
+
offeringType: TRYBE_OFFERING_TYPE_ENUM;
|
|
1455
|
+
}, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<{
|
|
1456
|
+
data: ITrybeSession | ITrybeCourse | ITrybeAppointment;
|
|
1457
|
+
}>;
|
|
1304
1458
|
createOrder(request: ICreateOrderRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ITrybeCreateOrderResponse>;
|
|
1305
1459
|
addCustomerToOrder(orderId: string, customerId: string, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
1306
1460
|
getOrder(orderId: string, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ITrybeGetOrderResponse>;
|
|
1307
1461
|
private mapOfferingTypeToTrybeApi;
|
|
1308
1462
|
addItemToOrder(request: IAddItemToOrderRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IAddItemToOrderResponse>;
|
|
1309
1463
|
addCustomerCreditsToOrder(orderId: string, customerCreditId: string, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
1310
|
-
submitOrder(orderId: string, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<
|
|
1464
|
+
submitOrder(orderId: string, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ITrybeSubmitOrderResponse>;
|
|
1311
1465
|
cancelOrder(orderId: string, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
1312
1466
|
updateOrder(request: IUpdateOrderRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IUpdateOrderResponse>;
|
|
1313
1467
|
updateOrderItem(orderId: string, itemId: string, request: IUpdateOrderRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ITrybeUpdateOrderItemResponse>;
|
|
1314
1468
|
addPaymentToOrder(request: IAddPaymentToOrderRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<void>;
|
|
1315
1469
|
fetchAppointments(request: IGetAppointmentsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
|
|
1470
|
+
fetchAppointment(request: {
|
|
1471
|
+
appointmentId: string;
|
|
1472
|
+
}, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<{
|
|
1473
|
+
data: ITrybeAppointment;
|
|
1474
|
+
}>;
|
|
1316
1475
|
fetchSessions(request: IGetSessionsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
|
|
1476
|
+
fetchSession(request: {
|
|
1477
|
+
sessionId: string;
|
|
1478
|
+
}, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<{
|
|
1479
|
+
data: ITrybeSession;
|
|
1480
|
+
}>;
|
|
1317
1481
|
fetchCourses(request: IGetCoursesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
|
|
1482
|
+
fetchCourse(request: {
|
|
1483
|
+
courseId: string;
|
|
1484
|
+
}, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<{
|
|
1485
|
+
data: ITrybeCourse;
|
|
1486
|
+
}>;
|
|
1318
1487
|
fetchPractitioners(request: IGetPractitionersRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IOfferingResource>>;
|
|
1319
1488
|
fetchCategories(request: IGetCategoriesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItemCategory>>;
|
|
1320
1489
|
fetchBookableItemsFromCredit(request: IGetBookableItemsFromCreditRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
|
|
1321
1490
|
fetchSessionAvailabilityForOffering(request: IFetchOfferingAvailabilityRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetAvailableDatesAndTimeSlotsResponse>;
|
|
1322
1491
|
fetchAppointmentAvailabilityForOffering(request: IFetchOfferingAvailabilityRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetAvailableDatesAndTimeSlotsResponse>;
|
|
1492
|
+
mapTrybeOfferingTypeToBookableItemType(offeringType: string): BOOKABLE_ITEM_TYPE_ENUM;
|
|
1323
1493
|
}
|
|
1324
1494
|
|
|
1325
1495
|
declare function formatDateForTrybe(date: Date, isStartOfDay: boolean): string;
|