@gls_spain/gps-common 34.9.1 → 34.9.3

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.
Files changed (81) hide show
  1. package/.eslintignore +1 -1
  2. package/.eslintrc.json +11 -11
  3. package/.idea/codeStyles/Project.xml +36 -36
  4. package/.idea/codeStyles/codeStyleConfig.xml +4 -4
  5. package/.idea/gps-common.iml +11 -11
  6. package/.idea/inspectionProfiles/Project_Default.xml +6 -6
  7. package/.idea/jsLibraryMappings.xml +5 -5
  8. package/.idea/misc.xml +5 -5
  9. package/.idea/modules.xml +7 -7
  10. package/.idea/prettier.xml +6 -6
  11. package/.idea/scopes/Source_files.xml +2 -2
  12. package/.idea/vcs.xml +5 -5
  13. package/.prettierignore +4 -4
  14. package/.prettierrc.json +13 -13
  15. package/.releaserc +17 -17
  16. package/CHANGELOG.md +1264 -1250
  17. package/README.md +103 -103
  18. package/errors/CountersDoNotExistError.js +11 -11
  19. package/errors/DatabaseNotEmptyError.js +11 -11
  20. package/errors/DefaultsDoNotExistError.js +11 -11
  21. package/errors/ExpeditionAlreadyExistsError.js +11 -11
  22. package/errors/ExpeditionCannotBeDeletedError.js +11 -11
  23. package/errors/ExpeditionCannotBeUpdatedError.js +11 -11
  24. package/errors/ExpeditionDoesNotExistError.js +11 -11
  25. package/errors/GLSRecordingError.js +11 -11
  26. package/errors/GLSSpainError.js +11 -11
  27. package/errors/InconsistentSalesSettingsError.js +11 -11
  28. package/errors/InvalidSaleDestinationError.js +11 -11
  29. package/errors/LabelDoesNotExistError.js +11 -11
  30. package/errors/NetworkAlreadyExistsError.js +11 -11
  31. package/errors/NetworkCannotBeDeletedError.js +11 -11
  32. package/errors/NetworkCannotBeUpdatedError.js +11 -11
  33. package/errors/NetworkDoesNotExistError.js +11 -11
  34. package/errors/RepresentativeAlreadyExistsError.js +11 -11
  35. package/errors/RepresentativeCannotBeDeletedError.js +11 -11
  36. package/errors/RepresentativeDoesNotExistError.js +11 -11
  37. package/errors/SaleAlreadyExistsError.js +11 -11
  38. package/errors/SaleDoesNotExistError.js +11 -11
  39. package/errors/ShopAlreadyExistsError.js +11 -11
  40. package/errors/ShopCannotBeDeletedError.js +11 -11
  41. package/errors/ShopCannotBeUpdatedError.js +11 -11
  42. package/errors/ShopCannotSellError.js +11 -11
  43. package/errors/ShopDoesNotExistError.js +11 -11
  44. package/errors/ShopNotEnabledError.js +11 -11
  45. package/errors/UserAlreadyExistsError.js +11 -11
  46. package/errors/UserCannotBeDeletedError.js +11 -11
  47. package/errors/UserCannotBeUpdatedError.js +11 -11
  48. package/errors/UserDoesNotExistError.js +11 -11
  49. package/errors/WrongNetworkError.js +11 -11
  50. package/errors/WrongPasswordError.js +11 -11
  51. package/errors/WrongShopError.js +11 -11
  52. package/errors/ZoneAlreadyExistsError.js +11 -11
  53. package/errors/ZoneCannotBeDeletedError.js +11 -11
  54. package/errors/ZoneDoesNotExistError.js +11 -11
  55. package/errors/index.js +118 -118
  56. package/index.js +9 -9
  57. package/index.test.js +36 -36
  58. package/jest.config.js +5 -5
  59. package/open-api-spec/index.js +3715 -3715
  60. package/package.json +65 -69
  61. package/schemas/definitions/become.js +5 -5
  62. package/schemas/definitions/common.js +462 -440
  63. package/schemas/definitions/counters.js +43 -43
  64. package/schemas/definitions/defaults.js +140 -140
  65. package/schemas/definitions/expeditions.js +867 -867
  66. package/schemas/definitions/gls-spain-integration-events.js +139 -139
  67. package/schemas/definitions/historic-records.js +90 -90
  68. package/schemas/definitions/integrations.js +38 -38
  69. package/schemas/definitions/login.js +38 -38
  70. package/schemas/definitions/logout.js +8 -8
  71. package/schemas/definitions/networks.js +123 -123
  72. package/schemas/definitions/pods.js +26 -26
  73. package/schemas/definitions/representatives.js +194 -194
  74. package/schemas/definitions/sales.js +253 -249
  75. package/schemas/definitions/shops.js +404 -404
  76. package/schemas/definitions/users.js +337 -337
  77. package/schemas/definitions/zones.js +92 -92
  78. package/schemas/index.js +400 -400
  79. package/scripts/build-documentation.js +40 -40
  80. package/scripts/build-json-schemas.js +35 -35
  81. package/.idea/workspace.xml +0 -696
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;
@@ -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;