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