starta.apiclient 1.37.3591 → 1.37.3592
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/index.d.ts +0 -5
- package/lib/services/organizations/index.js +0 -11
- package/lib/services/organizations/productOperations.d.ts +10 -0
- package/lib/services/organizations/productOperations.js +12 -0
- package/lib/types.d.ts +10 -0
- package/package.json +1 -1
- package/lib/services/organizations/cashRegisterOperations.d.ts +0 -24
- package/lib/services/organizations/cashRegisterOperations.js +0 -33
- package/lib/services/organizations/cashRegisterShifts.d.ts +0 -6
- package/lib/services/organizations/cashRegisterShifts.js +0 -15
- package/lib/services/organizations/cashRegisters.d.ts +0 -21
- package/lib/services/organizations/cashRegisters.js +0 -56
|
@@ -15,9 +15,7 @@ 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';
|
|
19
18
|
import ProductOperations from './productOperations';
|
|
20
|
-
import CashRegisterOperations from './cashRegisterOperations';
|
|
21
19
|
export declare type TariffDetails = {
|
|
22
20
|
tariff: 'lite' | 'pro';
|
|
23
21
|
period: 'monthly' | 'yearly';
|
|
@@ -110,9 +108,6 @@ export default class Organizations {
|
|
|
110
108
|
get warehouses(): Warehouses;
|
|
111
109
|
get products(): Products;
|
|
112
110
|
get productCategories(): ProductCategories;
|
|
113
|
-
get cashRegisters(): CashRegisters;
|
|
114
111
|
get productsOperations(): ProductOperations;
|
|
115
|
-
get cashRegisterOperations(): CashRegisterOperations;
|
|
116
|
-
get cashRegisterShifts(): CashRegisterOperations;
|
|
117
112
|
get startaTransactions(): StartaTransactions;
|
|
118
113
|
}
|
|
@@ -16,9 +16,7 @@ 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");
|
|
20
19
|
const productOperations_1 = require("./productOperations");
|
|
21
|
-
const cashRegisterOperations_1 = require("./cashRegisterOperations");
|
|
22
20
|
const _helpers_1 = require("../_helpers");
|
|
23
21
|
class Organizations {
|
|
24
22
|
constructor(requestRunner) {
|
|
@@ -253,18 +251,9 @@ class Organizations {
|
|
|
253
251
|
get productCategories() {
|
|
254
252
|
return new productCategories_1.default(this._requestRunner);
|
|
255
253
|
}
|
|
256
|
-
get cashRegisters() {
|
|
257
|
-
return new cashRegisters_1.default(this._requestRunner);
|
|
258
|
-
}
|
|
259
254
|
get productsOperations() {
|
|
260
255
|
return new productOperations_1.default(this._requestRunner);
|
|
261
256
|
}
|
|
262
|
-
get cashRegisterOperations() {
|
|
263
|
-
return new cashRegisterOperations_1.default(this._requestRunner);
|
|
264
|
-
}
|
|
265
|
-
get cashRegisterShifts() {
|
|
266
|
-
return new cashRegisterOperations_1.default(this._requestRunner);
|
|
267
|
-
}
|
|
268
257
|
get startaTransactions() {
|
|
269
258
|
return new startaTransactions_1.default(this._requestRunner);
|
|
270
259
|
}
|
|
@@ -15,4 +15,14 @@ export default class ProductOperations {
|
|
|
15
15
|
};
|
|
16
16
|
}): Promise<import("../../types").StartaResponse>;
|
|
17
17
|
add(organizationLogin: string, { date, type, supplier, warehouseId, products, isPaid, comment, }: ProductOperation): Promise<import("../../types").StartaResponse>;
|
|
18
|
+
transfer(organizationLogin: string, { date, fromWarehouseId, toWarehouseId, products, }: {
|
|
19
|
+
organizationLogin: string;
|
|
20
|
+
date: Date;
|
|
21
|
+
fromWarehouseId: string;
|
|
22
|
+
toWarehouseId: string;
|
|
23
|
+
products: Array<{
|
|
24
|
+
id: string;
|
|
25
|
+
quantity: number;
|
|
26
|
+
}>;
|
|
27
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
18
28
|
}
|
|
@@ -29,5 +29,17 @@ class ProductOperations {
|
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
+
transfer(organizationLogin, { date, fromWarehouseId, toWarehouseId, products, }) {
|
|
33
|
+
return this._requestRunner.performRequest({
|
|
34
|
+
url: `accounts/${organizationLogin}/productOperations/transfer`,
|
|
35
|
+
method: 'PUT',
|
|
36
|
+
body: {
|
|
37
|
+
date,
|
|
38
|
+
fromWarehouseId,
|
|
39
|
+
toWarehouseId,
|
|
40
|
+
products,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
32
44
|
}
|
|
33
45
|
exports.default = ProductOperations;
|
package/lib/types.d.ts
CHANGED
|
@@ -95,6 +95,16 @@ export declare type ProductOperation = {
|
|
|
95
95
|
isPaid?: boolean;
|
|
96
96
|
comment?: string;
|
|
97
97
|
};
|
|
98
|
+
export declare type WarehouseOperation = {
|
|
99
|
+
organizationLogin: string;
|
|
100
|
+
date: Date;
|
|
101
|
+
fromWarehouseId: string;
|
|
102
|
+
toWarehouseId: string;
|
|
103
|
+
products: Array<{
|
|
104
|
+
id: string;
|
|
105
|
+
quantity: number;
|
|
106
|
+
}>;
|
|
107
|
+
};
|
|
98
108
|
export declare type OrganizationSchedule = {
|
|
99
109
|
name: any;
|
|
100
110
|
location: {
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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;
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
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;
|