nazar-salary 3.4.4 → 3.4.6
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 +22 -0
- package/index.js +8 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -830,13 +830,19 @@ declare module 'nazar-salary' {
|
|
|
830
830
|
teachers: number;
|
|
831
831
|
};
|
|
832
832
|
finance: {
|
|
833
|
+
/** Verified payments, NET of bank commission (sum of net_amount) */
|
|
833
834
|
verified_amount: number;
|
|
834
835
|
verified_count: number;
|
|
836
|
+
/** Not-yet-verified payments, GROSS (sum of purchase_amount) — net_amount only exists after verification, so this is not comparable to verified_amount and the two must not be summed */
|
|
837
|
+
not_verified_amount: number;
|
|
838
|
+
not_verified_count: number;
|
|
835
839
|
manager_commission: number;
|
|
836
840
|
teacher_pending_amount: number;
|
|
837
841
|
teacher_pending_count: number;
|
|
838
842
|
/** Total future teacher payments = sum of (remaining_lessons * rate_per_lesson) for all active students */
|
|
839
843
|
future_teacher_payment: number;
|
|
844
|
+
/** Future teacher payments owed for students whose payments fall in the selected month (verified or not). Group courses counted once per group. */
|
|
845
|
+
future_teacher_payment_from_month: number;
|
|
840
846
|
};
|
|
841
847
|
}
|
|
842
848
|
|
|
@@ -1064,6 +1070,7 @@ declare module 'nazar-salary' {
|
|
|
1064
1070
|
date_to?: string;
|
|
1065
1071
|
display: string;
|
|
1066
1072
|
};
|
|
1073
|
+
/** Totals for the requested period (respects period/status/teacher_id filters) */
|
|
1067
1074
|
summary: {
|
|
1068
1075
|
total_teachers: number;
|
|
1069
1076
|
total_payments: number;
|
|
@@ -1074,6 +1081,21 @@ declare module 'nazar-salary' {
|
|
|
1074
1081
|
paid: number;
|
|
1075
1082
|
};
|
|
1076
1083
|
};
|
|
1084
|
+
/**
|
|
1085
|
+
* Lesson totals as of now — a snapshot, NOT limited by period/status
|
|
1086
|
+
* (student_history has no per-lesson dates). Respects teacher_id if passed.
|
|
1087
|
+
* Deleted students are excluded.
|
|
1088
|
+
*/
|
|
1089
|
+
lessons_summary: {
|
|
1090
|
+
/** Lessons conducted across all courses ever (finished and stopped included) */
|
|
1091
|
+
completed_lessons: number;
|
|
1092
|
+
/** Lessons still to be conducted — active courses only */
|
|
1093
|
+
remaining_lessons: number;
|
|
1094
|
+
/** completed_lessons valued at the current price (rate_per_lesson) */
|
|
1095
|
+
completed_amount: number;
|
|
1096
|
+
/** remaining_lessons valued at the current price — future teacher payout */
|
|
1097
|
+
remaining_amount: number;
|
|
1098
|
+
};
|
|
1077
1099
|
teachers: TeacherSalaryItem[];
|
|
1078
1100
|
}
|
|
1079
1101
|
|
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
|
-
*
|
|
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 });
|