nazar-salary 3.4.4 → 3.4.5

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 +16 -0
  2. package/index.js +8 -1
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1064,6 +1064,7 @@ declare module 'nazar-salary' {
1064
1064
  date_to?: string;
1065
1065
  display: string;
1066
1066
  };
1067
+ /** Totals for the requested period (respects period/status/teacher_id filters) */
1067
1068
  summary: {
1068
1069
  total_teachers: number;
1069
1070
  total_payments: number;
@@ -1074,6 +1075,21 @@ declare module 'nazar-salary' {
1074
1075
  paid: number;
1075
1076
  };
1076
1077
  };
1078
+ /**
1079
+ * Lesson totals as of now — a snapshot, NOT limited by period/status
1080
+ * (student_history has no per-lesson dates). Respects teacher_id if passed.
1081
+ * Deleted students are excluded.
1082
+ */
1083
+ lessons_summary: {
1084
+ /** Lessons conducted across all courses ever (finished and stopped included) */
1085
+ completed_lessons: number;
1086
+ /** Lessons still to be conducted — active courses only */
1087
+ remaining_lessons: number;
1088
+ /** completed_lessons valued at the current price (rate_per_lesson) */
1089
+ completed_amount: number;
1090
+ /** remaining_lessons valued at the current price — future teacher payout */
1091
+ remaining_amount: number;
1092
+ };
1077
1093
  teachers: TeacherSalaryItem[];
1078
1094
  }
1079
1095
 
package/index.js CHANGED
@@ -362,7 +362,14 @@ class SalaryAPI {
362
362
  * @param {string} [params.date_to] - End date YYYY-MM-DD (required if period_type=custom)
363
363
  * @param {string} [params.status] - Filter by status: 'not_paid', 'pending', 'paid'
364
364
  * @param {number} [params.teacher_id] - Filter by teacher ID
365
- * @returns {Promise<{period: object, summary: object, teachers: array}>}
365
+ *
366
+ * Response also carries `lessons_summary` — a snapshot as of now (NOT limited by
367
+ * period/status; respects teacher_id, excludes deleted students):
368
+ * completed_lessons — lessons conducted across all courses ever
369
+ * remaining_lessons — lessons still to conduct (active courses only)
370
+ * completed_amount — completed_lessons x current rate_per_lesson
371
+ * remaining_amount — remaining_lessons x current rate_per_lesson (future payout)
372
+ * @returns {Promise<{period: object, summary: object, lessons_summary: object, teachers: array}>}
366
373
  */
367
374
  async getTeachersSalary(params) {
368
375
  return await this.client.get("/api/v1/admin/salary/teachers", { params });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nazar-salary",
3
- "version": "3.4.4",
3
+ "version": "3.4.5",
4
4
  "description": "Frontend library for Nazar Salary API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",