nazar-salary 2.1.1 → 2.2.0
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 -1
- package/index.js +23 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -505,6 +505,23 @@ declare module 'nazar-salary' {
|
|
|
505
505
|
main_course?: string;
|
|
506
506
|
}
|
|
507
507
|
|
|
508
|
+
export interface ChangeStudentManagerData {
|
|
509
|
+
new_manager_id: number;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export interface ChangeStudentManagerResponse {
|
|
513
|
+
student_id: number;
|
|
514
|
+
old_manager: {
|
|
515
|
+
id: number;
|
|
516
|
+
name: string;
|
|
517
|
+
};
|
|
518
|
+
new_manager: {
|
|
519
|
+
id: number;
|
|
520
|
+
name: string;
|
|
521
|
+
};
|
|
522
|
+
reassigned_at: number;
|
|
523
|
+
}
|
|
524
|
+
|
|
508
525
|
export interface StudentBasicInfo {
|
|
509
526
|
id: number;
|
|
510
527
|
first_name: string;
|
|
@@ -649,7 +666,7 @@ declare module 'nazar-salary' {
|
|
|
649
666
|
}
|
|
650
667
|
|
|
651
668
|
/** @deprecated Use StudentsListParams instead */
|
|
652
|
-
export interface ManagerStudentsParams extends Omit<StudentsListParams, 'manager_id'> {}
|
|
669
|
+
export interface ManagerStudentsParams extends Omit<StudentsListParams, 'manager_id'> { }
|
|
653
670
|
|
|
654
671
|
/** @deprecated Use StudentsListResponse instead */
|
|
655
672
|
export interface ManagerStudentsResponse extends StudentsListResponse {
|
|
@@ -730,6 +747,7 @@ declare module 'nazar-salary' {
|
|
|
730
747
|
createStudent(data: CreateStudentData): Promise<Student>;
|
|
731
748
|
updateStudent(studentId: number, data: UpdateStudentData): Promise<UpdatedStudent>;
|
|
732
749
|
transferStudent(studentId: number, data: TransferStudentData): Promise<TransferResponse>;
|
|
750
|
+
changeStudentManager(studentId: number, data: ChangeStudentManagerData): Promise<ChangeStudentManagerResponse>;
|
|
733
751
|
getStudent(studentId: number): Promise<StudentDetail>;
|
|
734
752
|
searchStudents(params: SearchStudentsParams): Promise<SearchStudentsResponse>;
|
|
735
753
|
getStudentsList(params?: StudentsListParams): Promise<StudentsListResponse>;
|
package/index.js
CHANGED
|
@@ -189,13 +189,14 @@ class SalaryAPI {
|
|
|
189
189
|
*/
|
|
190
190
|
async uploadKaspiReceipt(file, options = {}) {
|
|
191
191
|
const formData = new FormData();
|
|
192
|
-
formData.append(
|
|
193
|
-
if (options.period_from)
|
|
194
|
-
|
|
192
|
+
formData.append("file", file);
|
|
193
|
+
if (options.period_from)
|
|
194
|
+
formData.append("period_from", options.period_from);
|
|
195
|
+
if (options.period_to) formData.append("period_to", options.period_to);
|
|
195
196
|
|
|
196
197
|
return await this.client.post("/api/v1/admin/receipts/upload", formData, {
|
|
197
198
|
headers: {
|
|
198
|
-
|
|
199
|
+
"Content-Type": "multipart/form-data",
|
|
199
200
|
},
|
|
200
201
|
});
|
|
201
202
|
}
|
|
@@ -452,7 +453,24 @@ class SalaryAPI {
|
|
|
452
453
|
* @returns {Promise<object>}
|
|
453
454
|
*/
|
|
454
455
|
async transferStudent(studentId, data) {
|
|
455
|
-
return await this.client.post(
|
|
456
|
+
return await this.client.post(
|
|
457
|
+
`/api/v1/student/${studentId}/transfer`,
|
|
458
|
+
data,
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Change student manager (Admin only)
|
|
464
|
+
* @param {number} studentId - Student ID
|
|
465
|
+
* @param {object} data - Change manager data
|
|
466
|
+
* @param {number} data.new_manager_id - New manager user ID
|
|
467
|
+
* @returns {Promise<{student_id: number, old_manager: object, new_manager: object, reassigned_at: number}>}
|
|
468
|
+
*/
|
|
469
|
+
async changeStudentManager(studentId, data) {
|
|
470
|
+
return await this.client.post(
|
|
471
|
+
`/api/v1/student/${studentId}/change-manager`,
|
|
472
|
+
data,
|
|
473
|
+
);
|
|
456
474
|
}
|
|
457
475
|
|
|
458
476
|
/**
|