@gls_spain/gps-common 34.9.2 → 34.9.4
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/.eslintignore +1 -1
- package/.eslintrc.json +11 -11
- package/.idea/codeStyles/Project.xml +36 -36
- package/.idea/codeStyles/codeStyleConfig.xml +4 -4
- package/.idea/gps-common.iml +11 -11
- package/.idea/inspectionProfiles/Project_Default.xml +6 -6
- package/.idea/jsLibraryMappings.xml +5 -5
- package/.idea/misc.xml +5 -5
- package/.idea/modules.xml +7 -7
- package/.idea/prettier.xml +6 -6
- package/.idea/scopes/Source_files.xml +2 -2
- package/.idea/vcs.xml +5 -5
- package/.prettierignore +4 -4
- package/.prettierrc.json +13 -13
- package/.releaserc +17 -17
- package/CHANGELOG.md +1271 -1257
- package/README.md +103 -103
- package/errors/CountersDoNotExistError.js +11 -11
- package/errors/DatabaseNotEmptyError.js +11 -11
- package/errors/DefaultsDoNotExistError.js +11 -11
- package/errors/ExpeditionAlreadyExistsError.js +11 -11
- package/errors/ExpeditionCannotBeDeletedError.js +11 -11
- package/errors/ExpeditionCannotBeUpdatedError.js +11 -11
- package/errors/ExpeditionDoesNotExistError.js +11 -11
- package/errors/GLSRecordingError.js +11 -11
- package/errors/GLSSpainError.js +11 -11
- package/errors/InconsistentSalesSettingsError.js +11 -11
- package/errors/InvalidSaleDestinationError.js +11 -11
- package/errors/LabelDoesNotExistError.js +11 -11
- package/errors/NetworkAlreadyExistsError.js +11 -11
- package/errors/NetworkCannotBeDeletedError.js +11 -11
- package/errors/NetworkCannotBeUpdatedError.js +11 -11
- package/errors/NetworkDoesNotExistError.js +11 -11
- package/errors/RepresentativeAlreadyExistsError.js +11 -11
- package/errors/RepresentativeCannotBeDeletedError.js +11 -11
- package/errors/RepresentativeDoesNotExistError.js +11 -11
- package/errors/SaleAlreadyExistsError.js +11 -11
- package/errors/SaleDoesNotExistError.js +11 -11
- package/errors/ShopAlreadyExistsError.js +11 -11
- package/errors/ShopCannotBeDeletedError.js +11 -11
- package/errors/ShopCannotBeUpdatedError.js +11 -11
- package/errors/ShopCannotSellError.js +11 -11
- package/errors/ShopDoesNotExistError.js +11 -11
- package/errors/ShopNotEnabledError.js +11 -11
- package/errors/UserAlreadyExistsError.js +11 -11
- package/errors/UserCannotBeDeletedError.js +11 -11
- package/errors/UserCannotBeUpdatedError.js +11 -11
- package/errors/UserDoesNotExistError.js +11 -11
- package/errors/WrongNetworkError.js +11 -11
- package/errors/WrongPasswordError.js +11 -11
- package/errors/WrongShopError.js +11 -11
- package/errors/ZoneAlreadyExistsError.js +11 -11
- package/errors/ZoneCannotBeDeletedError.js +11 -11
- package/errors/ZoneDoesNotExistError.js +11 -11
- package/errors/index.js +118 -118
- package/index.js +9 -9
- package/index.test.js +36 -36
- package/jest.config.js +5 -5
- package/open-api-spec/index.js +3715 -3715
- package/package.json +65 -69
- package/schemas/definitions/become.js +5 -5
- package/schemas/definitions/common.js +462 -451
- package/schemas/definitions/counters.js +43 -43
- package/schemas/definitions/defaults.js +140 -140
- package/schemas/definitions/expeditions.js +867 -867
- package/schemas/definitions/gls-spain-integration-events.js +139 -139
- package/schemas/definitions/historic-records.js +90 -90
- package/schemas/definitions/integrations.js +38 -38
- package/schemas/definitions/login.js +38 -38
- package/schemas/definitions/logout.js +8 -8
- package/schemas/definitions/networks.js +123 -123
- package/schemas/definitions/pods.js +26 -26
- package/schemas/definitions/representatives.js +194 -194
- package/schemas/definitions/sales.js +253 -249
- package/schemas/definitions/shops.js +413 -404
- package/schemas/definitions/users.js +337 -337
- package/schemas/definitions/zones.js +92 -92
- package/schemas/index.js +400 -400
- package/scripts/build-documentation.js +40 -40
- package/scripts/build-json-schemas.js +35 -35
- package/.idea/workspace.xml +0 -699
package/README.md
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
# @gls_spain/gps-common
|
|
2
|
-
|
|
3
|
-
Errors, schemas and documentation for the Parcel Shops project.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @gls_spain/gps-common
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
This is a **@gls_spain** private package so you need an [npm authentication token](https://docs.npmjs.com/about-authentication-tokens) to be able to install it.
|
|
12
|
-
|
|
13
|
-
Also remember to include a [.npmrc file](https://docs.npmjs.com/using-private-packages-in-a-ci-cd-workflow) at the root of your project so that when you deploy the project to production, the deployment server (or Google App Engine, Heroku, etc) is able to install it.
|
|
14
|
-
|
|
15
|
-
## Use
|
|
16
|
-
|
|
17
|
-
This package provides error classes, json schemas for route validation and an OpenAPI specification:
|
|
18
|
-
|
|
19
|
-
```javascript
|
|
20
|
-
const { errors, openApiSpec, schemas } = require('@gls_spain/gps-common');
|
|
21
|
-
|
|
22
|
-
const { DatabaseNotEmptyError } = errors;
|
|
23
|
-
|
|
24
|
-
const { loginResponse } = schemas;
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Errors
|
|
28
|
-
|
|
29
|
-
Import the errors to have access to individual errors and a list of all the error names:
|
|
30
|
-
|
|
31
|
-
```javascript
|
|
32
|
-
const { errors } = require('@gls_spain/gps-common');
|
|
33
|
-
|
|
34
|
-
const { DatabaseNotEmptyError, errorsNames } = errors;
|
|
35
|
-
|
|
36
|
-
console.log(errorsNames.UserDoesNotExistError);
|
|
37
|
-
// UserDoesNotExistError
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### JSON Schemas
|
|
41
|
-
|
|
42
|
-
The provided json schemas are the requests and responses schemas of the API. They can be used for validation and unit testing:
|
|
43
|
-
|
|
44
|
-
```javascript
|
|
45
|
-
const { schemas } = require('@gls_spain/gps-common');
|
|
46
|
-
|
|
47
|
-
const { loginResponse } = schemas;
|
|
48
|
-
const Ajv = require('ajv');
|
|
49
|
-
const validator = Ajv();
|
|
50
|
-
validator.addSchema(loginResponse);
|
|
51
|
-
|
|
52
|
-
const myResponse = {
|
|
53
|
-
user: {
|
|
54
|
-
_id: '2d34620b-c67d-42ec-853d-2541a964df56',
|
|
55
|
-
createdAt: '2019-05-23 09:00:00',
|
|
56
|
-
updatedAt: '2019-05-23 09:00:00',
|
|
57
|
-
username: 'bob',
|
|
58
|
-
deletable: false,
|
|
59
|
-
loginEnabled: true,
|
|
60
|
-
role: 'superAdmin',
|
|
61
|
-
name: 'Super administrator',
|
|
62
|
-
emails: [],
|
|
63
|
-
phones: [],
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const valid = validator.validate(loginResponse, myResponse); // true
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### OpenAPI specification
|
|
71
|
-
|
|
72
|
-
The exported `openApiSpec` is an OpenAPI specification that can be used to build a documentation. If you need a static HTML version see scripts below.
|
|
73
|
-
|
|
74
|
-
```javascript
|
|
75
|
-
const { openApiSpec } = require('@gls_spain/gps-common');
|
|
76
|
-
|
|
77
|
-
console.log(openApiSpec);
|
|
78
|
-
/*
|
|
79
|
-
{
|
|
80
|
-
openapi: '3.0.2'
|
|
81
|
-
info: {
|
|
82
|
-
title: 'GLS Parcel Shops API',
|
|
83
|
-
description: 'This is the API backend for the GLS Parcel Shops project.',
|
|
84
|
-
contact: { name: 'Cristóbal Valverde Albo', email: 'cristobal@albo.dev' },
|
|
85
|
-
license: { name: 'NO LICENSE', url: 'https://choosealicense.com/no-permission/' },
|
|
86
|
-
version: 'v1.0.0',
|
|
87
|
-
},
|
|
88
|
-
...
|
|
89
|
-
}
|
|
90
|
-
*/
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Scripts
|
|
94
|
-
|
|
95
|
-
This package provides two scripts, one to build a static version of the json schemas and one to build a [Redoc](https://rebilly.github.io/ReDoc/) HTML with the OpenAPI documentation.
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
build-gps-json-schemas --output=build/gls-schemas
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
build-gps-documentation --output=build/gls-documentation.html
|
|
103
|
-
```
|
|
1
|
+
# @gls_spain/gps-common
|
|
2
|
+
|
|
3
|
+
Errors, schemas and documentation for the Parcel Shops project.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @gls_spain/gps-common
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This is a **@gls_spain** private package so you need an [npm authentication token](https://docs.npmjs.com/about-authentication-tokens) to be able to install it.
|
|
12
|
+
|
|
13
|
+
Also remember to include a [.npmrc file](https://docs.npmjs.com/using-private-packages-in-a-ci-cd-workflow) at the root of your project so that when you deploy the project to production, the deployment server (or Google App Engine, Heroku, etc) is able to install it.
|
|
14
|
+
|
|
15
|
+
## Use
|
|
16
|
+
|
|
17
|
+
This package provides error classes, json schemas for route validation and an OpenAPI specification:
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
const { errors, openApiSpec, schemas } = require('@gls_spain/gps-common');
|
|
21
|
+
|
|
22
|
+
const { DatabaseNotEmptyError } = errors;
|
|
23
|
+
|
|
24
|
+
const { loginResponse } = schemas;
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Errors
|
|
28
|
+
|
|
29
|
+
Import the errors to have access to individual errors and a list of all the error names:
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
const { errors } = require('@gls_spain/gps-common');
|
|
33
|
+
|
|
34
|
+
const { DatabaseNotEmptyError, errorsNames } = errors;
|
|
35
|
+
|
|
36
|
+
console.log(errorsNames.UserDoesNotExistError);
|
|
37
|
+
// UserDoesNotExistError
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### JSON Schemas
|
|
41
|
+
|
|
42
|
+
The provided json schemas are the requests and responses schemas of the API. They can be used for validation and unit testing:
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
const { schemas } = require('@gls_spain/gps-common');
|
|
46
|
+
|
|
47
|
+
const { loginResponse } = schemas;
|
|
48
|
+
const Ajv = require('ajv');
|
|
49
|
+
const validator = Ajv();
|
|
50
|
+
validator.addSchema(loginResponse);
|
|
51
|
+
|
|
52
|
+
const myResponse = {
|
|
53
|
+
user: {
|
|
54
|
+
_id: '2d34620b-c67d-42ec-853d-2541a964df56',
|
|
55
|
+
createdAt: '2019-05-23 09:00:00',
|
|
56
|
+
updatedAt: '2019-05-23 09:00:00',
|
|
57
|
+
username: 'bob',
|
|
58
|
+
deletable: false,
|
|
59
|
+
loginEnabled: true,
|
|
60
|
+
role: 'superAdmin',
|
|
61
|
+
name: 'Super administrator',
|
|
62
|
+
emails: [],
|
|
63
|
+
phones: [],
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const valid = validator.validate(loginResponse, myResponse); // true
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### OpenAPI specification
|
|
71
|
+
|
|
72
|
+
The exported `openApiSpec` is an OpenAPI specification that can be used to build a documentation. If you need a static HTML version see scripts below.
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
const { openApiSpec } = require('@gls_spain/gps-common');
|
|
76
|
+
|
|
77
|
+
console.log(openApiSpec);
|
|
78
|
+
/*
|
|
79
|
+
{
|
|
80
|
+
openapi: '3.0.2'
|
|
81
|
+
info: {
|
|
82
|
+
title: 'GLS Parcel Shops API',
|
|
83
|
+
description: 'This is the API backend for the GLS Parcel Shops project.',
|
|
84
|
+
contact: { name: 'Cristóbal Valverde Albo', email: 'cristobal@albo.dev' },
|
|
85
|
+
license: { name: 'NO LICENSE', url: 'https://choosealicense.com/no-permission/' },
|
|
86
|
+
version: 'v1.0.0',
|
|
87
|
+
},
|
|
88
|
+
...
|
|
89
|
+
}
|
|
90
|
+
*/
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Scripts
|
|
94
|
+
|
|
95
|
+
This package provides two scripts, one to build a static version of the json schemas and one to build a [Redoc](https://rebilly.github.io/ReDoc/) HTML with the OpenAPI documentation.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
build-gps-json-schemas --output=build/gls-schemas
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
build-gps-documentation --output=build/gls-documentation.html
|
|
103
|
+
```
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class CountersDoNotExistError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Counters do not exist.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'CountersDoNotExistError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = CountersDoNotExistError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class CountersDoNotExistError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Counters do not exist.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'CountersDoNotExistError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = CountersDoNotExistError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class DatabaseNotEmptyError extends DatabaseError {
|
|
4
|
-
constructor(message = 'The database cannot be initialized because it is not empty.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'DatabaseNotEmptyError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = DatabaseNotEmptyError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class DatabaseNotEmptyError extends DatabaseError {
|
|
4
|
+
constructor(message = 'The database cannot be initialized because it is not empty.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'DatabaseNotEmptyError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = DatabaseNotEmptyError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class DefaultsDoNotExistError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Defaults do not exist.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'DefaultsDoNotExistError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = DefaultsDoNotExistError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class DefaultsDoNotExistError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Defaults do not exist.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'DefaultsDoNotExistError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = DefaultsDoNotExistError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class ExpeditionAlreadyExistsError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Expedition already exists.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'ExpeditionAlreadyExistsError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = ExpeditionAlreadyExistsError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ExpeditionAlreadyExistsError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Expedition already exists.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'ExpeditionAlreadyExistsError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = ExpeditionAlreadyExistsError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class ExpeditionCannotBeDeletedError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Expedition cannot be deleted.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'ExpeditionCannotBeDeletedError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = ExpeditionCannotBeDeletedError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ExpeditionCannotBeDeletedError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Expedition cannot be deleted.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'ExpeditionCannotBeDeletedError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = ExpeditionCannotBeDeletedError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class ExpeditionCannotBeUpdatedError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Expedition cannot be updated.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'ExpeditionCannotBeUpdatedError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = ExpeditionCannotBeUpdatedError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ExpeditionCannotBeUpdatedError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Expedition cannot be updated.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'ExpeditionCannotBeUpdatedError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = ExpeditionCannotBeUpdatedError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class ExpeditionDoesNotExistError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Expedition does not exist.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'ExpeditionDoesNotExistError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = ExpeditionDoesNotExistError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class ExpeditionDoesNotExistError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Expedition does not exist.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'ExpeditionDoesNotExistError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = ExpeditionDoesNotExistError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class GLSRecordingError extends DatabaseError {
|
|
4
|
-
constructor(message = 'GLS Spain recording layer error.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'GLSRecordingError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = GLSRecordingError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class GLSRecordingError extends DatabaseError {
|
|
4
|
+
constructor(message = 'GLS Spain recording layer error.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'GLSRecordingError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = GLSRecordingError;
|
package/errors/GLSSpainError.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class GLSSpainError extends DatabaseError {
|
|
4
|
-
constructor(message = 'GLS Spain integration error.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'GLSSpainError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = GLSSpainError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class GLSSpainError extends DatabaseError {
|
|
4
|
+
constructor(message = 'GLS Spain integration error.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'GLSSpainError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = GLSSpainError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class InconsistentSalesSettingsError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Sale settings are inconsistent.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'InconsistentSalesSettingsError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = InconsistentSalesSettingsError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class InconsistentSalesSettingsError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Sale settings are inconsistent.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'InconsistentSalesSettingsError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = InconsistentSalesSettingsError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class InvalidSaleDestinationError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Sale destination is invalid.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'InvalidSaleDestinationError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = InvalidSaleDestinationError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class InvalidSaleDestinationError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Sale destination is invalid.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'InvalidSaleDestinationError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = InvalidSaleDestinationError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class LabelDoesNotExistError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Label does not exist.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'LabelDoesNotExistError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = LabelDoesNotExistError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class LabelDoesNotExistError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Label does not exist.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'LabelDoesNotExistError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = LabelDoesNotExistError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class NetworkAlreadyExistsError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Network already exists.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'NetworkAlreadyExistsError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = NetworkAlreadyExistsError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class NetworkAlreadyExistsError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Network already exists.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'NetworkAlreadyExistsError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = NetworkAlreadyExistsError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class NetworkCannotBeDeletedError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Network cannot be deleted.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'NetworkCannotBeDeletedError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = NetworkCannotBeDeletedError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class NetworkCannotBeDeletedError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Network cannot be deleted.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'NetworkCannotBeDeletedError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = NetworkCannotBeDeletedError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class NetworkCannotBeUpdatedError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Network cannot be updated.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'NetworkCannotBeUpdatedError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = NetworkCannotBeUpdatedError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class NetworkCannotBeUpdatedError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Network cannot be updated.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'NetworkCannotBeUpdatedError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = NetworkCannotBeUpdatedError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class NetworkDoesNotExistError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Network does not exist.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'NetworkDoesNotExistError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = NetworkDoesNotExistError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class NetworkDoesNotExistError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Network does not exist.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'NetworkDoesNotExistError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = NetworkDoesNotExistError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class RepresentativeAlreadyExistsError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Representative already exists.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'RepresentativeAlreadyExistsError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = RepresentativeAlreadyExistsError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class RepresentativeAlreadyExistsError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Representative already exists.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'RepresentativeAlreadyExistsError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = RepresentativeAlreadyExistsError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class RepresentativeCannotBeDeletedError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Representative cannot be deleted.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'RepresentativeCannotBeDeletedError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = RepresentativeCannotBeDeletedError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class RepresentativeCannotBeDeletedError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Representative cannot be deleted.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'RepresentativeCannotBeDeletedError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = RepresentativeCannotBeDeletedError;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
-
|
|
3
|
-
class RepresentativeDoesNotExistError extends DatabaseError {
|
|
4
|
-
constructor(message = 'Representative does not exist.') {
|
|
5
|
-
// noinspection JSCheckFunctionSignatures
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'RepresentativeDoesNotExistError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = RepresentativeDoesNotExistError;
|
|
1
|
+
const { DatabaseError } = require('@gls_spain/mongodb');
|
|
2
|
+
|
|
3
|
+
class RepresentativeDoesNotExistError extends DatabaseError {
|
|
4
|
+
constructor(message = 'Representative does not exist.') {
|
|
5
|
+
// noinspection JSCheckFunctionSignatures
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'RepresentativeDoesNotExistError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = RepresentativeDoesNotExistError;
|