starta.apiclient 1.37.3593 → 1.37.3604
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/lib/services/organizations/cashRegisterOperations.d.ts +24 -0
- package/lib/services/organizations/cashRegisterOperations.js +33 -0
- package/lib/services/organizations/cashRegisterShifts.d.ts +6 -0
- package/lib/services/organizations/cashRegisterShifts.js +15 -0
- package/lib/services/organizations/cashRegisters.d.ts +21 -0
- package/lib/services/organizations/cashRegisters.js +56 -0
- package/lib/services/organizations/index.d.ts +11 -0
- package/lib/services/organizations/index.js +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StartaRequestRunner } from '../../types';
|
|
2
|
+
export default class CashRegisterOperations {
|
|
3
|
+
private _requestRunner;
|
|
4
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
5
|
+
index(organizationLogin: string, { branchId, dateFrom, dateTo, operationSubtype, cashRegisterId, }: {
|
|
6
|
+
branchId?: string;
|
|
7
|
+
dateFrom?: string;
|
|
8
|
+
dateTo?: string;
|
|
9
|
+
operationSubtype?: 'provisionOfServices' | 'saleOfProducts' | 'purchaseOfMaterials' | 'purchaseOfProducts' | 'employeeSalaries' | 'taxesAndFees' | 'otherIncome' | 'otherExpenses';
|
|
10
|
+
cashRegisterId?: string;
|
|
11
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
12
|
+
add(organizationLogin: string, { cashRegisterId, branchId, operationType, operationSubtype, receiverType, recipient, recipientLogin, amount, comment, date, }: {
|
|
13
|
+
cashRegisterId: string;
|
|
14
|
+
branchId?: string;
|
|
15
|
+
operationType: 'income' | 'expenses';
|
|
16
|
+
operationSubtype: 'provisionOfServices' | 'saleOfProducts' | 'purchaseOfMaterials' | 'purchaseOfProducts' | 'employeeSalaries' | 'taxesAndFees' | 'otherIncome' | 'otherExpenses';
|
|
17
|
+
receiverType: 'counterparty' | 'customer' | 'employee';
|
|
18
|
+
recipient?: string;
|
|
19
|
+
recipientLogin?: string;
|
|
20
|
+
amount: number;
|
|
21
|
+
comment?: string;
|
|
22
|
+
date: Date;
|
|
23
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _helpers_1 = require("../_helpers");
|
|
4
|
+
class CashRegisterOperations {
|
|
5
|
+
constructor(requestRunner) {
|
|
6
|
+
this._requestRunner = requestRunner;
|
|
7
|
+
}
|
|
8
|
+
index(organizationLogin, { branchId, dateFrom, dateTo, operationSubtype, cashRegisterId, }) {
|
|
9
|
+
return this._requestRunner.performRequest({
|
|
10
|
+
url: `accounts/${organizationLogin}/cashRegisterOperations${(0, _helpers_1.buildQuery)({ branchId, dateFrom, dateTo, operationSubtype, cashRegisterId })}`,
|
|
11
|
+
method: 'GET',
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
add(organizationLogin, { cashRegisterId, branchId, operationType, operationSubtype, receiverType, recipient, recipientLogin, amount, comment, date, }) {
|
|
15
|
+
return this._requestRunner.performRequest({
|
|
16
|
+
url: `accounts/${organizationLogin}/cashRegisterOperations`,
|
|
17
|
+
method: 'POST',
|
|
18
|
+
body: {
|
|
19
|
+
cashRegisterId,
|
|
20
|
+
branchId,
|
|
21
|
+
operationType,
|
|
22
|
+
operationSubtype,
|
|
23
|
+
receiverType,
|
|
24
|
+
recipient,
|
|
25
|
+
recipientLogin,
|
|
26
|
+
amount,
|
|
27
|
+
comment,
|
|
28
|
+
date,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = CashRegisterOperations;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StartaRequestRunner } from '../../types';
|
|
2
|
+
export default class CashRegisterShifts {
|
|
3
|
+
private _requestRunner;
|
|
4
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
5
|
+
index(organizationLogin: string, branchId?: string): Promise<import("../../types").StartaResponse>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _helpers_1 = require("../_helpers");
|
|
4
|
+
class CashRegisterShifts {
|
|
5
|
+
constructor(requestRunner) {
|
|
6
|
+
this._requestRunner = requestRunner;
|
|
7
|
+
}
|
|
8
|
+
index(organizationLogin, branchId) {
|
|
9
|
+
return this._requestRunner.performRequest({
|
|
10
|
+
url: `accounts/${organizationLogin}/cashRegisterShifts${(0, _helpers_1.buildQuery)({ branchId })}`,
|
|
11
|
+
method: 'GET',
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = CashRegisterShifts;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StartaRequestRunner } from '../../types';
|
|
2
|
+
export default class CashRegisters {
|
|
3
|
+
private _requestRunner;
|
|
4
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
5
|
+
index(organizationLogin: string, branchId?: string): Promise<import("../../types").StartaResponse>;
|
|
6
|
+
add(organizationLogin: string, { name, type, balance, description, branchId, }: {
|
|
7
|
+
name: string;
|
|
8
|
+
type: 'cash' | 'nonCash';
|
|
9
|
+
balance: number;
|
|
10
|
+
description?: string;
|
|
11
|
+
branchId?: string;
|
|
12
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
13
|
+
update(organizationLogin: string, cashRegisterId: string, { name, type, description, branchId, }: {
|
|
14
|
+
name: string;
|
|
15
|
+
type: 'cash' | 'nonCash';
|
|
16
|
+
description?: string;
|
|
17
|
+
branchId?: string;
|
|
18
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
19
|
+
delete(organizationLogin: string, cashRegisterId: string): Promise<import("../../types").StartaResponse>;
|
|
20
|
+
setDefaults(organizationLogin: string, cashRegisterId: string, nonCashRegisterId: string): Promise<import("../../types").StartaResponse>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _helpers_1 = require("../_helpers");
|
|
4
|
+
class CashRegisters {
|
|
5
|
+
constructor(requestRunner) {
|
|
6
|
+
this._requestRunner = requestRunner;
|
|
7
|
+
}
|
|
8
|
+
index(organizationLogin, branchId) {
|
|
9
|
+
return this._requestRunner.performRequest({
|
|
10
|
+
url: `accounts/${organizationLogin}/cashRegisters${(0, _helpers_1.buildQuery)({ branchId })}`,
|
|
11
|
+
method: 'GET',
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
add(organizationLogin, { name, type, balance, description, branchId, }) {
|
|
15
|
+
return this._requestRunner.performRequest({
|
|
16
|
+
url: `accounts/${organizationLogin}/cashRegisters`,
|
|
17
|
+
method: 'POST',
|
|
18
|
+
body: {
|
|
19
|
+
name,
|
|
20
|
+
type,
|
|
21
|
+
balance,
|
|
22
|
+
description,
|
|
23
|
+
branchId,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
update(organizationLogin, cashRegisterId, { name, type, description, branchId, }) {
|
|
28
|
+
return this._requestRunner.performRequest({
|
|
29
|
+
url: `accounts/${organizationLogin}/cashRegisters/${cashRegisterId}`,
|
|
30
|
+
method: 'PUT',
|
|
31
|
+
body: {
|
|
32
|
+
name,
|
|
33
|
+
type,
|
|
34
|
+
description,
|
|
35
|
+
branchId,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
delete(organizationLogin, cashRegisterId) {
|
|
40
|
+
return this._requestRunner.performRequest({
|
|
41
|
+
url: `accounts/${organizationLogin}/cashRegisters/${cashRegisterId}`,
|
|
42
|
+
method: 'DELETE'
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
setDefaults(organizationLogin, cashRegisterId, nonCashRegisterId) {
|
|
46
|
+
return this._requestRunner.performRequest({
|
|
47
|
+
url: `accounts/${organizationLogin}/cashRegisters/defaults`,
|
|
48
|
+
method: 'PUT',
|
|
49
|
+
body: {
|
|
50
|
+
cashRegisterId,
|
|
51
|
+
nonCashRegisterId,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.default = CashRegisters;
|
|
@@ -15,7 +15,9 @@ import StartaTransactions from './startaTransactions';
|
|
|
15
15
|
import Warehouses from './warehouses';
|
|
16
16
|
import Products from './products';
|
|
17
17
|
import ProductCategories from './productCategories';
|
|
18
|
+
import CashRegisters from './cashRegisters';
|
|
18
19
|
import ProductOperations from './productOperations';
|
|
20
|
+
import CashRegisterOperations from './cashRegisterOperations';
|
|
19
21
|
export declare type TariffDetails = {
|
|
20
22
|
tariff: 'lite' | 'pro';
|
|
21
23
|
period: 'monthly' | 'yearly';
|
|
@@ -93,6 +95,12 @@ export default class Organizations {
|
|
|
93
95
|
setForYearBonus(organizationLogin: string, bonusForYearUntil: string): Promise<import("../../types").StartaResponse>;
|
|
94
96
|
getBillingInfo(organizationLogin: string, month?: string): Promise<import("../../types").StartaResponse>;
|
|
95
97
|
setTariff(organizationLogin: string, { tariff, period, successUrl, cancelUrl }: TariffDetails): Promise<import("../../types").StartaResponse>;
|
|
98
|
+
addBalance(organizationLogin: string, { amount, comment, type, currency }: {
|
|
99
|
+
amount: number;
|
|
100
|
+
comment: string;
|
|
101
|
+
type: 'manual';
|
|
102
|
+
currency: 'PLN' | 'EUR' | 'UAH';
|
|
103
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
96
104
|
get orders(): Orders;
|
|
97
105
|
get customers(): Customers;
|
|
98
106
|
get rooms(): Rooms;
|
|
@@ -108,6 +116,9 @@ export default class Organizations {
|
|
|
108
116
|
get warehouses(): Warehouses;
|
|
109
117
|
get products(): Products;
|
|
110
118
|
get productCategories(): ProductCategories;
|
|
119
|
+
get cashRegisters(): CashRegisters;
|
|
111
120
|
get productsOperations(): ProductOperations;
|
|
121
|
+
get cashRegisterOperations(): CashRegisterOperations;
|
|
122
|
+
get cashRegisterShifts(): CashRegisterOperations;
|
|
112
123
|
get startaTransactions(): StartaTransactions;
|
|
113
124
|
}
|
|
@@ -16,7 +16,9 @@ const startaTransactions_1 = require("./startaTransactions");
|
|
|
16
16
|
const warehouses_1 = require("./warehouses");
|
|
17
17
|
const products_1 = require("./products");
|
|
18
18
|
const productCategories_1 = require("./productCategories");
|
|
19
|
+
const cashRegisters_1 = require("./cashRegisters");
|
|
19
20
|
const productOperations_1 = require("./productOperations");
|
|
21
|
+
const cashRegisterOperations_1 = require("./cashRegisterOperations");
|
|
20
22
|
const _helpers_1 = require("../_helpers");
|
|
21
23
|
class Organizations {
|
|
22
24
|
constructor(requestRunner) {
|
|
@@ -206,6 +208,13 @@ class Organizations {
|
|
|
206
208
|
body: { tariff, period, successUrl, cancelUrl },
|
|
207
209
|
});
|
|
208
210
|
}
|
|
211
|
+
addBalance(organizationLogin, { amount, comment, type, currency }) {
|
|
212
|
+
return this._requestRunner.performRequest({
|
|
213
|
+
url: `accounts/${organizationLogin}/balance`,
|
|
214
|
+
method: 'POST',
|
|
215
|
+
body: { amount, comment, type, currency },
|
|
216
|
+
});
|
|
217
|
+
}
|
|
209
218
|
get orders() {
|
|
210
219
|
return new orders_1.default(this._requestRunner);
|
|
211
220
|
}
|
|
@@ -251,9 +260,18 @@ class Organizations {
|
|
|
251
260
|
get productCategories() {
|
|
252
261
|
return new productCategories_1.default(this._requestRunner);
|
|
253
262
|
}
|
|
263
|
+
get cashRegisters() {
|
|
264
|
+
return new cashRegisters_1.default(this._requestRunner);
|
|
265
|
+
}
|
|
254
266
|
get productsOperations() {
|
|
255
267
|
return new productOperations_1.default(this._requestRunner);
|
|
256
268
|
}
|
|
269
|
+
get cashRegisterOperations() {
|
|
270
|
+
return new cashRegisterOperations_1.default(this._requestRunner);
|
|
271
|
+
}
|
|
272
|
+
get cashRegisterShifts() {
|
|
273
|
+
return new cashRegisterOperations_1.default(this._requestRunner);
|
|
274
|
+
}
|
|
257
275
|
get startaTransactions() {
|
|
258
276
|
return new startaTransactions_1.default(this._requestRunner);
|
|
259
277
|
}
|