nazar-salary 3.5.6 → 3.5.8

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 +59 -6
  2. package/index.js +19 -1
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -864,8 +864,8 @@ declare module 'nazar-salary' {
864
864
  cover_image_url: string | null;
865
865
  /** percent 0–100, null until graded */
866
866
  totalGrade: number | null;
867
- /** A1…C2, shown on the certificate check page; 'B2' until set */
868
- languageLevel: AkcentLanguageLevel | string;
867
+ /** A1…C2, shown on the certificate check page; null until set (the page shows no level) */
868
+ languageLevel: AkcentLanguageLevel | string | null;
869
869
  /** lessons with a teacher the student had; 12 until set */
870
870
  lessonsDone: number;
871
871
  /** lessons in the course; 12 until set */
@@ -878,7 +878,7 @@ declare module 'nazar-salary' {
878
878
 
879
879
  export type AkcentLanguageLevel = 'A1' | 'A2' | 'B1' | 'B2' | 'C1' | 'C2';
880
880
 
881
- /** Send only what changes; null puts the default back (B2, 12, 12). */
881
+ /** Send only what changes; null puts the default back (no level, 12, 12, no teacher). */
882
882
  export interface UpdateAkcentCourseData {
883
883
  languageLevel?: AkcentLanguageLevel | null;
884
884
  /** 0–1000, not more than lessonsTotal */
@@ -892,7 +892,7 @@ declare module 'nazar-salary' {
892
892
  export interface UpdateAkcentCourseResponse {
893
893
  userId: string;
894
894
  courseId: number;
895
- languageLevel: AkcentLanguageLevel | string;
895
+ languageLevel: AkcentLanguageLevel | string | null;
896
896
  lessonsDone: number;
897
897
  lessonsTotal: number;
898
898
  teacher_full_name: string | null;
@@ -923,7 +923,7 @@ declare module 'nazar-salary' {
923
923
  course_name: string;
924
924
  /** null when no teacher was given */
925
925
  teacher_full_name: string | null;
926
- languageLevel: AkcentLanguageLevel | string;
926
+ languageLevel: AkcentLanguageLevel | string | null;
927
927
  lessonsDone: number;
928
928
  lessonsTotal: number;
929
929
  totalGrade: number;
@@ -952,7 +952,8 @@ declare module 'nazar-salary' {
952
952
  course_name: string;
953
953
  /** optional, up to 201 characters; without it the check page shows the certificate's type and the PDF has no teacher line */
954
954
  teacher_full_name?: string | null;
955
- languageLevel: AkcentLanguageLevel;
955
+ /** optional; without it the check page and the PDF show no level */
956
+ languageLevel?: AkcentLanguageLevel | null;
956
957
  /** 0–1000, not more than lessonsTotal */
957
958
  lessonsDone: number;
958
959
  /** 1–1000 */
@@ -1606,6 +1607,56 @@ declare module 'nazar-salary' {
1606
1607
  students: ManagerFinishedStudentItem[];
1607
1608
  }
1608
1609
 
1610
+ /** GET /admin/students/active — every filter optional, manager_id included */
1611
+ export interface AdminStudentsListParams {
1612
+ manager_id?: number;
1613
+ teacher_id?: number;
1614
+ prepayment?: boolean;
1615
+ is_verified?: boolean;
1616
+ price_id?: number;
1617
+ created_from?: string;
1618
+ created_to?: string;
1619
+ main_course?: string;
1620
+ page?: number;
1621
+ /** Max 30 */
1622
+ limit?: number;
1623
+ }
1624
+
1625
+ export interface AdminStudentListItem extends Omit<StudentListItem, 'manager_name'> {
1626
+ owned_by: number;
1627
+ /** "First Last" of the student's manager */
1628
+ manager_name: string | null;
1629
+ }
1630
+
1631
+ export interface AdminStudentsListResponse {
1632
+ total_students: number;
1633
+ current_page: number;
1634
+ total_pages: number;
1635
+ students: AdminStudentListItem[];
1636
+ }
1637
+
1638
+ /** GET /admin/students/finished */
1639
+ export interface AdminFinishedStudentsParams {
1640
+ manager_id?: number;
1641
+ teacher_id?: number;
1642
+ search?: string;
1643
+ page?: number;
1644
+ /** Max 30 */
1645
+ limit?: number;
1646
+ }
1647
+
1648
+ export interface AdminFinishedStudentItem extends ManagerFinishedStudentItem {
1649
+ owned_by: number;
1650
+ manager_name: string | null;
1651
+ }
1652
+
1653
+ export interface AdminFinishedStudentsResponse {
1654
+ total_students: number;
1655
+ current_page: number;
1656
+ total_pages: number;
1657
+ students: AdminFinishedStudentItem[];
1658
+ }
1659
+
1609
1660
  export interface StudentsListLiteParams {
1610
1661
  page?: number;
1611
1662
  }
@@ -1893,6 +1944,8 @@ declare module 'nazar-salary' {
1893
1944
 
1894
1945
  /** Get finished (inactive course) students of specific manager (Admin only) */
1895
1946
  getManagerFinishedStudents(managerId: number, params?: ManagerFinishedStudentsParams): Promise<ManagerFinishedStudentsResponse>;
1947
+ getAdminActiveStudents(params?: AdminStudentsListParams): Promise<AdminStudentsListResponse>;
1948
+ getAdminFinishedStudents(params?: AdminFinishedStudentsParams): Promise<AdminFinishedStudentsResponse>;
1896
1949
 
1897
1950
  // Dashboard endpoints
1898
1951
  /**
package/index.js CHANGED
@@ -339,6 +339,24 @@ class SalaryAPI {
339
339
  );
340
340
  }
341
341
 
342
+ /**
343
+ * Active students of all managers or one (manager_id), with manager_name (Admin only)
344
+ * @param {object} [params] - { manager_id?, teacher_id?, prepayment?, is_verified?, price_id?, created_from?, created_to?, main_course?, page?, limit? (max 30) }
345
+ * @returns {Promise<AdminStudentsListResponse>}
346
+ */
347
+ async getAdminActiveStudents(params = {}) {
348
+ return await this.client.get("/api/v1/admin/students/active", { params });
349
+ }
350
+
351
+ /**
352
+ * Finished students (completed_lessons = total_lessons) of all managers or one, with manager_name (Admin only)
353
+ * @param {object} [params] - { manager_id?, teacher_id?, search?, page?, limit? (max 30) }
354
+ * @returns {Promise<AdminFinishedStudentsResponse>}
355
+ */
356
+ async getAdminFinishedStudents(params = {}) {
357
+ return await this.client.get("/api/v1/admin/students/finished", { params });
358
+ }
359
+
342
360
  /**
343
361
  * Get manager salary for specific month (Admin only)
344
362
  * @param {string} month - Month in YYYY-MM format
@@ -784,7 +802,7 @@ class SalaryAPI {
784
802
  * Give an Akcent certificate for an offline course (requireAuth: admin or owner manager)
785
803
  * Same student, course_name and day again updates the certificate given before.
786
804
  * @param {number} studentId - Student ID
787
- * @param {object} data - { course_name, teacher_full_name?, languageLevel, lessonsDone, lessonsTotal, given_date?, totalGrade? }
805
+ * @param {object} data - { course_name, teacher_full_name?, languageLevel?, lessonsDone, lessonsTotal, given_date?, totalGrade? }
788
806
  * @returns {Promise<CreateOfflineCertificateResponse>}
789
807
  */
790
808
  async createStudentOfflineCertificate(studentId, data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nazar-salary",
3
- "version": "3.5.6",
3
+ "version": "3.5.8",
4
4
  "description": "Frontend library for Nazar Salary API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",