washday-sdk 0.0.94 → 0.0.96
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/dist/api/cfdi/post.js +2 -1
- package/package.json +1 -1
- package/src/api/cfdi/post.ts +2 -1
- package/src/api/index.ts +6 -0
- package/src/api/order/put.ts +85 -0
- package/src/interfaces/Api.ts +6 -0
package/dist/api/cfdi/post.js
CHANGED
|
@@ -26,11 +26,12 @@ export const createCFDI = function (id, data) {
|
|
|
26
26
|
};
|
|
27
27
|
export const createGlobalCFDI = function (data) {
|
|
28
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
var _a;
|
|
29
30
|
try {
|
|
30
31
|
const config = {
|
|
31
32
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
33
|
};
|
|
33
|
-
return yield axiosInstance.post(`${GET_SET_CFDI}/global`, data, config);
|
|
34
|
+
return yield axiosInstance.post(`${GET_SET_CFDI}/global`, Object.assign(Object.assign({}, data), { ordersID: (_a = data.ordersID) === null || _a === void 0 ? void 0 : _a.join(',') }), config);
|
|
34
35
|
}
|
|
35
36
|
catch (error) {
|
|
36
37
|
console.error('Error fetching create:', error);
|
package/package.json
CHANGED
package/src/api/cfdi/post.ts
CHANGED
|
@@ -25,6 +25,7 @@ export const createCFDI = async function (this: WashdayClientInstance, id: strin
|
|
|
25
25
|
export const createGlobalCFDI = async function (this: WashdayClientInstance, data: {
|
|
26
26
|
ordersID: string[],
|
|
27
27
|
CFDIInfo: {
|
|
28
|
+
sendEmailInvoice: boolean
|
|
28
29
|
use: string
|
|
29
30
|
payment_method: string
|
|
30
31
|
payment_form: string
|
|
@@ -42,7 +43,7 @@ export const createGlobalCFDI = async function (this: WashdayClientInstance, dat
|
|
|
42
43
|
const config = {
|
|
43
44
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
44
45
|
};
|
|
45
|
-
return await axiosInstance.post(`${GET_SET_CFDI}/global`, data, config);
|
|
46
|
+
return await axiosInstance.post(`${GET_SET_CFDI}/global`, { ...data, ordersID: data.ordersID?.join(',') }, config);
|
|
46
47
|
} catch (error) {
|
|
47
48
|
console.error('Error fetching create:', error);
|
|
48
49
|
throw error;
|
package/src/api/index.ts
CHANGED
|
@@ -74,6 +74,12 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
74
74
|
fetchOrdersForCFDI: ordersEndpoints.getModule.fetchOrdersForCFDI,
|
|
75
75
|
updateById: ordersEndpoints.putModule.updateById,
|
|
76
76
|
updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
|
|
77
|
+
setOrderCancelledBySequence: ordersEndpoints.putModule.setOrderCancelledBySequence,
|
|
78
|
+
setOrderCleanedBySequence: ordersEndpoints.putModule.setOrderCleanedBySequence,
|
|
79
|
+
setOrderCollectedBySequence: ordersEndpoints.putModule.setOrderCollectedBySequence,
|
|
80
|
+
setOrdePickingBySequence: ordersEndpoints.putModule.setOrdePickingBySequence,
|
|
81
|
+
setOrdeDeliveringBySequence: ordersEndpoints.putModule.setOrdeDeliveringBySequence,
|
|
82
|
+
setOrdeDeliveredBySequence: ordersEndpoints.putModule.setOrdeDeliveredBySequence,
|
|
77
83
|
createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
|
|
78
84
|
sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
|
|
79
85
|
deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
|
package/src/api/order/put.ts
CHANGED
|
@@ -50,4 +50,89 @@ export const updatePaymentLineById = async function (this: WashdayClientInstance
|
|
|
50
50
|
console.error('Error fetching updateById:', error);
|
|
51
51
|
throw error;
|
|
52
52
|
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const setOrderCancelledBySequence = async function (this: WashdayClientInstance, sequence: string, storeId: string, data: {
|
|
56
|
+
cancelledDateTime: string
|
|
57
|
+
}): Promise<any> {
|
|
58
|
+
try {
|
|
59
|
+
const config = {
|
|
60
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
61
|
+
};
|
|
62
|
+
return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/cancelled`, data, config);
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.error('Error fetching setOrderCancelledBySequence:', error);
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const setOrderCleanedBySequence = async function (this: WashdayClientInstance, sequence: string, storeId: string, data: {
|
|
70
|
+
cleanedDateTime: string,
|
|
71
|
+
readyDateTime: string
|
|
72
|
+
}): Promise<any> {
|
|
73
|
+
try {
|
|
74
|
+
const config = {
|
|
75
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
76
|
+
};
|
|
77
|
+
return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/cleaned`, data, config);
|
|
78
|
+
} catch (error) {
|
|
79
|
+
console.error('Error fetching setOrderCleanedBySequence:', error);
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const setOrderCollectedBySequence = async function (this: WashdayClientInstance, sequence: string, storeId: string, data: {
|
|
85
|
+
collectedDateTime: string
|
|
86
|
+
}): Promise<any> {
|
|
87
|
+
try {
|
|
88
|
+
const config = {
|
|
89
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
90
|
+
};
|
|
91
|
+
return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/collected`, data, config);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
console.error('Error fetching setOrderCollectedBySequence:', error);
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const setOrdePickingBySequence = async function (this: WashdayClientInstance, sequence: string, storeId: string, data: {
|
|
99
|
+
pickingUpDateTime: string
|
|
100
|
+
}): Promise<any> {
|
|
101
|
+
try {
|
|
102
|
+
const config = {
|
|
103
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
104
|
+
};
|
|
105
|
+
return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/picking`, data, config);
|
|
106
|
+
} catch (error) {
|
|
107
|
+
console.error('Error fetching setOrdePickingBySequence:', error);
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const setOrdeDeliveringBySequence = async function (this: WashdayClientInstance, sequence: string, storeId: string, data: {
|
|
113
|
+
deliveringDateTime: string
|
|
114
|
+
}): Promise<any> {
|
|
115
|
+
try {
|
|
116
|
+
const config = {
|
|
117
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
118
|
+
};
|
|
119
|
+
return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/delivering`, data, config);
|
|
120
|
+
} catch (error) {
|
|
121
|
+
console.error('Error fetching setOrdeDeliveringBySequence:', error);
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const setOrdeDeliveredBySequence = async function (this: WashdayClientInstance, sequence: string, storeId: string, data: {
|
|
127
|
+
collectedDateTime: string
|
|
128
|
+
}): Promise<any> {
|
|
129
|
+
try {
|
|
130
|
+
const config = {
|
|
131
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
132
|
+
};
|
|
133
|
+
return await axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/delivered`, data, config);
|
|
134
|
+
} catch (error) {
|
|
135
|
+
console.error('Error fetching setOrdeDeliveredBySequence:', error);
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
53
138
|
};
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -60,6 +60,12 @@ export interface WashdayClientInstance {
|
|
|
60
60
|
fetchOrdersForCFDI: typeof ordersEndpoints.getModule.fetchOrdersForCFDI;
|
|
61
61
|
updateById: typeof ordersEndpoints.putModule.updateById;
|
|
62
62
|
updatePaymentLineById: typeof ordersEndpoints.putModule.updatePaymentLineById;
|
|
63
|
+
setOrderCancelledBySequence: typeof ordersEndpoints.putModule.setOrderCancelledBySequence,
|
|
64
|
+
setOrderCleanedBySequence: typeof ordersEndpoints.putModule.setOrderCleanedBySequence,
|
|
65
|
+
setOrderCollectedBySequence: typeof ordersEndpoints.putModule.setOrderCollectedBySequence,
|
|
66
|
+
setOrdePickingBySequence: typeof ordersEndpoints.putModule.setOrdePickingBySequence,
|
|
67
|
+
setOrdeDeliveringBySequence: typeof ordersEndpoints.putModule.setOrdeDeliveringBySequence,
|
|
68
|
+
setOrdeDeliveredBySequence: typeof ordersEndpoints.putModule.setOrdeDeliveredBySequence,
|
|
63
69
|
createPaymentLine: typeof ordersEndpoints.postModule.createPaymentLine;
|
|
64
70
|
deletePaymentLineById: typeof ordersEndpoints.deleteModule.deletePaymentLineById;
|
|
65
71
|
};
|