nazar-salary 2.7.1 → 2.8.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 +98 -6
- package/index.js +23 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -648,16 +648,104 @@ declare module 'nazar-salary' {
|
|
|
648
648
|
status: string;
|
|
649
649
|
student: {
|
|
650
650
|
id: number;
|
|
651
|
-
|
|
652
|
-
|
|
651
|
+
name: string;
|
|
652
|
+
is_active: false;
|
|
653
|
+
finished_at: number;
|
|
653
654
|
stop_reason: StopReason;
|
|
655
|
+
stop_comment: string | null;
|
|
654
656
|
completed_lessons: number;
|
|
657
|
+
total_lessons: number;
|
|
658
|
+
remaining_lessons: number;
|
|
655
659
|
};
|
|
656
|
-
|
|
660
|
+
lesson_group_id: number | null;
|
|
661
|
+
remaining_group_students: Array<{ id: number; name: string }> | null;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
export interface ResumeStudentData {
|
|
665
|
+
comment?: string;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
export interface ResumeStudentResponse {
|
|
669
|
+
status: string;
|
|
670
|
+
student: {
|
|
657
671
|
id: number;
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
672
|
+
name: string;
|
|
673
|
+
is_active: true;
|
|
674
|
+
resumed_at: number;
|
|
675
|
+
previous_stop_reason: StopReason | null;
|
|
676
|
+
completed_lessons: number;
|
|
677
|
+
total_lessons: number;
|
|
678
|
+
remaining_lessons: number;
|
|
679
|
+
};
|
|
680
|
+
lesson_group_id: number | null;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
export interface DashboardKpi {
|
|
684
|
+
students: {
|
|
685
|
+
active: number;
|
|
686
|
+
new_this_month: number;
|
|
687
|
+
finished_this_month: number;
|
|
688
|
+
};
|
|
689
|
+
staff: {
|
|
690
|
+
managers: number;
|
|
691
|
+
teachers: number;
|
|
692
|
+
};
|
|
693
|
+
finance: {
|
|
694
|
+
verified_amount: number;
|
|
695
|
+
verified_count: number;
|
|
696
|
+
manager_commission: number;
|
|
697
|
+
teacher_pending_amount: number;
|
|
698
|
+
teacher_pending_count: number;
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
export interface DashboardAlerts {
|
|
703
|
+
discrepancies: number;
|
|
704
|
+
orphan_payments: number;
|
|
705
|
+
teacher_not_paid_count: number;
|
|
706
|
+
teacher_not_paid_amount: number;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
export interface DashboardManagerItem {
|
|
710
|
+
id: number;
|
|
711
|
+
name: string;
|
|
712
|
+
students_count?: number;
|
|
713
|
+
total_commission?: number;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
export interface DashboardRecentReceipt {
|
|
717
|
+
id: number;
|
|
718
|
+
file_name: string;
|
|
719
|
+
status: 'processing' | 'completed' | 'failed';
|
|
720
|
+
uploaded_by: string;
|
|
721
|
+
uploaded_at: number;
|
|
722
|
+
verified_count: number;
|
|
723
|
+
discrepancies_count: number;
|
|
724
|
+
orphan_count: number;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
export interface DashboardRecentStudent {
|
|
728
|
+
id: number;
|
|
729
|
+
name: string;
|
|
730
|
+
manager_name: string;
|
|
731
|
+
created_at: number;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
export interface DashboardResponse {
|
|
735
|
+
period: {
|
|
736
|
+
month: string;
|
|
737
|
+
month_start: number;
|
|
738
|
+
month_end: number;
|
|
739
|
+
};
|
|
740
|
+
kpi: DashboardKpi;
|
|
741
|
+
alerts: DashboardAlerts;
|
|
742
|
+
top_managers: {
|
|
743
|
+
by_students: DashboardManagerItem[];
|
|
744
|
+
by_commission: DashboardManagerItem[];
|
|
745
|
+
};
|
|
746
|
+
recent: {
|
|
747
|
+
receipts: DashboardRecentReceipt[];
|
|
748
|
+
students: DashboardRecentStudent[];
|
|
661
749
|
};
|
|
662
750
|
}
|
|
663
751
|
|
|
@@ -1007,6 +1095,9 @@ declare module 'nazar-salary' {
|
|
|
1007
1095
|
getBanksConfig(): Promise<BanksConfigResponse>;
|
|
1008
1096
|
getManagerStudentsAdmin(managerId: number, params?: StudentsListParams): Promise<StudentsListResponse>;
|
|
1009
1097
|
|
|
1098
|
+
// Dashboard endpoints
|
|
1099
|
+
getDashboard(): Promise<DashboardResponse>;
|
|
1100
|
+
|
|
1010
1101
|
// Salary endpoints
|
|
1011
1102
|
getManagerSalary(month: string, managerId?: number): Promise<ManagerSalaryResponse>;
|
|
1012
1103
|
getTeachersSalary(params: TeachersSalaryParams): Promise<TeachersSalaryResponse>;
|
|
@@ -1036,6 +1127,7 @@ declare module 'nazar-salary' {
|
|
|
1036
1127
|
changeStudentManager(studentId: number, data: ChangeStudentManagerData): Promise<ChangeStudentManagerResponse>;
|
|
1037
1128
|
updateStudentProgress(studentId: number, data: UpdateStudentProgressData): Promise<UpdateStudentProgressResponse>;
|
|
1038
1129
|
stopStudent(studentId: number, data: StopStudentData): Promise<StopStudentResponse>;
|
|
1130
|
+
resumeStudent(studentId: number, data?: ResumeStudentData): Promise<ResumeStudentResponse>;
|
|
1039
1131
|
getStudent(studentId: number): Promise<StudentDetail>;
|
|
1040
1132
|
searchStudents(params: SearchStudentsParams): Promise<SearchStudentsResponse>;
|
|
1041
1133
|
getStudentsList(params?: StudentsListParams): Promise<StudentsListResponse>;
|
package/index.js
CHANGED
|
@@ -567,13 +567,21 @@ class SalaryAPI {
|
|
|
567
567
|
);
|
|
568
568
|
}
|
|
569
569
|
|
|
570
|
+
/**
|
|
571
|
+
* Get admin dashboard summary (Admin only)
|
|
572
|
+
* @returns {Promise<DashboardResponse>}
|
|
573
|
+
*/
|
|
574
|
+
async getDashboard() {
|
|
575
|
+
return await this.client.get("/api/v1/admin/dashboard/");
|
|
576
|
+
}
|
|
577
|
+
|
|
570
578
|
/**
|
|
571
579
|
* Stop student enrollment (Admin only)
|
|
572
580
|
* @param {number} studentId - Student ID
|
|
573
581
|
* @param {object} data - Stop data
|
|
574
582
|
* @param {string} data.reason - Reason for stopping (student_quit, moved_away, health_issues, financial, other)
|
|
575
583
|
* @param {string} [data.comment] - Optional comment
|
|
576
|
-
* @returns {Promise<
|
|
584
|
+
* @returns {Promise<StopStudentResponse>}
|
|
577
585
|
*/
|
|
578
586
|
async stopStudent(studentId, data) {
|
|
579
587
|
return await this.client.post(
|
|
@@ -582,6 +590,20 @@ class SalaryAPI {
|
|
|
582
590
|
);
|
|
583
591
|
}
|
|
584
592
|
|
|
593
|
+
/**
|
|
594
|
+
* Resume stopped student enrollment (Admin only)
|
|
595
|
+
* @param {number} studentId - Student ID
|
|
596
|
+
* @param {object} [data] - Resume data
|
|
597
|
+
* @param {string} [data.comment] - Optional comment
|
|
598
|
+
* @returns {Promise<ResumeStudentResponse>}
|
|
599
|
+
*/
|
|
600
|
+
async resumeStudent(studentId, data = {}) {
|
|
601
|
+
return await this.client.post(
|
|
602
|
+
`/api/v1/admin/progress/${studentId}/resume`,
|
|
603
|
+
data,
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
|
|
585
607
|
/**
|
|
586
608
|
* Get student by ID (requireAuth)
|
|
587
609
|
* @param {number} studentId - Student ID
|