nazar-salary 3.2.6 → 3.2.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/index.d.ts +51 -0
- package/index.js +13 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1613,7 +1613,58 @@ declare module 'nazar-salary' {
|
|
|
1613
1613
|
createRefund(studentId: number, data: CreateRefundData): Promise<CreateRefundResponse>;
|
|
1614
1614
|
getRefunds(params?: RefundsListParams): Promise<RefundsListResponse>;
|
|
1615
1615
|
|
|
1616
|
+
// Forecast endpoints
|
|
1617
|
+
/**
|
|
1618
|
+
* Get teacher salary forecast for upcoming months (Admin only)
|
|
1619
|
+
* @param monthsAhead Number of months to forecast (1–12). Default: 6
|
|
1620
|
+
*/
|
|
1621
|
+
getTeacherExpensesForecast(monthsAhead?: number): Promise<TeacherExpensesForecastResponse>;
|
|
1622
|
+
|
|
1616
1623
|
// Custom request
|
|
1617
1624
|
request(method: string, path: string, data?: any): Promise<any>;
|
|
1618
1625
|
}
|
|
1626
|
+
|
|
1627
|
+
export interface TeacherExpensesForecastResponse {
|
|
1628
|
+
status: string;
|
|
1629
|
+
forecast_metadata: {
|
|
1630
|
+
generated_at: string;
|
|
1631
|
+
current_month: string;
|
|
1632
|
+
forecast_period_months: number;
|
|
1633
|
+
forecast_from: string;
|
|
1634
|
+
forecast_to: string;
|
|
1635
|
+
active_students_count: number;
|
|
1636
|
+
};
|
|
1637
|
+
summary: {
|
|
1638
|
+
total_forecast_amount: number;
|
|
1639
|
+
average_monthly_salary: number;
|
|
1640
|
+
min_month_salary: number;
|
|
1641
|
+
max_month_salary: number;
|
|
1642
|
+
min_month: string | null;
|
|
1643
|
+
max_month: string | null;
|
|
1644
|
+
};
|
|
1645
|
+
monthly_data: Array<{
|
|
1646
|
+
month: string;
|
|
1647
|
+
month_display: string;
|
|
1648
|
+
total_salary: number;
|
|
1649
|
+
forecast_salary: number;
|
|
1650
|
+
real_salary: number | null;
|
|
1651
|
+
students_count: number;
|
|
1652
|
+
students: Array<{
|
|
1653
|
+
student_id: number;
|
|
1654
|
+
student_name: string;
|
|
1655
|
+
teacher_id: number;
|
|
1656
|
+
enrollment_months: number;
|
|
1657
|
+
lessons_per_month: number;
|
|
1658
|
+
rate_per_lesson: number;
|
|
1659
|
+
monthly_salary: number;
|
|
1660
|
+
remaining_months: number;
|
|
1661
|
+
}>;
|
|
1662
|
+
}>;
|
|
1663
|
+
risk_analysis: {
|
|
1664
|
+
trend: 'declining' | 'stable' | 'growing';
|
|
1665
|
+
risk_level: 'low' | 'medium' | 'high';
|
|
1666
|
+
warning_message: string;
|
|
1667
|
+
recommended_action: string;
|
|
1668
|
+
};
|
|
1669
|
+
}
|
|
1619
1670
|
}
|
package/index.js
CHANGED
|
@@ -976,6 +976,19 @@ class SalaryAPI {
|
|
|
976
976
|
return await this.client.get('/api/v1/admin/refunds', { params });
|
|
977
977
|
}
|
|
978
978
|
|
|
979
|
+
// ===== FORECAST ENDPOINTS =====
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Get teacher salary forecast for upcoming months (Admin only)
|
|
983
|
+
* @param {number} [monthsAhead=6] - Number of months to forecast (1-12)
|
|
984
|
+
* @returns {Promise<object>}
|
|
985
|
+
*/
|
|
986
|
+
async getTeacherExpensesForecast(monthsAhead = 6) {
|
|
987
|
+
return await this.client.get("/api/v1/forecast/teacher-expenses", {
|
|
988
|
+
params: { months_ahead: monthsAhead },
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
|
|
979
992
|
// ===== CUSTOM REQUEST =====
|
|
980
993
|
|
|
981
994
|
/**
|