@vitalfit/sdk 0.1.6 → 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 +295 -5
- 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 +295 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1318,6 +1318,14 @@ var BillingService = class {
|
|
|
1318
1318
|
this.updatePaymentStatus = this.updatePaymentStatus.bind(this);
|
|
1319
1319
|
this.getClientInvoices = this.getClientInvoices.bind(this);
|
|
1320
1320
|
this.getInvoices = this.getInvoices.bind(this);
|
|
1321
|
+
this.getTaxRateByBranch = this.getTaxRateByBranch.bind(this);
|
|
1322
|
+
}
|
|
1323
|
+
async getTaxRateByBranch(jwt, branchId) {
|
|
1324
|
+
const response = await this.client.get({
|
|
1325
|
+
url: `/billing/tax-rate/${branchId}`,
|
|
1326
|
+
jwt
|
|
1327
|
+
});
|
|
1328
|
+
return response;
|
|
1321
1329
|
}
|
|
1322
1330
|
async createInvoice(data, jwt) {
|
|
1323
1331
|
const response = await this.client.post({
|
|
@@ -1472,6 +1480,36 @@ var ReportService = class {
|
|
|
1472
1480
|
this.globalStats = this.globalStats.bind(this);
|
|
1473
1481
|
this.totalActiveBranches = this.totalActiveBranches.bind(this);
|
|
1474
1482
|
this.totalClients = this.totalClients.bind(this);
|
|
1483
|
+
this.totalSales = this.totalSales.bind(this);
|
|
1484
|
+
this.todayCheckIns = this.todayCheckIns.bind(this);
|
|
1485
|
+
this.currentOccupancy = this.currentOccupancy.bind(this);
|
|
1486
|
+
this.classCapacityRatio = this.classCapacityRatio.bind(this);
|
|
1487
|
+
this.upcomingClassesToday = this.upcomingClassesToday.bind(this);
|
|
1488
|
+
this.recentCheckIns = this.recentCheckIns.bind(this);
|
|
1489
|
+
this.newClientsKPI = this.newClientsKPI.bind(this);
|
|
1490
|
+
this.retentionRateKPI = this.retentionRateKPI.bind(this);
|
|
1491
|
+
this.cohortAnalysis = this.cohortAnalysis.bind(this);
|
|
1492
|
+
this.newVsRecurringChart = this.newVsRecurringChart.bind(this);
|
|
1493
|
+
this.instructorNextClass = this.instructorNextClass.bind(this);
|
|
1494
|
+
this.instructorStudentCountKPI = this.instructorStudentCountKPI.bind(this);
|
|
1495
|
+
this.instructorMonthlyClassesCount = this.instructorMonthlyClassesCount.bind(this);
|
|
1496
|
+
this.instructorClassesToday = this.instructorClassesToday.bind(this);
|
|
1497
|
+
this.weeklyRevenueKPI = this.weeklyRevenueKPI.bind(this);
|
|
1498
|
+
this.monthlyRecurringRevenueKPI = this.monthlyRecurringRevenueKPI.bind(this);
|
|
1499
|
+
this.accountsReceivableKPI = this.accountsReceivableKPI.bind(this);
|
|
1500
|
+
this.averageTicketKPI = this.averageTicketKPI.bind(this);
|
|
1501
|
+
this.monthlyRevenueChart = this.monthlyRevenueChart.bind(this);
|
|
1502
|
+
this.billingByBranchMatrix = this.billingByBranchMatrix.bind(this);
|
|
1503
|
+
this.totalTransactionsKPI = this.totalTransactionsKPI.bind(this);
|
|
1504
|
+
this.monthlyCashFlowChart = this.monthlyCashFlowChart.bind(this);
|
|
1505
|
+
this.averageCLVKPI = this.averageCLVKPI.bind(this);
|
|
1506
|
+
this.monthlySalesKPI = this.monthlySalesKPI.bind(this);
|
|
1507
|
+
this.activeMembersKPI = this.activeMembersKPI.bind(this);
|
|
1508
|
+
this.occupancyKPI = this.occupancyKPI.bind(this);
|
|
1509
|
+
this.weeklySalesChart = this.weeklySalesChart.bind(this);
|
|
1510
|
+
this.activityHeatmap = this.activityHeatmap.bind(this);
|
|
1511
|
+
this.classOccupancyChart = this.classOccupancyChart.bind(this);
|
|
1512
|
+
this.financialSummary = this.financialSummary.bind(this);
|
|
1475
1513
|
}
|
|
1476
1514
|
async mostUsedServices(jwt, start, end) {
|
|
1477
1515
|
const response = await this.client.get({
|
|
@@ -1484,13 +1522,14 @@ var ReportService = class {
|
|
|
1484
1522
|
});
|
|
1485
1523
|
return response;
|
|
1486
1524
|
}
|
|
1487
|
-
async salesByCategory(jwt, start, end) {
|
|
1525
|
+
async salesByCategory(jwt, start, end, branchId) {
|
|
1488
1526
|
const response = await this.client.get({
|
|
1489
1527
|
url: "/reports/charts/sales-by-category",
|
|
1490
1528
|
jwt,
|
|
1491
1529
|
params: {
|
|
1492
1530
|
start,
|
|
1493
|
-
end
|
|
1531
|
+
end,
|
|
1532
|
+
...branchId ? { branch_id: branchId } : {}
|
|
1494
1533
|
}
|
|
1495
1534
|
});
|
|
1496
1535
|
return response;
|
|
@@ -1556,6 +1595,244 @@ var ReportService = class {
|
|
|
1556
1595
|
});
|
|
1557
1596
|
return response;
|
|
1558
1597
|
}
|
|
1598
|
+
async totalSales(jwt) {
|
|
1599
|
+
const response = await this.client.get({
|
|
1600
|
+
url: "/reports/stats/total-sales",
|
|
1601
|
+
jwt
|
|
1602
|
+
});
|
|
1603
|
+
return response;
|
|
1604
|
+
}
|
|
1605
|
+
async todayCheckIns(jwt, branchId) {
|
|
1606
|
+
const response = await this.client.get({
|
|
1607
|
+
url: "/reports/stats/check-ins-today",
|
|
1608
|
+
jwt,
|
|
1609
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1610
|
+
});
|
|
1611
|
+
return response;
|
|
1612
|
+
}
|
|
1613
|
+
async currentOccupancy(jwt, branchId) {
|
|
1614
|
+
const response = await this.client.get({
|
|
1615
|
+
url: "/reports/stats/current-occupancy",
|
|
1616
|
+
jwt,
|
|
1617
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1618
|
+
});
|
|
1619
|
+
return response;
|
|
1620
|
+
}
|
|
1621
|
+
async classCapacityRatio(jwt, classId) {
|
|
1622
|
+
const response = await this.client.get({
|
|
1623
|
+
url: "/reports/stats/class-capacity",
|
|
1624
|
+
jwt,
|
|
1625
|
+
params: { class_id: classId }
|
|
1626
|
+
});
|
|
1627
|
+
return response;
|
|
1628
|
+
}
|
|
1629
|
+
async upcomingClassesToday(jwt, branchId) {
|
|
1630
|
+
const response = await this.client.get({
|
|
1631
|
+
url: "/reports/stats/upcoming-classes",
|
|
1632
|
+
jwt,
|
|
1633
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1634
|
+
});
|
|
1635
|
+
return response;
|
|
1636
|
+
}
|
|
1637
|
+
async recentCheckIns(jwt, branchId) {
|
|
1638
|
+
const response = await this.client.get({
|
|
1639
|
+
url: "/reports/stats/recent-check-ins",
|
|
1640
|
+
jwt,
|
|
1641
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1642
|
+
});
|
|
1643
|
+
return response;
|
|
1644
|
+
}
|
|
1645
|
+
async newClientsKPI(jwt, branchId) {
|
|
1646
|
+
const response = await this.client.get({
|
|
1647
|
+
url: "/reports/kpi/new-clients",
|
|
1648
|
+
jwt,
|
|
1649
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1650
|
+
});
|
|
1651
|
+
return response;
|
|
1652
|
+
}
|
|
1653
|
+
async retentionRateKPI(jwt, branchId) {
|
|
1654
|
+
const response = await this.client.get({
|
|
1655
|
+
url: "/reports/kpi/retention-rate",
|
|
1656
|
+
jwt,
|
|
1657
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1658
|
+
});
|
|
1659
|
+
return response;
|
|
1660
|
+
}
|
|
1661
|
+
async cohortAnalysis(jwt, branchId) {
|
|
1662
|
+
const response = await this.client.get({
|
|
1663
|
+
url: "/reports/charts/cohort-analysis",
|
|
1664
|
+
jwt,
|
|
1665
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1666
|
+
});
|
|
1667
|
+
return response;
|
|
1668
|
+
}
|
|
1669
|
+
async newVsRecurringChart(jwt, branchId) {
|
|
1670
|
+
const response = await this.client.get({
|
|
1671
|
+
url: "/reports/charts/new-vs-recurring",
|
|
1672
|
+
jwt,
|
|
1673
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1674
|
+
});
|
|
1675
|
+
return response;
|
|
1676
|
+
}
|
|
1677
|
+
async instructorNextClass(jwt) {
|
|
1678
|
+
const response = await this.client.get({
|
|
1679
|
+
url: "/reports/instructors/next-class",
|
|
1680
|
+
jwt
|
|
1681
|
+
});
|
|
1682
|
+
return response;
|
|
1683
|
+
}
|
|
1684
|
+
async instructorStudentCountKPI(jwt) {
|
|
1685
|
+
const response = await this.client.get({
|
|
1686
|
+
url: "/reports/instructors/student-count",
|
|
1687
|
+
jwt
|
|
1688
|
+
});
|
|
1689
|
+
return response;
|
|
1690
|
+
}
|
|
1691
|
+
async instructorMonthlyClassesCount(jwt) {
|
|
1692
|
+
const response = await this.client.get({
|
|
1693
|
+
url: "/reports/instructors/classes-count",
|
|
1694
|
+
jwt
|
|
1695
|
+
});
|
|
1696
|
+
return response;
|
|
1697
|
+
}
|
|
1698
|
+
async instructorClassesToday(jwt) {
|
|
1699
|
+
const response = await this.client.get({
|
|
1700
|
+
url: "/reports/instructors/classes-today",
|
|
1701
|
+
jwt
|
|
1702
|
+
});
|
|
1703
|
+
return response;
|
|
1704
|
+
}
|
|
1705
|
+
async weeklyRevenueKPI(jwt, branchId) {
|
|
1706
|
+
const response = await this.client.get({
|
|
1707
|
+
url: "/reports/kpi/weekly-revenue",
|
|
1708
|
+
jwt,
|
|
1709
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1710
|
+
});
|
|
1711
|
+
return response;
|
|
1712
|
+
}
|
|
1713
|
+
async monthlyRecurringRevenueKPI(jwt, branchId) {
|
|
1714
|
+
const response = await this.client.get({
|
|
1715
|
+
url: "/reports/kpi/mrr",
|
|
1716
|
+
jwt,
|
|
1717
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1718
|
+
});
|
|
1719
|
+
return response;
|
|
1720
|
+
}
|
|
1721
|
+
async accountsReceivableKPI(jwt, branchId) {
|
|
1722
|
+
const response = await this.client.get({
|
|
1723
|
+
url: "/reports/kpi/accounts-receivable",
|
|
1724
|
+
jwt,
|
|
1725
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1726
|
+
});
|
|
1727
|
+
return response;
|
|
1728
|
+
}
|
|
1729
|
+
async averageTicketKPI(jwt, branchId) {
|
|
1730
|
+
const response = await this.client.get({
|
|
1731
|
+
url: "/reports/kpi/average-ticket",
|
|
1732
|
+
jwt,
|
|
1733
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1734
|
+
});
|
|
1735
|
+
return response;
|
|
1736
|
+
}
|
|
1737
|
+
async monthlyRevenueChart(jwt, branchId) {
|
|
1738
|
+
const response = await this.client.get({
|
|
1739
|
+
url: "/reports/charts/monthly-revenue",
|
|
1740
|
+
jwt,
|
|
1741
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1742
|
+
});
|
|
1743
|
+
return response;
|
|
1744
|
+
}
|
|
1745
|
+
async billingByBranchMatrix(jwt, start, end) {
|
|
1746
|
+
const response = await this.client.get({
|
|
1747
|
+
url: "/reports/kpi/billing-matrix",
|
|
1748
|
+
jwt,
|
|
1749
|
+
params: {
|
|
1750
|
+
...start ? { start } : {},
|
|
1751
|
+
...end ? { end } : {}
|
|
1752
|
+
}
|
|
1753
|
+
});
|
|
1754
|
+
return response;
|
|
1755
|
+
}
|
|
1756
|
+
async totalTransactionsKPI(jwt, branchId) {
|
|
1757
|
+
const response = await this.client.get({
|
|
1758
|
+
url: "/reports/kpi/total-transactions",
|
|
1759
|
+
jwt,
|
|
1760
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1761
|
+
});
|
|
1762
|
+
return response;
|
|
1763
|
+
}
|
|
1764
|
+
async monthlyCashFlowChart(jwt, branchId) {
|
|
1765
|
+
const response = await this.client.get({
|
|
1766
|
+
url: "/reports/charts/cash-flow",
|
|
1767
|
+
jwt,
|
|
1768
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1769
|
+
});
|
|
1770
|
+
return response;
|
|
1771
|
+
}
|
|
1772
|
+
async averageCLVKPI(jwt, branchId) {
|
|
1773
|
+
const response = await this.client.get({
|
|
1774
|
+
url: "/reports/kpi/clv",
|
|
1775
|
+
jwt,
|
|
1776
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1777
|
+
});
|
|
1778
|
+
return response;
|
|
1779
|
+
}
|
|
1780
|
+
async monthlySalesKPI(jwt, branchId) {
|
|
1781
|
+
const response = await this.client.get({
|
|
1782
|
+
url: "/reports/kpi/monthly-sales",
|
|
1783
|
+
jwt,
|
|
1784
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1785
|
+
});
|
|
1786
|
+
return response;
|
|
1787
|
+
}
|
|
1788
|
+
async activeMembersKPI(jwt, branchId) {
|
|
1789
|
+
const response = await this.client.get({
|
|
1790
|
+
url: "/reports/kpi/active-members",
|
|
1791
|
+
jwt,
|
|
1792
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1793
|
+
});
|
|
1794
|
+
return response;
|
|
1795
|
+
}
|
|
1796
|
+
async occupancyKPI(jwt, branchId) {
|
|
1797
|
+
const response = await this.client.get({
|
|
1798
|
+
url: "/reports/kpi/occupancy",
|
|
1799
|
+
jwt,
|
|
1800
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1801
|
+
});
|
|
1802
|
+
return response;
|
|
1803
|
+
}
|
|
1804
|
+
async weeklySalesChart(jwt, branchId) {
|
|
1805
|
+
const response = await this.client.get({
|
|
1806
|
+
url: "/reports/charts/weekly-sales",
|
|
1807
|
+
jwt,
|
|
1808
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1809
|
+
});
|
|
1810
|
+
return response;
|
|
1811
|
+
}
|
|
1812
|
+
async activityHeatmap(jwt, branchId) {
|
|
1813
|
+
const response = await this.client.get({
|
|
1814
|
+
url: "/reports/charts/activity-heatmap",
|
|
1815
|
+
jwt,
|
|
1816
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1817
|
+
});
|
|
1818
|
+
return response;
|
|
1819
|
+
}
|
|
1820
|
+
async classOccupancyChart(jwt, branchId) {
|
|
1821
|
+
const response = await this.client.get({
|
|
1822
|
+
url: "/reports/charts/class-occupancy",
|
|
1823
|
+
jwt,
|
|
1824
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1825
|
+
});
|
|
1826
|
+
return response;
|
|
1827
|
+
}
|
|
1828
|
+
async financialSummary(jwt, branchId) {
|
|
1829
|
+
const response = await this.client.get({
|
|
1830
|
+
url: "/reports/kpi/financial-summary",
|
|
1831
|
+
jwt,
|
|
1832
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
1833
|
+
});
|
|
1834
|
+
return response;
|
|
1835
|
+
}
|
|
1559
1836
|
};
|
|
1560
1837
|
|
|
1561
1838
|
// src/services/staff.ts
|
|
@@ -1583,10 +1860,23 @@ var StaffService = class {
|
|
|
1583
1860
|
});
|
|
1584
1861
|
return response;
|
|
1585
1862
|
}
|
|
1586
|
-
async getBranchstaff(branchId, jwt
|
|
1863
|
+
async getBranchstaff(branchId, jwt, {
|
|
1864
|
+
page = 10,
|
|
1865
|
+
limit = 10,
|
|
1866
|
+
sort = "desc",
|
|
1867
|
+
search,
|
|
1868
|
+
role
|
|
1869
|
+
}) {
|
|
1587
1870
|
const response = await this.client.get({
|
|
1588
1871
|
url: `/branches/${branchId}/staff`,
|
|
1589
|
-
jwt
|
|
1872
|
+
jwt,
|
|
1873
|
+
params: {
|
|
1874
|
+
page,
|
|
1875
|
+
limit,
|
|
1876
|
+
sort,
|
|
1877
|
+
search,
|
|
1878
|
+
role
|
|
1879
|
+
}
|
|
1590
1880
|
});
|
|
1591
1881
|
return response;
|
|
1592
1882
|
}
|
|
@@ -1757,7 +2047,7 @@ var VitalFit = class _VitalFit {
|
|
|
1757
2047
|
return _VitalFit.instance;
|
|
1758
2048
|
}
|
|
1759
2049
|
version() {
|
|
1760
|
-
return "0.1.
|
|
2050
|
+
return "0.1.7";
|
|
1761
2051
|
}
|
|
1762
2052
|
};
|
|
1763
2053
|
export {
|