nazar-salary 3.4.3 → 3.4.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.
Files changed (3) hide show
  1. package/index.d.ts +11 -2
  2. package/index.js +4 -3
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -818,7 +818,10 @@ declare module 'nazar-salary' {
818
818
 
819
819
  export interface DashboardKpi {
820
820
  students: {
821
+ /** Students whose latest course record is active (excludes deleted students) */
821
822
  active: number;
823
+ /** Students whose latest course record is closed — finished, stopped or refunded (excludes deleted students) */
824
+ inactive: number;
822
825
  new_this_month: number;
823
826
  finished_this_month: number;
824
827
  };
@@ -1727,9 +1730,10 @@ declare module 'nazar-salary' {
1727
1730
  // Forecast endpoints
1728
1731
  /**
1729
1732
  * Get teacher salary forecast for upcoming months (Admin only)
1730
- * @param monthsAhead Number of months to forecast (1–12). Default: 6
1733
+ * @param monthsAhead Number of forecast months (1–12). Default: 6
1734
+ * @param monthsBefore Number of past months prepended to monthly_data (0–12). Default: 4
1731
1735
  */
1732
- getTeacherExpensesForecast(monthsAhead?: number): Promise<TeacherExpensesForecastResponse>;
1736
+ getTeacherExpensesForecast(monthsAhead?: number, monthsBefore?: number): Promise<TeacherExpensesForecastResponse>;
1733
1737
 
1734
1738
  // Export endpoints
1735
1739
  /**
@@ -1854,6 +1858,10 @@ declare module 'nazar-salary' {
1854
1858
  forecast_metadata: {
1855
1859
  generated_at: string;
1856
1860
  current_month: string;
1861
+ /** How many past months are prepended to monthly_data */
1862
+ previous_months: number;
1863
+ /** Earliest month present in monthly_data (current_month minus previous_months) */
1864
+ data_from: string;
1857
1865
  forecast_period_months: number;
1858
1866
  forecast_from: string;
1859
1867
  forecast_to: string;
@@ -1867,6 +1875,7 @@ declare module 'nazar-salary' {
1867
1875
  min_month: string | null;
1868
1876
  max_month: string | null;
1869
1877
  };
1878
+ /** First entry is the previous month (see forecast_metadata.previous_month), then the forecast window from current_month onward. summary/risk_analysis cover the forecast window only. */
1870
1879
  monthly_data: Array<{
1871
1880
  month: string;
1872
1881
  month_display: string;
package/index.js CHANGED
@@ -1033,12 +1033,13 @@ class SalaryAPI {
1033
1033
 
1034
1034
  /**
1035
1035
  * Get teacher salary forecast for upcoming months (Admin only)
1036
- * @param {number} [monthsAhead=6] - Number of months to forecast (1-12)
1036
+ * @param {number} [monthsAhead=6] - Number of forecast months (1-12)
1037
+ * @param {number} [monthsBefore=4] - Number of past months to prepend to monthly_data (0-12)
1037
1038
  * @returns {Promise<object>}
1038
1039
  */
1039
- async getTeacherExpensesForecast(monthsAhead = 6) {
1040
+ async getTeacherExpensesForecast(monthsAhead = 6, monthsBefore = 4) {
1040
1041
  return await this.client.get("/api/v1/forecast/teacher-expenses", {
1041
- params: { months_ahead: monthsAhead },
1042
+ params: { months_ahead: monthsAhead, months_before: monthsBefore },
1042
1043
  });
1043
1044
  }
1044
1045
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nazar-salary",
3
- "version": "3.4.3",
3
+ "version": "3.4.4",
4
4
  "description": "Frontend library for Nazar Salary API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",