nazar-salary 3.4.9 → 3.5.1
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 +15 -1
- package/index.js +9 -4
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1094,15 +1094,21 @@ declare module 'nazar-salary' {
|
|
|
1094
1094
|
to?: number;
|
|
1095
1095
|
/** Filter by manager (admin only; ignored for manager role) */
|
|
1096
1096
|
manager_id?: number;
|
|
1097
|
+
/** Page number (default 1) */
|
|
1098
|
+
page?: number;
|
|
1099
|
+
/** Items per page (default 20, max 100) */
|
|
1100
|
+
limit?: number;
|
|
1097
1101
|
}
|
|
1098
1102
|
|
|
1099
1103
|
export interface RefundsListResponse {
|
|
1104
|
+
/** Totals across all refunds matching the filters (not just the current page) */
|
|
1100
1105
|
summary: {
|
|
1101
1106
|
count: number;
|
|
1102
1107
|
total_refund_amount: number;
|
|
1103
1108
|
total_deduction_amount: number;
|
|
1104
1109
|
};
|
|
1105
1110
|
refunds: RefundItem[];
|
|
1111
|
+
pagination: Pagination;
|
|
1106
1112
|
}
|
|
1107
1113
|
|
|
1108
1114
|
export type TeacherPaymentStatus = 'not_paid' | 'pending' | 'paid';
|
|
@@ -1719,8 +1725,16 @@ declare module 'nazar-salary' {
|
|
|
1719
1725
|
deduction: TeamSalaryDeduction;
|
|
1720
1726
|
}
|
|
1721
1727
|
|
|
1728
|
+
export interface TeamSalaryDeductionsParams {
|
|
1729
|
+
/** Page number (default 1) */
|
|
1730
|
+
page?: number;
|
|
1731
|
+
/** Items per page (default 20, max 100) */
|
|
1732
|
+
limit?: number;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1722
1735
|
export interface TeamSalaryDeductionsResponse {
|
|
1723
1736
|
deductions: TeamSalaryDeduction[];
|
|
1737
|
+
pagination: Pagination;
|
|
1724
1738
|
}
|
|
1725
1739
|
|
|
1726
1740
|
export default class SalaryAPI {
|
|
@@ -1825,7 +1839,7 @@ declare module 'nazar-salary' {
|
|
|
1825
1839
|
getTeamSalaryTotal(): Promise<TeamSalaryTotal>;
|
|
1826
1840
|
deleteTeamSalaryPrice(priceId: number): Promise<void>;
|
|
1827
1841
|
addTeamSalaryDeduction(data: AddTeamSalaryDeductionData): Promise<TeamSalaryDeductionResponse>;
|
|
1828
|
-
getTeamSalaryDeductions(): Promise<TeamSalaryDeductionsResponse>;
|
|
1842
|
+
getTeamSalaryDeductions(params?: TeamSalaryDeductionsParams): Promise<TeamSalaryDeductionsResponse>;
|
|
1829
1843
|
deleteTeamSalaryDeduction(id: number): Promise<void>;
|
|
1830
1844
|
|
|
1831
1845
|
// Refund endpoints
|
package/index.js
CHANGED
|
@@ -1000,11 +1000,14 @@ class SalaryAPI {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
1002
|
/**
|
|
1003
|
-
* Get list of
|
|
1004
|
-
* @
|
|
1003
|
+
* Get paginated list of team salary deductions (Admin only)
|
|
1004
|
+
* @param {object} [params] - Query parameters
|
|
1005
|
+
* @param {number} [params.page=1] - Page number
|
|
1006
|
+
* @param {number} [params.limit=20] - Items per page (max 100)
|
|
1007
|
+
* @returns {Promise<{deductions: array, pagination: object}>}
|
|
1005
1008
|
*/
|
|
1006
|
-
async getTeamSalaryDeductions() {
|
|
1007
|
-
return await this.client.get("/api/v1/admin/team_salary/deductions");
|
|
1009
|
+
async getTeamSalaryDeductions(params = {}) {
|
|
1010
|
+
return await this.client.get("/api/v1/admin/team_salary/deductions", { params });
|
|
1008
1011
|
}
|
|
1009
1012
|
|
|
1010
1013
|
/**
|
|
@@ -1049,6 +1052,8 @@ class SalaryAPI {
|
|
|
1049
1052
|
* @param {number} [params.from] - Start timestamp (ms)
|
|
1050
1053
|
* @param {number} [params.to] - End timestamp (ms)
|
|
1051
1054
|
* @param {number} [params.manager_id] - Filter by manager ID
|
|
1055
|
+
* @param {number} [params.page=1] - Page number
|
|
1056
|
+
* @param {number} [params.limit=20] - Items per page (max 100)
|
|
1052
1057
|
* @returns {Promise<RefundsListResponse>}
|
|
1053
1058
|
*/
|
|
1054
1059
|
async getRefunds(params = {}) {
|