nazar-salary 3.4.7 → 3.4.9
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 +19 -2
- package/index.js +6 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -461,6 +461,10 @@ declare module 'nazar-salary' {
|
|
|
461
461
|
active_students: number;
|
|
462
462
|
/** Distinct students whose courses on this tariff are all closed */
|
|
463
463
|
inactive_students: number;
|
|
464
|
+
/** Team salary per month per student on this tariff; null if not configured */
|
|
465
|
+
monthly_team_price: number | null;
|
|
466
|
+
/** Sum of monthly_team_price * enrollment_months over active courses (same as /admin/team_salary/total gross, per tariff); null if not configured */
|
|
467
|
+
team_salary_total: number | null;
|
|
464
468
|
}
|
|
465
469
|
|
|
466
470
|
export interface PricesListResponse {
|
|
@@ -483,6 +487,8 @@ declare module 'nazar-salary' {
|
|
|
483
487
|
rate_per_lesson: number;
|
|
484
488
|
/** Gross payments attributed to this student on this tariff */
|
|
485
489
|
purchase_amount: number;
|
|
490
|
+
/** enrollment_months * monthly_team_price; null if no team_salary config for this price */
|
|
491
|
+
team_salary_amount: number | null;
|
|
486
492
|
teacher_id: number | null;
|
|
487
493
|
teacher_name: string | null;
|
|
488
494
|
/** Owner of the student (student_history.owned_by) */
|
|
@@ -496,7 +502,10 @@ declare module 'nazar-salary' {
|
|
|
496
502
|
group_name: string | null;
|
|
497
503
|
main_course: string;
|
|
498
504
|
student_history_id: number;
|
|
505
|
+
/** Course start date, ms timestamp */
|
|
499
506
|
created_at: number;
|
|
507
|
+
/** Student sale/registration date (students.created_at) — what created_from/created_to filter on */
|
|
508
|
+
student_created_at: number;
|
|
500
509
|
}
|
|
501
510
|
|
|
502
511
|
export interface PriceStudentsResponse {
|
|
@@ -508,6 +517,8 @@ declare module 'nazar-salary' {
|
|
|
508
517
|
lessons_per_month: number;
|
|
509
518
|
duration_minutes: number;
|
|
510
519
|
rate_per_lesson: number;
|
|
520
|
+
/** null if team salary is not configured for this tariff */
|
|
521
|
+
monthly_team_price: number | null;
|
|
511
522
|
};
|
|
512
523
|
pagination: {
|
|
513
524
|
page: number;
|
|
@@ -908,6 +919,12 @@ declare module 'nazar-salary' {
|
|
|
908
919
|
future_teacher_payment: number;
|
|
909
920
|
/** Future teacher payments owed for students whose payments fall in the selected month (verified or not). Group courses counted once per group. */
|
|
910
921
|
future_teacher_payment_from_month: number;
|
|
922
|
+
/** Team salary for sales of the selected month: months sold (new sales, extensions, resales) × tariff monthly_team_price */
|
|
923
|
+
team_salary_gross: number;
|
|
924
|
+
/** Team salary deductions with deduction_date in the selected month */
|
|
925
|
+
team_salary_deductions: number;
|
|
926
|
+
/** team_salary_gross − team_salary_deductions */
|
|
927
|
+
team_salary_net: number;
|
|
911
928
|
};
|
|
912
929
|
}
|
|
913
930
|
|
|
@@ -1769,8 +1786,8 @@ declare module 'nazar-salary' {
|
|
|
1769
1786
|
getPriceHistory(priceId: number): Promise<PriceHistoryResponse>;
|
|
1770
1787
|
deletePrice(priceId: number): Promise<void>;
|
|
1771
1788
|
getPricesList(): Promise<PricesListResponse>;
|
|
1772
|
-
getPriceStudents(priceId: number, params?: { status?: 'active' | 'inactive'; page?: number; limit?: number }): Promise<PriceStudentsResponse>;
|
|
1773
|
-
exportPriceStudents(prices?: number[] | string, options?: { status?: 'active' | 'inactive' }): Promise<ArrayBuffer>;
|
|
1789
|
+
getPriceStudents(priceId: number, params?: { status?: 'active' | 'inactive'; created_from?: string; created_to?: string; page?: number; limit?: number }): Promise<PriceStudentsResponse>;
|
|
1790
|
+
exportPriceStudents(prices?: number[] | string, options?: { status?: 'active' | 'inactive'; created_from?: string; created_to?: string }): Promise<ArrayBuffer>;
|
|
1774
1791
|
|
|
1775
1792
|
// Student endpoints
|
|
1776
1793
|
createStudent(data: CreateStudentData): Promise<CreateStudentResponse>;
|
package/index.js
CHANGED
|
@@ -541,6 +541,8 @@ class SalaryAPI {
|
|
|
541
541
|
* @param {number} priceId - Price/tariff ID
|
|
542
542
|
* @param {object} [params]
|
|
543
543
|
* @param {'active'|'inactive'} [params.status] - Filter by course state
|
|
544
|
+
* @param {string} [params.created_from] - Student sale date from, YYYY-MM-DD or ISO 8601
|
|
545
|
+
* @param {string} [params.created_to] - Student sale date to, inclusive
|
|
544
546
|
* @param {number} [params.page=1]
|
|
545
547
|
* @param {number} [params.limit=30] - Max 200
|
|
546
548
|
* @returns {Promise<PriceStudentsResponse>}
|
|
@@ -1073,6 +1075,8 @@ class SalaryAPI {
|
|
|
1073
1075
|
* @param {number[]|string} [prices] - Tariff IDs, e.g. [1,2,3] or "1,2,3". Omit for all tariffs
|
|
1074
1076
|
* @param {object} [options]
|
|
1075
1077
|
* @param {'active'|'inactive'} [options.status] - Filter by course state
|
|
1078
|
+
* @param {string} [options.created_from] - Student sale date from, YYYY-MM-DD or ISO 8601
|
|
1079
|
+
* @param {string} [options.created_to] - Student sale date to, inclusive
|
|
1076
1080
|
* @returns {Promise<ArrayBuffer>} Excel file
|
|
1077
1081
|
*/
|
|
1078
1082
|
async exportPriceStudents(prices, options = {}) {
|
|
@@ -1081,6 +1085,8 @@ class SalaryAPI {
|
|
|
1081
1085
|
params.prices = Array.isArray(prices) ? prices.join(",") : prices;
|
|
1082
1086
|
}
|
|
1083
1087
|
if (options.status !== undefined) params.status = options.status;
|
|
1088
|
+
if (options.created_from !== undefined) params.created_from = options.created_from;
|
|
1089
|
+
if (options.created_to !== undefined) params.created_to = options.created_to;
|
|
1084
1090
|
return await this.client.get("/api/v1/price/students/export", {
|
|
1085
1091
|
params,
|
|
1086
1092
|
responseType: "arraybuffer",
|