nazar-salary 2.8.0 → 2.8.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.
Files changed (3) hide show
  1. package/index.d.ts +41 -0
  2. package/index.js +15 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -979,6 +979,46 @@ declare module 'nazar-salary' {
979
979
  students: StudentListItem[];
980
980
  }
981
981
 
982
+ export interface StoppedStudentsParams {
983
+ search?: string;
984
+ manager_id?: number;
985
+ teacher_id?: number;
986
+ stop_reason?: string;
987
+ page?: number;
988
+ limit?: number;
989
+ }
990
+
991
+ export interface StoppedStudentItem {
992
+ id: number;
993
+ first_name: string;
994
+ last_name: string;
995
+ phone: string;
996
+ age: number;
997
+ created_at: number;
998
+ history_id: number;
999
+ price_id: number;
1000
+ teacher_id: number;
1001
+ owned_by: number;
1002
+ manager_name: string;
1003
+ enrollment_months: number;
1004
+ total_lessons: number;
1005
+ completed_lessons: number;
1006
+ remaining_lessons: number;
1007
+ main_course: string;
1008
+ group_name: string | null;
1009
+ lesson_group_id: number | null;
1010
+ stop_reason: string;
1011
+ stop_comment: string | null;
1012
+ finished_at: number;
1013
+ }
1014
+
1015
+ export interface StoppedStudentsResponse {
1016
+ total_students: number;
1017
+ current_page: number;
1018
+ total_pages: number;
1019
+ students: StoppedStudentItem[];
1020
+ }
1021
+
982
1022
  export interface StudentsListParams {
983
1023
  manager_id?: number;
984
1024
  prepayment?: boolean;
@@ -1130,6 +1170,7 @@ declare module 'nazar-salary' {
1130
1170
  resumeStudent(studentId: number, data?: ResumeStudentData): Promise<ResumeStudentResponse>;
1131
1171
  getStudent(studentId: number): Promise<StudentDetail>;
1132
1172
  searchStudents(params: SearchStudentsParams): Promise<SearchStudentsResponse>;
1173
+ getStoppedStudents(params?: StoppedStudentsParams): Promise<StoppedStudentsResponse>;
1133
1174
  getStudentsList(params?: StudentsListParams): Promise<StudentsListResponse>;
1134
1175
  /** @deprecated Use getStudentsList instead */
1135
1176
  getManagerStudents(managerId: number, params?: ManagerStudentsParams): Promise<ManagerStudentsResponse>;
package/index.js CHANGED
@@ -634,6 +634,21 @@ class SalaryAPI {
634
634
  return await this.client.get("/api/v1/admin/students", { params });
635
635
  }
636
636
 
637
+ /**
638
+ * Get stopped students list (Admin only)
639
+ * @param {object} [params] - Filter parameters
640
+ * @param {string} [params.search] - Search by name or phone
641
+ * @param {number} [params.manager_id] - Filter by manager ID
642
+ * @param {number} [params.teacher_id] - Filter by teacher ID
643
+ * @param {string} [params.stop_reason] - Filter by stop reason
644
+ * @param {number} [params.page=1] - Page number
645
+ * @param {number} [params.limit=30] - Page size
646
+ * @returns {Promise<object>}
647
+ */
648
+ async getStoppedStudents(params = {}) {
649
+ return await this.client.get("/api/v1/admin/students/stopped", { params });
650
+ }
651
+
637
652
  /**
638
653
  * Get students of specific manager (Admin provides manager_id, Manager gets own students)
639
654
  * @param {object} [params] - Filter parameters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nazar-salary",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Frontend library for Nazar Salary API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",