nazar-salary 3.5.2 → 3.5.4

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 +39 -0
  2. package/index.js +15 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -864,10 +864,47 @@ 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;
869
+ /** lessons with a teacher the student had; 12 until set */
870
+ lessonsDone: number;
871
+ /** lessons in the course; 12 until set */
872
+ lessonsTotal: number;
873
+ /** shown on the check page in place of the certificate's type; null until set */
874
+ teacher_full_name: string | null;
867
875
  /** null while the course is not completed */
868
876
  certificate: AkcentCertificate | null;
869
877
  }
870
878
 
879
+ export type AkcentLanguageLevel = 'A1' | 'A2' | 'B1' | 'B2' | 'C1' | 'C2';
880
+
881
+ /** Send only what changes; null puts the default back (B2, 12, 12). */
882
+ export interface UpdateAkcentCourseData {
883
+ languageLevel?: AkcentLanguageLevel | null;
884
+ /** 0–1000, not more than lessonsTotal */
885
+ lessonsDone?: number | null;
886
+ /** 1–1000 */
887
+ lessonsTotal?: number | null;
888
+ /** up to 201 characters; "" counts as null */
889
+ teacher_full_name?: string | null;
890
+ }
891
+
892
+ export interface UpdateAkcentCourseResponse {
893
+ userId: string;
894
+ courseId: number;
895
+ languageLevel: AkcentLanguageLevel | string;
896
+ lessonsDone: number;
897
+ lessonsTotal: number;
898
+ teacher_full_name: string | null;
899
+ }
900
+
901
+ /** Teacher of the student's latest course in Salary (default for teacher_full_name) */
902
+ export interface CertificatesSalaryTeacher {
903
+ id: number;
904
+ first_name: string | null;
905
+ last_name: string | null;
906
+ }
907
+
871
908
  export interface AkcentStudent {
872
909
  userId: string;
873
910
  firstName: string | null;
@@ -881,6 +918,7 @@ declare module 'nazar-salary' {
881
918
  /** false — no Akcent student with this phone */
882
919
  found: boolean;
883
920
  student: AkcentStudent | null;
921
+ salary_teacher: CertificatesSalaryTeacher | null;
884
922
  }
885
923
 
886
924
  export type StopReason = 'student_quit' | 'moved_away' | 'health_issues' | 'financial' | 'other' | 'refund';
@@ -1851,6 +1889,7 @@ declare module 'nazar-salary' {
1851
1889
  resumeMyStudent(studentId: number, data?: ResumeStudentData): Promise<ResumeStudentResponse>;
1852
1890
  getStudent(studentId: number): Promise<StudentDetail>;
1853
1891
  getStudentCertificates(studentId: number): Promise<StudentCertificatesResponse>;
1892
+ updateStudentCertificateCourse(studentId: number, courseId: number, data: UpdateAkcentCourseData): Promise<UpdateAkcentCourseResponse>;
1854
1893
  searchStudents(params: SearchStudentsParams): Promise<SearchStudentsResponse>;
1855
1894
  getStoppedStudents(params?: StoppedStudentsParams): Promise<StoppedStudentsResponse>;
1856
1895
  getMyStoppedStudents(params?: MyStoppedStudentsParams): Promise<MyStoppedStudentsResponse>;
package/index.js CHANGED
@@ -765,6 +765,21 @@ class SalaryAPI {
765
765
  return await this.client.get(`/api/v1/student/${studentId}/certificates`);
766
766
  }
767
767
 
768
+ /**
769
+ * Set language level and lessons held for one Akcent course (requireAuth: admin or owner manager)
770
+ * Shown on the certificate check page (verifyUrl). Send only what changes; null = default.
771
+ * @param {number} studentId - Student ID
772
+ * @param {number} courseId - Akcent course ID
773
+ * @param {object} data - { languageLevel?, lessonsDone?, lessonsTotal?, teacher_full_name? }
774
+ * @returns {Promise<UpdateAkcentCourseResponse>}
775
+ */
776
+ async updateStudentCertificateCourse(studentId, courseId, data) {
777
+ return await this.client.put(
778
+ `/api/v1/student/${studentId}/certificates/courses/${courseId}`,
779
+ data,
780
+ );
781
+ }
782
+
768
783
  /**
769
784
  * Search students globally (Admin only)
770
785
  * By default returns only active records; pass is_active=false for stopped.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nazar-salary",
3
- "version": "3.5.2",
3
+ "version": "3.5.4",
4
4
  "description": "Frontend library for Nazar Salary API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",