nazar-salary 3.3.3 → 3.3.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.
- package/index.d.ts +48 -2
- package/index.js +16 -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,51 @@ declare module 'nazar-salary' {
|
|
|
1274
1272
|
manager: ManagerInfo;
|
|
1275
1273
|
}
|
|
1276
1274
|
|
|
1275
|
+
export interface ManagerFinishedStudentsParams {
|
|
1276
|
+
/** true = finished_at IS NOT NULL; false = finished_at IS NULL; omit = all inactive */
|
|
1277
|
+
is_finished?: boolean;
|
|
1278
|
+
page?: number;
|
|
1279
|
+
/** Max 30 */
|
|
1280
|
+
limit?: number;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
export interface ManagerFinishedStudentItem {
|
|
1284
|
+
id: number;
|
|
1285
|
+
first_name: string;
|
|
1286
|
+
last_name: string;
|
|
1287
|
+
phone: string;
|
|
1288
|
+
age: number | null;
|
|
1289
|
+
created_at: number;
|
|
1290
|
+
history_id: number;
|
|
1291
|
+
price_id: number;
|
|
1292
|
+
teacher_id: number | null;
|
|
1293
|
+
enrollment_months: number;
|
|
1294
|
+
total_lessons: number;
|
|
1295
|
+
completed_lessons: number;
|
|
1296
|
+
remaining_lessons: number;
|
|
1297
|
+
main_course: string;
|
|
1298
|
+
group_name: string | null;
|
|
1299
|
+
lesson_group_id: number | null;
|
|
1300
|
+
stop_reason: string | null;
|
|
1301
|
+
stop_comment: string | null;
|
|
1302
|
+
finished_at: number | null;
|
|
1303
|
+
total_purchase_amount: number;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
export interface ManagerFinishedStudentsResponse {
|
|
1307
|
+
manager: {
|
|
1308
|
+
id: number;
|
|
1309
|
+
first_name: string;
|
|
1310
|
+
last_name: string;
|
|
1311
|
+
phone: string;
|
|
1312
|
+
role: string;
|
|
1313
|
+
};
|
|
1314
|
+
total_students: number;
|
|
1315
|
+
current_page: number;
|
|
1316
|
+
total_pages: number;
|
|
1317
|
+
students: ManagerFinishedStudentItem[];
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1277
1320
|
export interface StudentsListLiteParams {
|
|
1278
1321
|
page?: number;
|
|
1279
1322
|
}
|
|
@@ -1551,6 +1594,9 @@ declare module 'nazar-salary' {
|
|
|
1551
1594
|
getBanksConfig(): Promise<BanksConfigResponse>;
|
|
1552
1595
|
getManagerStudentsAdmin(managerId: number, params?: StudentsListParams): Promise<StudentsListResponse>;
|
|
1553
1596
|
|
|
1597
|
+
/** Get finished (inactive course) students of specific manager (Admin only) */
|
|
1598
|
+
getManagerFinishedStudents(managerId: number, params?: ManagerFinishedStudentsParams): Promise<ManagerFinishedStudentsResponse>;
|
|
1599
|
+
|
|
1554
1600
|
// Dashboard endpoints
|
|
1555
1601
|
/**
|
|
1556
1602
|
* @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,22 @@ class SalaryAPI {
|
|
|
325
324
|
);
|
|
326
325
|
}
|
|
327
326
|
|
|
327
|
+
/**
|
|
328
|
+
* Get finished (inactive course) students of specific manager (Admin only)
|
|
329
|
+
* @param {number} managerId - Manager ID
|
|
330
|
+
* @param {object} [params] - Query parameters
|
|
331
|
+
* @param {boolean} [params.is_finished] - true = finished_at IS NOT NULL; false = finished_at IS NULL; omit = all inactive
|
|
332
|
+
* @param {number} [params.page=1] - Page number
|
|
333
|
+
* @param {number} [params.limit=30] - Items per page (max 30)
|
|
334
|
+
* @returns {Promise<{manager: object, total_students: number, current_page: number, total_pages: number, students: array}>}
|
|
335
|
+
*/
|
|
336
|
+
async getManagerFinishedStudents(managerId, params = {}) {
|
|
337
|
+
return await this.client.get(
|
|
338
|
+
`/api/v1/admin/manager/${managerId}/finished-students`,
|
|
339
|
+
{ params },
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
328
343
|
/**
|
|
329
344
|
* Get manager salary for specific month (Admin only)
|
|
330
345
|
* @param {string} month - Month in YYYY-MM format
|