@dv4resi/dvss-backend-module-offering-im 0.0.4 → 0.0.6

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 CHANGED
@@ -1,98 +1,72 @@
1
- <p align="center">
2
- <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
3
- </p>
4
-
5
- [circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
6
- [circleci-url]: https://circleci.com/gh/nestjs/nest
7
-
8
- <p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
9
- <p align="center">
10
- <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
11
- <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
12
- <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
13
- <a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
14
- <a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
15
- <a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
16
- <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
17
- <a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
18
- <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
19
- <a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
20
- </p>
21
- <!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
22
- [![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
23
-
24
- ## Description
25
-
26
- [Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
27
-
28
- ## Project setup
1
+ # dvss-backend-module-offering-im
29
2
 
30
- ```bash
31
- $ yarn install
32
- ```
33
-
34
- ## Compile and run the project
35
-
36
- ```bash
37
- # development
38
- $ yarn run start
3
+ Offering Integration Manager module for UIF. This app consumes shared
4
+ integration packages and provides the offering integration runtime.
39
5
 
40
- # watch mode
41
- $ yarn run start:dev
6
+ ## Dependencies
42
7
 
43
- # production mode
44
- $ yarn run start:prod
45
- ```
8
+ Development dependencies include:
46
9
 
47
- ## Run tests
10
+ - `@dvss/dvss-integration-libs`
11
+ - `@dvss/dvss-integration-trybe`
48
12
 
49
- ```bash
50
- # unit tests
51
- $ yarn run test
13
+ ## Build output
52
14
 
53
- # e2e tests
54
- $ yarn run test:e2e
15
+ - Compiled artifacts are emitted to `dist/` via `tsup`
16
+ - Internal UIF packages are bundled into `dist/` so consumers only install
17
+ `@dv4resi/dvss-backend-module-offering-im`
55
18
 
56
- # test coverage
57
- $ yarn run test:cov
58
- ```
19
+ ## Bundling behavior
59
20
 
60
- ## Deployment
21
+ - Bundled: `@dvss/dvss-integration-libs`, `@dvss/dvss-integration-trybe`
22
+ - Externalized: NestJS, RxJS, and other runtime dependencies listed in
23
+ `package.json`
24
+ - Build-time requirement: `@swc/core` (installed at the monorepo root)
61
25
 
62
- When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information.
63
-
64
- If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
26
+ ## Scripts
65
27
 
66
28
  ```bash
67
- $ yarn install -g @nestjs/mau
68
- $ mau deploy
69
- ```
70
-
71
- With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
72
-
73
- ## Resources
29
+ # Start in dev mode with watch on dependent packages
30
+ # This picks up changes from libs and trybe
31
+ yarn run start:dev
74
32
 
75
- Check out a few resources that may come in handy when working with NestJS:
33
+ # Build the package
34
+ yarn run build
76
35
 
77
- - Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
78
- - For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
79
- - To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
80
- - Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
81
- - Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
82
- - Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
83
- - To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
84
- - Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
36
+ # Watch builds (tsup)
37
+ yarn run build:dev
85
38
 
86
- ## Support
39
+ # Build all local dependencies before building
40
+ yarn run build:with-deps
87
41
 
88
- Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
42
+ # Tests
43
+ yarn run test
44
+ ```
89
45
 
90
- ## Stay in touch
46
+ ## Local usage
91
47
 
92
- - Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
93
- - Website - [https://nestjs.com](https://nestjs.com/)
94
- - Twitter - [@nestframework](https://twitter.com/nestframework)
48
+ From the monorepo root:
95
49
 
96
- ## License
50
+ ```bash
51
+ yarn --cwd apps/dvss-backend-module-offering-im run build
52
+ ```
97
53
 
98
- Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
54
+ ## Setup notes
55
+
56
+ - Install all workspace dependencies from the repo root with `yarn install`
57
+ - When working on dependent packages (e.g., trybe or libs), use `yarn run start:dev` here to pick up their changes
58
+
59
+ ## Release checklist
60
+
61
+ - Bump `package.json` version in `apps/dvss-backend-module-offering-im` before release
62
+ - Lint and tests run automatically on commit via Husky
63
+ - Merge to `master` to trigger the initial lint/build pipeline
64
+ - After the initial pipeline passes, trigger the publish pipeline from the latest
65
+ merged commit on `master`
66
+ - Tag format must match the version script in `scripts/validate-tag-and-publish.sh`:
67
+ - Tag pattern: `dvss-backend-module-offering-im-vX.Y.Z`
68
+ - Version must be exactly the next patch/minor/major from npm (no skipping)
69
+ - The tag prefix must be allowlisted in `ALLOWED_APP_NAMES`
70
+ - Example: if current published version is `0.0.3`, valid tags are
71
+ `dvss-backend-module-offering-im-v0.0.4`, `...-v0.1.0`, or `...-v1.0.0`
72
+ - Also the package.json version should be the next valid version.
package/dist/index.d.ts CHANGED
@@ -111,10 +111,6 @@ interface ICredit {
111
111
  capabilityIntegrationId?: bigint;
112
112
  meta?: Record<string, unknown>;
113
113
  }
114
- interface ICustomerCreditsSystemResponse {
115
- totalCount: number;
116
- records: ICredit[];
117
- }
118
114
  interface IGetCustomerCreditsRequestFilters {
119
115
  by: CREDIT_FILTER_BY_ENUM;
120
116
  values: string[];
@@ -166,6 +162,124 @@ interface IValidatedCapabilityIntegration {
166
162
  projectId?: number;
167
163
  }
168
164
 
165
+ declare enum BOOKABLE_ITEM_TYPE_ENUM {
166
+ APPOINTMENT = "APPOINTMENT",
167
+ SESSION = "SESSION",
168
+ COURSE = "COURSE"
169
+ }
170
+ declare enum BOOKABLE_ITEM_STATUS_ENUM {
171
+ ACTIVE = "ACTIVE",
172
+ INACTIVE = "INACTIVE"
173
+ }
174
+ declare enum DAY_OF_WEEK {
175
+ MON = "MON",
176
+ TUE = "TUE",
177
+ WED = "WED",
178
+ THU = "THU",
179
+ FRI = "FRI",
180
+ SAT = "SAT",
181
+ SUN = "SUN"
182
+ }
183
+ interface IBookableItemPriceMeta {
184
+ id?: bigint;
185
+ externalId?: string;
186
+ status?: BOOKABLE_ITEM_STATUS_ENUM;
187
+ price: number;
188
+ currency: string;
189
+ configuredForDays?: DAY_OF_WEEK[];
190
+ config?: Record<string, unknown>;
191
+ }
192
+ interface IBookableItemPrice {
193
+ id?: bigint;
194
+ label?: string;
195
+ currency: string;
196
+ price: number;
197
+ externalResourceId?: string;
198
+ durationInMinute?: number;
199
+ configuredForDays?: DAY_OF_WEEK[];
200
+ pricesMeta?: IBookableItemPriceMeta[];
201
+ config?: Record<string, unknown>;
202
+ }
203
+ interface IBookableItemMedia {
204
+ id?: string;
205
+ url?: string;
206
+ originalUrl?: string;
207
+ fileName?: string;
208
+ mimeType?: string;
209
+ thumbnailUrl?: string;
210
+ }
211
+ interface IBookableItem {
212
+ id?: bigint;
213
+ externalId: string;
214
+ name: string;
215
+ description?: string;
216
+ type: BOOKABLE_ITEM_TYPE_ENUM;
217
+ status: BOOKABLE_ITEM_STATUS_ENUM;
218
+ icon?: IBookableItemMedia;
219
+ primaryAsset?: IBookableItemMedia;
220
+ prices?: IBookableItemPrice[];
221
+ linkedBookableItems?: IBookableItem[];
222
+ updatedAt?: Date;
223
+ createdAt?: Date;
224
+ meta?: Record<string, unknown>;
225
+ }
226
+ interface IBookableItemCategory {
227
+ id?: bigint;
228
+ externalId: string;
229
+ name: string;
230
+ description?: string;
231
+ meta?: Record<string, unknown>;
232
+ }
233
+ interface IWellnessManagementRequestOptions {
234
+ page?: number;
235
+ count?: number;
236
+ }
237
+ interface IGetAppointmentsRequest {
238
+ shouldFetchAllAppointments: boolean;
239
+ practitionerIds?: string[];
240
+ options?: IWellnessManagementRequestOptions;
241
+ }
242
+ interface IGetSessionsRequest {
243
+ shouldFetchAllSessions: boolean;
244
+ practitionerIds?: string[];
245
+ options?: IWellnessManagementRequestOptions;
246
+ }
247
+ interface IGetCoursesRequest {
248
+ shouldFetchAllCourses: boolean;
249
+ options?: IWellnessManagementRequestOptions;
250
+ }
251
+ interface IGetCategoriesRequest {
252
+ shouldFetchAllCategories: boolean;
253
+ options?: IWellnessManagementRequestOptions;
254
+ }
255
+ interface IGetBookableItemsFromCreditRequest {
256
+ couponCodeId: string;
257
+ options?: IWellnessManagementRequestOptions;
258
+ }
259
+ interface IFetchOfferingAvailabilityRequest {
260
+ externalOfferingBookableItemId: string;
261
+ dateTimeFrom: Date;
262
+ dateTimeTo: Date;
263
+ }
264
+ interface IAvailableTimeSlot {
265
+ fromTime: string;
266
+ toTime: string;
267
+ meta?: unknown;
268
+ }
269
+ interface IAvailableDateWithSlots {
270
+ date: Date;
271
+ meta?: unknown;
272
+ time: IAvailableTimeSlot[];
273
+ }
274
+ interface IGetAvailableDatesAndTimeSlotsResponse {
275
+ dates: IAvailableDateWithSlots[];
276
+ }
277
+
278
+ interface ISystemResponse<T> {
279
+ totalCount: number;
280
+ records: T[];
281
+ }
282
+
169
283
  interface IApiCallRequest<TBody = unknown> {
170
284
  apiMethod: HTTP_METHOD;
171
285
  url: string;
@@ -200,7 +314,15 @@ declare abstract class BaseAuth {
200
314
  abstract fetchAccessToken(integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<string>;
201
315
  }
202
316
 
203
- declare abstract class BaseWellnessAppointmentBooking {
317
+ declare abstract class BaseWellnessManagement {
318
+ abstract fetchAppointments(request: IGetAppointmentsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
319
+ abstract fetchSessions(request: IGetSessionsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
320
+ abstract fetchCourses(request: IGetCoursesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
321
+ abstract fetchCategories(request: IGetCategoriesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItemCategory>>;
322
+ abstract fetchBookableItemsFromCredit(request: IGetBookableItemsFromCreditRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
323
+ abstract fetchSessionAvailabilityForOffering(request: IFetchOfferingAvailabilityRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetAvailableDatesAndTimeSlotsResponse>;
324
+ abstract fetchAppointmentAvailabilityForOffering(request: IFetchOfferingAvailabilityRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetAvailableDatesAndTimeSlotsResponse>;
325
+ abstract fetchPractitioners(): Promise<void>;
204
326
  abstract fetchWellnessAppointmentSession(): Promise<void>;
205
327
  abstract checkWellnessAppointmentSessionAvailability(): Promise<void>;
206
328
  abstract createWellnessAppointmentSessionOrder(): Promise<void>;
@@ -209,7 +331,7 @@ declare abstract class BaseWellnessAppointmentBooking {
209
331
  }
210
332
 
211
333
  declare abstract class BaseCreditBooking {
212
- abstract fetchCustomerCredits(request: IGetCustomerCreditsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ICustomerCreditsSystemResponse>;
334
+ abstract fetchCustomerCredits(request: IGetCustomerCreditsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<ICredit>>;
213
335
  }
214
336
 
215
337
  declare abstract class BaseCustomerManagement {
@@ -362,6 +484,264 @@ interface ITrybeCredit {
362
484
  }
363
485
  type ITrybeGetCustomerCreditsResponse = IGetTrybeResourcesCommonResponse<ITrybeCredit>;
364
486
 
487
+ interface ITrybeImage {
488
+ id: string;
489
+ file_name: string;
490
+ mime_type: string;
491
+ size: number;
492
+ url: string;
493
+ original_url: string;
494
+ }
495
+ interface ITrybeMeta {
496
+ title: string;
497
+ description: string;
498
+ }
499
+ interface ITrybePriceRule {
500
+ id: string;
501
+ price: number;
502
+ weekdays?: string[];
503
+ date_from: string;
504
+ date_to: string;
505
+ time_from?: string;
506
+ time_to?: string;
507
+ }
508
+ interface ITrybeCategory {
509
+ id: string;
510
+ name: string;
511
+ voucher_applicable: unknown;
512
+ }
513
+ type ITrybeGetCategoriesResponse = IGetTrybeResourcesCommonResponse<ITrybeCategory>;
514
+ interface ITrybeAppointmentPriceRule extends ITrybePriceRule {
515
+ appointment_type_id: string;
516
+ }
517
+ interface ITrybeAppointment {
518
+ id: string;
519
+ name: string;
520
+ description?: string;
521
+ currency: string;
522
+ product_code: string;
523
+ image?: ITrybeImage;
524
+ site_ids: string[];
525
+ room_ids: string[];
526
+ equipment_ids: unknown[];
527
+ practitioner_ids: string[];
528
+ category_ids: string[];
529
+ durations: number[];
530
+ end_buffer: number;
531
+ start_time_interval: number;
532
+ max_advance_bookings_interval?: string;
533
+ min_advance_bookings_interval?: string;
534
+ tag_ids: unknown[];
535
+ tags: unknown[];
536
+ categories: ITrybeCategory[];
537
+ price_rules: ITrybeAppointmentPriceRule[];
538
+ contraindications: unknown[];
539
+ offered_online: boolean;
540
+ private: boolean;
541
+ visibility: string;
542
+ customers_only: boolean;
543
+ members_only: boolean;
544
+ membership_booking_windows_enabled: boolean;
545
+ membership_booking_windows: unknown[];
546
+ meta: ITrybeMeta;
547
+ upsell_offerings: unknown[];
548
+ cross_sell_offerings: unknown[];
549
+ related_retail_offerings: unknown[];
550
+ customer_cancellation_permitted?: string;
551
+ customer_cancellation_min_duration?: string;
552
+ min_guests: number;
553
+ max_guests: number;
554
+ allocate_multi_capacity_rooms: boolean;
555
+ enquiries_enabled: boolean;
556
+ revenue_centre: unknown;
557
+ include_pricing_on_calendar: boolean;
558
+ max_per_basket: unknown;
559
+ max_per_guest: unknown;
560
+ shop_practitioner_selection_enabled: boolean;
561
+ updated_at: string;
562
+ deleted_at: string;
563
+ }
564
+ type ITrybeGetAppointmentsResponse = IGetTrybeResourcesCommonResponse<ITrybeAppointment>;
565
+ interface ITrybeSessionPriceRule extends ITrybePriceRule {
566
+ session_type_id: string;
567
+ }
568
+ interface ITrybeSessionMeta {
569
+ title: string;
570
+ description: string;
571
+ }
572
+ interface ITrybeSessionRecurrenceGroup {
573
+ id: string;
574
+ name: string;
575
+ practitioner: {
576
+ id: string;
577
+ name: string;
578
+ };
579
+ room: ITrybeSessionRoom;
580
+ weekdays: string[];
581
+ start_time: string;
582
+ start_times: ITrybeSessionStartTime[];
583
+ capacity: number;
584
+ recurrence_start?: string;
585
+ recurrence_end?: string;
586
+ session_type_id: string;
587
+ deleted_at: string;
588
+ }
589
+ interface ITrybeSessionStartTime {
590
+ value: string;
591
+ id: string;
592
+ }
593
+ interface ITrybeSession {
594
+ id: string;
595
+ name: string;
596
+ description?: string;
597
+ currency: string;
598
+ product_code: string;
599
+ image?: ITrybeImage;
600
+ site_id: string;
601
+ category_ids: string[];
602
+ price_rules: ITrybeSessionPriceRule[];
603
+ duration?: number;
604
+ offered_online: boolean;
605
+ private: boolean;
606
+ visibility: string;
607
+ customers_only: boolean;
608
+ members_only: boolean;
609
+ membership_booking_windows_enabled: boolean;
610
+ membership_booking_windows: unknown[];
611
+ max_bookings_per_member: number;
612
+ meta: ITrybeSessionMeta;
613
+ upsell_offerings: unknown[];
614
+ cross_sell_offerings: unknown[];
615
+ related_retail_offerings: unknown[];
616
+ customer_cancellation_permitted?: string;
617
+ customer_cancellation_min_duration?: string;
618
+ waitlist_enabled: boolean;
619
+ max_advance_bookings_interval?: string;
620
+ min_advance_bookings_interval?: string;
621
+ min_guests: number;
622
+ max_guests: number;
623
+ categories: ITrybeCategory[];
624
+ max_baskets_per_session?: number;
625
+ recurrence_groups: ITrybeSessionRecurrenceGroup[];
626
+ revenue_centre: string;
627
+ include_pricing_on_calendar: boolean;
628
+ max_per_basket: string;
629
+ max_per_guest: string;
630
+ updated_at: string;
631
+ deleted_at: string;
632
+ }
633
+ type ITrybeGetSessionsResponse = IGetTrybeResourcesCommonResponse<ITrybeSession>;
634
+ interface ITrybeOffering {
635
+ offering_type: string;
636
+ offering_id: string;
637
+ offering_name: string;
638
+ }
639
+ interface ITrybeCourse {
640
+ id: string;
641
+ name: string;
642
+ description?: string;
643
+ currency: string;
644
+ product_code: string;
645
+ coupon_id: string;
646
+ offerings: ITrybeOffering[];
647
+ offering_type: string;
648
+ offering_id: string;
649
+ image?: ITrybeImage;
650
+ site_id: string;
651
+ category_ids: string[];
652
+ quantity: number;
653
+ credits_validity_interval?: string;
654
+ offered_online: boolean;
655
+ private: boolean;
656
+ visibility: string;
657
+ customers_only: boolean;
658
+ members_only: boolean;
659
+ meta: ITrybeMeta;
660
+ upsell_offerings: ITrybeOffering[];
661
+ cross_sell_offerings: ITrybeOffering[];
662
+ related_retail_offerings: ITrybeOffering[];
663
+ availability_rules: unknown[];
664
+ price_rules: ITrybePriceRule[];
665
+ revenue_centre: unknown;
666
+ updated_at: string;
667
+ deleted_at: string;
668
+ }
669
+ type ITrybeGetCoursesResponse = IGetTrybeResourcesCommonResponse<ITrybeCourse>;
670
+ declare enum TRYBE_OFFERING_TYPE_ENUM {
671
+ APPOINTMENT = "APPOINTMENT",
672
+ SESSION = "SESSION",
673
+ COURSE = "COURSE"
674
+ }
675
+ interface ITrybeCouponCodeOffering {
676
+ offering_type: TRYBE_OFFERING_TYPE_ENUM;
677
+ offering_id: string;
678
+ offering_name: string;
679
+ }
680
+ interface ITrybeCouponCodeOfferingsData {
681
+ id: string;
682
+ offerings: ITrybeCouponCodeOffering[];
683
+ discount_type: string;
684
+ fixed_amount: unknown;
685
+ percentage: number;
686
+ }
687
+ interface ITrybeGetCouponCodeOfferingsResponse {
688
+ data: ITrybeCouponCodeOfferingsData;
689
+ }
690
+ interface ITrybeAppointmentSlot {
691
+ start_time: string;
692
+ end_time: string;
693
+ duration: number;
694
+ end_buffer: number;
695
+ practitioner_ids: string[];
696
+ total_quantity: number;
697
+ quantity_available: number;
698
+ is_valid: boolean;
699
+ currency: string;
700
+ price: number;
701
+ nonoptimal_practitioner_allocation: boolean;
702
+ nonoptimal_practitioner_ids: string[];
703
+ bookable_from: string;
704
+ bookable_to: string | null;
705
+ }
706
+ interface ITrybeAppointmentAvailabilityResponse {
707
+ data: ITrybeAppointmentSlot[];
708
+ }
709
+ interface ITrybeSessionPractitioner {
710
+ id: string;
711
+ name: string;
712
+ }
713
+ interface ITrybeSessionRoom {
714
+ id: string;
715
+ name: string;
716
+ capacity: number;
717
+ }
718
+ interface ITrybeSessionRoom {
719
+ id: string;
720
+ name: string;
721
+ capacity: number;
722
+ }
723
+ interface ITrybeSessionAvailability {
724
+ id: string;
725
+ practitioner_id: string;
726
+ practitioner: ITrybeSessionPractitioner;
727
+ room_id: string;
728
+ room: ITrybeSessionRoom;
729
+ start_time: string;
730
+ end_time: string;
731
+ duration: number;
732
+ capacity: number;
733
+ remaining_capacity: number;
734
+ waitlist_enabled: boolean;
735
+ is_valid: boolean;
736
+ price: number;
737
+ currency: string;
738
+ no_availability_reason?: string;
739
+ no_availability_message?: string;
740
+ }
741
+ interface ITrybeSessionAvailabilityResponse {
742
+ data: ITrybeSessionAvailability[];
743
+ }
744
+
365
745
  declare class TrybeCustomerManagement implements BaseCustomerManagement {
366
746
  private readonly logger;
367
747
  private readonly trafficGatewayService;
@@ -388,19 +768,39 @@ declare class TrybeCreditBooking implements BaseCreditBooking {
388
768
  private readonly trybeAuthService;
389
769
  private readonly fileName;
390
770
  constructor(logger: LoggerService, trafficGatewayService: TrafficGatewayService, trybeAuthService: TrybeAuthService);
391
- fetchCustomerCredits(request: IGetCustomerCreditsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ICustomerCreditsSystemResponse>;
771
+ fetchCustomerCredits(request: IGetCustomerCreditsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<ICredit>>;
392
772
  }
393
773
 
394
- declare abstract class TrybePackageManagement implements BasePackageManagement {
395
- abstract fetchCourseTypes(): Promise<void>;
396
- }
774
+ declare function formatDateForTrybe(date: Date, isStartOfDay: boolean): string;
775
+ declare function extractTimeFromIsoString(isoString: string): string;
776
+ declare function convertKeysToCamelCase(object: unknown): unknown;
397
777
 
398
- declare abstract class TrybeWellnessAppointmentBooking extends BaseWellnessAppointmentBooking {
399
- abstract fetchWellnessAppointmentSession(): Promise<void>;
400
- abstract checkWellnessAppointmentSessionAvailability(): Promise<void>;
401
- abstract createWellnessAppointmentSessionOrder(): Promise<void>;
402
- abstract addWellnessAppointmentSessionOrderItems(): Promise<void>;
403
- abstract confirmWellnessAppointmentSessionOrder(): Promise<void>;
404
- }
778
+ declare const fetchAllPages: <T, TResponse extends {
779
+ data: T[];
780
+ meta: {
781
+ last_page: number;
782
+ };
783
+ }>(firstPageResponse: TResponse, shouldFetchAll: boolean, fetchPage: (page: number) => Promise<TResponse>) => Promise<T[]>;
405
784
 
406
- export { BaseAccountingContactManagement, BaseAccountingCreditNoteManagement, BaseAccountingCustomerManagement, BaseAccountingCustomerPaymentManagement, BaseAccountingInvoiceManagement, BaseAccountingLOAManagement, BaseAccountingTaxManagement, BaseAuth, BaseCreditBooking, BaseCustomerManagement, BaseMembershipCustomerManagement, BaseMembershipManagement, BasePackageManagement, BasePayment, BasePaymentMethodManagement, BasePaymentUserManagement, BaseWellnessAppointmentBooking, CREDIT_FILTER_BY_ENUM, CREDIT_STATUS_ENUM, CREDIT_TYPE_ENUM, HTTP_METHOD, type IApiCallRequest, type ICapabilityIntegration, type ICapabilityIntegrationConfig, type ICredit, type ICustomer, type ICustomerCreditsSystemResponse, type ICustomerLastCheckIn, type IGetCustomerCreditsRequest, type IGetCustomerCreditsRequestFilters, type IGetCustomerCreditsRequestOptions, type IGetCustomerRequest, type IGetTrybeResourcesCommonResponse, type IIntegrationRequestContext, INTEGRATION_PROVIDER_ENUM, type ITrybeCredit, type ITrybeCustomer, type ITrybeCustomerAvatar, type ITrybeCustomerLabels, type ITrybeCustomerResponse, type ITrybeGetCustomerByEmailResponse, type ITrybeGetCustomerCreditsResponse, type ITrybeGetResourcesCommonLink, type ITrybeGetResourcesCommonLinks, type ITrybeGetResourcesCommonMeta, type IValidatedCapabilityIntegration, type IValidatedCapabilityIntegrationConfig, AppModule as IntegrationLibsModule, AppModule$1 as IntegrationTrybeModule, AppModule$2 as OfferingIntegrationManager, TRAFFIC_ROUTER_CONFIGURATION_STORE_KEY, TrafficGatewayService, TrybeAuthService, TrybeCreditBooking, TrybeCustomerManagement, TrybePackageManagement, TrybeWellnessAppointmentBooking };
785
+ declare class TrybeWellnessManagement implements BaseWellnessManagement {
786
+ private readonly logger;
787
+ private readonly trafficGatewayService;
788
+ private readonly trybeAuthService;
789
+ private readonly fileName;
790
+ constructor(logger: LoggerService, trafficGatewayService: TrafficGatewayService, trybeAuthService: TrybeAuthService);
791
+ fetchPractitioners(): Promise<void>;
792
+ fetchWellnessAppointmentSession(): Promise<void>;
793
+ checkWellnessAppointmentSessionAvailability(): Promise<void>;
794
+ createWellnessAppointmentSessionOrder(): Promise<void>;
795
+ addWellnessAppointmentSessionOrderItems(): Promise<void>;
796
+ confirmWellnessAppointmentSessionOrder(): Promise<void>;
797
+ fetchAppointments(request: IGetAppointmentsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
798
+ fetchSessions(request: IGetSessionsRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
799
+ fetchCourses(request: IGetCoursesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
800
+ fetchCategories(request: IGetCategoriesRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItemCategory>>;
801
+ fetchBookableItemsFromCredit(request: IGetBookableItemsFromCreditRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<ISystemResponse<IBookableItem>>;
802
+ fetchSessionAvailabilityForOffering(request: IFetchOfferingAvailabilityRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetAvailableDatesAndTimeSlotsResponse>;
803
+ fetchAppointmentAvailabilityForOffering(request: IFetchOfferingAvailabilityRequest, integration: ICapabilityIntegration, loggedInUserId: bigint): Promise<IGetAvailableDatesAndTimeSlotsResponse>;
804
+ }
805
+
806
+ export { BOOKABLE_ITEM_STATUS_ENUM, BOOKABLE_ITEM_TYPE_ENUM, BaseAccountingContactManagement, BaseAccountingCreditNoteManagement, BaseAccountingCustomerManagement, BaseAccountingCustomerPaymentManagement, BaseAccountingInvoiceManagement, BaseAccountingLOAManagement, BaseAccountingTaxManagement, BaseAuth, BaseCreditBooking, BaseCustomerManagement, BaseMembershipCustomerManagement, BaseMembershipManagement, BasePackageManagement, BasePayment, BasePaymentMethodManagement, BasePaymentUserManagement, BaseWellnessManagement, CREDIT_FILTER_BY_ENUM, CREDIT_STATUS_ENUM, CREDIT_TYPE_ENUM, DAY_OF_WEEK, HTTP_METHOD, type IApiCallRequest, type IAvailableDateWithSlots, type IAvailableTimeSlot, type IBookableItem, type IBookableItemCategory, type IBookableItemMedia, type IBookableItemPrice, type IBookableItemPriceMeta, type ICapabilityIntegration, type ICapabilityIntegrationConfig, type ICredit, type ICustomer, type ICustomerLastCheckIn, type IFetchOfferingAvailabilityRequest, type IGetAppointmentsRequest, type IGetAvailableDatesAndTimeSlotsResponse, type IGetBookableItemsFromCreditRequest, type IGetCategoriesRequest, type IGetCoursesRequest, type IGetCustomerCreditsRequest, type IGetCustomerCreditsRequestFilters, type IGetCustomerCreditsRequestOptions, type IGetCustomerRequest, type IGetSessionsRequest, type IGetTrybeResourcesCommonResponse, type IIntegrationRequestContext, INTEGRATION_PROVIDER_ENUM, type ISystemResponse, type ITrybeAppointment, type ITrybeAppointmentAvailabilityResponse, type ITrybeAppointmentPriceRule, type ITrybeAppointmentSlot, type ITrybeCategory, type ITrybeCouponCodeOffering, type ITrybeCouponCodeOfferingsData, type ITrybeCourse, type ITrybeCredit, type ITrybeCustomer, type ITrybeCustomerAvatar, type ITrybeCustomerLabels, type ITrybeCustomerResponse, type ITrybeGetAppointmentsResponse, type ITrybeGetCategoriesResponse, type ITrybeGetCouponCodeOfferingsResponse, type ITrybeGetCoursesResponse, type ITrybeGetCustomerByEmailResponse, type ITrybeGetCustomerCreditsResponse, type ITrybeGetResourcesCommonLink, type ITrybeGetResourcesCommonLinks, type ITrybeGetResourcesCommonMeta, type ITrybeGetSessionsResponse, type ITrybeImage, type ITrybeMeta, type ITrybeOffering, type ITrybePriceRule, type ITrybeSession, type ITrybeSessionAvailability, type ITrybeSessionAvailabilityResponse, type ITrybeSessionMeta, type ITrybeSessionPractitioner, type ITrybeSessionPriceRule, type ITrybeSessionRecurrenceGroup, type ITrybeSessionRoom, type ITrybeSessionStartTime, type IValidatedCapabilityIntegration, type IValidatedCapabilityIntegrationConfig, type IWellnessManagementRequestOptions, AppModule as IntegrationLibsModule, AppModule$1 as IntegrationTrybeModule, AppModule$2 as OfferingIntegrationManager, TRAFFIC_ROUTER_CONFIGURATION_STORE_KEY, TRYBE_OFFERING_TYPE_ENUM, TrafficGatewayService, TrybeAuthService, TrybeCreditBooking, TrybeCustomerManagement, TrybeWellnessManagement, convertKeysToCamelCase, extractTimeFromIsoString, fetchAllPages, formatDateForTrybe };