@vitalfit/sdk 0.1.5 → 0.1.7
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 +296 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +116 -3
- package/dist/index.d.ts +116 -3
- package/dist/index.js +296 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1358,6 +1358,14 @@ var BillingService = class {
|
|
|
1358
1358
|
this.updatePaymentStatus = this.updatePaymentStatus.bind(this);
|
|
1359
1359
|
this.getClientInvoices = this.getClientInvoices.bind(this);
|
|
1360
1360
|
this.getInvoices = this.getInvoices.bind(this);
|
|
1361
|
+
this.getTaxRateByBranch = this.getTaxRateByBranch.bind(this);
|
|
1362
|
+
}
|
|
1363
|
+
async getTaxRateByBranch(jwt, branchId) {
|
|
1364
|
+
const response = await this.client.get({
|
|
1365
|
+
url: `/billing/tax-rate/${branchId}`,
|
|
1366
|
+
jwt
|
|
1367
|
+
});
|
|
1368
|
+
return response;
|
|
1361
1369
|
}
|
|
1362
1370
|
async createInvoice(data, jwt) {
|
|
1363
1371
|
const response = await this.client.post({
|
|
@@ -1512,6 +1520,36 @@ var ReportService = class {
|
|
|
1512
1520
|
this.globalStats = this.globalStats.bind(this);
|
|
1513
1521
|
this.totalActiveBranches = this.totalActiveBranches.bind(this);
|
|
1514
1522
|
this.totalClients = this.totalClients.bind(this);
|
|
1523
|
+
this.totalSales = this.totalSales.bind(this);
|
|
1524
|
+
this.todayCheckIns = this.todayCheckIns.bind(this);
|
|
1525
|
+
this.currentOccupancy = this.currentOccupancy.bind(this);
|
|
1526
|
+
this.classCapacityRatio = this.classCapacityRatio.bind(this);
|
|
1527
|
+
this.upcomingClassesToday = this.upcomingClassesToday.bind(this);
|
|
1528
|
+
this.recentCheckIns = this.recentCheckIns.bind(this);
|
|
1529
|
+
this.newClientsKPI = this.newClientsKPI.bind(this);
|
|
1530
|
+
this.retentionRateKPI = this.retentionRateKPI.bind(this);
|
|
1531
|
+
this.cohortAnalysis = this.cohortAnalysis.bind(this);
|
|
1532
|
+
this.newVsRecurringChart = this.newVsRecurringChart.bind(this);
|
|
1533
|
+
this.instructorNextClass = this.instructorNextClass.bind(this);
|
|
1534
|
+
this.instructorStudentCountKPI = this.instructorStudentCountKPI.bind(this);
|
|
1535
|
+
this.instructorMonthlyClassesCount = this.instructorMonthlyClassesCount.bind(this);
|
|
1536
|
+
this.instructorClassesToday = this.instructorClassesToday.bind(this);
|
|
1537
|
+
this.weeklyRevenueKPI = this.weeklyRevenueKPI.bind(this);
|
|
1538
|
+
this.monthlyRecurringRevenueKPI = this.monthlyRecurringRevenueKPI.bind(this);
|
|
1539
|
+
this.accountsReceivableKPI = this.accountsReceivableKPI.bind(this);
|
|
1540
|
+
this.averageTicketKPI = this.averageTicketKPI.bind(this);
|
|
1541
|
+
this.monthlyRevenueChart = this.monthlyRevenueChart.bind(this);
|
|
1542
|
+
this.billingByBranchMatrix = this.billingByBranchMatrix.bind(this);
|
|
1543
|
+
this.totalTransactionsKPI = this.totalTransactionsKPI.bind(this);
|
|
1544
|
+
this.monthlyCashFlowChart = this.monthlyCashFlowChart.bind(this);
|
|
1545
|
+
this.averageCLVKPI = this.averageCLVKPI.bind(this);
|
|
1546
|
+
this.monthlySalesKPI = this.monthlySalesKPI.bind(this);
|
|
1547
|
+
this.activeMembersKPI = this.activeMembersKPI.bind(this);
|
|
1548
|
+
this.occupancyKPI = this.occupancyKPI.bind(this);
|
|
1549
|
+
this.weeklySalesChart = this.weeklySalesChart.bind(this);
|
|
1550
|
+
this.activityHeatmap = this.activityHeatmap.bind(this);
|
|
1551
|
+
this.classOccupancyChart = this.classOccupancyChart.bind(this);
|
|
1552
|
+
this.financialSummary = this.financialSummary.bind(this);
|
|
1515
1553
|
}
|
|
1516
1554
|
async mostUsedServices(jwt, start, end) {
|
|
1517
1555
|
const response = await this.client.get({
|
|
@@ -1524,13 +1562,14 @@ var ReportService = class {
|
|
|
1524
1562
|
});
|
|
1525
1563
|
return response;
|
|
1526
1564
|
}
|
|
1527
|
-
async salesByCategory(jwt, start, end) {
|
|
1565
|
+
async salesByCategory(jwt, start, end, branchId) {
|
|
1528
1566
|
const response = await this.client.get({
|
|
1529
1567
|
url: "/reports/charts/sales-by-category",
|
|
1530
1568
|
jwt,
|
|
1531
1569
|
params: {
|
|
1532
1570
|
start,
|
|
1533
|
-
end
|
|
1571
|
+
end,
|
|
1572
|
+
...branchId ? { branch_id: branchId } : {}
|
|
1534
1573
|
}
|
|
1535
1574
|
});
|
|
1536
1575
|
return response;
|
|
@@ -1596,6 +1635,244 @@ var ReportService = class {
|
|
|
1596
1635
|
});
|
|
1597
1636
|
return response;
|
|
1598
1637
|
}
|
|
1638
|
+
async totalSales(jwt) {
|
|
1639
|
+
const response = await this.client.get({
|
|
1640
|
+
url: "/reports/stats/total-sales",
|
|
1641
|
+
jwt
|
|
1642
|
+
});
|
|
1643
|
+
return response;
|
|
1644
|
+
}
|
|
1645
|
+
async todayCheckIns(jwt, branchId) {
|
|
1646
|
+
const response = await this.client.get({
|
|
1647
|
+
url: "/reports/stats/check-ins-today",
|
|
1648
|
+
jwt,
|
|
1649
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1650
|
+
});
|
|
1651
|
+
return response;
|
|
1652
|
+
}
|
|
1653
|
+
async currentOccupancy(jwt, branchId) {
|
|
1654
|
+
const response = await this.client.get({
|
|
1655
|
+
url: "/reports/stats/current-occupancy",
|
|
1656
|
+
jwt,
|
|
1657
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1658
|
+
});
|
|
1659
|
+
return response;
|
|
1660
|
+
}
|
|
1661
|
+
async classCapacityRatio(jwt, classId) {
|
|
1662
|
+
const response = await this.client.get({
|
|
1663
|
+
url: "/reports/stats/class-capacity",
|
|
1664
|
+
jwt,
|
|
1665
|
+
params: { class_id: classId }
|
|
1666
|
+
});
|
|
1667
|
+
return response;
|
|
1668
|
+
}
|
|
1669
|
+
async upcomingClassesToday(jwt, branchId) {
|
|
1670
|
+
const response = await this.client.get({
|
|
1671
|
+
url: "/reports/stats/upcoming-classes",
|
|
1672
|
+
jwt,
|
|
1673
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1674
|
+
});
|
|
1675
|
+
return response;
|
|
1676
|
+
}
|
|
1677
|
+
async recentCheckIns(jwt, branchId) {
|
|
1678
|
+
const response = await this.client.get({
|
|
1679
|
+
url: "/reports/stats/recent-check-ins",
|
|
1680
|
+
jwt,
|
|
1681
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1682
|
+
});
|
|
1683
|
+
return response;
|
|
1684
|
+
}
|
|
1685
|
+
async newClientsKPI(jwt, branchId) {
|
|
1686
|
+
const response = await this.client.get({
|
|
1687
|
+
url: "/reports/kpi/new-clients",
|
|
1688
|
+
jwt,
|
|
1689
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1690
|
+
});
|
|
1691
|
+
return response;
|
|
1692
|
+
}
|
|
1693
|
+
async retentionRateKPI(jwt, branchId) {
|
|
1694
|
+
const response = await this.client.get({
|
|
1695
|
+
url: "/reports/kpi/retention-rate",
|
|
1696
|
+
jwt,
|
|
1697
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1698
|
+
});
|
|
1699
|
+
return response;
|
|
1700
|
+
}
|
|
1701
|
+
async cohortAnalysis(jwt, branchId) {
|
|
1702
|
+
const response = await this.client.get({
|
|
1703
|
+
url: "/reports/charts/cohort-analysis",
|
|
1704
|
+
jwt,
|
|
1705
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1706
|
+
});
|
|
1707
|
+
return response;
|
|
1708
|
+
}
|
|
1709
|
+
async newVsRecurringChart(jwt, branchId) {
|
|
1710
|
+
const response = await this.client.get({
|
|
1711
|
+
url: "/reports/charts/new-vs-recurring",
|
|
1712
|
+
jwt,
|
|
1713
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1714
|
+
});
|
|
1715
|
+
return response;
|
|
1716
|
+
}
|
|
1717
|
+
async instructorNextClass(jwt) {
|
|
1718
|
+
const response = await this.client.get({
|
|
1719
|
+
url: "/reports/instructors/next-class",
|
|
1720
|
+
jwt
|
|
1721
|
+
});
|
|
1722
|
+
return response;
|
|
1723
|
+
}
|
|
1724
|
+
async instructorStudentCountKPI(jwt) {
|
|
1725
|
+
const response = await this.client.get({
|
|
1726
|
+
url: "/reports/instructors/student-count",
|
|
1727
|
+
jwt
|
|
1728
|
+
});
|
|
1729
|
+
return response;
|
|
1730
|
+
}
|
|
1731
|
+
async instructorMonthlyClassesCount(jwt) {
|
|
1732
|
+
const response = await this.client.get({
|
|
1733
|
+
url: "/reports/instructors/classes-count",
|
|
1734
|
+
jwt
|
|
1735
|
+
});
|
|
1736
|
+
return response;
|
|
1737
|
+
}
|
|
1738
|
+
async instructorClassesToday(jwt) {
|
|
1739
|
+
const response = await this.client.get({
|
|
1740
|
+
url: "/reports/instructors/classes-today",
|
|
1741
|
+
jwt
|
|
1742
|
+
});
|
|
1743
|
+
return response;
|
|
1744
|
+
}
|
|
1745
|
+
async weeklyRevenueKPI(jwt, branchId) {
|
|
1746
|
+
const response = await this.client.get({
|
|
1747
|
+
url: "/reports/kpi/weekly-revenue",
|
|
1748
|
+
jwt,
|
|
1749
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1750
|
+
});
|
|
1751
|
+
return response;
|
|
1752
|
+
}
|
|
1753
|
+
async monthlyRecurringRevenueKPI(jwt, branchId) {
|
|
1754
|
+
const response = await this.client.get({
|
|
1755
|
+
url: "/reports/kpi/mrr",
|
|
1756
|
+
jwt,
|
|
1757
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1758
|
+
});
|
|
1759
|
+
return response;
|
|
1760
|
+
}
|
|
1761
|
+
async accountsReceivableKPI(jwt, branchId) {
|
|
1762
|
+
const response = await this.client.get({
|
|
1763
|
+
url: "/reports/kpi/accounts-receivable",
|
|
1764
|
+
jwt,
|
|
1765
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1766
|
+
});
|
|
1767
|
+
return response;
|
|
1768
|
+
}
|
|
1769
|
+
async averageTicketKPI(jwt, branchId) {
|
|
1770
|
+
const response = await this.client.get({
|
|
1771
|
+
url: "/reports/kpi/average-ticket",
|
|
1772
|
+
jwt,
|
|
1773
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1774
|
+
});
|
|
1775
|
+
return response;
|
|
1776
|
+
}
|
|
1777
|
+
async monthlyRevenueChart(jwt, branchId) {
|
|
1778
|
+
const response = await this.client.get({
|
|
1779
|
+
url: "/reports/charts/monthly-revenue",
|
|
1780
|
+
jwt,
|
|
1781
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1782
|
+
});
|
|
1783
|
+
return response;
|
|
1784
|
+
}
|
|
1785
|
+
async billingByBranchMatrix(jwt, start, end) {
|
|
1786
|
+
const response = await this.client.get({
|
|
1787
|
+
url: "/reports/kpi/billing-matrix",
|
|
1788
|
+
jwt,
|
|
1789
|
+
params: {
|
|
1790
|
+
...start ? { start } : {},
|
|
1791
|
+
...end ? { end } : {}
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
return response;
|
|
1795
|
+
}
|
|
1796
|
+
async totalTransactionsKPI(jwt, branchId) {
|
|
1797
|
+
const response = await this.client.get({
|
|
1798
|
+
url: "/reports/kpi/total-transactions",
|
|
1799
|
+
jwt,
|
|
1800
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1801
|
+
});
|
|
1802
|
+
return response;
|
|
1803
|
+
}
|
|
1804
|
+
async monthlyCashFlowChart(jwt, branchId) {
|
|
1805
|
+
const response = await this.client.get({
|
|
1806
|
+
url: "/reports/charts/cash-flow",
|
|
1807
|
+
jwt,
|
|
1808
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1809
|
+
});
|
|
1810
|
+
return response;
|
|
1811
|
+
}
|
|
1812
|
+
async averageCLVKPI(jwt, branchId) {
|
|
1813
|
+
const response = await this.client.get({
|
|
1814
|
+
url: "/reports/kpi/clv",
|
|
1815
|
+
jwt,
|
|
1816
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1817
|
+
});
|
|
1818
|
+
return response;
|
|
1819
|
+
}
|
|
1820
|
+
async monthlySalesKPI(jwt, branchId) {
|
|
1821
|
+
const response = await this.client.get({
|
|
1822
|
+
url: "/reports/kpi/monthly-sales",
|
|
1823
|
+
jwt,
|
|
1824
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1825
|
+
});
|
|
1826
|
+
return response;
|
|
1827
|
+
}
|
|
1828
|
+
async activeMembersKPI(jwt, branchId) {
|
|
1829
|
+
const response = await this.client.get({
|
|
1830
|
+
url: "/reports/kpi/active-members",
|
|
1831
|
+
jwt,
|
|
1832
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1833
|
+
});
|
|
1834
|
+
return response;
|
|
1835
|
+
}
|
|
1836
|
+
async occupancyKPI(jwt, branchId) {
|
|
1837
|
+
const response = await this.client.get({
|
|
1838
|
+
url: "/reports/kpi/occupancy",
|
|
1839
|
+
jwt,
|
|
1840
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1841
|
+
});
|
|
1842
|
+
return response;
|
|
1843
|
+
}
|
|
1844
|
+
async weeklySalesChart(jwt, branchId) {
|
|
1845
|
+
const response = await this.client.get({
|
|
1846
|
+
url: "/reports/charts/weekly-sales",
|
|
1847
|
+
jwt,
|
|
1848
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1849
|
+
});
|
|
1850
|
+
return response;
|
|
1851
|
+
}
|
|
1852
|
+
async activityHeatmap(jwt, branchId) {
|
|
1853
|
+
const response = await this.client.get({
|
|
1854
|
+
url: "/reports/charts/activity-heatmap",
|
|
1855
|
+
jwt,
|
|
1856
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1857
|
+
});
|
|
1858
|
+
return response;
|
|
1859
|
+
}
|
|
1860
|
+
async classOccupancyChart(jwt, branchId) {
|
|
1861
|
+
const response = await this.client.get({
|
|
1862
|
+
url: "/reports/charts/class-occupancy",
|
|
1863
|
+
jwt,
|
|
1864
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1865
|
+
});
|
|
1866
|
+
return response;
|
|
1867
|
+
}
|
|
1868
|
+
async financialSummary(jwt, branchId) {
|
|
1869
|
+
const response = await this.client.get({
|
|
1870
|
+
url: "/reports/kpi/financial-summary",
|
|
1871
|
+
jwt,
|
|
1872
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1873
|
+
});
|
|
1874
|
+
return response;
|
|
1875
|
+
}
|
|
1599
1876
|
};
|
|
1600
1877
|
|
|
1601
1878
|
// src/services/staff.ts
|
|
@@ -1623,10 +1900,23 @@ var StaffService = class {
|
|
|
1623
1900
|
});
|
|
1624
1901
|
return response;
|
|
1625
1902
|
}
|
|
1626
|
-
async getBranchstaff(branchId, jwt
|
|
1903
|
+
async getBranchstaff(branchId, jwt, {
|
|
1904
|
+
page = 10,
|
|
1905
|
+
limit = 10,
|
|
1906
|
+
sort = "desc",
|
|
1907
|
+
search,
|
|
1908
|
+
role
|
|
1909
|
+
}) {
|
|
1627
1910
|
const response = await this.client.get({
|
|
1628
1911
|
url: `/branches/${branchId}/staff`,
|
|
1629
|
-
jwt
|
|
1912
|
+
jwt,
|
|
1913
|
+
params: {
|
|
1914
|
+
page,
|
|
1915
|
+
limit,
|
|
1916
|
+
sort,
|
|
1917
|
+
search,
|
|
1918
|
+
role
|
|
1919
|
+
}
|
|
1630
1920
|
});
|
|
1631
1921
|
return response;
|
|
1632
1922
|
}
|
|
@@ -1635,7 +1925,7 @@ var StaffService = class {
|
|
|
1635
1925
|
url: `/branches/${branchId}/staff`,
|
|
1636
1926
|
jwt,
|
|
1637
1927
|
data: {
|
|
1638
|
-
|
|
1928
|
+
staff_ids: staffIds
|
|
1639
1929
|
}
|
|
1640
1930
|
});
|
|
1641
1931
|
}
|
|
@@ -1797,7 +2087,7 @@ var VitalFit = class _VitalFit {
|
|
|
1797
2087
|
return _VitalFit.instance;
|
|
1798
2088
|
}
|
|
1799
2089
|
version() {
|
|
1800
|
-
return "0.1.
|
|
2090
|
+
return "0.1.7";
|
|
1801
2091
|
}
|
|
1802
2092
|
};
|
|
1803
2093
|
// Annotate the CommonJS export names for ESM import in node:
|