washday-sdk 0.0.61 → 0.0.62
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/cashierbox/delete.js +31 -14
- package/dist/api/cashierbox/get.js +19 -4
- package/dist/api/cashierbox/post.js +48 -15
- package/dist/api/cashierbox/put.js +32 -15
- package/dist/api/index.js +42 -34
- package/package.json +1 -1
- package/src/api/cashierbox/delete.ts +14 -14
- package/src/api/cashierbox/get.ts +16 -3
- package/src/api/cashierbox/post.ts +36 -15
- package/src/api/cashierbox/put.ts +16 -15
- package/src/api/index.ts +9 -1
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.deleteCashierBoxById = void 0;
|
|
16
|
+
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
+
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
18
|
+
const deleteCashierBoxById = function (storeId, id) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
try {
|
|
21
|
+
const config = {
|
|
22
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
|
+
};
|
|
24
|
+
return yield axiosInstance_1.default.delete(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, config);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error('Error fetching getStoreStaff:', error);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.deleteCashierBoxById = deleteCashierBoxById;
|
|
@@ -12,23 +12,38 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.getCashierboxesById = exports.getCashierboxesByStoreId = void 0;
|
|
16
16
|
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
17
|
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
18
|
-
exports.GET_SET_CASHIER_BOX = GET_SET_CASHIER_BOX;
|
|
19
18
|
const getCashierboxesByStoreId = function (storeId, queryParams) {
|
|
20
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
20
|
try {
|
|
22
21
|
const config = {
|
|
23
22
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
24
23
|
};
|
|
25
|
-
const response = yield axiosInstance_1.default.get(`${
|
|
24
|
+
const response = yield axiosInstance_1.default.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams}`, config);
|
|
26
25
|
return response;
|
|
27
26
|
}
|
|
28
27
|
catch (error) {
|
|
29
|
-
console.error('Error fetching
|
|
28
|
+
console.error('Error fetching getCashierboxesByStoreId:', error);
|
|
30
29
|
throw error;
|
|
31
30
|
}
|
|
32
31
|
});
|
|
33
32
|
};
|
|
34
33
|
exports.getCashierboxesByStoreId = getCashierboxesByStoreId;
|
|
34
|
+
const getCashierboxesById = function (storeId, id, queryParams) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
try {
|
|
37
|
+
const config = {
|
|
38
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
39
|
+
};
|
|
40
|
+
const response = yield axiosInstance_1.default.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}?${queryParams}`, config);
|
|
41
|
+
return response;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error('Error fetching getCashierboxesById:', error);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
exports.getCashierboxesById = getCashierboxesById;
|
|
@@ -1,16 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.addCashierBoxMovement = exports.createCashierBox = void 0;
|
|
16
|
+
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
+
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
18
|
+
const createCashierBox = function (storeId, data) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
try {
|
|
21
|
+
const config = {
|
|
22
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
|
+
};
|
|
24
|
+
const response = yield axiosInstance_1.default.post(`${GET_SET_CASHIER_BOX(storeId)}`, data, config);
|
|
25
|
+
return response;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error('Error fetching getStoreStaff:', error);
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.createCashierBox = createCashierBox;
|
|
34
|
+
const addCashierBoxMovement = function (storeId, id, data) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
try {
|
|
37
|
+
const config = {
|
|
38
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
39
|
+
};
|
|
40
|
+
const response = yield axiosInstance_1.default.post(`${GET_SET_CASHIER_BOX(storeId)}/${id}/add-movement`, data, config);
|
|
41
|
+
return response;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error('Error fetching createStoreImage:', error);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
exports.addCashierBoxMovement = addCashierBoxMovement;
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.updateCashierBoxById = void 0;
|
|
16
|
+
const axiosInstance_1 = __importDefault(require("../axiosInstance"));
|
|
17
|
+
const GET_SET_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
18
|
+
const updateCashierBoxById = function (storeId, id, data) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
try {
|
|
21
|
+
const config = {
|
|
22
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
|
+
};
|
|
24
|
+
const response = yield axiosInstance_1.default.put(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, data, config);
|
|
25
|
+
return response;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error('Error fetching getStoreById:', error);
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.updateCashierBoxById = updateCashierBoxById;
|
package/dist/api/index.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const delete_1 = require("./cashierbox/delete");
|
|
3
4
|
const get_1 = require("./cashierbox/get");
|
|
5
|
+
const post_1 = require("./cashierbox/post");
|
|
6
|
+
const put_1 = require("./cashierbox/put");
|
|
4
7
|
const get_2 = require("./companies/get");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
8
|
+
const post_2 = require("./companies/post");
|
|
9
|
+
const put_2 = require("./companies/put");
|
|
7
10
|
const get_3 = require("./countries/get");
|
|
8
11
|
const get_4 = require("./customers/get");
|
|
9
12
|
const get_5 = require("./discounts/get");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
+
const post_3 = require("./discounts/post");
|
|
14
|
+
const put_3 = require("./discounts/put");
|
|
15
|
+
const put_4 = require("./products/put");
|
|
13
16
|
const get_6 = require("./sections/get");
|
|
14
|
-
const
|
|
17
|
+
const delete_2 = require("./staff/delete");
|
|
15
18
|
const get_7 = require("./staff/get");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
19
|
+
const post_4 = require("./staff/post");
|
|
20
|
+
const put_5 = require("./staff/put");
|
|
18
21
|
const get_8 = require("./stores/get");
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
22
|
+
const post_5 = require("./stores/post");
|
|
23
|
+
const put_6 = require("./stores/put");
|
|
24
|
+
const post_6 = require("./stripe/post");
|
|
25
|
+
const put_7 = require("./users/put");
|
|
23
26
|
const WashdayClient = function WashdayClient(apiToken) {
|
|
24
27
|
this.apiToken = apiToken;
|
|
25
28
|
WashdayClient.prototype.customers.apiToken = apiToken;
|
|
@@ -45,56 +48,61 @@ WashdayClient.prototype.customers = {
|
|
|
45
48
|
WashdayClient.prototype.stores = {
|
|
46
49
|
getStores: get_8.getStores,
|
|
47
50
|
getStoreById: get_8.getStoreById,
|
|
48
|
-
createStore:
|
|
49
|
-
copyStore:
|
|
50
|
-
updateStoreById:
|
|
51
|
-
createStoreImage:
|
|
51
|
+
createStore: post_5.createStore,
|
|
52
|
+
copyStore: post_5.copyStore,
|
|
53
|
+
updateStoreById: put_6.updateStoreById,
|
|
54
|
+
createStoreImage: post_5.createStoreImage,
|
|
52
55
|
getStoreReviewLink: get_8.getStoreReviewLink,
|
|
53
|
-
deleteStoreById:
|
|
56
|
+
deleteStoreById: put_6.deleteStoreById,
|
|
54
57
|
};
|
|
55
58
|
WashdayClient.prototype.products = {
|
|
56
|
-
bulkUpdate:
|
|
59
|
+
bulkUpdate: put_4.bulkUpdate,
|
|
57
60
|
};
|
|
58
61
|
WashdayClient.prototype.users = {
|
|
59
|
-
updateUserById:
|
|
62
|
+
updateUserById: put_7.updateUserById,
|
|
60
63
|
};
|
|
61
64
|
WashdayClient.prototype.countries = {
|
|
62
65
|
getCountries: get_3.getCountries,
|
|
63
66
|
};
|
|
64
67
|
WashdayClient.prototype.cashierboxes = {
|
|
65
68
|
getCashierboxesByStoreId: get_1.getCashierboxesByStoreId,
|
|
69
|
+
getCashierboxesById: get_1.getCashierboxesById,
|
|
70
|
+
createCashierBox: post_1.createCashierBox,
|
|
71
|
+
updateCashierBoxById: put_1.updateCashierBoxById,
|
|
72
|
+
deleteCashierBoxById: delete_1.deleteCashierBoxById,
|
|
73
|
+
addCashierBoxMovement: post_1.addCashierBoxMovement,
|
|
66
74
|
};
|
|
67
75
|
WashdayClient.prototype.companies = {
|
|
68
76
|
getCompanyById: get_2.getCompanyById,
|
|
69
|
-
updateCompanyById:
|
|
70
|
-
updateCompanyLogoById:
|
|
71
|
-
updateCompanyTaxInfoById:
|
|
72
|
-
updateCompanyTaxInfoCertificates:
|
|
73
|
-
updateCFDIOrgLogo:
|
|
77
|
+
updateCompanyById: put_2.updateCompanyById,
|
|
78
|
+
updateCompanyLogoById: put_2.updateCompanyLogoById,
|
|
79
|
+
updateCompanyTaxInfoById: put_2.updateCompanyTaxInfoById,
|
|
80
|
+
updateCompanyTaxInfoCertificates: post_2.updateCompanyTaxInfoCertificates,
|
|
81
|
+
updateCFDIOrgLogo: post_2.updateCFDIOrgLogo
|
|
74
82
|
};
|
|
75
83
|
WashdayClient.prototype.stripe = {
|
|
76
|
-
createCreateSuscriptionCheckoutSession:
|
|
77
|
-
createCFDISuscrptionCheckoutSession:
|
|
78
|
-
createCustomerPortalSession:
|
|
84
|
+
createCreateSuscriptionCheckoutSession: post_6.createCreateSuscriptionCheckoutSession,
|
|
85
|
+
createCFDISuscrptionCheckoutSession: post_6.createCFDISuscrptionCheckoutSession,
|
|
86
|
+
createCustomerPortalSession: post_6.createCustomerPortalSession
|
|
79
87
|
};
|
|
80
88
|
WashdayClient.prototype.staff = {
|
|
81
89
|
getStoreStaff: get_7.getStoreStaff,
|
|
82
90
|
getStoreStaffById: get_7.getStoreStaffById,
|
|
83
|
-
updateStoreStaffById:
|
|
84
|
-
createStoreStaff:
|
|
85
|
-
deleteStoreStaffById:
|
|
91
|
+
updateStoreStaffById: put_5.updateStoreStaffById,
|
|
92
|
+
createStoreStaff: post_4.createStoreStaff,
|
|
93
|
+
deleteStoreStaffById: delete_2.deleteStoreStaffById,
|
|
86
94
|
};
|
|
87
95
|
WashdayClient.prototype.discountCodes = {
|
|
88
96
|
getDiscountCodes: get_5.getDiscountCodes,
|
|
89
97
|
getDiscountCodeById: get_5.getDiscountCodeById,
|
|
90
98
|
verifyDiscountCode: get_5.verifyDiscountCode,
|
|
91
|
-
createDiscountCode:
|
|
92
|
-
deleteDiscountCodeById:
|
|
99
|
+
createDiscountCode: post_3.createDiscountCode,
|
|
100
|
+
deleteDiscountCodeById: put_3.deleteDiscountCodeById,
|
|
93
101
|
};
|
|
94
102
|
WashdayClient.prototype.automaticDiscount = {
|
|
95
103
|
getAutomaticDiscounts: get_5.getAutomaticDiscounts,
|
|
96
104
|
getAutomaticDiscountById: get_5.getAutomaticDiscountById,
|
|
97
|
-
createAutomaticDiscount:
|
|
98
|
-
deleteAutomaticDiscountById:
|
|
105
|
+
createAutomaticDiscount: post_3.createAutomaticDiscount,
|
|
106
|
+
deleteAutomaticDiscountById: put_3.deleteAutomaticDiscountById,
|
|
99
107
|
};
|
|
100
108
|
exports.default = WashdayClient;
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
import axiosInstance from "../axiosInstance";
|
|
3
|
+
const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// };
|
|
5
|
+
export const deleteCashierBoxById = async function (this: WashdayClientInstance, storeId: string, id: string): Promise<any> {
|
|
6
|
+
try {
|
|
7
|
+
const config = {
|
|
8
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
9
|
+
};
|
|
10
|
+
return await axiosInstance.delete(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, config);
|
|
11
|
+
} catch (error) {
|
|
12
|
+
console.error('Error fetching getStoreStaff:', error);
|
|
13
|
+
throw error;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
|
-
import { IStore } from "../../interfaces/Store";
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
|
|
6
5
|
|
|
7
6
|
export const getCashierboxesByStoreId = async function (this: WashdayClientInstance, storeId: string, queryParams?: string): Promise<any> {
|
|
8
7
|
try {
|
|
@@ -12,7 +11,21 @@ export const getCashierboxesByStoreId = async function (this: WashdayClientInsta
|
|
|
12
11
|
const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams}`, config);
|
|
13
12
|
return response;
|
|
14
13
|
} catch (error) {
|
|
15
|
-
console.error('Error fetching
|
|
14
|
+
console.error('Error fetching getCashierboxesByStoreId:', error);
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export const getCashierboxesById = async function (this: WashdayClientInstance, storeId: string, id: string, queryParams?: string): Promise<any> {
|
|
21
|
+
try {
|
|
22
|
+
const config = {
|
|
23
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
24
|
+
};
|
|
25
|
+
const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}?${queryParams}`, config);
|
|
26
|
+
return response;
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error('Error fetching getCashierboxesById:', error);
|
|
16
29
|
throw error;
|
|
17
30
|
}
|
|
18
31
|
};
|
|
@@ -1,17 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
import axiosInstance from "../axiosInstance";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
export const createCashierBox = async function (this: WashdayClientInstance, storeId: string, data: {
|
|
7
|
+
name: string
|
|
8
|
+
}): Promise<any> {
|
|
9
|
+
try {
|
|
10
|
+
const config = {
|
|
11
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
12
|
+
};
|
|
13
|
+
const response = await axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}`, data, config);
|
|
14
|
+
return response;
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error('Error fetching getStoreStaff:', error);
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const addCashierBoxMovement = async function (this: WashdayClientInstance, storeId: string, id: string, data: {
|
|
22
|
+
type: string;
|
|
23
|
+
date: Date;
|
|
24
|
+
amount: number,
|
|
25
|
+
notes?: string;
|
|
26
|
+
paymentMethod: string;
|
|
27
|
+
}): Promise<any> {
|
|
28
|
+
try {
|
|
29
|
+
const config = {
|
|
30
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
31
|
+
};
|
|
32
|
+
const response = await axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}/${id}/add-movement`, data, config);
|
|
33
|
+
return response;
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error('Error fetching createStoreImage:', error);
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// import axiosInstance from "../axiosInstance";
|
|
1
|
+
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
|
+
import axiosInstance from "../axiosInstance";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
const GET_SET_CASHIER_BOX = (storeId: string) => `api/store/${storeId}/cashierbox`;
|
|
5
|
+
|
|
6
|
+
export const updateCashierBoxById = async function (this: WashdayClientInstance, storeId: string, id: string, data: { name: string }): Promise<any> {
|
|
7
|
+
try {
|
|
8
|
+
const config = {
|
|
9
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
|
+
};
|
|
11
|
+
const response = await axiosInstance.put(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, data, config);
|
|
12
|
+
return response;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.error('Error fetching getStoreById:', error);
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
};
|
package/src/api/index.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../interfaces/Api";
|
|
2
|
-
import {
|
|
2
|
+
import { deleteCashierBoxById } from "./cashierbox/delete";
|
|
3
|
+
import { getCashierboxesById, getCashierboxesByStoreId } from "./cashierbox/get";
|
|
4
|
+
import { addCashierBoxMovement, createCashierBox } from "./cashierbox/post";
|
|
5
|
+
import { updateCashierBoxById } from "./cashierbox/put";
|
|
3
6
|
import { getCompanyById } from "./companies/get";
|
|
4
7
|
import { updateCFDIOrgLogo, updateCompanyTaxInfoCertificates } from "./companies/post";
|
|
5
8
|
import { updateCompanyById, updateCompanyLogoById, updateCompanyTaxInfoById } from "./companies/put";
|
|
@@ -77,6 +80,11 @@ WashdayClient.prototype.countries = {
|
|
|
77
80
|
|
|
78
81
|
WashdayClient.prototype.cashierboxes = {
|
|
79
82
|
getCashierboxesByStoreId: getCashierboxesByStoreId,
|
|
83
|
+
getCashierboxesById: getCashierboxesById,
|
|
84
|
+
createCashierBox: createCashierBox,
|
|
85
|
+
updateCashierBoxById: updateCashierBoxById,
|
|
86
|
+
deleteCashierBoxById: deleteCashierBoxById,
|
|
87
|
+
addCashierBoxMovement: addCashierBoxMovement,
|
|
80
88
|
};
|
|
81
89
|
|
|
82
90
|
WashdayClient.prototype.companies = {
|