nazar-salary 3.3.2 → 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 -0
- package/index.js +16 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1272,6 +1272,51 @@ declare module 'nazar-salary' {
|
|
|
1272
1272
|
manager: ManagerInfo;
|
|
1273
1273
|
}
|
|
1274
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
|
+
|
|
1275
1320
|
export interface StudentsListLiteParams {
|
|
1276
1321
|
page?: number;
|
|
1277
1322
|
}
|
|
@@ -1549,6 +1594,9 @@ declare module 'nazar-salary' {
|
|
|
1549
1594
|
getBanksConfig(): Promise<BanksConfigResponse>;
|
|
1550
1595
|
getManagerStudentsAdmin(managerId: number, params?: StudentsListParams): Promise<StudentsListResponse>;
|
|
1551
1596
|
|
|
1597
|
+
/** Get finished (inactive course) students of specific manager (Admin only) */
|
|
1598
|
+
getManagerFinishedStudents(managerId: number, params?: ManagerFinishedStudentsParams): Promise<ManagerFinishedStudentsResponse>;
|
|
1599
|
+
|
|
1552
1600
|
// Dashboard endpoints
|
|
1553
1601
|
/**
|
|
1554
1602
|
* @param month Optional month in MM.YYYY format (e.g. "04.2026"). Defaults to current month.
|
package/index.js
CHANGED
|
@@ -324,6 +324,22 @@ class SalaryAPI {
|
|
|
324
324
|
);
|
|
325
325
|
}
|
|
326
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
|
+
|
|
327
343
|
/**
|
|
328
344
|
* Get manager salary for specific month (Admin only)
|
|
329
345
|
* @param {string} month - Month in YYYY-MM format
|