nazar-salary 3.4.8 → 3.5.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.
Files changed (3) hide show
  1. package/index.d.ts +23 -1
  2. package/index.js +7 -4
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -461,6 +461,10 @@ declare module 'nazar-salary' {
461
461
  active_students: number;
462
462
  /** Distinct students whose courses on this tariff are all closed */
463
463
  inactive_students: number;
464
+ /** Team salary per month per student on this tariff; null if not configured */
465
+ monthly_team_price: number | null;
466
+ /** Sum of monthly_team_price * enrollment_months over active courses (same as /admin/team_salary/total gross, per tariff); null if not configured */
467
+ team_salary_total: number | null;
464
468
  }
465
469
 
466
470
  export interface PricesListResponse {
@@ -483,6 +487,8 @@ declare module 'nazar-salary' {
483
487
  rate_per_lesson: number;
484
488
  /** Gross payments attributed to this student on this tariff */
485
489
  purchase_amount: number;
490
+ /** enrollment_months * monthly_team_price; null if no team_salary config for this price */
491
+ team_salary_amount: number | null;
486
492
  teacher_id: number | null;
487
493
  teacher_name: string | null;
488
494
  /** Owner of the student (student_history.owned_by) */
@@ -511,6 +517,8 @@ declare module 'nazar-salary' {
511
517
  lessons_per_month: number;
512
518
  duration_minutes: number;
513
519
  rate_per_lesson: number;
520
+ /** null if team salary is not configured for this tariff */
521
+ monthly_team_price: number | null;
514
522
  };
515
523
  pagination: {
516
524
  page: number;
@@ -911,6 +919,12 @@ declare module 'nazar-salary' {
911
919
  future_teacher_payment: number;
912
920
  /** Future teacher payments owed for students whose payments fall in the selected month (verified or not). Group courses counted once per group. */
913
921
  future_teacher_payment_from_month: number;
922
+ /** Team salary for sales of the selected month: months sold (new sales, extensions, resales) × tariff monthly_team_price */
923
+ team_salary_gross: number;
924
+ /** Team salary deductions with deduction_date in the selected month */
925
+ team_salary_deductions: number;
926
+ /** team_salary_gross − team_salary_deductions */
927
+ team_salary_net: number;
914
928
  };
915
929
  }
916
930
 
@@ -1705,8 +1719,16 @@ declare module 'nazar-salary' {
1705
1719
  deduction: TeamSalaryDeduction;
1706
1720
  }
1707
1721
 
1722
+ export interface TeamSalaryDeductionsParams {
1723
+ /** Page number (default 1) */
1724
+ page?: number;
1725
+ /** Items per page (default 20, max 100) */
1726
+ limit?: number;
1727
+ }
1728
+
1708
1729
  export interface TeamSalaryDeductionsResponse {
1709
1730
  deductions: TeamSalaryDeduction[];
1731
+ pagination: Pagination;
1710
1732
  }
1711
1733
 
1712
1734
  export default class SalaryAPI {
@@ -1811,7 +1833,7 @@ declare module 'nazar-salary' {
1811
1833
  getTeamSalaryTotal(): Promise<TeamSalaryTotal>;
1812
1834
  deleteTeamSalaryPrice(priceId: number): Promise<void>;
1813
1835
  addTeamSalaryDeduction(data: AddTeamSalaryDeductionData): Promise<TeamSalaryDeductionResponse>;
1814
- getTeamSalaryDeductions(): Promise<TeamSalaryDeductionsResponse>;
1836
+ getTeamSalaryDeductions(params?: TeamSalaryDeductionsParams): Promise<TeamSalaryDeductionsResponse>;
1815
1837
  deleteTeamSalaryDeduction(id: number): Promise<void>;
1816
1838
 
1817
1839
  // Refund endpoints
package/index.js CHANGED
@@ -1000,11 +1000,14 @@ class SalaryAPI {
1000
1000
  }
1001
1001
 
1002
1002
  /**
1003
- * Get list of all team salary deductions (Admin only)
1004
- * @returns {Promise<{deductions: array}>}
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
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nazar-salary",
3
- "version": "3.4.8",
3
+ "version": "3.5.0",
4
4
  "description": "Frontend library for Nazar Salary API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",