nazar-salary 3.4.7 → 3.4.8

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 +5 -2
  2. package/index.js +6 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -496,7 +496,10 @@ declare module 'nazar-salary' {
496
496
  group_name: string | null;
497
497
  main_course: string;
498
498
  student_history_id: number;
499
+ /** Course start date, ms timestamp */
499
500
  created_at: number;
501
+ /** Student sale/registration date (students.created_at) — what created_from/created_to filter on */
502
+ student_created_at: number;
500
503
  }
501
504
 
502
505
  export interface PriceStudentsResponse {
@@ -1769,8 +1772,8 @@ declare module 'nazar-salary' {
1769
1772
  getPriceHistory(priceId: number): Promise<PriceHistoryResponse>;
1770
1773
  deletePrice(priceId: number): Promise<void>;
1771
1774
  getPricesList(): Promise<PricesListResponse>;
1772
- getPriceStudents(priceId: number, params?: { status?: 'active' | 'inactive'; page?: number; limit?: number }): Promise<PriceStudentsResponse>;
1773
- exportPriceStudents(prices?: number[] | string, options?: { status?: 'active' | 'inactive' }): Promise<ArrayBuffer>;
1775
+ getPriceStudents(priceId: number, params?: { status?: 'active' | 'inactive'; created_from?: string; created_to?: string; page?: number; limit?: number }): Promise<PriceStudentsResponse>;
1776
+ exportPriceStudents(prices?: number[] | string, options?: { status?: 'active' | 'inactive'; created_from?: string; created_to?: string }): Promise<ArrayBuffer>;
1774
1777
 
1775
1778
  // Student endpoints
1776
1779
  createStudent(data: CreateStudentData): Promise<CreateStudentResponse>;
package/index.js CHANGED
@@ -541,6 +541,8 @@ class SalaryAPI {
541
541
  * @param {number} priceId - Price/tariff ID
542
542
  * @param {object} [params]
543
543
  * @param {'active'|'inactive'} [params.status] - Filter by course state
544
+ * @param {string} [params.created_from] - Student sale date from, YYYY-MM-DD or ISO 8601
545
+ * @param {string} [params.created_to] - Student sale date to, inclusive
544
546
  * @param {number} [params.page=1]
545
547
  * @param {number} [params.limit=30] - Max 200
546
548
  * @returns {Promise<PriceStudentsResponse>}
@@ -1073,6 +1075,8 @@ class SalaryAPI {
1073
1075
  * @param {number[]|string} [prices] - Tariff IDs, e.g. [1,2,3] or "1,2,3". Omit for all tariffs
1074
1076
  * @param {object} [options]
1075
1077
  * @param {'active'|'inactive'} [options.status] - Filter by course state
1078
+ * @param {string} [options.created_from] - Student sale date from, YYYY-MM-DD or ISO 8601
1079
+ * @param {string} [options.created_to] - Student sale date to, inclusive
1076
1080
  * @returns {Promise<ArrayBuffer>} Excel file
1077
1081
  */
1078
1082
  async exportPriceStudents(prices, options = {}) {
@@ -1081,6 +1085,8 @@ class SalaryAPI {
1081
1085
  params.prices = Array.isArray(prices) ? prices.join(",") : prices;
1082
1086
  }
1083
1087
  if (options.status !== undefined) params.status = options.status;
1088
+ if (options.created_from !== undefined) params.created_from = options.created_from;
1089
+ if (options.created_to !== undefined) params.created_to = options.created_to;
1084
1090
  return await this.client.get("/api/v1/price/students/export", {
1085
1091
  params,
1086
1092
  responseType: "arraybuffer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nazar-salary",
3
- "version": "3.4.7",
3
+ "version": "3.4.8",
4
4
  "description": "Frontend library for Nazar Salary API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",