nazar-salary 2.6.0 → 2.7.1
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 +17 -8
- package/index.js +8 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -336,7 +336,7 @@ declare module 'nazar-salary' {
|
|
|
336
336
|
description?: string;
|
|
337
337
|
format: PriceFormat;
|
|
338
338
|
lesson_type: LessonType;
|
|
339
|
-
lessons_per_month: 8 | 12;
|
|
339
|
+
lessons_per_month: 8 | 12 | 16;
|
|
340
340
|
duration_minutes: number;
|
|
341
341
|
rate_per_lesson: number;
|
|
342
342
|
created_at: number;
|
|
@@ -348,7 +348,7 @@ declare module 'nazar-salary' {
|
|
|
348
348
|
description?: string;
|
|
349
349
|
format: PriceFormat;
|
|
350
350
|
lesson_type: LessonType;
|
|
351
|
-
lessons_per_month: 8 | 12;
|
|
351
|
+
lessons_per_month: 8 | 12 | 16;
|
|
352
352
|
duration_minutes: number;
|
|
353
353
|
rate_per_lesson: number;
|
|
354
354
|
}
|
|
@@ -358,7 +358,7 @@ declare module 'nazar-salary' {
|
|
|
358
358
|
description?: string;
|
|
359
359
|
format?: PriceFormat;
|
|
360
360
|
lesson_type?: LessonType;
|
|
361
|
-
lessons_per_month?: 8 | 12;
|
|
361
|
+
lessons_per_month?: 8 | 12 | 16;
|
|
362
362
|
rate_per_lesson?: number;
|
|
363
363
|
}
|
|
364
364
|
|
|
@@ -370,7 +370,7 @@ declare module 'nazar-salary' {
|
|
|
370
370
|
id: number;
|
|
371
371
|
format: PriceFormat;
|
|
372
372
|
lesson_type: LessonType;
|
|
373
|
-
lessons_per_month: 8 | 12;
|
|
373
|
+
lessons_per_month: 8 | 12 | 16;
|
|
374
374
|
duration_minutes: number;
|
|
375
375
|
rate_per_lesson: number;
|
|
376
376
|
created_at: number;
|
|
@@ -472,15 +472,24 @@ declare module 'nazar-salary' {
|
|
|
472
472
|
transfer_date: number;
|
|
473
473
|
}
|
|
474
474
|
|
|
475
|
+
export interface LessonGroupStudent {
|
|
476
|
+
id: number;
|
|
477
|
+
name: string;
|
|
478
|
+
}
|
|
479
|
+
|
|
475
480
|
export interface LessonGroup {
|
|
476
481
|
lesson_group_id: number;
|
|
477
482
|
lesson_group_name: string;
|
|
478
|
-
|
|
479
|
-
|
|
483
|
+
group_type: string;
|
|
484
|
+
teacher_name: string;
|
|
485
|
+
students: LessonGroupStudent[];
|
|
486
|
+
current_count: number;
|
|
487
|
+
max_count: number;
|
|
488
|
+
available: boolean;
|
|
480
489
|
}
|
|
481
490
|
|
|
482
491
|
export interface LessonGroupsResponse {
|
|
483
|
-
|
|
492
|
+
lesson_groups: LessonGroup[];
|
|
484
493
|
}
|
|
485
494
|
|
|
486
495
|
export interface StudentCourse {
|
|
@@ -1021,7 +1030,7 @@ declare module 'nazar-salary' {
|
|
|
1021
1030
|
|
|
1022
1031
|
// Student endpoints
|
|
1023
1032
|
createStudent(data: CreateStudentData): Promise<CreateStudentResponse>;
|
|
1024
|
-
getLessonGroups(): Promise<LessonGroupsResponse>;
|
|
1033
|
+
getLessonGroups(managerId?: number): Promise<LessonGroupsResponse>;
|
|
1025
1034
|
updateStudent(studentId: number, data: UpdateStudentData): Promise<UpdateStudentResponse>;
|
|
1026
1035
|
transferStudent(studentId: number, data: TransferStudentData): Promise<TransferResponse>;
|
|
1027
1036
|
changeStudentManager(studentId: number, data: ChangeStudentManagerData): Promise<ChangeStudentManagerResponse>;
|
package/index.js
CHANGED
|
@@ -398,7 +398,7 @@ class SalaryAPI {
|
|
|
398
398
|
* @param {string} [data.description] - Description
|
|
399
399
|
* @param {string} data.format - Format: individual, duet, trio, group
|
|
400
400
|
* @param {string} data.lesson_type - Lesson type: online, offline
|
|
401
|
-
* @param {number} data.lessons_per_month - Lessons per month: 8 or 12
|
|
401
|
+
* @param {number} data.lessons_per_month - Lessons per month: 8 or 12 or 16
|
|
402
402
|
* @param {number} data.duration_minutes - Duration in minutes
|
|
403
403
|
* @param {number} data.rate_per_lesson - Rate per lesson in tenge
|
|
404
404
|
* @returns {Promise<object>}
|
|
@@ -433,7 +433,7 @@ class SalaryAPI {
|
|
|
433
433
|
* @param {string} [data.description] - Description
|
|
434
434
|
* @param {string} [data.format] - Format: individual, duet, trio, group
|
|
435
435
|
* @param {string} [data.lesson_type] - Lesson type: online, offline
|
|
436
|
-
* @param {number} [data.lessons_per_month] - Lessons per month: 8 or 12
|
|
436
|
+
* @param {number} [data.lessons_per_month] - Lessons per month: 8 or 12 or 16
|
|
437
437
|
* @param {number} [data.rate_per_lesson] - Rate per lesson in tenge
|
|
438
438
|
* @returns {Promise<object>}
|
|
439
439
|
*/
|
|
@@ -495,10 +495,13 @@ class SalaryAPI {
|
|
|
495
495
|
|
|
496
496
|
/**
|
|
497
497
|
* Get available lesson groups for duet/trio (requireAuth)
|
|
498
|
-
* @
|
|
498
|
+
* @param {number} [managerId] - Manager ID (required for admin users)
|
|
499
|
+
* @returns {Promise<{lesson_groups: Array<{lesson_group_id: number, lesson_group_name: string, group_type: string, teacher_name: string, students: Array, current_count: number, max_count: number, available: boolean}>}>}
|
|
499
500
|
*/
|
|
500
|
-
async getLessonGroups() {
|
|
501
|
-
|
|
501
|
+
async getLessonGroups(managerId) {
|
|
502
|
+
const params = {};
|
|
503
|
+
if (managerId !== undefined) params.manager_id = managerId;
|
|
504
|
+
return await this.client.get("/api/v1/student/lesson-groups", { params });
|
|
502
505
|
}
|
|
503
506
|
|
|
504
507
|
/**
|