nazar-salary 3.5.0 → 3.5.2

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 +12 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -849,6 +849,40 @@ declare module 'nazar-salary' {
849
849
  history: ProgressHistoryEntry[];
850
850
  }
851
851
 
852
+ export interface AkcentCertificate {
853
+ number: string | null;
854
+ /** epoch ms */
855
+ issuedAt: number;
856
+ verifyUrl: string | null;
857
+ /** public PDF link, supports ?lang=ru|kk|en */
858
+ downloadUrl: string | null;
859
+ }
860
+
861
+ export interface AkcentCourse {
862
+ courseId: number;
863
+ title: string;
864
+ cover_image_url: string | null;
865
+ /** percent 0–100, null until graded */
866
+ totalGrade: number | null;
867
+ /** null while the course is not completed */
868
+ certificate: AkcentCertificate | null;
869
+ }
870
+
871
+ export interface AkcentStudent {
872
+ userId: string;
873
+ firstName: string | null;
874
+ lastName: string | null;
875
+ logo_url: string | null;
876
+ phone: string | null;
877
+ courses: AkcentCourse[];
878
+ }
879
+
880
+ export interface StudentCertificatesResponse {
881
+ /** false — no Akcent student with this phone */
882
+ found: boolean;
883
+ student: AkcentStudent | null;
884
+ }
885
+
852
886
  export type StopReason = 'student_quit' | 'moved_away' | 'health_issues' | 'financial' | 'other' | 'refund';
853
887
 
854
888
  export interface StopStudentData {
@@ -1094,15 +1128,21 @@ declare module 'nazar-salary' {
1094
1128
  to?: number;
1095
1129
  /** Filter by manager (admin only; ignored for manager role) */
1096
1130
  manager_id?: number;
1131
+ /** Page number (default 1) */
1132
+ page?: number;
1133
+ /** Items per page (default 20, max 100) */
1134
+ limit?: number;
1097
1135
  }
1098
1136
 
1099
1137
  export interface RefundsListResponse {
1138
+ /** Totals across all refunds matching the filters (not just the current page) */
1100
1139
  summary: {
1101
1140
  count: number;
1102
1141
  total_refund_amount: number;
1103
1142
  total_deduction_amount: number;
1104
1143
  };
1105
1144
  refunds: RefundItem[];
1145
+ pagination: Pagination;
1106
1146
  }
1107
1147
 
1108
1148
  export type TeacherPaymentStatus = 'not_paid' | 'pending' | 'paid';
@@ -1810,6 +1850,7 @@ declare module 'nazar-salary' {
1810
1850
  resumeStudent(studentId: number, data?: ResumeStudentData): Promise<ResumeStudentResponse>;
1811
1851
  resumeMyStudent(studentId: number, data?: ResumeStudentData): Promise<ResumeStudentResponse>;
1812
1852
  getStudent(studentId: number): Promise<StudentDetail>;
1853
+ getStudentCertificates(studentId: number): Promise<StudentCertificatesResponse>;
1813
1854
  searchStudents(params: SearchStudentsParams): Promise<SearchStudentsResponse>;
1814
1855
  getStoppedStudents(params?: StoppedStudentsParams): Promise<StoppedStudentsResponse>;
1815
1856
  getMyStoppedStudents(params?: MyStoppedStudentsParams): Promise<MyStoppedStudentsResponse>;
package/index.js CHANGED
@@ -755,6 +755,16 @@ class SalaryAPI {
755
755
  return await this.client.get(`/api/v1/student/${studentId}`);
756
756
  }
757
757
 
758
+ /**
759
+ * Get student's Akcent Online courses and certificates (requireAuth: admin or owner manager)
760
+ * The backend finds the student in Akcent by phone.
761
+ * @param {number} studentId - Student ID
762
+ * @returns {Promise<StudentCertificatesResponse>}
763
+ */
764
+ async getStudentCertificates(studentId) {
765
+ return await this.client.get(`/api/v1/student/${studentId}/certificates`);
766
+ }
767
+
758
768
  /**
759
769
  * Search students globally (Admin only)
760
770
  * By default returns only active records; pass is_active=false for stopped.
@@ -1052,6 +1062,8 @@ class SalaryAPI {
1052
1062
  * @param {number} [params.from] - Start timestamp (ms)
1053
1063
  * @param {number} [params.to] - End timestamp (ms)
1054
1064
  * @param {number} [params.manager_id] - Filter by manager ID
1065
+ * @param {number} [params.page=1] - Page number
1066
+ * @param {number} [params.limit=20] - Items per page (max 100)
1055
1067
  * @returns {Promise<RefundsListResponse>}
1056
1068
  */
1057
1069
  async getRefunds(params = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nazar-salary",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "description": "Frontend library for Nazar Salary API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",