washday-sdk 1.1.0 → 1.1.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/README.md CHANGED
@@ -112,6 +112,7 @@ npm test
112
112
 
113
113
  ## 🆕 What's New
114
114
 
115
+ - **v1.1.1**: 🐛 Fixed missing parameters in attendance endpoints (`userId` in getHistory/getStatus, `storeId` in clockOut)
115
116
  - **v1.1.0**: ✨ Added Attendance module with clock-in/out functionality
116
117
  - **v1.0.2**: 🔧 Enhanced order management features
117
118
 
@@ -16,6 +16,8 @@ export const getHistory = function (params) {
16
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
17
  };
18
18
  let queryParams = '';
19
+ if (params.userId)
20
+ queryParams += `userId=${params.userId}&`; // ✅ AÑADIDO
19
21
  if (params.storeId)
20
22
  queryParams += `storeId=${params.storeId}&`;
21
23
  if (params.startDate)
@@ -45,7 +47,11 @@ export const getStatus = function (params) {
45
47
  };
46
48
  let queryParams = '';
47
49
  if (params === null || params === void 0 ? void 0 : params.storeId)
48
- queryParams += `storeId=${params.storeId}`;
50
+ queryParams += `storeId=${params.storeId}&`;
51
+ if (params === null || params === void 0 ? void 0 : params.userId)
52
+ queryParams += `userId=${params.userId}&`; // ✅ ARREGLADO - añadir &
53
+ // Remove trailing '&'
54
+ queryParams = queryParams.slice(0, -1);
49
55
  const url = queryParams ? `${ATTENDANCE_API}/status?${queryParams}` : `${ATTENDANCE_API}/status`;
50
56
  return yield axiosInstance.get(url, config);
51
57
  }
package/docs/README.md CHANGED
@@ -46,6 +46,7 @@ Welcome to the Washday SDK documentation! This folder contains comprehensive gui
46
46
 
47
47
  ## 🆕 What's New
48
48
 
49
+ - **v1.1.1**: 🐛 Fixed missing parameters in attendance endpoints (`userId` in getHistory/getStatus, `storeId` in clockOut)
49
50
  - **v1.1.0**: Added Attendance module with clock-in/out functionality
50
51
  - **v1.0.2**: Enhanced order management features
51
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -4,6 +4,7 @@ import axiosInstance from "../axiosInstance";
4
4
  const ATTENDANCE_API = 'api/attendance';
5
5
 
6
6
  export const getHistory = async function (this: WashdayClientInstance, params: {
7
+ userId?: string; // ✅ AÑADIDO - requerido por backend
7
8
  storeId?: string;
8
9
  startDate?: string;
9
10
  endDate?: string;
@@ -16,6 +17,7 @@ export const getHistory = async function (this: WashdayClientInstance, params: {
16
17
  };
17
18
 
18
19
  let queryParams = '';
20
+ if (params.userId) queryParams += `userId=${params.userId}&`; // ✅ AÑADIDO
19
21
  if (params.storeId) queryParams += `storeId=${params.storeId}&`;
20
22
  if (params.startDate) queryParams += `startDate=${params.startDate}&`;
21
23
  if (params.endDate) queryParams += `endDate=${params.endDate}&`;
@@ -35,6 +37,7 @@ export const getHistory = async function (this: WashdayClientInstance, params: {
35
37
 
36
38
  export const getStatus = async function (this: WashdayClientInstance, params?: {
37
39
  storeId?: string;
40
+ userId?: string;
38
41
  }): Promise<any> {
39
42
  try {
40
43
  const config = {
@@ -42,7 +45,11 @@ export const getStatus = async function (this: WashdayClientInstance, params?: {
42
45
  };
43
46
 
44
47
  let queryParams = '';
45
- if (params?.storeId) queryParams += `storeId=${params.storeId}`;
48
+ if (params?.storeId) queryParams += `storeId=${params.storeId}&`;
49
+ if (params?.userId) queryParams += `userId=${params.userId}&`; // ✅ ARREGLADO - añadir &
50
+
51
+ // Remove trailing '&'
52
+ queryParams = queryParams.slice(0, -1);
46
53
 
47
54
  const url = queryParams ? `${ATTENDANCE_API}/status?${queryParams}` : `${ATTENDANCE_API}/status`;
48
55
  return await axiosInstance.get(url, config);
@@ -22,6 +22,7 @@ export const clockIn = async function (this: WashdayClientInstance, data: {
22
22
 
23
23
  export const clockOut = async function (this: WashdayClientInstance, data: {
24
24
  userId?: string;
25
+ storeId?: string; // ✅ AÑADIDO - requerido por backend
25
26
  ipAddress?: string;
26
27
  notes?: string;
27
28
  }): Promise<any> {