@vitalfit/sdk 0.3.2 → 0.3.4

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/dist/index.cjs CHANGED
@@ -397,6 +397,9 @@ var UserService = class {
397
397
  this.deleteUser = this.deleteUser.bind(this);
398
398
  this.resendActivateOtp = this.resendActivateOtp.bind(this);
399
399
  this.UpgradePassword = this.UpgradePassword.bind(this);
400
+ this.createMedicalProfile = this.createMedicalProfile.bind(this);
401
+ this.getMedicalProfile = this.getMedicalProfile.bind(this);
402
+ this.updateMedicalProfile = this.updateMedicalProfile.bind(this);
400
403
  }
401
404
  async getStaffUsers({ search, role }, jwt) {
402
405
  const response = await this.client.get({
@@ -494,6 +497,28 @@ var UserService = class {
494
497
  }
495
498
  });
496
499
  }
500
+ //medical
501
+ async createMedicalProfile(userId, data, jwt) {
502
+ await this.client.post({
503
+ url: `/clients/${userId}/medical-info`,
504
+ jwt,
505
+ data
506
+ });
507
+ }
508
+ async getMedicalProfile(userId, jwt) {
509
+ const response = await this.client.get({
510
+ url: `/clients/${userId}/medical-info`,
511
+ jwt
512
+ });
513
+ return response;
514
+ }
515
+ async updateMedicalProfile(userId, data, jwt) {
516
+ await this.client.put({
517
+ url: `/clients/${userId}/medical-info`,
518
+ jwt,
519
+ data
520
+ });
521
+ }
497
522
  };
498
523
 
499
524
  // src/services/branch.ts
@@ -846,6 +871,7 @@ var MarketingService = class {
846
871
  this.getPromotionByID = this.getPromotionByID.bind(this);
847
872
  this.updatePromotion = this.updatePromotion.bind(this);
848
873
  this.deletePromotion = this.deletePromotion.bind(this);
874
+ this.getRandomBanner = this.getRandomBanner.bind(this);
849
875
  }
850
876
  async createBanners(BannerData, jwt) {
851
877
  await this.client.post({
@@ -921,6 +947,12 @@ var MarketingService = class {
921
947
  jwt
922
948
  });
923
949
  }
950
+ async getRandomBanner() {
951
+ const response = await this.client.get({
952
+ url: "/marketing/banners/random"
953
+ });
954
+ return response;
955
+ }
924
956
  };
925
957
 
926
958
  // src/services/memberships.ts
@@ -942,6 +974,7 @@ var MembershipService = class {
942
974
  this.getCancelReasons = this.getCancelReasons.bind(this);
943
975
  this.updateCancelReason = this.updateCancelReason.bind(this);
944
976
  this.deleteCancelReason = this.deleteCancelReason.bind(this);
977
+ this.getMyMemberships = this.getMyMemberships.bind(this);
945
978
  }
946
979
  async createMembershipType(data, jwt) {
947
980
  await this.client.post({
@@ -1064,6 +1097,13 @@ var MembershipService = class {
1064
1097
  jwt
1065
1098
  });
1066
1099
  }
1100
+ async getMyMemberships(jwt) {
1101
+ const response = await this.client.get({
1102
+ url: "/client-memberships/me",
1103
+ jwt
1104
+ });
1105
+ return response;
1106
+ }
1067
1107
  };
1068
1108
 
1069
1109
  // src/services/public.ts
@@ -1636,7 +1676,7 @@ var BookingService = class {
1636
1676
  }
1637
1677
  async cancelBooking(bookingId, jwt) {
1638
1678
  await this.client.patch({
1639
- url: `/booking/${bookingId}/cancel`,
1679
+ url: `/bookings/${bookingId}/cancel`,
1640
1680
  jwt
1641
1681
  });
1642
1682
  }
@@ -1681,6 +1721,8 @@ var AccessService = class {
1681
1721
  constructor(client) {
1682
1722
  this.client = client;
1683
1723
  this.checkIn = this.checkIn.bind(this);
1724
+ this.getClientAttendanceHistory = this.getClientAttendanceHistory.bind(this);
1725
+ this.getClientServiceUsage = this.getClientServiceUsage.bind(this);
1684
1726
  }
1685
1727
  async checkIn(jwt, data) {
1686
1728
  const response = await this.client.post({
@@ -1690,6 +1732,34 @@ var AccessService = class {
1690
1732
  });
1691
1733
  return response;
1692
1734
  }
1735
+ async getClientAttendanceHistory(jwt, userId, start, end, { page = 1, limit = 10, sort = "desc" } = {}) {
1736
+ const response = await this.client.get({
1737
+ url: `/clients/${userId}/attendance-history`,
1738
+ jwt,
1739
+ params: {
1740
+ start_date: start,
1741
+ end_date: end,
1742
+ page,
1743
+ limit,
1744
+ sort
1745
+ }
1746
+ });
1747
+ return response;
1748
+ }
1749
+ async getClientServiceUsage(jwt, userId, start, end, { page = 1, limit = 10, sort = "desc" } = {}) {
1750
+ const response = await this.client.get({
1751
+ url: `/clients/${userId}/service-usage`,
1752
+ jwt,
1753
+ params: {
1754
+ start_date: start,
1755
+ end_date: end,
1756
+ page,
1757
+ limit,
1758
+ sort
1759
+ }
1760
+ });
1761
+ return response;
1762
+ }
1693
1763
  };
1694
1764
 
1695
1765
  // src/services/reports.ts
@@ -1737,6 +1807,7 @@ var ReportService = class {
1737
1807
  this.classOccupancyChart = this.classOccupancyChart.bind(this);
1738
1808
  this.financialSummary = this.financialSummary.bind(this);
1739
1809
  this.salesByDemography = this.salesByDemography.bind(this);
1810
+ this.churnRateKPI = this.churnRateKPI.bind(this);
1740
1811
  }
1741
1812
  async mostUsedServices(jwt, start, end) {
1742
1813
  const response = await this.client.get({
@@ -2073,6 +2144,14 @@ var ReportService = class {
2073
2144
  });
2074
2145
  return response;
2075
2146
  }
2147
+ async churnRateKPI(jwt, branchId) {
2148
+ const response = await this.client.get({
2149
+ url: "/reports/kpi/churn-rate",
2150
+ jwt,
2151
+ params: branchId ? { branch_id: branchId } : void 0
2152
+ });
2153
+ return response;
2154
+ }
2076
2155
  };
2077
2156
 
2078
2157
  // src/services/staff.ts
@@ -2406,7 +2485,7 @@ var VitalFit = class _VitalFit {
2406
2485
  return _VitalFit.instance;
2407
2486
  }
2408
2487
  version() {
2409
- return "0.3.2";
2488
+ return "0.3.4";
2410
2489
  }
2411
2490
  };
2412
2491
  // Annotate the CommonJS export names for ESM import in node: