nazar-salary 3.3.3 → 3.3.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.
- package/index.d.ts +45 -2
- package/index.js +15 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1242,8 +1242,6 @@ declare module 'nazar-salary' {
|
|
|
1242
1242
|
created_from?: string;
|
|
1243
1243
|
created_to?: string;
|
|
1244
1244
|
main_course?: string;
|
|
1245
|
-
/** If true, returns students who have finished the course (is_active=FALSE) */
|
|
1246
|
-
is_finished?: boolean;
|
|
1247
1245
|
page?: number;
|
|
1248
1246
|
limit?: number;
|
|
1249
1247
|
}
|
|
@@ -1274,6 +1272,48 @@ declare module 'nazar-salary' {
|
|
|
1274
1272
|
manager: ManagerInfo;
|
|
1275
1273
|
}
|
|
1276
1274
|
|
|
1275
|
+
export interface ManagerFinishedStudentsParams {
|
|
1276
|
+
page?: number;
|
|
1277
|
+
/** Max 30 */
|
|
1278
|
+
limit?: number;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
export interface ManagerFinishedStudentItem {
|
|
1282
|
+
id: number;
|
|
1283
|
+
first_name: string;
|
|
1284
|
+
last_name: string;
|
|
1285
|
+
phone: string;
|
|
1286
|
+
age: number | null;
|
|
1287
|
+
created_at: number;
|
|
1288
|
+
history_id: number;
|
|
1289
|
+
price_id: number;
|
|
1290
|
+
teacher_id: number | null;
|
|
1291
|
+
enrollment_months: number;
|
|
1292
|
+
total_lessons: number;
|
|
1293
|
+
completed_lessons: number;
|
|
1294
|
+
main_course: string;
|
|
1295
|
+
group_name: string | null;
|
|
1296
|
+
lesson_group_id: number | null;
|
|
1297
|
+
stop_reason: string | null;
|
|
1298
|
+
stop_comment: string | null;
|
|
1299
|
+
finished_at: number | null;
|
|
1300
|
+
total_purchase_amount: number;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
export interface ManagerFinishedStudentsResponse {
|
|
1304
|
+
manager: {
|
|
1305
|
+
id: number;
|
|
1306
|
+
first_name: string;
|
|
1307
|
+
last_name: string;
|
|
1308
|
+
phone: string;
|
|
1309
|
+
role: string;
|
|
1310
|
+
};
|
|
1311
|
+
total_students: number;
|
|
1312
|
+
current_page: number;
|
|
1313
|
+
total_pages: number;
|
|
1314
|
+
students: ManagerFinishedStudentItem[];
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1277
1317
|
export interface StudentsListLiteParams {
|
|
1278
1318
|
page?: number;
|
|
1279
1319
|
}
|
|
@@ -1551,6 +1591,9 @@ declare module 'nazar-salary' {
|
|
|
1551
1591
|
getBanksConfig(): Promise<BanksConfigResponse>;
|
|
1552
1592
|
getManagerStudentsAdmin(managerId: number, params?: StudentsListParams): Promise<StudentsListResponse>;
|
|
1553
1593
|
|
|
1594
|
+
/** Get finished (inactive course) students of specific manager (Admin only) */
|
|
1595
|
+
getManagerFinishedStudents(managerId: number, params?: ManagerFinishedStudentsParams): Promise<ManagerFinishedStudentsResponse>;
|
|
1596
|
+
|
|
1554
1597
|
// Dashboard endpoints
|
|
1555
1598
|
/**
|
|
1556
1599
|
* @param month Optional month in MM.YYYY format (e.g. "04.2026"). Defaults to current month.
|
package/index.js
CHANGED
|
@@ -313,7 +313,6 @@ class SalaryAPI {
|
|
|
313
313
|
* @param {string} [params.created_from] - Filter by created date from (ISO 8601)
|
|
314
314
|
* @param {string} [params.created_to] - Filter by created date to (ISO 8601)
|
|
315
315
|
* @param {string} [params.main_course] - Filter by main course
|
|
316
|
-
* @param {boolean} [params.is_finished] - If true, returns students who have finished the course
|
|
317
316
|
* @param {number} [params.page=1] - Page number
|
|
318
317
|
* @param {number} [params.limit=30] - Items per page (max 30)
|
|
319
318
|
* @returns {Promise<{manager: object, total_students: number, current_page: number, total_pages: number, students: array}>}
|
|
@@ -325,6 +324,21 @@ class SalaryAPI {
|
|
|
325
324
|
);
|
|
326
325
|
}
|
|
327
326
|
|
|
327
|
+
/**
|
|
328
|
+
* Get finished students of specific manager (completed_lessons = total_lessons, Admin only)
|
|
329
|
+
* @param {number} managerId - Manager ID
|
|
330
|
+
* @param {object} [params] - Query parameters
|
|
331
|
+
* @param {number} [params.page=1] - Page number
|
|
332
|
+
* @param {number} [params.limit=30] - Items per page (max 30)
|
|
333
|
+
* @returns {Promise<{manager: object, total_students: number, current_page: number, total_pages: number, students: array}>}
|
|
334
|
+
*/
|
|
335
|
+
async getManagerFinishedStudents(managerId, params = {}) {
|
|
336
|
+
return await this.client.get(
|
|
337
|
+
`/api/v1/admin/manager/${managerId}/finished-students`,
|
|
338
|
+
{ params },
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
|
|
328
342
|
/**
|
|
329
343
|
* Get manager salary for specific month (Admin only)
|
|
330
344
|
* @param {string} month - Month in YYYY-MM format
|