nazar-salary 3.5.4 → 3.5.6
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 +50 -1
- package/index.js +15 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -912,13 +912,61 @@ declare module 'nazar-salary' {
|
|
|
912
912
|
logo_url: string | null;
|
|
913
913
|
phone: string | null;
|
|
914
914
|
courses: AkcentCourse[];
|
|
915
|
+
/** certificates for offline courses, newest first */
|
|
916
|
+
offline_certificates: AkcentOfflineCertificate[];
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
export interface AkcentOfflineCertificate {
|
|
920
|
+
number: string;
|
|
921
|
+
/** given_date, epoch ms */
|
|
922
|
+
issuedAt: number;
|
|
923
|
+
course_name: string;
|
|
924
|
+
/** null when no teacher was given */
|
|
925
|
+
teacher_full_name: string | null;
|
|
926
|
+
languageLevel: AkcentLanguageLevel | string;
|
|
927
|
+
lessonsDone: number;
|
|
928
|
+
lessonsTotal: number;
|
|
929
|
+
totalGrade: number;
|
|
930
|
+
verifyUrl: string;
|
|
931
|
+
downloadUrl: string;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/** Latest course of the student in Salary (defaults for forms) */
|
|
935
|
+
export interface CertificatesSalaryCourse {
|
|
936
|
+
completed_lessons: number;
|
|
937
|
+
total_lessons: number;
|
|
915
938
|
}
|
|
916
939
|
|
|
917
940
|
export interface StudentCertificatesResponse {
|
|
918
|
-
/** false —
|
|
941
|
+
/** false — the student could not be loaded from Akcent */
|
|
919
942
|
found: boolean;
|
|
943
|
+
/** true — the student was just created in Akcent by this request */
|
|
944
|
+
created: boolean;
|
|
920
945
|
student: AkcentStudent | null;
|
|
921
946
|
salary_teacher: CertificatesSalaryTeacher | null;
|
|
947
|
+
salary_course: CertificatesSalaryCourse | null;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
export interface CreateOfflineCertificateData {
|
|
951
|
+
/** up to 255 characters */
|
|
952
|
+
course_name: string;
|
|
953
|
+
/** optional, up to 201 characters; without it the check page shows the certificate's type and the PDF has no teacher line */
|
|
954
|
+
teacher_full_name?: string | null;
|
|
955
|
+
languageLevel: AkcentLanguageLevel;
|
|
956
|
+
/** 0–1000, not more than lessonsTotal */
|
|
957
|
+
lessonsDone: number;
|
|
958
|
+
/** 1–1000 */
|
|
959
|
+
lessonsTotal: number;
|
|
960
|
+
/** "YYYY-MM-DD" (Almaty day), ISO date-time or epoch ms; today by default; not later than tomorrow */
|
|
961
|
+
given_date?: string | number;
|
|
962
|
+
/** 0–100, 95 by default */
|
|
963
|
+
totalGrade?: number;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
export interface CreateOfflineCertificateResponse {
|
|
967
|
+
/** false — the certificate given before for this student, course and day (updated) */
|
|
968
|
+
created: boolean;
|
|
969
|
+
certificate: AkcentOfflineCertificate;
|
|
922
970
|
}
|
|
923
971
|
|
|
924
972
|
export type StopReason = 'student_quit' | 'moved_away' | 'health_issues' | 'financial' | 'other' | 'refund';
|
|
@@ -1890,6 +1938,7 @@ declare module 'nazar-salary' {
|
|
|
1890
1938
|
getStudent(studentId: number): Promise<StudentDetail>;
|
|
1891
1939
|
getStudentCertificates(studentId: number): Promise<StudentCertificatesResponse>;
|
|
1892
1940
|
updateStudentCertificateCourse(studentId: number, courseId: number, data: UpdateAkcentCourseData): Promise<UpdateAkcentCourseResponse>;
|
|
1941
|
+
createStudentOfflineCertificate(studentId: number, data: CreateOfflineCertificateData): Promise<CreateOfflineCertificateResponse>;
|
|
1893
1942
|
searchStudents(params: SearchStudentsParams): Promise<SearchStudentsResponse>;
|
|
1894
1943
|
getStoppedStudents(params?: StoppedStudentsParams): Promise<StoppedStudentsResponse>;
|
|
1895
1944
|
getMyStoppedStudents(params?: MyStoppedStudentsParams): Promise<MyStoppedStudentsResponse>;
|
package/index.js
CHANGED
|
@@ -757,7 +757,7 @@ class SalaryAPI {
|
|
|
757
757
|
|
|
758
758
|
/**
|
|
759
759
|
* Get student's Akcent Online courses and certificates (requireAuth: admin or owner manager)
|
|
760
|
-
* The backend finds the student in Akcent by phone.
|
|
760
|
+
* The backend finds the student in Akcent by phone and creates them there if missing.
|
|
761
761
|
* @param {number} studentId - Student ID
|
|
762
762
|
* @returns {Promise<StudentCertificatesResponse>}
|
|
763
763
|
*/
|
|
@@ -780,6 +780,20 @@ class SalaryAPI {
|
|
|
780
780
|
);
|
|
781
781
|
}
|
|
782
782
|
|
|
783
|
+
/**
|
|
784
|
+
* Give an Akcent certificate for an offline course (requireAuth: admin or owner manager)
|
|
785
|
+
* Same student, course_name and day again updates the certificate given before.
|
|
786
|
+
* @param {number} studentId - Student ID
|
|
787
|
+
* @param {object} data - { course_name, teacher_full_name?, languageLevel, lessonsDone, lessonsTotal, given_date?, totalGrade? }
|
|
788
|
+
* @returns {Promise<CreateOfflineCertificateResponse>}
|
|
789
|
+
*/
|
|
790
|
+
async createStudentOfflineCertificate(studentId, data) {
|
|
791
|
+
return await this.client.post(
|
|
792
|
+
`/api/v1/student/${studentId}/certificates`,
|
|
793
|
+
data,
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
|
|
783
797
|
/**
|
|
784
798
|
* Search students globally (Admin only)
|
|
785
799
|
* By default returns only active records; pass is_active=false for stopped.
|