nazar-salary 2.5.0 → 2.6.0
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 +23 -2
- package/index.js +14 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -660,8 +660,7 @@ declare module 'nazar-salary' {
|
|
|
660
660
|
operation_number: string;
|
|
661
661
|
purchase_amount: number;
|
|
662
662
|
prepayment: boolean;
|
|
663
|
-
|
|
664
|
-
kaspi_commission: number;
|
|
663
|
+
commission: number;
|
|
665
664
|
net_amount: number;
|
|
666
665
|
manager_commission: number;
|
|
667
666
|
verified_at: string;
|
|
@@ -949,6 +948,27 @@ declare module 'nazar-salary' {
|
|
|
949
948
|
students: StudentLiteItem[];
|
|
950
949
|
}
|
|
951
950
|
|
|
951
|
+
export interface DeletedPurchaseInfo {
|
|
952
|
+
id: number;
|
|
953
|
+
operation_number: string;
|
|
954
|
+
purchase_amount: number;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
export interface RemainingPayment {
|
|
958
|
+
id: number;
|
|
959
|
+
operation_number: string;
|
|
960
|
+
purchase_amount: number;
|
|
961
|
+
prepayment: boolean;
|
|
962
|
+
is_verified: boolean;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
export interface DeleteStudentPurchaseResponse {
|
|
966
|
+
message: string;
|
|
967
|
+
deleted_purchase: DeletedPurchaseInfo;
|
|
968
|
+
remaining_payments: RemainingPayment[];
|
|
969
|
+
total_purchase_amount: number;
|
|
970
|
+
}
|
|
971
|
+
|
|
952
972
|
export default class SalaryAPI {
|
|
953
973
|
constructor(options?: SalaryAPIOptions);
|
|
954
974
|
|
|
@@ -1013,6 +1033,7 @@ declare module 'nazar-salary' {
|
|
|
1013
1033
|
/** @deprecated Use getStudentsList instead */
|
|
1014
1034
|
getManagerStudents(managerId: number, params?: ManagerStudentsParams): Promise<ManagerStudentsResponse>;
|
|
1015
1035
|
getStudentsListLite(params?: StudentsListLiteParams): Promise<StudentsListLiteResponse>;
|
|
1036
|
+
deleteStudentPurchase(studentId: number, purchaseId: number): Promise<DeleteStudentPurchaseResponse>;
|
|
1016
1037
|
|
|
1017
1038
|
// Custom request
|
|
1018
1039
|
request(method: string, path: string, data?: any): Promise<any>;
|
package/index.js
CHANGED
|
@@ -652,6 +652,20 @@ class SalaryAPI {
|
|
|
652
652
|
return await this.client.get("/api/v1/student/list/lite", { params });
|
|
653
653
|
}
|
|
654
654
|
|
|
655
|
+
/**
|
|
656
|
+
* Delete student purchase/payment (requireAuth)
|
|
657
|
+
* Managers can only delete non-verified payments
|
|
658
|
+
* Admins can delete any payment
|
|
659
|
+
* @param {number} studentId - Student ID
|
|
660
|
+
* @param {number} purchaseId - Purchase ID to delete
|
|
661
|
+
* @returns {Promise<{message: string, deleted_purchase: object, remaining_payments: array, total_purchase_amount: number}>}
|
|
662
|
+
*/
|
|
663
|
+
async deleteStudentPurchase(studentId, purchaseId) {
|
|
664
|
+
return await this.client.delete(
|
|
665
|
+
`/api/v1/student/${studentId}/purchase/${purchaseId}`,
|
|
666
|
+
);
|
|
667
|
+
}
|
|
668
|
+
|
|
655
669
|
// ===== CUSTOM REQUEST =====
|
|
656
670
|
|
|
657
671
|
/**
|